Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -35,15 +35,15 @@ def user_interaction(comment, model):
|
|
35 |
compound_score = analyzer.polarity_scores(comment)["compound"]
|
36 |
rate_pred = model.predict([[negative_score, neutral_score, positive_score, compound_score]])
|
37 |
|
38 |
-
return f"\nYour Comment: {comment}\n" +
|
39 |
-
"*"*10 + "Analysis of the Comment" + "*"*10 +
|
40 |
-
"-"*10 + f"Negativity Score: {negative_score:.2f}" + "-"*10 +
|
41 |
-
"-"*10 + f"Neutrality Score: {neutral_score:.2f}" + "-"*10 +
|
42 |
-
"-"*10 + f"Positivity Score: {positive_score:.2f}" + "-"*10 +
|
43 |
-
"-"*10 + f"Compound Score: {compound_score:.2f}" + "-"*10 +
|
44 |
-
"*"*43,
|
45 |
-
"\nThe estimated rating this comment can give" +
|
46 |
-
"*"*20 + str(round(rate_pred[0], 2)) + "*"*20
|
47 |
|
48 |
|
49 |
def take_input(model):
|
|
|
35 |
compound_score = analyzer.polarity_scores(comment)["compound"]
|
36 |
rate_pred = model.predict([[negative_score, neutral_score, positive_score, compound_score]])
|
37 |
|
38 |
+
return (f"\nYour Comment: {comment}\n" +
|
39 |
+
"*"*10 + "Analysis of the Comment" + "*"*10 + "\n" +
|
40 |
+
"-"*10 + f"Negativity Score: {negative_score:.2f}" + "-"*10 + "\n" +
|
41 |
+
"-"*10 + f"Neutrality Score: {neutral_score:.2f}" + "-"*10 + "\n" +
|
42 |
+
"-"*10 + f"Positivity Score: {positive_score:.2f}" + "-"*10 + "\n" +
|
43 |
+
"-"*10 + f"Compound Score: {compound_score:.2f}" + "-"*10 + "\n" +
|
44 |
+
"*"*43 + "\n"),
|
45 |
+
("\nThe estimated rating this comment can give" + "\n" +
|
46 |
+
"*"*20 + str(round(rate_pred[0], 2)) + "*"*20 + "\n")
|
47 |
|
48 |
|
49 |
def take_input(model):
|