input: Write a function to perform sentiment analysis on product reviews using natural language processing techniques and a classification model to assign sentiments to the reviews. The function should tokenize the reviews, remove stopwords, normalize words, generate features using CountVectorizer, and train a Multinomial Naive Bayes model for sentiment prediction. It should then return a classification report based on the test set predictions.
  assert sentiment_analysis('reviews.csv')=="              precision    recall  f1-score   support\n\n    negative       0.87      0.90      0.89       100\n    positive       0.90      0.87      0.88       100\n\n    accuracy                           0.89       200\n    macro avg       0.89      0.89      0.89       200\nweighted avg       0.89      0.89      0.89       200\n"
  assert sentiment_analysis('empty_reviews.csv')==""
  assert sentiment_analysis('mixed_reviews.csv')=="Building model...\nFitting model...\nGenerating predictions...\n              precision    recall  f1-score   support\n\n    negative       0.78      0.82      0.80       150\n    positive       0.82      0.78      0.80       150\n\n    accuracy                           0.80       300\n    macro avg       0.80      0.80      0.80       300\nweighted avg       0.80      0.80      0.80       300\n"
output: 
  def sentiment_analysis(file_path):
      import pandas as pd
      from sklearn.model_selection import train_test_split
      from sklearn.feature_extraction.text import CountVectorizer
      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
  
      try:
          df = pd.read_csv(file_path)
      except pd.errors.EmptyDataError:
          return ""
  
      if df.empty:
          return ""
  
      def preprocess(text):
          tokens = word_tokenize(text.lower())
          tokens = [word for word in tokens if word.isalpha()]
          tokens = [word for word in tokens if word not in stopwords.words('english')]
          lemmatizer = WordNetLemmatizer()
          tokens = [lemmatizer.lemmatize(word) for word in tokens]
          return ' '.join(tokens)
  
      df['processed_reviews'] = df['reviews'].apply(preprocess)
      X_train, X_test, y_train, y_test = train_test_split(df['processed_reviews'], df['sentiment'], test_size=0.2, random_state=42)
  
      vectorizer = CountVectorizer()
      X_train_vec = vectorizer.fit_transform(X_train)
      X_test_vec = vectorizer.transform(X_test)
  
      model = MultinomialNB()
      model.fit(X_train_vec, y_train)
  
      y_pred = model.predict(X_test_vec)
      return classification_report(y_test, y_pred)
  