In the previous sections, we learned how to generate word vectors using multiple models. In this section, we will learn how to build a sentiment classifier for a given sentence. We will continue using the airline sentiment tweet dataset for this exercise.
Building sentiment classification using word vectors
How to do it...
Generate word vectors like the way we extracted in previous recipes (the code file is available as word2vec.ipynb in GitHub):
- Import the packages and download the dataset:
import re
import nltk
from nltk.corpus import stopwords
import pandas as pd
nltk.download('stopwords')
stop = set(stopwords.words('english'))
data=pd.read_csv('https://www.dropbox.com/s/8yq0edd4q908xqw/airline_sentiment...