Matt09Miao commited on
Commit
03272c6
·
verified ·
1 Parent(s): ffe91fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
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 your Tweet for Toxicity Analysis :performing_arts:")
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