Find answers from the community

Home
Members
nikkwong
n
nikkwong
Offline, last seen 3 months ago
Joined September 25, 2024
Hi, what's the best way to do NER on a string of text using llamaindex? (Or maybe get triplet pairs)? Or which ever is more effective? (I'm a newbie)
1 comment
L
Hello! I am trying to use my existing nodes and edges in neo4j as the index for my KnowledgeGraphIndex, but loading the nodes from neo4j and using the existing relationships to build the index is not straightforward with the documentation. Can someone help me? My current approach looks something like this.. but I'm a bit stuck

Plain Text
nodes = graph_store.query('MATCH (n)-[r]->(m) RETURN n,r,m;')

for node in nodes:
  subject = node['n']['id']
  relationship = node['r']['id']
  object = node['m']['id']
  index.upsert_triplet_and_node(
    [subject, relationship, object], 
    TextNode(
      text=..., 
      id_=node['n']['id'],
    )
  )


Any help is appreciated thank you
4 comments
n
L