I am looking for a way to compare two paragraphs and see if both share the same meaning.

For example, these two paragraphs have the same meaning, but they are worded differently.

Paragraph 1:

The golden sun dipped below the horizon, casting a warm, orange glow across the tranquil sea. The waves gently lapped at the shore, singing a soothing lullaby. Seagulls glided gracefully through the air, their calls harmonizing with the gentle rustle of palm leaves. As the day bid its farewell, a sense of peace settled over the beach, inviting contemplation and reflection.

Paragraph 2:

As the day drew to a close, the sun's golden rays stretched long shadows over the calm expanse of the ocean. The sea murmured softly, a gentle rhythm that seemed to cradle the world. Birds, with their wings outstretched, soared through the sky, their calls blending seamlessly with the gentle whisper of palm fronds. In this moment of transition, serenity enveloped the beach, inviting introspection and meditation.

Which AI model is able to compare the two paragraphs and determine if they share the same meaning or not? Azure AL Language has multiple models of AI Language, but I don't see one that would help with semantic comparison.

What AI model can be used to provide similarity evaluation of two paragraphs?


1 Answer 1


There are a lot of document embedding libraries that you can use. They will represent each paragraph as a vector and you can use the distance between these vectors as a proxy for similarity. You will have to decide which distance is the cutoff for the "same" meaning though

  • $\begingroup$ Can you please give an example of a document embedding libraries that can be used? Does document embedding libraries actually process the meaning of each paragraph or does it just compare words similarity in both paragraphs? $\endgroup$
    – Jay
    Commented Oct 19, 2023 at 18:35
  • $\begingroup$ It does process the meaning, though the primary mechanism is comparing word similarity. Doc2Vec is popular $\endgroup$ Commented Oct 19, 2023 at 18:45
  • $\begingroup$ I can't seems to find a service on Azure that converts Doc to vector. Any Clues if there is a service for this? $\endgroup$
    – Jay
    Commented Oct 19, 2023 at 20:59

You must log in to answer this question.

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