Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.14 KB

README.md

File metadata and controls

31 lines (21 loc) · 1.14 KB
description
NLP Knowledge and experiences

NLP

Python

import sklearn
from sklearn.feature_extraction.text import CountVectorizer
# instantiate an ngram counter
counts = CountVectorizer(analyzer='word', ngram_range=(n,n))

# create a dictionary of n-grams by calling `.fit`
vocab2int = counts.fit([a_text, s_text]).vocabulary_

Resources