Promptify
1.0.0
Teknik cepat, menyelesaikan masalah NLP dengan LLM & dengan mudah menghasilkan permintaan tugas NLP yang berbeda untuk model generatif populer seperti GPT, Palm, dan banyak lagi dengan Prictify
Repositori ini diuji pada Python 3.7+, OpenAI 0.25+.
Anda harus menginstal computtify menggunakan perintah PIP
pip3 install promptifyatau
pip3 install git+https://github.com/promptslab/Promptify.git Untuk segera menggunakan model LLM untuk tugas NLP Anda, kami menyediakan API Pipeline .
from promptify import Prompter , OpenAI , Pipeline
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 ) # or `HubModel()` for Huggingface-based inference or 'Azure' etc
prompter = Prompter ( 'ner.jinja' ) # select a template or provide custom template
pipe = Pipeline ( prompter , model )
result = pipe . fit ( sentence , domain = "medical" , labels = None )
### 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" },
]
| Nama tugas | Colab Notebook | Status |
|---|---|---|
| Pengakuan entitas yang disebutkan | Contoh NER dengan GPT-3 | ✅ |
| Klasifikasi teks multi-label | Contoh klasifikasi dengan GPT-3 | ✅ |
| Klasifikasi teks multi-kelas | Contoh klasifikasi dengan GPT-3 | ✅ |
| Klasifikasi teks biner | Contoh klasifikasi dengan GPT-3 | ✅ |
| Permintaan-pertanyaan | Contoh tugas QA dengan GPT-3 | ✅ |
| Generasi tanya jawab | Contoh tugas QA dengan GPT-3 | ✅ |
| Ekstraksi Relasi | Contoh ekstraksi relasi dengan GPT-3 | ✅ |
| Peringkasan | Contoh tugas peringkasan dengan GPT-3 | ✅ |
| Penjelasan | Contoh tugas penjelasan dengan GPT-3 | ✅ |
| Penulis SQL | Contoh penulis SQL dengan GPT-3 | ✅ |
| Data Tabular | ||
| Data gambar | ||
| Lebih banyak petunjuk |
Minta dokumen
@misc{Promptify2022,
title = {Promptify: Structured Output from LLMs},
author = {Pal, Ankit},
year = {2022},
howpublished = {url{https://github.com/promptslab/Promptify}},
note = {Prompt-Engineering components for NLP tasks in Python}
}
Kami menyambut setiap kontribusi untuk proyek open source kami, termasuk fitur baru, peningkatan infrastruktur, dan dokumentasi yang lebih komprehensif. Silakan lihat pedoman yang berkontribusi