get_polarity_dictionary: Get a standard polarity dictionary for sentiment analysis

View source: R/textstat_polarity.R

get_polarity_dictionaryR Documentation

Get a standard polarity dictionary for sentiment analysis

Description

Checks and standardizes a dictionary object with its polarity set, so that the polarity categories are standardized into the keys pos, neg, and (optionally) neut. Also checks that the dictionary contains all of the keys named in the polarity object. (It is necessary to check here since the dictionary could have been subset after creation.)

Usage

get_polarity_dictionary(dictionary)

Arguments

dictionary

a quanteda dictionary

Value

a single-level dictionary with keys pos, neg, and (optionally) neut.


quanteda/quanteda.sentiment documentation built on Feb. 26, 2024, 12:42 a.m.