metadata
language:
- en
tags:
- paraphrase detection
licenses:
- cc-by-nc-sa
Mutual implication score: a symmetric measure of text semantic similarity based on a RoBERTA model pretrained for natural language inference and fine-tuned for paraphrase detection.
The following snippet illustrates code usage:
from mutual_implication_score import MIS
mis = MIS(device='cpu')
source_texts = ['I want to leave this room',
'Hello world, my name is Nick']
paraphrases = ['I want to go out of this room',
'Hello world, my surname is Petrov']
scores = mis.compute(source_texts, paraphrases)
print(scores)
# expected output: [0.9748, 0.0545]
The first two texts are semantically equivalent, their MIS is close to 1. The two other texts have different meanings, and their score is low.