Update README.md
Browse files
README.md
CHANGED
|
@@ -7,4 +7,24 @@ tags:
|
|
| 7 |
|
| 8 |
licenses:
|
| 9 |
- cc-by-nc-sa
|
| 10 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
licenses:
|
| 9 |
- cc-by-nc-sa
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
Mutual implication score: a symmetric measure of text semantic similarity
|
| 13 |
+
based on a RoBERTA model pretrained for natural language inference
|
| 14 |
+
and fine-tuned for paraphrase detection.
|
| 15 |
+
|
| 16 |
+
The following snippet illustrates code usage:
|
| 17 |
+
```python
|
| 18 |
+
from mutual_implication_score import MIS
|
| 19 |
+
mis = MIS(device='cpu')
|
| 20 |
+
source_texts = ['I want to leave this room',
|
| 21 |
+
'Hello world, my name is Nick']
|
| 22 |
+
paraphrases = ['I want to go out of this room',
|
| 23 |
+
'Hello world, my surname is Petrov']
|
| 24 |
+
scores = mis.compute(source_texts, paraphrases)
|
| 25 |
+
print(scores)
|
| 26 |
+
# expected output: [0.9748, 0.0545]
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
The first two texts are semantically equivalent, their MIS is close to 1.
|
| 30 |
+
The two other texts have different meanings, and their score is low.
|