Skip to content

Commit

Permalink
Update medical_ner.py
Browse files Browse the repository at this point in the history
  • Loading branch information
monk1337 authored Jul 22, 2023
1 parent 0c7a6a5 commit a121b88
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions examples/medical_ner.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
from promptify import OpenAI
from promptify import Prompter
from promptify import Prompter,OpenAI, Pipeline

sentence = """The patient is a 93-year-old female with a medical
sentence = "The patient is a 93-year-old female with a medical
history of chronic right hip pain, osteoporosis,
hypertension, depression, and chronic atrial
fibrillation admitted for evaluation and management
of severe nausea and vomiting and urinary tract
infection"""
infection"

model = OpenAI(api_key) # or `HubModel()` for Huggingface-based inference or 'Azure' etc
prompter = Prompter('ner.jinja') # select a template or provide custom template
pipe = Pipeline(prompter , model)

model = OpenAI(api_key="")

prompter = Prompter(model=model, template="ner.jinja")

output = prompter.fit(text_input=sentence, domain="medical", labels=None)

output = pipe.fit(text_input=sentence, domain="medical", labels=None)
print(output)

0 comments on commit a121b88

Please sign in to comment.