Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,10 @@ nlp_pipeline = pipeline("fill-mask", model=model, tokenizer=tokenizer)
|
|
11 |
|
12 |
# Function to interact with ClinicalBERT
|
13 |
def medical_chatbot(user_input):
|
14 |
-
|
|
|
|
|
|
|
15 |
return response[0]["sequence"] # Returns the most likely sentence
|
16 |
|
17 |
# Gradio UI
|
|
|
11 |
|
12 |
# Function to interact with ClinicalBERT
|
13 |
def medical_chatbot(user_input):
|
14 |
+
if "[MASK]" not in user_input:
|
15 |
+
return "Please include '[MASK]' in your input. Example: 'The patient is showing signs of [MASK].'"
|
16 |
+
|
17 |
+
response = nlp_pipeline(user_input)
|
18 |
return response[0]["sequence"] # Returns the most likely sentence
|
19 |
|
20 |
# Gradio UI
|