input: Write a function to perform sentiment analysis on product reviews. The function should use natural language processing techniques like tokenization, removing stopwords, lemmatization, and n-gram generation to generate features for sentiment analysis. It should then use a classification model (such as Multinomial Naive Bayes) to assign sentiments to the reviews and print a classification report. If the reviews are stored in a CSV file with columns 'review' and 'sentiment', the function should read the data from this file, preprocess the text, generate the features, split the data into training and test sets, train the model, make predictions, and finally output the classification report.
  assert sentiment_analysis_report('reviews.csv')
  assert sentiment_analysis_report('another_reviews.csv')=='''              precision    recall  f1-score   support
  
      negative       0.85      0.81      0.83       100
       positive       0.82      0.86      0.84       100
  
      accuracy                           0.84       200
     macro avg       0.84      0.84      0.84       200
  weighted avg       0.84      0.84      0.84       200
  '''
  assert sentiment_analysis_report('empty_reviews.csv')==None
output: 
  import pandas as pd
  from sklearn.feature_extraction.text import CountVectorizer
  from sklearn.model_selection import train_test_split
  from sklearn.naive_bayes import MultinomialNB
  from sklearn.metrics import classification_report
  from nltk.corpus import stopwords
  from nltk.tokenize import word_tokenize
  from nltk.stem import WordNetLemmatizer
  import string
  
  def sentiment_analysis_report(file_path):
      try:
          df = pd.read_csv(file_path)
          if df.empty:
              return None
          
          stop_words = set(stopwords.words('english'))
          lemmatizer = WordNetLemmatizer()
          
          def preprocess(text):
              tokens = word_tokenize(text.lower())
              tokens = [lemmatizer.lemmatize(word) for word in tokens if word.isalpha() and word not in stop_words]
              return ' '.join(tokens)
          
          df['review'] = df['review'].apply(preprocess)
          
          X = df['review']
          y = df['sentiment']
          
          vectorizer = CountVectorizer(ngram_range=(1, 2))
          X = vectorizer.fit_transform(X)
          
          X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
          
          model = MultinomialNB()
          model.fit(X_train, y_train)
          
          y_pred = model.predict(X_test)
          
          report = classification_report(y_test, y_pred, output_dict=True)
          return classification_report(y_test, y_pred)
      except Exception as e:
          return None
  