简体   繁体   中英

Javascript for analyzing a text in chrome extension

Hi everyone i'm stuck on this thing, i know it's pretty easy hope someone can help. How can I read each word of a text in input and give a value to each word? The output must contain all the sentences with the highest medium value. After that I need to compare these sentences with some that i have to see how much similar they are.

Please just tell me if you need me to be more clear, any kind of help is appreciated!

You can try to use sentence encoder .

Quoting the source:

The Universal Sentence Encoder makes getting sentence level embeddings as easy as it has historically been to lookup the embeddings for individual words. The sentence embeddings can then be trivially used to compute sentence level meaning similarity as well as to enable better performance on downstream classification tasks using less supervised training data.

Go through that notebook, it is basically doing exactly what you are asking for.

Does this help?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM