Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,6 @@ def preprocess_text(text):
|
|
33 |
# Converter para letras minúsculas
|
34 |
text = text.lower()
|
35 |
return text
|
36 |
-
|
37 |
def generate_predictions(text):
|
38 |
sentences = text.split(".")
|
39 |
sentences = [preprocess_text(sentence) for sentence in sentences]
|
@@ -52,9 +51,10 @@ def generate_predictions(text):
|
|
52 |
|
53 |
# Make predictions
|
54 |
sentence_prediction = predict(loaded_model, input_loader)[0]
|
55 |
-
predictions.append(sentence_prediction)
|
56 |
|
57 |
-
|
|
|
58 |
|
59 |
|
60 |
# Specify the device as CPU
|
|
|
33 |
# Converter para letras minúsculas
|
34 |
text = text.lower()
|
35 |
return text
|
|
|
36 |
def generate_predictions(text):
|
37 |
sentences = text.split(".")
|
38 |
sentences = [preprocess_text(sentence) for sentence in sentences]
|
|
|
51 |
|
52 |
# Make predictions
|
53 |
sentence_prediction = predict(loaded_model, input_loader)[0]
|
54 |
+
predictions.append(f"{sentence}: {sentence_prediction}")
|
55 |
|
56 |
+
predictions_html = "<br>".join(predictions)
|
57 |
+
return predictions_html
|
58 |
|
59 |
|
60 |
# Specify the device as CPU
|