File size: 1,171 Bytes
3d7af40
 
 
 
6686bbd
 
 
 
e8d285b
3d7af40
 
 
 
e8d285b
3d7af40
 
 
e8d285b
 
3d7af40
e8d285b
 
 
3d7af40
 
 
 
 
 
e8d285b
 
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
31
---
license: mit
language: 
 - en
datasets: climatebert/distilroberta-base-climate-f
tags:
 - fact-checking
 - climate
 - text entailment
---

This model fine-tuned ClimateBert on the textual entailment task. Given (claim, evidence) pairs, the model predicts support (entailment), refute (contradict), or not enough info (neutral).
 
 ```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model = AutoModelForSequenceClassification.from_pretrained("amandakonet/climatebert-fact-checking", use_auth_token=True)
tokenizer = AutoTokenizer.from_pretrained("amandakonet/climatebert-fact-checking", use_auth_token=True)

features = tokenizer(['Beginning in 2005, however, polar ice modestly receded for several years'], 
                    ['Polar Discovery "Continued Sea Ice Decline in 2005'],  
                    padding='max_length', truncation=True, return_tensors="pt", max_length=512)

model.eval()
with torch.no_grad():
    scores = model(**features).logits
    label_mapping = ['contradiction', 'entailment', 'neutral']
    labels = [label_mapping[score_max] for score_max in scores.argmax(dim=1)]
    print(labels)
 ```