Package: promptify
PromptifyPrompt Engineering, Solve NLP Problems with LLM's & Easily generate different NLP Task prompts for popular generative models like GPT, PaLM, and more with PromptifyInstallationWith pipThis repository is tested on Python 3.7+, openai 0.25+.You should install Promptify using Pip commandpip3installpromptifyorpip3installgit+https://github.com/promptslab/Promptify.gitQuick tourTo immediately use a LLM model for your NLP task, we provide thePipelineAPI.frompromptifyimportPrompter,OpenAI,Pipelinesentence="""The patient is a 93-year-old female with a medicalhistory of chronic right hip pain, osteoporosis,hypertension, depression, and chronic atrialfibrillation admitted for evaluation and managementof severe nausea and vomiting and urinary tractinfection"""model=OpenAI(api_key)# or `HubModel()` for Huggingface-based inference or 'Azure' etcprompter=Prompter('ner.jinja')# select a template or provide custom templatepipe=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 TaskFeatures 🎮Perform NLP tasks (such as NER and classification) in just 2 lines of code, with no training data requiredEasily add one shot, two shot, or few shot examples to the promptHandling 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 (seenotebook guide).Optimized prompts to reduce OpenAI token costs (coming soon)Supporting wide-range of Prompt-Based NLP tasks :Task NameColab NotebookStatusNamed Entity RecognitionNER Examples with GPT-3✅Multi-Label Text ClassificationClassification Examples with GPT-3✅Multi-Class Text ClassificationClassification Examples with GPT-3✅Binary Text ClassificationClassification Examples with GPT-3✅Question-AnsweringQA Task Examples with GPT-3✅Question-Answer GenerationQA Task Examples with GPT-3✅Relation-ExtractionRelation-Extraction Examples with GPT-3✅SummarizationSummarization Task Examples with GPT-3✅ExplanationExplanation Task Examples with GPT-3✅SQL WriterSQL Writer Example with GPT-3✅Tabular DataImage DataMore PromptsDocsPromptify DocsCommunityIf you are interested in Prompt-Engineering, LLMs, ChatGPT and other latest research discussions, please consider joiningPromptsLab@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}
}💁 ContributingWe welcome any contributions to our open source project, including new features, improvements to infrastructure, and more comprehensive documentation.
Please see thecontributing guidelines