Machine translation systems convert text from one language to another. Which of the following best explains how these systems manage to understand and translate different languages?
Think about how modern AI learns from examples rather than fixed rules.
Modern machine translation uses large bilingual datasets to learn how words and phrases correspond in context, enabling more accurate and natural translations.
Given the following Python code simulating a simple translation prediction, what is the output?
def translate(word): dictionary = {'hello': 'hola', 'world': 'mundo'} return dictionary.get(word, 'unknown') result = translate('hello') print(result)
Check what the dictionary returns for the key 'hello'.
The function looks up 'hello' in the dictionary and returns 'hola'.
Which model type is best suited for breaking language barriers by translating sentences with context and meaning?
Consider which model can understand sentence context and produce fluent translations.
Neural machine translation with sequence-to-sequence and attention mechanisms captures context and produces more natural translations than rule-based or phrase-based methods.
Which statement correctly describes what the BLEU score measures in machine translation?
Think about how we compare machine output to human translations.
BLEU score compares the overlap of short sequences of words (n-grams) between the machine translation and reference human translations to estimate quality.
Consider this Python snippet training a simple translation model. What error will it raise?
import torch import torch.nn as nn class SimpleTranslator(nn.Module): def __init__(self): super(SimpleTranslator, self).__init__() self.linear = nn.Linear(10, 10) def forward(self, x): return self.linear(x) model = SimpleTranslator() input_tensor = torch.randn(5, 5) # Incorrect input size output = model(input_tensor)
Check the input size versus the expected input size of the linear layer.
The linear layer expects input features of size 10, but the input tensor has size 5, causing a size mismatch error.