Promptify
1.0.0
วิศวกรรมที่รวดเร็วแก้ปัญหา NLP ด้วย LLM และสร้างงาน NLP ที่แตกต่างกันได้อย่างง่ายดายสำหรับโมเดล Generative ยอดนิยมเช่น GPT, Palm และอื่น ๆ
ที่เก็บนี้ได้รับการทดสอบใน Python 3.7+, OpenAI 0.25+
คุณควรติดตั้งพร้อมท์โดยใช้คำสั่ง PIP
pip3 install promptify
หรือ
pip3 install git+https://github.com/promptslab/Promptify.git
ในการใช้แบบจำลอง LLM ทันทีสำหรับงาน NLP ของคุณเราได้จัดเตรียม Pipeline
API
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" },
]
ชื่องาน | สมุดบันทึก colab | สถานะ |
---|---|---|
การจดจำเอนทิตีชื่อ | ตัวอย่างด้วย GPT-3 | |
การจำแนกประเภทข้อความหลายฉลาก | ตัวอย่างการจำแนกประเภทด้วย GPT-3 | |
การจำแนกประเภทข้อความหลายคลาส | ตัวอย่างการจำแนกประเภทด้วย GPT-3 | |
การจำแนกประเภทข้อความไบนารี | ตัวอย่างการจำแนกประเภทด้วย GPT-3 | |
การตอบคำถาม | ตัวอย่างงาน QA ด้วย GPT-3 | |
การตอบคำถามตอบคำถาม | ตัวอย่างงาน QA ด้วย GPT-3 | |
ความสัมพันธ์ | ตัวอย่างความสัมพันธ์-การสกัดด้วย GPT-3 | |
การสรุป | ตัวอย่างงานสรุปด้วย GPT-3 | |
คำอธิบาย | คำอธิบายตัวอย่างงานด้วย GPT-3 | |
นักเขียน SQL | ตัวอย่างนักเขียน SQL ด้วย GPT-3 | |
ข้อมูลตาราง | ||
ข้อมูลภาพ | ||
พรอมต์เพิ่มเติม |
กระตุ้นเอกสาร
@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}
}
เรายินดีต้อนรับการมีส่วนร่วมใด ๆ ในโครงการโอเพ่นซอร์สของเรารวมถึงคุณสมบัติใหม่การปรับปรุงโครงสร้างพื้นฐานและเอกสารที่ครอบคลุมมากขึ้น โปรดดูแนวทางการสนับสนุน