BINAII commited on
Commit
8224c6c
·
verified ·
1 Parent(s): 317c28d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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
- response = nlp_pipeline(user_input.replace("[MASK]", ""))
 
 
 
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