Downloads · 30 days
165
2% of all-time downloads
amandakonet/climatebert-fact-checking
climatebert-fact-checking is a text classification model from amandakonet. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This model fine-tuned ClimateBert on the textual entailment task using Climate FEVER data. Given (claim, evidence) pairs, the model predicts support (entailment), refute (contradict), or not enough info (neutral). The…
Downloads · 30 days
165
2% of all-time downloads
All-time downloads
8.7K
Public
Repo size
658 MB
Likes
10
Public
Click a slice to open those files.
.bin329 MB · 99%
From the Hugging Face model README
This model fine-tuned ClimateBert on the textual entailment task using Climate FEVER data. Given (claim, evidence) pairs, the model predicts support (entailment), refute (contradict), or not enough info (neutral). The model has 67% validation accuracy.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model = AutoModelForSequenceClassification.from_pretrained("amandakonet/climatebert-fact-checking")
tokenizer = AutoTokenizer.from_pretrained("amandakonet/climatebert-fact-checking")
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 = ['entailment', 'contradiction', 'neutral']
labels = [label_mapping[score_max] for score_max in scores.argmax(dim=1)]
print(labels)