<commit_before>from sklearn.feature_extraction.text import CountVectorizer

cv = CountVectorizer(analyzer='word', ngram_range=(2,2), min_df = 0)

corpus = [u'The quick brown fox jumped over the lazy brown dog.', u'The quick thinking hare jumped over the moon.']
for text in corpus:
    print(text)
print()

print(cv.fit_transform(corpus).toarray())

for pair in cv.get_feature_names():
    print(pair)<commit_msg>Update model<commit_after>from sklearn.feature_extraction.text import CountVectorizer

cv = CountVectorizer(analyzer='word', ngram_range=(3,3), min_df = 2)

try:
    sample_text = open('sample_text.txt', 'r')
    corpus = sample_text.read().split('.')
except IOError:
    corpus = [u'The quick brown fox jumped over the lazy brown dog.', u'The quick thinking hare jumped over the moon.']

for text in corpus:
    print(text)
print()

print(cv.fit_transform(corpus).toarray())

for pair in cv.get_feature_names():
    print(pair)
{'fraction_non_alphanumeric': 0.12221041445270989, 'fraction_numerical': 0.006376195536663124, 'mean_word_length': 5.23841059602649, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4351870', 'n_tokens_mistral': 313, 'n_tokens_neox': 306, 'n_words': 88}