# How can we perform STS(Semantic Textual Similarity) on UnSupervised dataset using Deep Learning?

How to implement STS(Semantic Textual Similarity) on unlabelled dataset. Dataset column contains Unique_id, text1(contains paragraph), text2(contains paragraph).

Ex: Column representation: Unique_id | Text1 | Text2

Unique_id 0

Text1 public show for reynolds suspension of his coaching licence. portrait sir joshua reynolds portrait of omai will get a public airing following fears it would stay hidden because of an export wrangle.

Text2 then requested to do so by spain s anti-violence commission. the fine was far less than the expected amount of about Â£22 000 or even the suspension of his coaching licence.

Unique_id 1

Text1 groening. gervais has already begun writing the script but is keeping its subject matter a closely guarded secret. he will also write a part for himself in the episode. i ve got the rough idea but this is the most intimidating project of my career.

Text2 philadelphia said they found insufficient evidence to support the woman s allegations regarding an alleged incident in january 2004. the woman reported the allegations to canadian authorities last month. cosby s lawyer walter m phillips jr said the comedian was pleased with the decision.

In the above problem, I've to compare two paragraphs texts i.e. Text1 & Text2 and then I've to compare semantic similarity between two texts. If they are semantically similar then it will print '1' if not then '0'

Any refrence implementation link or any suggestions !

You could take pretrained embedder and look for distances between the embeddings. There's LASER from Facebook. This is an unofficial pypi package, it replaces some of the internal tools used for tokenization and BPE encodings. I've used it extensively and it works just fine. It encodes your text as 1024-element numerical vector. Then you can just calculate distance metric between embeddings i.e. euclidean.