Commit
·
c1da9c3
1
Parent(s):
891311d
Update app.py
Browse files
app.py
CHANGED
@@ -4,14 +4,14 @@ import torch
|
|
4 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
5 |
|
6 |
# Load the model and tokenizer
|
7 |
-
|
8 |
-
|
9 |
|
10 |
# Define the function for detecting fake news
|
11 |
@st.cache_resource
|
12 |
def detect_fake_news(text):
|
13 |
# Load the pipeline.
|
14 |
-
model = transformers.pipeline("text-classification", model=
|
15 |
|
16 |
# Predict the sentiment.
|
17 |
prediction = pipeline(text)
|
|
|
4 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
5 |
|
6 |
# Load the model and tokenizer
|
7 |
+
model_name = AutoModelForSequenceClassification.from_pretrained("ikoghoemmanuell/finetuned_fake_news_bert")
|
8 |
+
tokenizer_name = AutoTokenizer.from_pretrained("ikoghoemmanuell/finetuned_fake_news_bert")
|
9 |
|
10 |
# Define the function for detecting fake news
|
11 |
@st.cache_resource
|
12 |
def detect_fake_news(text):
|
13 |
# Load the pipeline.
|
14 |
+
model = transformers.pipeline("text-classification", model=model_name, tokenizer=tokenizer_name)
|
15 |
|
16 |
# Predict the sentiment.
|
17 |
prediction = pipeline(text)
|