input: def sentiment_analyzer(text: str) -> dict:
      """Analyze the sentiment of a given text by tokenizing, stemming, removing punctuation and stopwords, and calculating polarity score.
      >>> sentiment_analyzer("I love this product! It's amazing.")
      {'neg': 0.0, 'neu': 0.164, 'pos': 0.836, 'compound': 0.8316}
      >>> sentiment_analyzer("This is the worst experience I've ever had.")
      {'neg': 0.492, 'neu': 0.508, 'pos': 0.0, 'compound': -0.6249}
      """
output:     from nltk.sentiment import SentimentIntensityAnalyzer
      from nltk.tokenize import word_tokenize
      from nltk.stem import PorterStemmer
      from nltk.corpus import stopwords
      import string
  
      # Tokenize the text
      tokens = word_tokenize(text.lower())
  
      # Remove punctuation
      tokens = [token for token in tokens if token not in string.punctuation]
  
      # Remove stopwords
      stop_words = set(stopwords.words('english'))
      tokens = [token for token in tokens if token not in stop_words]
  
      # Stem the tokens
      stemmer = PorterStemmer()
      tokens = [stemmer.stem(token) for token in tokens]
  
      # Join tokens back into a single string
      processed_text = ' '.join(tokens)
  
      # Analyze sentiment
      sia = SentimentIntensityAnalyzer()
      sentiment_scores = sia.polarity_scores(processed_text)
  
      return sentiment_scores