Promptify
1.0.0
迅速なエンジニアリング、LLMのNLP問題を解決し、GPT、Palmなどの一般的な生成モデルのさまざまなNLPタスクプロンプトを簡単に生成します。
このリポジトリは、Python 3.7+、Openai 0.25+でテストされています。
PIPコマンドを使用してProspifyをインストールする必要があります
pip3 install promptifyまたは
pip3 install git+https://github.com/promptslab/Promptify.gitNLPタスクに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" },
]
| タスク名 | コラブノートブック | 状態 |
|---|---|---|
| 名前付きエンティティ認識 | 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}
}
新機能、インフラストラクチャの改善、より包括的なドキュメントなど、オープンソースプロジェクトへの貢献を歓迎します。貢献ガイドラインをご覧ください