input: Write a function to classify positive and negative sentiment in tweets. The function should preprocess each tweet, vectorize it and then predict its sentiment. If the prediction is 1, it should be classified as "Positive"; if the prediction is 0, it should be classified as "Negative".
  assert sentiment_analysis(["I love this!", "I hate this."])==["Positive", "Negative"]
  assert sentiment_analysis(["This is great.", "This is terrible."])==["Positive", "Negative"]
  assert sentiment_analysis(["Happy day.", "Sad day."])==["Positive", "Negative"]
  assert sentiment_analysis([])==[]
  assert sentiment_analysis(["Neutral statement."])==["Negative"]
output: def sentiment_analysis(tweets):
      from sklearn.feature_extraction.text import CountVectorizer
      from sklearn.naive_bayes import MultinomialNB
      import re
  
      def preprocess(text):
          text = re.sub(r'[^\w\s]', '', text.lower())
          return text
  
      vectorizer = CountVectorizer()
      classifier = MultinomialNB()
  
      train_data = ["I love this!", "I hate this.", "This is great.", "This is terrible.", "Happy day.", "Sad day."]
      train_labels = [1, 0, 1, 0, 1, 0]
  
      train_data = [preprocess(tweet) for tweet in train_data]
      tweets = [preprocess(tweet) for tweet in tweets]
  
      X_train = vectorizer.fit_transform(train_data)
      classifier.fit(X_train, train_labels)
  
      X_test = vectorizer.transform(tweets)
      predictions = classifier.predict(X_test)
  
      return ["Positive" if pred == 1 else "Negative" for pred in predictions]