Spaces:
Runtime error
Runtime error
remove radio buttons
Browse files
app.py
CHANGED
@@ -1,23 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
def choosistant(review_text,procon='Benefits'):
|
4 |
-
|
5 |
-
return review_text
|
6 |
-
elif procon == 'Drawbacks':
|
7 |
-
return review_text[-4:]
|
8 |
-
else:
|
9 |
-
return "Select whether to see either benefits or drawbacks of this product."
|
10 |
|
11 |
text_input = gr.Textbox(lines=8,placeholder="Enter the review text here...",label="Review Text")
|
12 |
new_title = gr.Textbox(label="Detected pro/con")
|
13 |
iface = gr.Interface(
|
14 |
-
choosistant, [text_input
|
15 |
new_title,
|
16 |
description ="Checkout some amazon reviews eg at [http://snap.stanford.edu/data/amazon/productGraph/categoryFiles/reviews_Musical_Instruments_5.json.gz](http://snap.stanford.edu/data/amazon/productGraph/categoryFiles/reviews_Musical_Instruments_5.json.gz)",
|
17 |
allow_flagging="manual",
|
18 |
-
flagging_options = ['Incorrect','
|
19 |
-
examples = [['The top side came ripped off'
|
20 |
-
['The gear is child friendly'
|
21 |
)
|
22 |
|
23 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
def choosistant(review_text,procon='Benefits'):
|
4 |
+
#waiting for model
|
5 |
+
return "none yet" +' '+ review_text
|
|
|
|
|
|
|
|
|
6 |
|
7 |
text_input = gr.Textbox(lines=8,placeholder="Enter the review text here...",label="Review Text")
|
8 |
new_title = gr.Textbox(label="Detected pro/con")
|
9 |
iface = gr.Interface(
|
10 |
+
choosistant, [text_input],
|
11 |
new_title,
|
12 |
description ="Checkout some amazon reviews eg at [http://snap.stanford.edu/data/amazon/productGraph/categoryFiles/reviews_Musical_Instruments_5.json.gz](http://snap.stanford.edu/data/amazon/productGraph/categoryFiles/reviews_Musical_Instruments_5.json.gz)",
|
13 |
allow_flagging="manual",
|
14 |
+
flagging_options = ['Incorrect','Offensive', 'Other'],
|
15 |
+
examples = [['The top side came ripped off'],
|
16 |
+
['The gear is child friendly']],
|
17 |
)
|
18 |
|
19 |
iface.launch()
|