Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -54,13 +54,14 @@ def user_interaction(comment, model):
|
|
| 54 |
"*"*20 + str(round(rate_pred[0], 2)) + "*"*20 + "\n")"""
|
| 55 |
|
| 56 |
|
| 57 |
-
def take_input(
|
| 58 |
#if (detect(comment) != "en") or (len(comment) < 20):
|
| 59 |
# return "Sorry, your comment does not meet the requirements.\n", "Please check your comment"
|
| 60 |
#else:
|
| 61 |
-
|
|
|
|
|
|
|
| 62 |
|
| 63 |
-
cons_tuned_svr, _, _, _, _ = sample_model(data, SVR(C=3, kernel="rbf", tol=0.001))
|
| 64 |
|
| 65 |
|
| 66 |
with gr.Blocks() as demo:
|
|
@@ -81,6 +82,6 @@ with gr.Blocks() as demo:
|
|
| 81 |
posscore = gr.Number(label="Positivity Score")
|
| 82 |
compscore = gr.Number(label="Compound Score")
|
| 83 |
rating = gr.Number(label="Generated Rating from Your Comment")
|
| 84 |
-
button.click(fn=take_input
|
| 85 |
|
| 86 |
demo.launch()
|
|
|
|
| 54 |
"*"*20 + str(round(rate_pred[0], 2)) + "*"*20 + "\n")"""
|
| 55 |
|
| 56 |
|
| 57 |
+
def take_input(comment):
|
| 58 |
#if (detect(comment) != "en") or (len(comment) < 20):
|
| 59 |
# return "Sorry, your comment does not meet the requirements.\n", "Please check your comment"
|
| 60 |
#else:
|
| 61 |
+
cons_tuned_svr, _, _, _, _ = sample_model(data, SVR(C=3, kernel="rbf", tol=0.001))
|
| 62 |
+
return user_interaction(comment, cons_tuned_svr)
|
| 63 |
+
|
| 64 |
|
|
|
|
| 65 |
|
| 66 |
|
| 67 |
with gr.Blocks() as demo:
|
|
|
|
| 82 |
posscore = gr.Number(label="Positivity Score")
|
| 83 |
compscore = gr.Number(label="Compound Score")
|
| 84 |
rating = gr.Number(label="Generated Rating from Your Comment")
|
| 85 |
+
button.click(fn=take_input, inputs=["text"], outputs=[negscore, neuscore, posscore, compscore, rating])
|
| 86 |
|
| 87 |
demo.launch()
|