Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,8 +10,9 @@ model_id_2 = "microsoft/deberta-base"
|
|
| 10 |
model_id_3 = "distilbert-base-uncased-finetuned-sst-2-english"
|
| 11 |
model_id_4 = "lordtt13/emo-mobilebert"
|
| 12 |
model_id_5 = "juliensimon/reviews-sentiment-analysis"
|
|
|
|
| 13 |
|
| 14 |
-
def parse_output(output_json):
|
| 15 |
list_pred=[]
|
| 16 |
for i in range(len(output_json[0])):
|
| 17 |
label = output_json[0][i]['label']
|
|
@@ -71,18 +72,25 @@ with app:
|
|
| 71 |
Model 5 = juliensimon/reviews-sentiment-analysis
|
| 72 |
""")
|
| 73 |
btn5 = gr.Button("Predict - Model 5")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
with gr.Column():
|
| 76 |
out_1 = gr.Textbox(label="Predictions for Model 1")
|
| 77 |
out_2 = gr.Textbox(label="Predictions for Model 2")
|
| 78 |
out_3 = gr.Textbox(label="Predictions for Model 3")
|
| 79 |
out_4 = gr.Textbox(label="Predictions for Model 4")
|
| 80 |
-
out_5 = gr.Textbox(label="Predictions for Model 5")
|
|
|
|
| 81 |
|
| 82 |
btn1.click(fn=get_prediction(model_id_1), inputs=inp_1, outputs=out_1)
|
| 83 |
btn2.click(fn=get_prediction(model_id_2), inputs=inp_1, outputs=out_2)
|
| 84 |
btn3.click(fn=get_prediction(model_id_3), inputs=inp_1, outputs=out_3)
|
| 85 |
btn4.click(fn=get_prediction(model_id_4), inputs=inp_1, outputs=out_4)
|
| 86 |
btn5.click(fn=get_prediction(model_id_5), inputs=inp_1, outputs=out_5)
|
| 87 |
-
|
| 88 |
app.launch()
|
|
|
|
| 10 |
model_id_3 = "distilbert-base-uncased-finetuned-sst-2-english"
|
| 11 |
model_id_4 = "lordtt13/emo-mobilebert"
|
| 12 |
model_id_5 = "juliensimon/reviews-sentiment-analysis"
|
| 13 |
+
model_id_6 = "sbcBI/sentiment_analysis_model"
|
| 14 |
|
| 15 |
+
def parse_output(output_json): # list of list of dicts
|
| 16 |
list_pred=[]
|
| 17 |
for i in range(len(output_json[0])):
|
| 18 |
label = output_json[0][i]['label']
|
|
|
|
| 72 |
Model 5 = juliensimon/reviews-sentiment-analysis
|
| 73 |
""")
|
| 74 |
btn5 = gr.Button("Predict - Model 5")
|
| 75 |
+
gr.Markdown(
|
| 76 |
+
"""
|
| 77 |
+
Model 6 = sbcBI/sentiment_analysis_model
|
| 78 |
+
""")
|
| 79 |
+
btn6 = gr.Button("Predict - Model 6")
|
| 80 |
+
|
| 81 |
|
| 82 |
with gr.Column():
|
| 83 |
out_1 = gr.Textbox(label="Predictions for Model 1")
|
| 84 |
out_2 = gr.Textbox(label="Predictions for Model 2")
|
| 85 |
out_3 = gr.Textbox(label="Predictions for Model 3")
|
| 86 |
out_4 = gr.Textbox(label="Predictions for Model 4")
|
| 87 |
+
out_5 = gr.Textbox(label="Predictions for Model 5")
|
| 88 |
+
out_6 = gr.Textbox(label="Predictions for Model 6")
|
| 89 |
|
| 90 |
btn1.click(fn=get_prediction(model_id_1), inputs=inp_1, outputs=out_1)
|
| 91 |
btn2.click(fn=get_prediction(model_id_2), inputs=inp_1, outputs=out_2)
|
| 92 |
btn3.click(fn=get_prediction(model_id_3), inputs=inp_1, outputs=out_3)
|
| 93 |
btn4.click(fn=get_prediction(model_id_4), inputs=inp_1, outputs=out_4)
|
| 94 |
btn5.click(fn=get_prediction(model_id_5), inputs=inp_1, outputs=out_5)
|
| 95 |
+
btn6.click(fn=get_prediction(model_id_5), inputs=inp_1, outputs=out_6)
|
| 96 |
app.launch()
|