Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -64,22 +64,31 @@ embeddings = model.encode(["Hello world", "Hi there"])
|
|
| 64 |
|
| 65 |
### Interpretability
|
| 66 |
|
| 67 |
-
Token-level attribution via Integrated Gradients
|
| 68 |
|
| 69 |
```python
|
| 70 |
# Get raw token attributions
|
| 71 |
-
result = model.interpret("The
|
| 72 |
for token, attr in zip(result["tokens"], result["attributions"]):
|
| 73 |
print(f"{token:>15s} {attr:+.4f}")
|
| 74 |
|
| 75 |
# Save interactive HTML heatmap
|
| 76 |
model.visualize(
|
| 77 |
-
"The
|
| 78 |
-
"
|
|
|
|
| 79 |
output_path="attribution.html",
|
| 80 |
)
|
| 81 |
```
|
| 82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
## Evaluation Benchmarks
|
| 84 |
|
| 85 |
Evaluated on 7 benchmarks: SNLI, MultiNLI, MedNLI, TruthfulQA, COCO-Caption, NEWTS, and Climate-FEVER.
|
|
|
|
| 64 |
|
| 65 |
### Interpretability
|
| 66 |
|
| 67 |
+
Token-level attribution via Integrated Gradients:
|
| 68 |
|
| 69 |
```python
|
| 70 |
# Get raw token attributions
|
| 71 |
+
result = model.interpret("The cat sat on the mat.", "A feline rested on the rug.")
|
| 72 |
for token, attr in zip(result["tokens"], result["attributions"]):
|
| 73 |
print(f"{token:>15s} {attr:+.4f}")
|
| 74 |
|
| 75 |
# Save interactive HTML heatmap
|
| 76 |
model.visualize(
|
| 77 |
+
"The cat sat on the mat.",
|
| 78 |
+
"A feline rested on the rug.",
|
| 79 |
+
label="Correct",
|
| 80 |
output_path="attribution.html",
|
| 81 |
)
|
| 82 |
```
|
| 83 |
|
| 84 |
+
**Aligned pair** ("The cat sat on the mat." vs. "A feline rested on the rug."):
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
|
| 88 |
+
**Contradictory pair** ("It is raining outside." vs. "The weather is sunny and clear."):
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
|
| 92 |
## Evaluation Benchmarks
|
| 93 |
|
| 94 |
Evaluated on 7 benchmarks: SNLI, MultiNLI, MedNLI, TruthfulQA, COCO-Caption, NEWTS, and Climate-FEVER.
|