<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 <a href='http
Step1:  Remove Blank Records (optional)
Step2:  Import SentimentIntensityAnalyzer and create an sid object
This assumes that the VADER lexicon has been downloaded.
Step3:  Use sid to append a comp_score to the dataset
Step4:  Perform a comparison analysis between the original label and comp_score
<ASSISTANT_TASK:>
Python Code:
import numpy as np
import pandas as pd
df = pd.read_csv('../TextFiles/moviereviews.tsv', sep='\t')
df.head()
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Sentiment Analysis Project
For this project, we'll perform the same type of NLTK VADER sentiment analysis, this time on our movie reviews dataset.
The 2,000 record IMDb movie review database is accessible through NLTK directly with
<pre>from nltk.corpus import movie_reviews</pre>
However, since we already have it in a tab-delimited file we'll use that instead.
Load the Data
End of explanation
# REMOVE NaN VALUES AND EMPTY STRINGS:
df.dropna(inplace=True)
blanks = []  # start with an empty list
for i,lb,rv in df.itertuples():  # iterate over the DataFrame
    if type(rv)==str:            # avoid NaN values
        if rv.isspace():         # test 'review' for whitespace
            blanks.append(i)     # add matching index numbers to the list
df.drop(blanks, inplace=True)
df['label'].value_counts()
Explanation: Remove Blank Records (optional)
End of explanation
from nltk.sentiment.vader import SentimentIntensityAnalyzer
sid = SentimentIntensityAnalyzer()
Explanation: Import SentimentIntensityAnalyzer and create an sid object
This assumes that the VADER lexicon has been downloaded.
End of explanation
df['scores'] = df['review'].apply(lambda review: sid.polarity_scores(review))
df['compound']  = df['scores'].apply(lambda score_dict: score_dict['compound'])
df['comp_score'] = df['compound'].apply(lambda c: 'pos' if c >=0 else 'neg')
df.head()
Explanation: Use sid to append a comp_score to the dataset
End of explanation
from sklearn.metrics import accuracy_score,classification_report,confusion_matrix
accuracy_score(df['label'],df['comp_score'])
print(classification_report(df['label'],df['comp_score']))
print(confusion_matrix(df['label'],df['comp_score']))
Explanation: Perform a comparison analysis between the original label and comp_score
End of explanation
<END_TASK>