Please how do I compute the cosine similarity between two text in Neo4j? I tried using the approach below but the function does not exist. On the Neo4j page I only see how to compute the cosine similarity between two numeric vectors and not text.
MATCH (n1:Node), (n2:Node)
WHERE n1.text = 'A string of text' AND n2.text = 'Another string of text'
WITH n1, n2, apoc.algo.cosineSimilarity(n1.text, n2.text) AS similarity
RETURN n1, n2, similarity
I equally tried with
apoc.text.cosineSimilarity
but it won't work. The functions are unknown This :
gds.similarity.cosine
works for vectors of numeric values