Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-26-2020 04:11 PM
Hi,
I am attempting to do so NLP follow work. Take documents find root term and part of speech (pos), and the sequence of words. I have seemed to get the base documents Patents) in ok as well as the words with their terms and pos and I am now trying to link the words to the host document which is a field in the csv. I need to convert it to integer, but that is straight forward.
When I run the following cypher it says it has created 2675 nodes along with 16000+ relationships. When I ask for example Word I see the base relationships and when expanded it shows the nodes but those nodes have no node label, just an id.
What is the error in my ways?
Andy
LOAD CSV WITH HEADERS FROM 'file:///ulvac_abstract.csv' AS row
MATCH (a:patent{patNum:ToInteger(row.patent)})
WITH split(row.sentence," ") as text,split(row.pos," ") as POS
UNWIND range(0,size(text)-2) AS i
MATCH (w1:Word{term:text[i],pos:POS[i]})
MATCH (w2:Word{term:text[i+1],pos:POS[i+1]})
MERGE (w1)-[:Is_in]->(a)
MERGE (w2)-[:Is_in]->(a)
The file basically looks like this.
sentence pos patent org
display device drive thin film transistor high brightness provide NOUN NOUN VERB ADJ NOUN NOUN ADJ NOUN VERB 7999464 ulvac
low voltage drive inorganic luminescent layer control transistor form substrate ADJ NOUN VERB ADJ ADJ NOUN NOUN NOUN VERB NOUN 7999464 ulvac
08-26-2020 04:55 PM
Hi @andy.hegedus,
You should add a
to the pipeline. So...
LOAD CSV WITH HEADERS FROM 'file:///ulvac_abstract.csv' AS row
MATCH (a:patent{patNum:ToInteger(row.patent)})
WITH split(row.sentence," ") as text,split(row.pos," ") as POS , a
UNWIND range(0,size(text)-2) AS i
MATCH (w1:Word{term:text[i],pos:POS[i]})
MATCH (w2:Word{term:text[i+1],pos:POS[i+1]})
MERGE (w1)-[:Is_in]->(a)
MERGE (w2)-[:Is_in]->(a)
H
08-26-2020 05:04 PM
Thank you very much!
All for the want of "a".
Sometimes the little things trip you up.
Andy
All the sessions of the conference are now available online