FastText
A model trained on a news corpus meets the word “unfriendliness” for the first time. Word2Vec has nothing to offer — the word was never in its vocabulary, so there is no vector for it. FastText has seen “friend”, “un” and “ness” inside thousands of other words, and builds a vector out of the pieces.
Words made of character n-grams
FastText keeps the skip-gram training objective and changes what a word is. Each word becomes a bag of character n-grams, typically three to six characters long and wrapped in boundary markers, and the word's vector is the sum of its n-gram vectors plus one vector for the whole word. Two consequences follow:
- No out-of-vocabulary hole — any unseen word, including a typo or an unusual inflection, can be assembled from n-grams seen elsewhere.
- Morphology comes for free — “run”, “running” and “runner” share substrings and land near each other, which matters enormously in Finnish or Turkish, where one lemma has dozens of surface forms.
In practice
Facebook AI Research released pretrained vectors for 157 languages along with a companion supervised classifier that trains a bag-of-n-grams model in seconds on a laptop — still the strong baseline to beat for language identification and topic tagging before anyone reaches for a transformer. Gensim loads the vectors directly.
What it does not fix
FastText is still static: “bank” gets one vector, averaged over rivers and finance, and that is the limit contextual embeddings were built to break. Subword composition will also hand you a confident vector for a word that means nothing at all — gibberish is embedded as readily as vocabulary.
FastText is a word-embedding method that represents each word as the sum of vectors for its character n-grams rather than as a single atomic token. Trained with the skip-gram objective, it can therefore build a vector for any unseen word, typo or inflected form out of pieces it already knows, and it captures morphology directly. That makes it the practical choice for rare words and for morphologically rich languages, where Word2Vec has no entry at all.
A child who has never met the word “unhelpfulness” can still guess what it means, because “help”, “un” and “ness” are all familiar. The word is new; its parts are not.
FastText gives software the same trick. Older systems learned a separate numeric fingerprint for every whole word they had seen, and were stuck when a new one turned up — a typo, a rare name, an unusual ending. FastText instead learns fingerprints for short chunks of letters and adds them up, so it can always make a sensible guess. That is a real help for languages like Finnish or Turkish, where a single word takes dozens of different forms.