Learn R Programming

politeness (version 0.9.4)

politenessDNM: Politeness Features

Description

Detects linguistic markers of politeness in natural language. This function emulates the original features of the Danescu-Niculescu-Mizil Politeness paper. This primarily exists to contrast with the full feature set in the main package, and is not recommended otherwise.

Usage

politenessDNM(text, uk_english = FALSE)

Value

a data.frame of politeness features, with one row for every item in `text`. The original names are used where possible.

Arguments

text

character A vector of texts, each of which will be tallied for politeness features.

uk_english

logical Does the text contain any British English spelling? Including variants (e.g. Canadian). Default is FALSE

References

Danescu-Niculescu-Mizil, C., Sudhof, M., Jurafsky, D., Leskovec, J., & Potts, C. (2013). A computational approach to politeness with application to social factors. arXiv preprint arXiv:1306.6078.

Examples

Run this code

if (FALSE) {
# Connect to SpaCy installation for part-of-speech features
install.packages("spacyr")
spacyr::spacy_initialize(python_executable = PYTHON_PATH)
data("phone_offers")

politeness(phone_offers$message)

}


Run the code above in your browser using DataLab