davebulaval
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -23,6 +23,7 @@ checks. For more details, refer to our publicly available article.
|
|
23 |
> in the article for a more robust one, that also includes the commutative property of the meaning function. Namely, Meaning(Sent_a, Sent_b) = Meaning(Sent_b, Sent_a).
|
24 |
|
25 |
- [HuggingFace Model Card](https://huggingface.co/davebulaval/MeaningBERT)
|
|
|
26 |
|
27 |
## Sanity Check
|
28 |
|
@@ -68,8 +69,6 @@ model = AutoModelForSequenceClassification.from_pretrained("davebulaval/MeaningB
|
|
68 |
|
69 |
or you can use MeaningBERT as a metric for evaluation (no retrain) using the following with HuggingFace
|
70 |
|
71 |
-
## Code Examples
|
72 |
-
|
73 |
```python
|
74 |
import torch
|
75 |
|
@@ -92,6 +91,19 @@ with torch.no_grad():
|
|
92 |
|
93 |
print(scores.logits.tolist())
|
94 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
|
97 |
------------------
|
|
|
23 |
> in the article for a more robust one, that also includes the commutative property of the meaning function. Namely, Meaning(Sent_a, Sent_b) = Meaning(Sent_b, Sent_a).
|
24 |
|
25 |
- [HuggingFace Model Card](https://huggingface.co/davebulaval/MeaningBERT)
|
26 |
+
- [HuggingFace Metric Card](https://huggingface.co/spaces/davebulaval/meaningbert)
|
27 |
|
28 |
## Sanity Check
|
29 |
|
|
|
69 |
|
70 |
or you can use MeaningBERT as a metric for evaluation (no retrain) using the following with HuggingFace
|
71 |
|
|
|
|
|
72 |
```python
|
73 |
import torch
|
74 |
|
|
|
91 |
|
92 |
print(scores.logits.tolist())
|
93 |
```
|
94 |
+
or using our HuggingFace Metric module
|
95 |
+
|
96 |
+
```python
|
97 |
+
import evaluate
|
98 |
+
|
99 |
+
documents = ["He wanted to make them pay.", "This sandwich looks delicious.", "He wants to eat."]
|
100 |
+
simplifications = ["He wanted to make them pay.", "This sandwich looks delicious.",
|
101 |
+
"Whatever, whenever, this is a sentence."]
|
102 |
+
|
103 |
+
meaning_bert = evaluate.load("davebulaval/meaningbert")
|
104 |
+
|
105 |
+
print(meaning_bert.compute(documents=documents, simplifications=simplifications))
|
106 |
+
```
|
107 |
|
108 |
|
109 |
------------------
|