0
0
Prompt Engineering / GenAIml~10 mins

Zero-shot prompting in Prompt Engineering / GenAI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a zero-shot prompt that asks the model to classify sentiment.

Prompt Engineering / GenAI
prompt = "Classify the sentiment of this sentence: '[1]'"
Drag options to blanks, or click blank then click option'
ACalculate the sum
BGenerate a summary
CTranslate to French
DI love this product
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated instructions like 'Generate a summary' instead of a sentence.
Leaving the prompt empty or incomplete.
2fill in blank
medium

Complete the code to send a zero-shot prompt to a language model API.

Prompt Engineering / GenAI
response = model.generate(prompt=[1])
Drag options to blanks, or click blank then click option'
A"Summarize this text."
Bprompt
Cinput_text
DNone
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a string literal instead of the prompt variable.
Passing None or unrelated variables.
3fill in blank
hard

Fix the error in the zero-shot prompt that asks for a translation.

Prompt Engineering / GenAI
prompt = "Translate this sentence to Spanish: [1]"
Drag options to blanks, or click blank then click option'
A"Hello, how are you?"
BHello, how are you?
C'Hello, how are you?'
DHello how are you
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting the sentence inside the prompt string.
Using single quotes that conflict with the outer quotes.
4fill in blank
hard

Fill both blanks to create a zero-shot prompt that asks for a summary of a given text.

Prompt Engineering / GenAI
prompt = "[1] this text: '[2]'"
Drag options to blanks, or click blank then click option'
ASummarize
BTranslate
CHere is the text
DAnalyze
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Translate' instead of 'Summarize' for the action.
Not including a phrase before the text.
5fill in blank
hard

Fill all three blanks to create a zero-shot prompt that asks the model to classify the topic of a given sentence.

Prompt Engineering / GenAI
prompt = "Classify the topic of this sentence: '[1]'. Possible topics: [2]. Choose the best: [3]."
Drag options to blanks, or click blank then click option'
AThe stock market is volatile today
Bsports, finance, technology
Csports
Dweather, cooking, travel
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing unrelated sentences and topics.
Not matching the sentence topic with the possible topics.