Promptify
1.0.0
프롬프트 엔지니어링, LLM의 NLP 문제 해결 및 GPT, Palm 등과 같은 인기있는 생성 모델에 대한 다양한 NLP 작업 프롬프트를 쉽게 생성합니다.
이 저장소는 Python 3.7+, OpenAI 0.25+에서 테스트됩니다.
PIP 명령을 사용하여 Promptify를 설치해야합니다
pip3 install promptify
또는
pip3 install git+https://github.com/promptslab/Promptify.git
NLP 작업에 LLM 모델을 즉시 사용하려면 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을 사용한 NER 예 | ✅ |
멀티 라벨 텍스트 분류 | GPT-3을 사용한 분류 예 | ✅ |
멀티 클래스 텍스트 분류 | GPT-3을 사용한 분류 예 | ✅ |
이진 텍스트 분류 | GPT-3을 사용한 분류 예 | ✅ |
질문 응답 | GPT-3을 사용한 QA 작업 예제 | ✅ |
질문 응답 세대 | GPT-3을 사용한 QA 작업 예제 | ✅ |
관계-추출 | GPT-3을 사용한 관계 추출 예 | ✅ |
요약 | GPT-3을 사용한 요약 작업 예제 | ✅ |
설명 | GPT-3을 사용한 설명 작업 예제 | ✅ |
SQL 작가 | GPT-3을 사용한 SQL 작가 예제 | ✅ |
표 데이터 | ||
이미지 데이터 | ||
더 많은 프롬프트 |
문서를 신속하게하십시오
@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}
}
새로운 기능, 인프라 개선 및보다 포괄적 인 문서를 포함하여 오픈 소스 프로젝트에 대한 기여를 환영합니다. 기고 가이드 라인을 참조하십시오