Example of a Prompt Template for Machine Translation
Prompt templates can be designed for various NLP tasks, including machine translation. To frame translation as a text generation problem, a template can be used to instruct the model. For example, to translate an English sentence into Chinese, the following template could be used, where {*sentence*} is a placeholder for the input text:
{*sentence*} Question: What is the Chinese translation of this English sentence? Answer:
0
1
Tags
Ch.2 Generative Models - Foundations of Large Language Models
Foundations of Large Language Models
Foundations of Large Language Models Course
Computing Sciences
Related
Example of a Prompt Template for Machine Translation
Code-like Prompt Templates
A developer is testing different ways to ask a language model to translate the English sentence 'The cat sat on the mat' into French. Consider the following three approaches:
Translate the following English text to French: The cat sat on the matEnglish: The cat sat on the mat Question: What is the French translation of this English sentence? Answer:- `def translate_to_french(english_text): """Translates the given English text to French.""" return model.translate(english_text)
input = "The cat sat on the mat" output = translate_to_french(input)`
Which option correctly identifies the format of each approach?
Examples of Instruction-like Prompts for Language Models
Improving Idiomatic Machine Translation
Constructing Machine Translation Prompts
Example of a Prompt Template for Machine Translation
A team has successfully implemented a system where a language model classifies customer reviews as 'Positive', 'Negative', or 'Neutral' using a specific instructional format:
Review: {*review_text*} Sentiment:. The team now wants to use the same language model for a completely different task: summarizing long articles into a single paragraph. Which of the following actions best demonstrates an understanding of how to adapt instructional formats for new tasks?Adapting a Prompt Template for a New Task
Evaluating a Prompt Template Adaptation Strategy
Learn After
Consider two different approaches for instructing a language model to translate an English sentence to French.
Approach A:
"{english_sentence}" Question: What is the French translation of this English sentence? Answer:Approach B:
Translate the following English sentence to French: {english_sentence}Which statement best analyzes the fundamental difference in how these two approaches frame the translation task for the model?
Designing a Prompt Template for E-commerce Review Translation
Debugging a Machine Translation Prompt Template