input: Write a function to perform sentiment analysis on product reviews using natural language processing techniques. The function should tokenize the reviews, remove stopwords, normalize words, generate features using n-grams, and classify the sentiments using a Naive Bayes classifier. The function should take a CSV file containing reviews as input and print a classification report.
  assert sentiment_analysis('reviews.csv', ['positive', 'negative']) == "Positive and negative sentiment classification report for the given file"
  assert sentiment_analysis('reviews_no_sentiment.csv', ['positive', 'negative']) == "Error: CSV file does not contain sentiment column"
  assert sentiment_analysis('reviews_empty.csv', ['positive', 'negative']) == "Error: CSV file is empty"
  assert sentiment_analysis('reviews.csv', ['positive', 'negative', 'neutral']) == "Error: Sentiment classes do not match the provided model"
output: import pandas as pd
  from sklearn.feature_extraction.text import CountVectorizer
  from sklearn.naive_bayes import MultinomialNB
  from sklearn.pipeline import Pipeline
  from sklearn.model_selection import train_test_split
  from sklearn.metrics import classification_report
  import nltk
  from nltk.corpus import stopwords
  from nltk.tokenize import word_tokenize
  import string
  
  def sentiment_analysis(csv_file, sentiment_classes):
      try:
          df = pd.read_csv(csv_file)
          if df.empty:
              return "Error: CSV file is empty"
          if 'sentiment' not in df.columns:
              return "Error: CSV file does not contain sentiment column"
          if set(df['sentiment'].unique()) != set(sentiment_classes):
              return "Error: Sentiment classes do not match the provided model"
          
          nltk.download('punkt')
          nltk.download('stopwords')
          stop_words = set(stopwords.words('english'))
          
          def preprocess(text):
              tokens = word_tokenize(text.lower())
              tokens = [word for word in tokens if word.isalnum() and word not in stop_words and word not in string.punctuation]
              return ' '.join(tokens)
          
          df['review'] = df['review'].apply(preprocess)
          
          X_train, X_test, y_train, y_test = train_test_split(df['review'], df['sentiment'], test_size=0.2, random_state=42)
          
          pipeline = Pipeline([
              ('vectorizer', CountVectorizer(ngram_range=(1, 2))),
              ('classifier', MultinomialNB())
          ])
          
          pipeline.fit(X_train, y_train)
          y_pred = pipeline.predict(X_test)
          
          report = classification_report(y_test, y_pred, target_names=sentiment_classes)
          return report
      
      except Exception as e:
          return f"Error: {str(e)}"