input: 
  from typing import List
  
  def sentiment_analyzer(text: str) -> dict:
      """ Analyze the sentiment of the given text. The function tokenizes the text, stems 
      each word, removes punctuation and stopwords, then calculates the polarity score 
      using SentimentIntensityAnalyzer from nltk.
      >>> sentiment_analyzer("I love this product! It's amazing.")
      {'neg': 0.0, 'neu': 0.295, 'pos': 0.705, 'compound': 0.6369}
      >>> sentiment_analyzer("I hate this product! It's terrible.")
      {'neg': 0.508, 'neu': 0.492, 'pos': 0.0, 'compound': -0.5423}
      """
  
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 = [word for word in tokens if word not in string.punctuation]
  
      # Remove stopwords
      stop_words = set(stopwords.words('english'))
      tokens = [word for word in tokens if word not in stop_words]
  
      # Stem each word
      stemmer = PorterStemmer()
      tokens = [stemmer.stem(word) for word in tokens]
  
      # Join the tokens back into a single string
      cleaned_text = ' '.join(tokens)
  
      # Calculate sentiment scores
      sia = SentimentIntensityAnalyzer()
      sentiment_scores = sia.polarity_scores(cleaned_text)
  
      return sentiment_scores