I am programming in python and I want that every input that I get from python programming to store to neo4j graph database. I am using py2neo to connect neo4j to python. And then I want to use stanford-nlp that neo4j offers to make keyword extraction. The code that I tried is this below:
from py2neo import Graph, Node, Relationship
graph = Graph("bolt://xxxxxxxxxxx", auth=("neo4j", "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()
Can anyone help me, solving this case???