input: Write a function to perform sentiment analysis on product reviews using natural language processing techniques like tokenization, removing stopwords, normalization, and feature extraction. The function should then use a classification model to assign sentiments to the reviews. The function should read in a CSV file containing reviews and their corresponding sentiments, process the reviews to generate features, train a Naive Bayes model on the training data, and print a classification report on the test data.
  
  assert perform_sentiment_analysis("reviews.csv")=={'accuracy': 0.85, 'precision': 0.82, 'recall': 0.86, 'f1-score': 0.84}
  assert perform_sentiment_analysis("empty_reviews.csv")=={'accuracy': 0.0, 'precision': 0.0, 'recall': 0.0, 'f1-score': 0.0}
  assert perform_sentiment_analysis("reviews_with_typos.csv")=={'accuracy': 0.83, 'precision': 0.81, 'recall': 0.85, 'f1-score': 0.83}
output: 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
  import nltk
  from nltk.corpus import stopwords
  from nltk.tokenize import word_tokenize
  import string
  
  def perform_sentiment_analysis(filename):
      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]
          return ' '.join(tokens)
      
      df = pd.read_csv(filename)
      if df.empty:
          return {'accuracy': 0.0, 'precision': 0.0, 'recall': 0.0, 'f1-score': 0.0}
      
      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)
      
      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)
      report = classification_report(y_test, y_pred, output_dict=True)
      
      return {
          'accuracy': report['accuracy'],
          'precision': report['weighted avg']['precision'],
          'recall': report['weighted avg']['recall'],
          'f1-score': report['weighted avg']['f1-score']
      }