Spaces:
Sleeping
Sleeping
Commit
·
ebd52bf
1
Parent(s):
bf5b098
test 2 without model
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ from transformers import pipeline
|
|
7 |
|
8 |
# Model and pipeline
|
9 |
MODEL_PATH = 'danielcd99/multilanguage-toxicity-classifier'
|
|
|
10 |
"""
|
11 |
def load_pipeline():
|
12 |
pipe=pipeline(
|
@@ -24,22 +25,3 @@ st.subheader("This is an app for detecting toxicity in tweets written in portugu
|
|
24 |
"Write the name of the user (without @) and select the number of tweets you want to check.")
|
25 |
|
26 |
|
27 |
-
# User information
|
28 |
-
with st.form(key='forms'):
|
29 |
-
st.markdown(
|
30 |
-
"""#### Tweets are classified in:
|
31 |
-
- 0: Harmless
|
32 |
-
- 1: Toxic
|
33 |
-
""")
|
34 |
-
username = st.text_input(label='Username:')
|
35 |
-
number_of_tweets = st.selectbox(
|
36 |
-
'How many tweets do you want to check?',
|
37 |
-
(5, 10, 20, 30))
|
38 |
-
submit_button = st.form_submit_button(label='Analyze')
|
39 |
-
|
40 |
-
if submit_button:
|
41 |
-
scraper = TwitterUserScraper(username)
|
42 |
-
tweets = get_tweets(scraper, number_of_tweets)
|
43 |
-
predictions = get_predictions(tweets, pipe)
|
44 |
-
|
45 |
-
#st.table(pd.DataFrame({'tweet': tweets, 'toxic':predictions}))
|
|
|
7 |
|
8 |
# Model and pipeline
|
9 |
MODEL_PATH = 'danielcd99/multilanguage-toxicity-classifier'
|
10 |
+
|
11 |
"""
|
12 |
def load_pipeline():
|
13 |
pipe=pipeline(
|
|
|
25 |
"Write the name of the user (without @) and select the number of tweets you want to check.")
|
26 |
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|