Closed kiritowu closed 1 year ago
Summarised from this blog post on best practice for prompt engineering
Input context like this:
Summarize the text below as a bullet point list of the most important points.
Text: """
{text input here}
"""
Write a short inspiring poem about OpenAI, focusing on the recent DALL-E product launch (DALL-E is a text to image ML model) in the style of a {famous poet}
Start with zero-shot, then few-shot (example), neither of them worked, then fine-tune
Extract keywords from the below
Text: {text}
Keywords:
Extract keywords from the corresponding texts below.
Text 1: Stripe provides APIs that web developers can use to integrate payment processing into their websites and mobile applications. Keywords 1: Stripe, payment processing, APIs, web developers, websites, mobile applications
Text 2: OpenAI has trained cutting-edge language models that are very good at understanding and generating text. Our API provides access to these models and can be used to solve virtually any task that involves processing language. Keywords 2: OpenAI, language models, text processing, API.
Text 3: {text} Keywords 3:
Use a 3 to 5 sentence paragraph to describe this product.
model
- Higher performance models are more expensive and have higher latency.temperature
- A measure of how often the model outputs a less likely token. The higher the temperature, the more random (and usually creative) the output. This, however, is not the same as “truthfulness”. For most factual use cases such as data extraction, and truthful Q&A, the temperature of 0 is best.max_tokens
(maximum length) - Does not control the length of the output, but a hard cutoff limit for token generation. Ideally you won’t hit this limit often, as your model will stop either when it thinks it’s finished, or when it hits a stop sequence you defined.stop
(stop sequences) - A set of characters (tokens) that, when generated, will cause the text generation to stop.Well-known use-case for GPT along with its prompts (if available)
Text Conversion (e.g. Emojifier)
Add emoji at the end of sentence for each paragraph
text:"""
{text}
"""
Can change the following parameters by editing the initial prompt.
{
"audience": ["General", "Knowledgeable", "Expert"],
"formality": ["Informal", "Neural", "Formal"],
"intent": ["Inform","Describe", "Convince", "Tell A Story"],
"context": ["Letter", "Email", "Reflection", "Social Media"],
"role": ["Storyteller", "Motivational Coach", "Debate Coach", "Screenwriter", "Novelist", "Movie Critic", "Poet", "Rapper", "Philosophy Teacher", "AI Writing Tutor", "Commentariat", "Journal Reviwer", "ETC"]
}
prompt=`
Rephrase the following paragraph in context of an ${context}. The goal is to ${intent} the audience who is ${audience}. Use a more ${formality} tone in the text. Role play as a ${role}.
text:"""
${prompt}
"""
`
Text Completion
Complete the following paragraph in style of {} within {} sentences
Vertical farming provides a novel solution for producing food locally, reducing transportation costs and
Summarisation
Summarize this for a second-grade student:
Jupiter is the fifth planet from the Sun and the largest in the Solar System. It is a gas giant with a mass one-thousandth that of the Sun, but two-and-a-half times that of all the other planets in the Solar System combined. Jupiter is one of the brightest objects visible to the naked eye in the night sky, and has been known to ancient civilizations since before recorded history. It is named after the Roman god Jupiter.[19] When viewed from Earth, Jupiter can be bright enough for its reflected light to cast visible shadows,[20] and is on average the third-brightest natural object in the night sky after the Moon and Venus.
Find ways to make use of prompt engineer to enhance the usage of Chat-GPT
To-Dos: