Feature Engineering for NLP in Python
Rounak Banik
Data Scientist
| recenze | štítek |
|---|---|
'The movie was good and not boring' |
pozitivní |
'The movie was not good and boring' |
negativní |
'for you a thousand times over'
[
'for you',
'you a',
'a thousand',
'thousand times',
'times over'
]
'for you a thousand times over'
[
'for you a',
'you a thousand',
'a thousand times',
'thousand times over'
]
Generuje pouze bigramy.
bigrams = CountVectorizer(ngram_range=(2,2))
Generuje unigramy, bigramy a trigramy.
ngrams = CountVectorizer(ngram_range=(1,3))
Feature Engineering for NLP in Python