Update app.py
Browse files
app.py
CHANGED
@@ -43,11 +43,13 @@ examples = [
|
|
43 |
|
44 |
|
45 |
model_binary = pipeline("sentiment-analysis", model="hackathon-pln-es/readability-es-sentences", return_all_scores=True)
|
46 |
-
|
47 |
|
48 |
def predict(text, levels):
|
49 |
if levels == 0:
|
50 |
predicted_scores = model_binary(text)[0]
|
|
|
|
|
51 |
|
52 |
output_scores = {}
|
53 |
for e in predicted_scores:
|
|
|
43 |
|
44 |
|
45 |
model_binary = pipeline("sentiment-analysis", model="hackathon-pln-es/readability-es-sentences", return_all_scores=True)
|
46 |
+
model_ternary = pipeline("sentiment-analysis", model="hackathon-pln-es/readability-es-3class-sentences", return_all_scores=True)
|
47 |
|
48 |
def predict(text, levels):
|
49 |
if levels == 0:
|
50 |
predicted_scores = model_binary(text)[0]
|
51 |
+
else:
|
52 |
+
predicted_scores = model_ternary(text)[0]
|
53 |
|
54 |
output_scores = {}
|
55 |
for e in predicted_scores:
|