I’m new to Knime. I’m trying to find cosine similarity between sentences. I can see Cosine distance option in the Numerical Distance node. I need this apply on 2 sentences.
But I fail to represent sentence to vector format.
I used Strings To Document => Document Vector. But it gives the error “No column containing TermCells found !”
Sentence Extractor only gives me the ‘Number of Terms’
The Document Vector node expects as input the Bag of Words for each document. Therefore you need one additional node, which is the Bag Of Words Creator node. To calculate the cosine distance between the different sentences you can use for example the Distance Matrix Calculate node.
This is a small example workflow, which shows the different steps: