Siran-Li commited on
Commit
1f68b0c
·
verified ·
1 Parent(s): f7af40a

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +13 -4
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 (requires `pip install captum`):
68
 
69
  ```python
70
  # Get raw token attributions
71
- result = model.interpret("The vaccine failed all trials.", "The vaccine was proven effective.")
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 vaccine failed all trials.",
78
- "The vaccine was proven effective.",
 
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
+ ![Attribution example - aligned](attrbution_ex1.jpeg)
87
+
88
+ **Contradictory pair** ("It is raining outside." vs. "The weather is sunny and clear."):
89
+
90
+ ![Attribution example - contradictory](attrbution_ex2.jpeg)
91
+
92
  ## Evaluation Benchmarks
93
 
94
  Evaluated on 7 benchmarks: SNLI, MultiNLI, MedNLI, TruthfulQA, COCO-Caption, NEWTS, and Climate-FEVER.