Views
No views yet
0 = Fake1 = Real| Metric | Score |
|---|---|
| Accuracy | ~95% |
| F1 Score | ~95% |
| Precision | ~95% |
| Recall | ~95% |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
2
3model_path = "divyanshu-chauhan-7786/fake-news-roberta"
4
5tokenizer = AutoTokenizer.from_pretrained(model_path)
6model = AutoModelForSequenceClassification.from_pretrained(model_path)
7
8clf = pipeline("text-classification", model=model, tokenizer=tokenizer)
9
10text = "Breaking: Government announces new education reforms!"
11result = clf(text, truncation=True, max_length=256)
12
13print(result)