1 year ago

#358113

test-img

denji

Is it possible to show the specific content which was similar when doing paragraph similarity?

I'm trying to create a paragraph similarity checker using Python. I'm using Sentence Transformers along with the "All the News 2" dataset which contains over 2 million articles.

I have already created the similarity checker and it shows the title, author, and the content of the article itself, but I can only print out the whole content of the article. Is it possible to only print out the parts that were similar to the article? Say for example my input is The quick brown fox jumps over the lazy dog, I only want to show the part that is similar to my input instead of the whole article itself.

This is the current code that I'm using to show the whole article that was detected to have similar content: most_similar_content = cleaned_articles.nlargest(n=5, columns='similarity').article where article is the column which contains the content of the article itself.

python

nlp

sentence-similarity

sentence-transformers

0 Answers

Your Answer

Accepted video resources