Spaces:
Sleeping
Sleeping
Kingston Yip
commited on
Commit
·
e5df87e
1
Parent(s):
6f318d4
updates
Browse files
app.py
CHANGED
@@ -7,12 +7,16 @@ image = "kanye_tweet.jpg"
|
|
7 |
st.image(image, use_column_width=True)
|
8 |
|
9 |
# create a dropdown to select the model
|
10 |
-
model = st.selectbox("Select model", ["
|
11 |
|
12 |
#form
|
13 |
with st.form("my_form"):
|
14 |
submitted = st.form_submit_button("Analyze")
|
15 |
tweet = st.text_area("enter tweet here:", value="i'm nice at ping pong")
|
16 |
if submitted:
|
17 |
-
out =
|
|
|
|
|
|
|
|
|
18 |
st.json(out)
|
|
|
7 |
st.image(image, use_column_width=True)
|
8 |
|
9 |
# create a dropdown to select the model
|
10 |
+
model = st.selectbox("Select model", ["sentiment-analysis transformer", "finiteautomata/bertweet-base-sentiment-analysis"])
|
11 |
|
12 |
#form
|
13 |
with st.form("my_form"):
|
14 |
submitted = st.form_submit_button("Analyze")
|
15 |
tweet = st.text_area("enter tweet here:", value="i'm nice at ping pong")
|
16 |
if submitted:
|
17 |
+
out = None
|
18 |
+
if model == "sentiment-analysis transformer":
|
19 |
+
out = pipe(tweet)
|
20 |
+
else:
|
21 |
+
out = pipe(tweet, model="nlptown/bert-base-multilingual-uncased-sentiment")
|
22 |
st.json(out)
|