CoolFace
Modelpublic

mempooltx/bert-base-fallacy-detection

sourceHugging Facemitupdated 3y agoView on Hugging Face
0likes8downloads
Model Card
python
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
import torch.nn.functional as F

# Load the model and tokenizer
model = AutoModelForSequenceClassification.from_pretrained("mempooltx/bert-base-fallacy-detection")
tokenizer = AutoTokenizer.from_pretrained("mempooltx/bert-base-fallacy-detection")

# Prepare the text
text = "the sky is blue because the sky is blue"
inputs = tokenizer(text, padding=True, truncation=True, return_tensors="pt")

# Get predictions
model.eval()
with torch.no_grad():
    outputs = model(**inputs)

# Convert logits to probabilities
probabilities = F.softmax(outputs.logits, dim=1)
LabelDescription
0false causality
1circular reasoning
2fallacy of relevance
3intentional
4fallacy of credibility
5faulty generalization
6equivocation
7ad hominem
8appeal to emotion
9fallacy of extension
10false dilemma
11fallacy of logic
12ad populum