Description Usage Arguments Details Value Examples
View source: R/feature_engineering.R
Engineers features related to emojis in Tweets.
1 | feature_emoji(data, doc_id_field, text_field, top_num = 20)
|
data |
a dataframe or tibble containing the text data and document id |
doc_id_field |
unquoted field name identifying the field within the data that represents the unique document id |
text_field |
unquoted field name identifying the field name in data that contains the text of the Tweet |
top_num |
integer, the top n emojis to create features from |
The full list of emojis are initially downloaded from https://unicode.org/Public/emoji/12.0/emoji-test.txt so an internet connection is required.
The emoji features are calculated as a proportion of the total number of words in the Tweet:
the count of the top n emojis in the data
A data frame of document ids their associated emoji features
1 2 3 4 5 | tweets <- data.frame(status_id = c(1234, 5678),
text = c("I tweet about one thing \U0001f602 #onething #things \U0001f600",
"I tweet about another thing \U0001f602 #another thing #things"),
stringsAsFactors = FALSE)
feature_emoji(tweets, status_id, text)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.