FastText can create embeddings for words not seen during training. How does it do this?
Think about how FastText uses parts of words to build vectors.
FastText represents words as a sum of character n-gram vectors, allowing it to generate embeddings for unseen words by combining known subword units.
What is the output of the following code snippet?
from gensim.models import FastText sentences = [['hello', 'world'], ['machine', 'learning']] model = FastText(sentences, vector_size=10, window=3, min_count=1, epochs=5) print(len(model.wv['hello']))
Check the vector_size parameter used when creating the model.
The vector_size parameter sets the dimension of word vectors. Here it is 10, so the length of the vector for 'hello' is 10.
You want to build word embeddings for a language with many word forms and suffixes. Which model is best suited?
Consider how subword information helps with many word forms.
FastText uses character n-grams, which helps it capture morphological variations common in rich languages, unlike Word2Vec or GloVe.
You evaluate FastText embeddings on a word analogy task (e.g., king - man + woman = ?). Which metric best measures performance?
Think about how analogy tasks are scored.
Analogy tasks are evaluated by accuracy: how often the model predicts the correct word completing the analogy.
You train a FastText model but notice the loss does not decrease after many epochs. Which is the most likely cause?
Consider how learning rate affects training stability.
A too high learning rate can cause the model to jump around the loss surface without settling, preventing loss decrease.