Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -35,8 +35,12 @@ def classify_comment(comment):
|
|
35 |
# Make predictions
|
36 |
predictions = model.predict(comment_sequence)[0]
|
37 |
results = dict(zip(labels, predictions))
|
|
|
|
|
38 |
|
39 |
-
|
|
|
|
|
40 |
|
41 |
# Create the Gradio interface
|
42 |
comment_input = gr.inputs.Textbox(label="Enter your comment here")
|
|
|
35 |
# Make predictions
|
36 |
predictions = model.predict(comment_sequence)[0]
|
37 |
results = dict(zip(labels, predictions))
|
38 |
+
|
39 |
+
max_value = max(results.values())
|
40 |
|
41 |
+
max_keys = [key for key, value in results.items() if value == max_value]
|
42 |
+
|
43 |
+
return max_keys[0].capitalize()
|
44 |
|
45 |
# Create the Gradio interface
|
46 |
comment_input = gr.inputs.Textbox(label="Enter your comment here")
|