<p>Try out models based on BERT, e.g., </p>

<blockquote>
  <p>MoverScore: <a href="https://pypi.org/project/moverscore/" rel="nofollow noreferrer">https://pypi.org/project/moverscore/</a></p>
</blockquote>

<p>which is very good for capturing the semantic similarity of two sentences. Paper reference: <a href="https://arxiv.org/abs/1909.02622" rel="nofollow noreferrer">https://arxiv.org/abs/1909.02622</a></p>

<p>Also you may want to look for tasks such as "STS" (semantic textual similarity).</p>
The distance between the meaning of two sentences
<p>I am looking for a way to measure the semantic distance between two sentences. Suppose we have the following sentences:</p>

<pre><code>(S1) The beautiful cherry blossoms in Japan. 
(S2) The beautiful Japan.
</code></pre>

<p>S2 is created from S1 by eliminating the words "cherry", "blossoms" and "in". I want to define a function that gives a high distance between S1 and S2. The reason for this is that they do have significantly different meaning, since beautiful modifies cherry blossoms and not Japan.</p>