promptslab / Promptify
- вторник, 31 января 2023 г. в 00:36:21
Prompt Engineering | Use GPT or other prompt based models to get structured output. Join our discord for Prompt-Engineering, LLMs and other latest research
Prompt Engineering, Solve NLP Problems with LLM's & Easily generate different NLP Task prompts for popular generative models like GPT, PaLM, and more with Promptify
This repository is tested on Python 3.7+, openai 0.25+.
You should install Promptify using Pip command
pip3 install promptify
To immediately use a LLM model for your NLP task, we provide the Prompter
API.
from promptify import OpenAI
from promptify import Prompter
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"
model = OpenAI(api_key)
nlp_prompter = Prompter(model)
result = nlp_prompter.fit('ner.jinja',
domain = 'medical',
text_input = sentence)
### Output
[{'E': '93-year-old', 'T': 'Age'},
{'E': 'chronic right hip pain', 'T': 'Medical Condition'},
{'E': 'osteoporosis', 'T': 'Medical Condition'},
{'E': 'hypertension', 'T': 'Medical Condition'},
{'E': 'depression', 'T': 'Medical Condition'},
{'E': 'chronic atrial fibrillation', 'T': 'Medical Condition'},
{'E': 'severe nausea and vomiting', 'T': 'Symptom'},
{'E': 'urinary tract infection', 'T': 'Medical Condition'},
{'Branch': 'Internal Medicine', 'Group': 'Geriatrics'}]
Task Name | Colab Notebook | Status |
---|---|---|
Named Entity Recognition | NER Examples with GPT-3 | |
Multi-Label Text Classification | Classification Examples with GPT-3 | |
Multi-Class Text Classification | Classification Examples with GPT-3 | |
Binary Text Classification | Classification Examples with GPT-3 | |
Question-Answering | QA Task Examples with GPT-3 | |
Question-Answer Generation | QA Task Examples with GPT-3 | |
Summarization | Summarization Task Examples with GPT-3 | |
Explanation | Explanation Task Examples with GPT-3 | |
Tabular Data | ||
Image Data | ||
More Prompts |
We welcome any contributions to our open source project, including new features, improvements to infrastructure, and more comprehensive documentation. Please see the contributing guidelines