Establish an algorithm that can quantify the degree of similarity between the two text documents based on semantic similarity.
Semantic Textual Similarity (STS) assesses the degree to which two sentences are semantically equivalent to each other.
- 1 means highly similar
- 0 means highly dissimilar
- Python
- Numpy
- Pandas
- Seaborn
- Matplotlib.pyplot
- Joblib
- warnings
- string
- Gensim Downloader
- Sklearn
- nltk
- math
- json
- requests
- Flask
- Machine Learning
- Natural Language Processing
-
Libraries Used:
The final algorithm should be exposed as a Server API Endpoint. In order to test this API, make sure you hit a request to the server to get the result as a response to the API. The request-response body should be in the following format:
Request body: {“text1”: ”nuclear body seeks new tech …....”, ”text2”: ”terror suspects face arrest ……”} Response body: {“similarity score”: 0.2 }
Note: “text1”, “text2”, and “similarity score” keys should be kept as it is, without any change.
The given dataset does not contain any label. Therefore, can be treated as an unsupervised learning problem. However, this does not imply that supervised techniques/algorithms are not applicable. The candidate is free to use any technique.