I am currently learning classification using turicreate
and have a question regarding the word count vector
.
Using the example that I found here
#build a word count vector
products['word_count'] = turicreate.text_analytics.count_words(products['review'])
#determine positive or negative review
products['sentiment'] = products['rating'] >= 4
#train the sentiment classifier
sentiment_model = turicreate.logistic_classifier.create(train_data,
target='sentiment',
features=['word_count'],
validation_set=test_data)
I am trying to understand the following:
If the classification is being done based on 'sentiment' (1 or 0), why do we need 'word_count'?
What is the role of 'word_count' when training the sentiment
classifier?
I tried to read the documentation for turicreate.text_analytics.count_words
but I don't think I understand.