Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -54,7 +54,7 @@ def user_interaction(comment, model):
|
|
| 54 |
"*"*20 + str(round(rate_pred[0], 2)) + "*"*20 + "\n")"""
|
| 55 |
|
| 56 |
|
| 57 |
-
def take_input(model):
|
| 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:
|
|
@@ -73,7 +73,7 @@ with gr.Blocks() as demo:
|
|
| 73 |
#### Tell us about your personal experience enrolling in this course. Was it the right match for you?
|
| 74 |
#### (Note: Comment should be written in English and be longer than 20 characters)
|
| 75 |
""")
|
| 76 |
-
|
| 77 |
button = gr.Button("What is the Rating I Gave? Click me to Learn")
|
| 78 |
gr.Markdown("#### Sentiment Scores of Your Comment")
|
| 79 |
negscore = gr.Number(label="Negativity Score")
|
|
@@ -81,6 +81,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(model, 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:
|
|
|
|
| 73 |
#### Tell us about your personal experience enrolling in this course. Was it the right match for you?
|
| 74 |
#### (Note: Comment should be written in English and be longer than 20 characters)
|
| 75 |
""")
|
| 76 |
+
placeholder_1 = gr.Textbox(placeholder="Write your comment here...")
|
| 77 |
button = gr.Button("What is the Rating I Gave? Click me to Learn")
|
| 78 |
gr.Markdown("#### Sentiment Scores of Your Comment")
|
| 79 |
negscore = gr.Number(label="Negativity Score")
|
|
|
|
| 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, inputs=[cons_tuned_svr, "text"], outputs=[negscore, neuscore, posscore, compscore, rating])
|
| 85 |
|
| 86 |
demo.launch()
|