Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/promptslab/Promptify
Prompt Engineering | Prompt Versioning | Use GPT or other prompt based models to get structured output. Join our discord for Prompt-Engineering, LLMs and other latest research
https://github.com/promptslab/Promptify
chatgpt chatgpt-api chatgpt-python gpt-3 gpt-3-prompts gpt-4 gpt-4-api gpt3-library large-language-models machine-learning nlp openai prompt-engineering prompt-toolkit prompt-tuning prompt-versioning prompting prompts promptversioning transformers
Last synced: about 1 month ago
JSON representation
Prompt Engineering | Prompt Versioning | Use GPT or other prompt based models to get structured output. Join our discord for Prompt-Engineering, LLMs and other latest research
- Host: GitHub
- URL: https://github.com/promptslab/Promptify
- Owner: promptslab
- License: apache-2.0
- Created: 2022-12-12T18:06:32.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-15T10:58:58.000Z (9 months ago)
- Last Synced: 2024-10-29T15:37:23.369Z (about 1 month ago)
- Topics: chatgpt, chatgpt-api, chatgpt-python, gpt-3, gpt-3-prompts, gpt-4, gpt-4-api, gpt3-library, large-language-models, machine-learning, nlp, openai, prompt-engineering, prompt-toolkit, prompt-tuning, prompt-versioning, prompting, prompts, promptversioning, transformers
- Language: Jupyter Notebook
- Homepage: https://discord.gg/m88xfYMbK6
- Size: 2.76 MB
- Stars: 3,242
- Watchers: 48
- Forks: 240
- Open Issues: 60
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-prompts - Promptify
- Awesome-LLM-Reasoning - Promptify
- awesome-llmops - Promptify - ![Repo stars of promptslab/Promptify](https://img.shields.io/github/stars/promptslab/Promptify?style=social) - An utility / tookit for Prompt engineering. (Tools (GitHub) / LLMOps vs MLOps)
- Awesome_Multimodel_LLM - Promptify
- awesome-langchain-zh - Promptify
- project-awesome - promptslab/Promptify - Prompt Engineering | Prompt Versioning | Use GPT or other prompt based models to get structured output. Join our discord for Prompt-Engineering, LLMs and other latest research (Jupyter Notebook)
- stars - promptslab/Promptify - Prompt Engineering | Prompt Versioning | Use GPT or other prompt based models to get structured output. Join our discord for Prompt-Engineering, LLMs and other latest research (Jupyter Notebook)
- awesome-langchain - Promptify
- StarryDivineSky - promptslab/Promptify
- Awesome-Prompt-Engineering - [Github
- Awesome-LLM - Promptify
- awesome-chatgpt - promptslab/Promptify - Promptify is a Python library that enables prompt engineering and the generation of structured output from prompt-based language models such as GPT and PaLM. It provides a convenient pipeline API for performing various NLP tasks, including named entity recognition (NER) and classification, with just a few lines of code. Promptify allows developers to easily customize prompts and add examples to improve model performance. (SDK, Libraries, Frameworks / Python)
- jimsghstars - promptslab/Promptify - Prompt Engineering | Prompt Versioning | Use GPT or other prompt based models to get structured output. Join our discord for Prompt-Engineering, LLMs and other latest research (Jupyter Notebook)
- awesome-prompt-engineering-zh-cn - [Github
- awesome-prompt-engineering-zh-cn - [Github
- awesome-interpretability - Promptify
README
Promptify
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
## Installation
### With pip
This repository is tested on Python 3.7+, openai 0.25+.
You should install Promptify using Pip command
```bash
pip3 install promptify
```or
```bash
pip3 install git+https://github.com/promptslab/Promptify.git
```## Quick tour
To immediately use a LLM model for your NLP task, we provide the `Pipeline` API.
```python
from promptify import Prompter,OpenAI, Pipelinesentence = """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 Example with NER, MultiLabel, Question Generation Task
Features 🎮
- Perform NLP tasks (such as NER and classification) in just 2 lines of code, with no training data required
- Easily add one shot, two shot, or few shot examples to the prompt
- Handling out-of-bounds prediction from LLMS (GPT, t5, etc.)
- Output always provided as a Python object (e.g. list, dictionary) for easy parsing and filtering. This is a major advantage over LLMs generated output, whose unstructured and raw output makes it difficult to use in business or other applications.
- Custom examples and samples can be easily added to the prompt
- 🤗 Run inference on any model stored on the Huggingface Hub (see notebook guide).
- Optimized prompts to reduce OpenAI token costs (coming soon)
### Supporting wide-range of Prompt-Based NLP tasks :
| Task Name | Colab Notebook | Status |
|-------------|-------|-------|
| Named Entity Recognition | [NER Examples with GPT-3](https://colab.research.google.com/drive/16DUUV72oQPxaZdGMH9xH1WbHYu6Jqk9Q?usp=sharing) | ✅ |
| Multi-Label Text Classification | [Classification Examples with GPT-3](https://colab.research.google.com/drive/1gNqDxNyMMUO67DxigzRAOa7C_Tcr2g6M?usp=sharing) | ✅ |
| Multi-Class Text Classification | [Classification Examples with GPT-3](https://colab.research.google.com/drive/1gNqDxNyMMUO67DxigzRAOa7C_Tcr2g6M?usp=sharing) | ✅ |
| Binary Text Classification | [Classification Examples with GPT-3](https://colab.research.google.com/drive/1gNqDxNyMMUO67DxigzRAOa7C_Tcr2g6M?usp=sharing) | ✅ |
| Question-Answering | [QA Task Examples with GPT-3](https://colab.research.google.com/drive/1Yhl7iFb7JF0x89r1L3aDuufydVWX_VrL?usp=sharing) | ✅ |
| Question-Answer Generation | [QA Task Examples with GPT-3](https://colab.research.google.com/drive/1Yhl7iFb7JF0x89r1L3aDuufydVWX_VrL?usp=sharing) | ✅ |
| Relation-Extraction | [Relation-Extraction Examples with GPT-3](https://colab.research.google.com/drive/1iW4QNjllc8ktaQBWh3_04340V-tap1co?usp=sharing) | ✅ |
| Summarization | [Summarization Task Examples with GPT-3](https://colab.research.google.com/drive/1PlXIAMDtrK-RyVdDhiSZy6ztcDWsNPNw?usp=sharing) | ✅ |
| Explanation | [Explanation Task Examples with GPT-3](https://colab.research.google.com/drive/1PlXIAMDtrK-RyVdDhiSZy6ztcDWsNPNw?usp=sharing) | ✅ |
| SQL Writer | [SQL Writer Example with GPT-3](https://colab.research.google.com/drive/1JNUYCTdqkdeIAxiX-NzR-4dngdmWj0rV?usp=sharing) | ✅ |
| Tabular Data | | |
| Image Data | | |
| More Prompts | | |
## Docs
[Promptify Docs](https://promptify.readthedocs.io/)
## Community
If you are interested in Prompt-Engineering, LLMs, ChatGPT and other latest research discussions, please consider joining PromptsLab
```
@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}
}
```
## 💁 Contributing
We welcome any contributions to our open source project, including new features, improvements to infrastructure, and more comprehensive documentation.
Please see the [contributing guidelines](contribute.md)