input: Write a function to analyze the sentiment of a given text using natural language processing techniques. The function should tokenize the text, stem each word, remove punctuation and stopwords, and then return the sentiment polarity scores. If the input text is empty, the function should return an empty dictionary.
  assert sentiment_analyzer("I love programming!")['compound']>0
  assert sentiment_analyzer("This is a terrible movie")['compound']<0
  assert sentiment_analyzer("")=={}
output: def sentiment_analyzer(text):
      from nltk.sentiment.vader import SentimentIntensityAnalyzer
      from nltk.tokenize import word_tokenize
      from nltk.stem import PorterStemmer
      from nltk.corpus import stopwords
      import string
  
      if not text:
          return {}
  
      sia = SentimentIntensityAnalyzer()
      stemmer = PorterStemmer()
      stop_words = set(stopwords.words('english'))
      tokens = word_tokenize(text.lower())
      filtered_tokens = [stemmer.stem(word) for word in tokens if word.isalnum() and word not in stop_words]
      filtered_text = ' '.join(filtered_tokens)
      sentiment_scores = sia.polarity_scores(filtered_text)
      
      return sentiment_scores