Text Classification
Transformers
PyTorch
roberta
text-embeddings-inference

Run this model with HF Jobs

Run newsmediabias/FakeWatch on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/newsmediabias/FakeWatch. Ask me which dataset to train on, then push the fine-tuned model to a new private model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/newsmediabias/FakeWatch on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline

# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("newsmediabias/fake-news-classifier-elections")
model = AutoModelForSequenceClassification.from_pretrained("newsmediabias/fake-news-classifier-elections")

# Initialize the pipeline for sequence classification with the model and tokenizer
fake_news_classifier = pipeline(
    "text-classification",
    model=model,
    tokenizer=tokenizer
)

# Define label mapping based on the model's training
label_mapping = {
    "LABEL_0": "REAL",
    "LABEL_1": "FAKE"
}

# Example text to classify
example_text = "The election was rigged and full of fraud."

# Perform inference
predictions = fake_news_classifier(example_text)
predicted_class = label_mapping[predictions[0]['label']]
confidence_score = predictions[0]['score'] * 100

# Output the results
print(f"Predicted Class: {predicted_class}")
print(f"Confidence Score: {confidence_score:.2f}%")
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Datasets used to train newsmediabias/FakeWatch