Sentiment (beta)

  • The Sentiment enrichment uses NLTK's VADER lexicon to generate a score and corresponding sentiment for all specified columns.
  • For each string column on which sentiment enrichment is enabled, two additional columns are added.
  • To enable set enrichment parameter tosentiment.

Requirements

  • Reachability to www.nltk.org/nltk_data to download latest vader lexicon
fdl.ModelInfo.from_dataset_info(
    dataset_info=dataset_info,
    display_name='llm_model',
    model_task=fdl.core_objects.ModelTask.LLM,
    custom_features = [
      fdl.Enrichment(
          name='Question Sentiment',
          enrichment='sentiment',
          columns=['question'],
      ),
    ]
)

The above example leads to creation of two columns -

  • FDL Question Sentiment (question) compound(float): raw score of sentiment
  • FDL Question Sentiment (question) sentiment(string): one of positive, negative and neutral