read_word_vectors¶
-
ucca.textutil.
read_word_vectors
(dim, size, filename)[source]¶ Read word vectors from text file, with an optional first row indicating size and dimension :param dim: dimension to trim vectors to :param size: maximum number of vectors to load :param filename: text file to load vectors from :return: generator: first element is (#vectors, #dims); and all the rest are (word [string], vector [NumPy array])