File size: 822 Bytes
eedf98a
 
 
 
 
 
 
 
 
fb03fbe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
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:
```python
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.