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$

1 Answer 1

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$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .