From ad7791c857be4fccab6df0b5f8082c3e966e691a Mon Sep 17 00:00:00 2001 From: jcollopy-tulane Date: Mon, 29 Apr 2024 17:20:28 -0500 Subject: [PATCH] 1 --- nlp/app/forms.py | 3 ++- nlp/cli.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/nlp/app/forms.py b/nlp/app/forms.py index 5d492b4..430c478 100644 --- a/nlp/app/forms.py +++ b/nlp/app/forms.py @@ -12,6 +12,7 @@ class Meta: # Ignoring CSRF security feature. model_choice = RadioField('Choose Model', choices=[ ('bnb', 'Naive Bayes'), ('lr', 'Logistic Regression'), - ('cnn', 'CNN') + ('cnn', 'CNN'), + ('bert', "BERT") ]) submit = SubmitField('Submit') \ No newline at end of file diff --git a/nlp/cli.py b/nlp/cli.py index d71631d..b46be43 100644 --- a/nlp/cli.py +++ b/nlp/cli.py @@ -242,9 +242,9 @@ def __len__(self): precision = precision_score(true_labels, predictions) recall = recall_score(true_labels, predictions) f1 = f1_score(true_labels, predictions) - print("Precision on Test:", precision) - print("Recall on Test:", recall) - print("F1 Score on Test:", f1) + print("Precision on Test:", round(precision,3)) + print("Recall on Test:", round(recall,3)) + print("F1 Score on Test:", round(f1,3)) if __name__ == "__main__": sys.exit(main())