sukh28 commited on
Commit
fe43cad
1 Parent(s): 41262da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
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
- return results
 
 
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")