Python, NLP, Numpy, Scikit Learn.
vec_dict[token] = count/doc_length vec = [v for v in vec_dict.values()] return np.array(vec) Using the counter encoding yields these results: encoder = CountEncoder(corpus.vocab()) sent1 = [word for word in word_tokenize(corpus.raw('sent1.txt'))] vec1 = encoder.count_vector(sent1) print(vec1) # [0.