Hello,
I am trying to use Stanford NLP framework along with neo4j for a project. I want to know how can I use a input from python to be stored into a node in neo4j graph database so then I could use NLP to this node and start building a knowledge graph based on the input that I will get? I tried the code below but it is not working (I am using py2neo and also cypher queries at the beginning just to create the idea):
from py2neo import Graph, Node, Relationship
graph = Graph("bolt://xxx.x.xxx.xxx:7687", auth=("xxxx", "xxxxx"))
nlp = input("Text: ")
def get(nlp):
query = '''
Merge (t:Text)
SET t.text = {nlp}
'''
graph.run(query,nlp).data()
def find():
query_find = '''
Match (t:Text)
CALL ga.nlp.annotate({text: t.text, id: id(t)})
YIELD result
MERGE (t)-[:HAS_ANNOTATED_TEXT]->(result)
RETURN result
'''
graph.run(query_find).data()
I would be pleased if someone helps me with this thing???