classify | R Documentation |
Twitter text classifier
classify(text, classifier, sentiment)
sentiment |
Additonal sentiment matrix. Only needed with the Nature classifiers. See examples |
text_vector |
Character vector of text data describing the the combination of names and descriptions |
type |
Choice of classifier (see below): "Hunting - full", "Hunting - relevance", "Hunting - stance", "Nature - full", "Nature - trim", "Nature - relevance", "Nature - stance", "Bio - full", "Bio - person", Bio - expert" |
A character vector of classifications.
There are 10 choices of classier, falling into three groups (Hunting, Nature, Bio), each with varying classification levels and accuracy
"Hunting - full" classification (0.87 accuracy): Irrelevant, Against-hunting, Pro-hunting
"Hunting - relevance" classification (0.89 accuracy): Irrelevant, Relevant
"Hunting - stance" classification (0.99 accuracy): Against-hunting, Pro-hunting
"Nature - trim" classification (0.82 accuracy; recommended over Nature - full): Irrelevant, Pro-nature positive phrasing, Pro-nature negative phrasing
"Nature - full" classification (0.81 accuracy): Irrelevant, Pro-nature positive phrasing, Pro-nature negative phrasing, Against-nature
"Nature - relevance" classification (0.90 accuracy): Irrelevant, Relevant
"Nature - stance" classification (0.92 accuracy): Pro-nature positive phrasing, Pro-nature negative phrasing
"Bio - full" classification (0.79 accuracy): Expert, Person, Other, Nature organisation
"Bio - person" classification (0.87 accuracy): Person, Other
"Bio - expert" classification (0.94 accuracy): Expert, Person
text_vector = c("a collection of text", "another collection of text")
classify(text_vector, "Hunting - full")
text_vector = c("a collection of text", "another collection of text")
sm = as.matrix(cbind(valence(text_vector),lang_eng(text_vector),senti_matrix(text_vector)))
classify(text_vector, "Nature - full", sentiment = sm)
text_vector = c("a collection of text", "another collection of text")
classify(text_vector, "Bio - full")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.