Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,11 +5,14 @@ from transformers import pipeline
|
|
5 |
|
6 |
toxic_model = pipeline("text-classification", model="Matt09Miao/GP5_tweet_toxic")
|
7 |
|
8 |
-
|
|
|
|
|
|
|
9 |
|
10 |
st.set_page_config(page_title="Tweet Toxicity Analysis")
|
11 |
|
12 |
-
st.header("Please input
|
13 |
input = st.text_area("Enter a Tweer for analysis")
|
14 |
result = toxic_model(input)
|
15 |
|
@@ -18,4 +21,7 @@ st.write("Tweet:", input)
|
|
18 |
st.write("label:", result[0]['label'])
|
19 |
st.write("score:", result[0]['score'])
|
20 |
|
|
|
|
|
|
|
21 |
|
|
|
5 |
|
6 |
toxic_model = pipeline("text-classification", model="Matt09Miao/GP5_tweet_toxic")
|
7 |
|
8 |
+
def text2audio(text):
|
9 |
+
pipe = pipeline("text-to-audio", model="Matthijs/mms-tts-eng")
|
10 |
+
audio_data = pipe(text)
|
11 |
+
return audio_data
|
12 |
|
13 |
st.set_page_config(page_title="Tweet Toxicity Analysis")
|
14 |
|
15 |
+
st.header("Please input a Tweet for Toxicity Analysis :performing_arts:")
|
16 |
input = st.text_area("Enter a Tweer for analysis")
|
17 |
result = toxic_model(input)
|
18 |
|
|
|
21 |
st.write("label:", result[0]['label'])
|
22 |
st.write("score:", result[0]['score'])
|
23 |
|
24 |
+
text2audio("Tweet:", input)
|
25 |
+
text2audio"label:", result[0]['label'])
|
26 |
+
text2audio("score:", result[0]['score'])
|
27 |
|