Spaces:
Runtime error
Runtime error
Ariel Hsieh
commited on
Commit
•
ceafef9
1
Parent(s):
40ea4c3
update
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ import pandas as pd
|
|
8 |
#title
|
9 |
st.title("Toxic Tweets")
|
10 |
|
11 |
-
selection = st.selectbox("Select fine-tuned model",("Ariel8/toxic-tweets-classification","roberta-large-mnli","twitter-XLM-roBERTa-base"
|
12 |
|
13 |
if selection == "Ariel8/toxic-tweets-classification":
|
14 |
tokenizer = AutoTokenizer.from_pretrained("Ariel8/toxic-tweets-classification")
|
@@ -59,7 +59,7 @@ else:
|
|
59 |
data = []
|
60 |
text = st.text_input("Enter text here for Sentiment Analysis:","Artificial Intelligence is useful")
|
61 |
data.append(text)
|
62 |
-
if
|
63 |
#1
|
64 |
if st.button("Run Sentiment Analysis of Text"):
|
65 |
model_path = "roberta-large-mnli"
|
@@ -68,7 +68,7 @@ else:
|
|
68 |
label = result[0]["label"]
|
69 |
score = result[0]["score"]
|
70 |
st.write("The classification of the given text is " + label + " with a score of " + str(score))
|
71 |
-
elif
|
72 |
#2
|
73 |
if st.button("Run Sentiment Analysis of Text"):
|
74 |
model_path = "cardiffnlp/twitter-xlm-roberta-base-sentiment"
|
|
|
8 |
#title
|
9 |
st.title("Toxic Tweets")
|
10 |
|
11 |
+
selection = st.selectbox("Select fine-tuned model",("Ariel8/toxic-tweets-classification","roberta-large-mnli","twitter-XLM-roBERTa-base"))
|
12 |
|
13 |
if selection == "Ariel8/toxic-tweets-classification":
|
14 |
tokenizer = AutoTokenizer.from_pretrained("Ariel8/toxic-tweets-classification")
|
|
|
59 |
data = []
|
60 |
text = st.text_input("Enter text here for Sentiment Analysis:","Artificial Intelligence is useful")
|
61 |
data.append(text)
|
62 |
+
if selection == "roberta-large-mnli":
|
63 |
#1
|
64 |
if st.button("Run Sentiment Analysis of Text"):
|
65 |
model_path = "roberta-large-mnli"
|
|
|
68 |
label = result[0]["label"]
|
69 |
score = result[0]["score"]
|
70 |
st.write("The classification of the given text is " + label + " with a score of " + str(score))
|
71 |
+
elif selection == "twitter-XLM-roBERTa-base":
|
72 |
#2
|
73 |
if st.button("Run Sentiment Analysis of Text"):
|
74 |
model_path = "cardiffnlp/twitter-xlm-roberta-base-sentiment"
|