Instructions to use MuhammadAzharITU/fake-news-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MuhammadAzharITU/fake-news-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="MuhammadAzharITU/fake-news-classifier")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("MuhammadAzharITU/fake-news-classifier") model = AutoModelForSequenceClassification.from_pretrained("MuhammadAzharITU/fake-news-classifier") - Notebooks
- Google Colab
- Kaggle
Create App.py
Browse files
App.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
model_name = "MuhammadAzharITU/fake-news-classifier"
|
| 5 |
+
pipe = pipeline("text-classification", model=model_name)
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
st.title("Fake News Classifier")
|
| 9 |
+
text = st.text_area("Enter Urdu news here")
|
| 10 |
+
|
| 11 |
+
if text:
|
| 12 |
+
# Perform classification
|
| 13 |
+
out = pipe(text)
|
| 14 |
+
st.json(out)
|