input: Write a function to perform sentiment analysis on product reviews. The function should use natural language processing techniques like tokenization and n-grams to generate features for sentiment analysis and use a classification model to assign sentiments to the reviews. The function should read in a CSV file named 'reviews.csv' that contains columns 'review' and 'sentiment', preprocess the reviews, generate features, train a classifier, and print a classification report.
  assert perform_sentiment_analysis()=="precision    recall  f1-score   support\n\n  negative       0.85      0.80      0.82       100\n  positive       0.81      0.86      0.83       100\n\naccuracy                           0.83       200\nmacro avg       0.83      0.83      0.83       200\nmicro avg       0.83      0.83      0.83       200"
  assert perform_sentiment_analysis()=="precision    recall  f1-score   support\n\n  negative       0.78      0.75      0.77       150\n  positive       0.77      0.80      0.78       150\n\naccuracy                           0.77       300\nmacro avg       0.77      0.77      0.77       300\nmicro avg       0.77      0.77      0.77       300"
  assert perform_sentiment_analysis()=="precision    recall  f1-score   support\n\n  negative       0.90      0.88      0.89       200\n  positive       0.89      0.91      0.90       200\n\naccuracy                           0.90       400\nmacro avg       0.90      0.90      0.90       400\nmicro avg       0.90      0.90      0.90       400"
output: def perform_sentiment_analysis():
      import pandas as pd
      from sklearn.feature_extraction.text import TfidfVectorizer
      from sklearn.model_selection import train_test_split
      from sklearn.naive_bayes import MultinomialNB
      from sklearn.metrics import classification_report
  
      df = pd.read_csv('reviews.csv')
      X = df['review']
      y = df['sentiment']
  
      vectorizer = TfidfVectorizer(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)
  
      classifier = MultinomialNB()
      classifier.fit(X_train, y_train)
  
      y_pred = classifier.predict(X_test)
      report = classification_report(y_test, y_pred, output_dict=False)
      return report