-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |