RoBERTa Causal Narrative Classifier

This model is a fine-tuned version of roberta-base for causal narrative sentence classification.

Model Description

  • Base Model: roberta-base
  • Task: Binary classification (causal vs non-causal sentences)
  • Training Data: CausalNewsCorpus V2

Training Results

  • Accuracy: 83.82%
  • Precision: 84.31%
  • Recall: 83.20%
  • F1 Score: 83.48%

Usage

from transformers import RobertaTokenizer, RobertaForSequenceClassification
import torch

# Load model and tokenizer
model_name = "Policat/roberta-causal-narrative-classifier"
tokenizer = RobertaTokenizer.from_pretrained(model_name)
model = RobertaForSequenceClassification.from_pretrained(model_name)

# Predict
text = "The heavy rain caused flooding in the city."
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)

with torch.no_grad():
    outputs = model(**inputs)
    prediction = torch.argmax(outputs.logits, dim=-1).item()

print(f"Is causal: {prediction == 1}")

Labels

  • 0: Non-causal sentence
  • 1: Causal narrative sentence
Downloads last month
21
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support