Word2Vec
A foundational model that learns word embeddings by predicting context words or the target word. It includes architectures like Continuous Bag-of-Words (CBOW) and Skip-gram.
# Example using Gensim
from gensim.models import Word2Vec
sentences = [["word1", "word2"], ["word3", "word4"]]
model = Word2Vec(sentences, vector_size=100, window=5, min_count=1, workers=4)
vector = model.wv['word1']
Learn More
GloVe (Global Vectors for Word Representation)
An unsupervised learning algorithm for obtaining vector representations for words. It leverages global word-word co-occurrence statistics from a corpus.
# Example using GloVe library (conceptual)
# (Requires corpus and training)
# model = GloVe(corpus_path='corpus.txt', vector_size=50, ...)
# vector = model.get_vector('example')
Learn More
FastText
Developed by Facebook AI Research, FastText extends Word2Vec by considering subword information (character n-grams), making it effective for out-of-vocabulary words and morphologically rich languages.
# Example using FastText library
import fasttext
# model = fasttext.train_unsupervised('corpus.txt', model='skipgram')
# vector = model.get_word_vector('word')
Learn More