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.
politenessDNM(text, uk_english = FALSE)
a data.frame of politeness features, with one row for every item in `text`. The original names are used where possible.
character A vector of texts, each of which will be tallied for politeness features.
logical Does the text contain any British English spelling? Including variants (e.g. Canadian). Default is FALSE
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.
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