Viewing a single comment thread. View all comments

DeepArdent t1_ixdlbg1 wrote

Is there a Javascript npm package that returns the sentence similarity of two sentences using ML? Here similarity means how close the sentences are in terms of their meaning and not how close their character count is or word count is.

​

My ultimate aim is to find which sentence(strings) among a set is most similar to a given sentence in a NextJS app.

1

I-am_Sleepy t1_ixfrnr0 wrote

Using tfjs? The sentence embedding vector and be then compare using cosine similarity (which is relatively easy to implement in javascript, better yet the project page already implement dotProduct, and the vector is already normalize)

1