Downloads · 30 days
28
2% of all-time downloads
MidhunKanadan/roberta-large-fallacy-classification
roberta-large-fallacy-classification is a text classification model from MidhunKanadan. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of roberta-large trained on the Logical Fallacy Classification Dataset. It is capable of classifying various types of logical fallacies in text.
Downloads · 30 days
28
2% of all-time downloads
All-time downloads
1.6K
Public
Parameters
355M
2.8 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors1.4 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of roberta-large trained on the Logical Fallacy Classification Dataset. It is capable of classifying various types of logical fallacies in text.
roberta-largeThe model can classify the following types of logical fallacies:
To use the model for quick classification with a text pipeline:
from transformers import pipeline
pipe = pipeline("text-classification", model="MidhunKanadan/roberta-large-fallacy-classification", device=0)
text = "The rooster crows always before the sun rises, therefore the crowing rooster causes the sun to rise."
result = pipe(text)[0]
print(f"Predicted Label: {result['label']}, Score: {result['score']:.4f}")
Expected Output:
Predicted Label: false causality, Score: 0.9632
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch.nn.functional as F
model_path = "MidhunKanadan/roberta-large-fallacy-classification"
text = "The rooster crows always before the sun rises, therefore the crowing rooster causes the sun to rise."
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path).to("cuda")
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=128).to("cuda")
with torch.no_grad():
probs = F.softmax(model(**inputs).logits, dim=-1)
results = {model.config.id2label[i]: score.item() for i, score in enumerate(probs[0])}
# Print scores for all labels
for label, score in sorted(results.items(), key=lambda x: x[1], reverse=True):
print(f"{label}: {score:.4f}")
Expected Output:
false causality: 0.9632
fallacy of logic: 0.0139
faulty generalization: 0.0054
intentional: 0.0029
fallacy of credibility: 0.0023
equivocation: 0.0022
fallacy of extension: 0.0020
ad hominem: 0.0019
circular reasoning: 0.0016
false dilemma: 0.0015
fallacy of relevance: 0.0013
ad populum: 0.0009
appeal to emotion: 0.0009
The model is licensed under the Apache 2.0 License.