political: Returns a probability distribution over the political...

Description Usage Arguments Value See Also Examples

Description

Given input text, returns a probability distribution over the political alignment of the speaker.

Usage

1
political(text, local.api = FALSE)

Arguments

text

text for analysis

local.api

logical, whether use local or remote API

Value

List with party probability pairs

See Also

sentiment, language

Examples

1
2
3
4
5
6
7
8
affilation <- political("I am so proud to stand here today
                         as Prime Minister of four nations
                         in one United Kingdom.")
affilation
most.like <- names(affilation[which.max(unlist(affilation))])
least.like <- names(affilation[which.min(unlist(affilation))])
cat(sprintf("This text is most like %s and least like %s",
            most.like, least.like))

redmode/indicoio documentation built on May 27, 2019, 4:03 a.m.