0
$\begingroup$

Context: I want to determine if someone's written review contains content that is relevant to a paragraph that they are reviewing.

To do so, I am trying to determine if one paragraph is relevant to another paragraph. I initially tried to use TF-IDF to calculate the relevancy, but I think TF-IDF works well for determining if one paragraph is relevant to a whole set of paragraphs. I only want to determine if two paragraphs are relevant with each other.

What would be a good approach for this problem?

$\endgroup$
0
$\begingroup$

A very simple approach can be:

  • Calculate tf-idf vector for sentence 1 and 2.
  • Calculate vector similarity (Cosine similarity) of these 2 vectors.

This is a general approach and works for any representational vector.

For a more complex one, check semantic similarity with BERT post from Keras blog.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.