Promptify is a powerful tool designed to facilitate prompt engineering and solve NLP problems effortlessly. With Promptify, you can generate different NLP task prompts for well-known generative models like GPT and PaLM.
Installation
Getting started with Promptify is simple. Follow the installation steps below:
- With pip:
 - This repository is tested on Python 3.7+ and openai 0.25+.
 - Run the following command to install Promptify:
 
pip3 install promptify
        
        pip3 install git+https://github.com/promptslab/Promptify.git
        
    
A Quick Tour
To immediately utilize a LLM model for your NLP tasks, you can take advantage of the Pipeline API provided by Promptify. Here’s how to do it:
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)
This code snippet is akin to ordering your favorite dish at a restaurant. You start by selecting a specific meal (your sentence), place your order with the chef (the model), and use a waiter (the pipeline) to bring your meal right to your table (the result). In this case, the meal is the output generated from your input data.
Output
Here’s what to expect from the 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,
]
Each element is structured output clearly defining entities and their types detected in the text.
Features
Promptify comes loaded with a myriad of features:
- Perform NLP tasks (like NER and classification) in merely two lines of code, without requiring training data.
 - Seamlessly incorporate one-shot, two-shot, or few-shot examples in your prompts.
 - Handle out-of-bounds predictions from LLMs (GPT, T5, etc.).
 - Receive outputs formatted as Python objects (list, dictionary), which facilitates easy parsing and filtering.
 - Add custom examples effortlessly to your prompts.
 - Run inference on any model available on the Huggingface Hub.
 - Optimize prompts to diminish OpenAI token costs (coming soon).
 
Troubleshooting
If you encounter issues while using Promptify, consider the following troubleshooting steps:
- Check Your Environment: Ensure that your Python version is compatible with Promptify (Python 3.7+).
 - Dependencies: Confirm that all necessary dependencies are properly installed (like openai 0.25+).
 - API Keys: Verify that your API key for OpenAI or any other required service is correctly set up and active.
 - Output Issues: If the output seems incorrect, double-check your input data and the chosen prompts or templates.
 
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.
Supporting Wide Range of Prompt-Based NLP Tasks
With Promptify, you can explore a variety of NLP tasks from Named Entity Recognition to Summarization. Here’s a brief overview of the available tasks:
- Named Entity Recognition – NER Examples with GPT-3
 - Multi-Label Text Classification – Classification Examples with GPT-3
 - Question-Answering – QA Task Examples with GPT-3
 - Summarization – Summarization Task Examples with GPT-3
 
Conclusion
Promptify simplifies the often daunting world of NLP tasks by allowing you to interact effortlessly with powerful LLM models. Whether you are a seasoned data scientist or a newcomer, Promptify provides the tools you need to succeed in prompt engineering and NLP applications.

