Я успешно загрузил файл CSV в neo4j, хочу удалить стоп-слова в наборе данных.У меня есть отдельный список стоп-слов в текстовом файле.Я нашел пример кода с использованием стоп-слов.Но я хочу заменить его своим списком стоп-слов.Как мне нужно продолжить?Можем ли мы загрузить 2 набора данных (kbv5.txt и stopwords.txt) в один запрос?
Я хочу включить файл списка стоп-слов в мой код:
LOAD CSV FROM "file:///kbv5.txt" as row fieldterminator "."
with row
unwind row as text
with reduce(t=tolower(text), delim in
["","",",",".","!","?",'"',":",";","'","-"] | replace(t,delim,"")) as
normalized
with [w in split(normalized," ") | trim(w)] as words
unwind range(0,size(words)-2) as idx
MERGE (w1:Word {name:words[idx]})
ON CREATE SET w1.count = 1
ON MATCH SET w1.count = w1.count + 1
MERGE (w2:Word {name:words[idx+1]})
ON CREATE SET w2.count = 1
ON MATCH SET w2.count = w2.count + (case when idx = size(words)-2 then 1
else 0 end)
MERGE (w1)-[r:NEXT]->(w2)
ON CREATE SET r.count = 1 ON MATCH SET r.count = r.count +1
Пример кода для использованияСтоп-слова:
with "Great device, but the calls drop too frequently." as text
with replace(replace(tolower(text),".",""),",","") as normalized
with [w in split(normalized," ") | trim(w)] as words
with [w in words WHERE NOT w IN ["the","an","on"]] as words
UNWIND range(0,size(words)-2) as idx
MERGE (w1:Word {name:words[idx]})
MERGE (w2:Word {name:words[idx+1]})
MERGE (w1)-[:NEXT]->(w2)
Заранее спасибо