Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated instructions like 'Generate a summary' instead of a sentence.
Leaving the prompt empty or incomplete.
✗ Incorrect
The prompt should include the sentence whose sentiment you want to classify. 'I love this product' is a valid example sentence.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a string literal instead of the prompt variable.
Passing None or unrelated variables.
✗ Incorrect
The variable 'prompt' holds the zero-shot prompt string, so it should be passed to the generate function.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting the sentence inside the prompt string.
Using single quotes that conflict with the outer quotes.
✗ Incorrect
The sentence should be a string inside the prompt, so it needs to be enclosed in quotes inside the string.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Translate' instead of 'Summarize' for the action.
Not including a phrase before the text.
✗ Incorrect
The prompt should start with 'Summarize' and then include the text after 'this text:'.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing unrelated sentences and topics.
Not matching the sentence topic with the possible topics.
✗ Incorrect
The prompt includes the sentence to classify, a list of possible topics, and asks to choose the best topic.