class_docstr: Give a sentiment intensity score to sentences.
class_docstr_tok: ["Give","a","sentiment","intensity","score","to","sentences","."]
code: def score_valence(self, sentiments, text):
      if sentiments:
          sum_s = float(sum(sentiments))
          # compute and add emphasis from punctuation in text
          punct_emph_amplifier = self._punctuation_emphasis(text)
          if sum_s > 0:
              sum_s += punct_emph_amplifier
          elif sum_s < 0:
              sum_s -= punct_emph_amplifier
  
          compound = normalize(sum_s)
          # discriminate between positive, negative and neutral sentiment scores
          pos_sum, neg_sum, neu_count = self._sift_sentiment_scores(
              sentiments
          )
  
          if pos_sum > math.fabs(neg_sum):
              pos_sum += punct_emph_amplifier
          elif pos_sum < math.fabs(neg_sum):
              neg_sum -= punct_emph_amplifier
  
          total = pos_sum + math.fabs(neg_sum) + neu_count
          pos = math.fabs(pos_sum / total)
          neg = math.fabs(neg_sum / total)
          neu = math.fabs(neu_count / total)
  
      else:
          compound = 0.0
          pos = 0.0
          neg = 0.0
          neu = 0.0
  
      sentiment_dict = {
          "neg": round(neg, 3),
          "neu": round(neu, 3),
          "pos": round(pos, 3),
          "compound": round(compound, 4),
      }
  
      return sentiment_dict
  
imports: import os
  import re
  import math
  import string
  import codecs
  import json
  from itertools import product
  from inspect import getsourcefile
  from io import open
label_desc: Use image node_id 15 for calling the SentimentIntensityAnalyzer obj's underlying member method code with example usage: obj.score_valence(sentiments, text) and returns: sentiment_dict