NLP, Python, Scikit Learn.
import numpy as np vocab = corpus.vocab() vector_lookup = api.load('glove-wiki-gigaword-50') word_vector(tokens): return np.array([ vector_lookup[token] for token in tokens if token in vocab and token in vector_lookup ]) X['word_vector'] = X['tokens'].apply(lambda tokens: word_vector(tokens))