Spaces:
Sleeping
Sleeping
Kingston Yip
commited on
Commit
β’
869a57d
1
Parent(s):
d1320a7
YEEEE
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import torch
|
|
3 |
from transformers import AutoModelForSequenceClassification, pipeline, AutoTokenizer, DistilBertForSequenceClassification, DistilBertTokenizerFast
|
4 |
import pandas as pd
|
5 |
import comments
|
6 |
-
from random import
|
7 |
import requests
|
8 |
|
9 |
|
@@ -80,7 +80,7 @@ with st.form("my_form"):
|
|
80 |
default = "I'm nice at ping pong"
|
81 |
tweet = st.text_area(label="Enter Text:",value=default)
|
82 |
submitted = st.form_submit_button("Analyze textbox")
|
83 |
-
random = st.form_submit_button("
|
84 |
kanye = st.form_submit_button("Get a ye quote π»π€π§πΆ")
|
85 |
|
86 |
if random:
|
@@ -93,10 +93,10 @@ with st.form("my_form"):
|
|
93 |
if response.status_code == 200:
|
94 |
data = response.json()
|
95 |
tweet = data['quote']
|
96 |
-
print(f'Kanye says: "{tweet}"')
|
97 |
else:
|
98 |
-
|
99 |
st.write(tweet)
|
|
|
100 |
|
101 |
if submitted:
|
102 |
df = perform_cyberbullying_analysis(tweet)
|
|
|
3 |
from transformers import AutoModelForSequenceClassification, pipeline, AutoTokenizer, DistilBertForSequenceClassification, DistilBertTokenizerFast
|
4 |
import pandas as pd
|
5 |
import comments
|
6 |
+
from random import randint
|
7 |
import requests
|
8 |
|
9 |
|
|
|
80 |
default = "I'm nice at ping pong"
|
81 |
tweet = st.text_area(label="Enter Text:",value=default)
|
82 |
submitted = st.form_submit_button("Analyze textbox")
|
83 |
+
random = st.form_submit_button("Get a random πππ tweet (warning!!)")
|
84 |
kanye = st.form_submit_button("Get a ye quote π»π€π§πΆ")
|
85 |
|
86 |
if random:
|
|
|
93 |
if response.status_code == 200:
|
94 |
data = response.json()
|
95 |
tweet = data['quote']
|
|
|
96 |
else:
|
97 |
+
st.error("Error getting Kanye quote | status code: " + str(response.status_code))
|
98 |
st.write(tweet)
|
99 |
+
submitted = True
|
100 |
|
101 |
if submitted:
|
102 |
df = perform_cyberbullying_analysis(tweet)
|