add an error
Browse files
app.py
CHANGED
|
@@ -30,6 +30,9 @@ def index():
|
|
| 30 |
print("Tokenized:", tokenizer.tokenize(input_text))
|
| 31 |
predictions = nlp(input_text)
|
| 32 |
print("Predictions:", predictions)
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
log_entry = {
|
| 35 |
"timestamp": str(datetime.datetime.now()),
|
|
|
|
| 30 |
print("Tokenized:", tokenizer.tokenize(input_text))
|
| 31 |
predictions = nlp(input_text)
|
| 32 |
print("Predictions:", predictions)
|
| 33 |
+
if not predictions:
|
| 34 |
+
return "Error: No medical abbreviation detected in the input.", 400
|
| 35 |
+
|
| 36 |
|
| 37 |
log_entry = {
|
| 38 |
"timestamp": str(datetime.datetime.now()),
|