Remoodji is a text analysis package that focuses on sentiment analysis in text files in quantitative and qualitative ways. Specifically, it is used for determining what kind of underlying emotion your input text gives off and quantitative analyses of your text (character, word, and sentence count as well as visual and quantitative sentiment analysis). The emotions analyzed include angry, sad, happy, and disgust. Another core feature of Remoodji is it replaces words with emojis to provide the user with a text file where it is easier to pick up on the emotions being conveyed in a visually appealing snapshot view. This package can be useful when proofreading an important message which you want to elicit a certain emotion or tone, particularly with a given pattern or rhythm (speeches, letters, applications, songs, poems, etc).
You can install the released version of remoodji from CRAN with:
install.packages("remoodji")
And the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("UBC-MDS/remoodji")
Counter:
Sentiment Analysis Dataframe:
Character Replacement:
Sentiment Analysis Plot:
Here is a example of how this package could be used. Let’s say there is a statement that you are trying to analyze. This is how you could implement our package.
First you need to import this package with the following command:
library('remoodji')
Let’s say you have the following statement:
I was happily walking. I then saw a monster and I got scared. However, when I found out it was a prank I became angry instead.
To start you might want to first determine the number of characters, words, and sentences to ensure that your statement fits within guidelines.
counter('I was happily walking. I then saw a monster and I got scared. However, when I found out it was a prank I became angry instead.')
This would output a tibble with the following values:
char_count word_count sentence_count 126 26 3After you have some insight into the length of your statement you would
want to get a dataframe that will provide you with some statistics about
the emotional content of your statement.
sentiment_df("I was happily walking. I then saw a monster and I got scared. However, when I found out it was a prank I became angry instead.")
Now you might want to take this tabular / text data and turn it into a data visualization so that you can better understand the breakdown of emotions used in your statement.
sentiment_plot(text = "I was happily walking. I then saw a monster and I got scared. However, when I found out it was a prank I became angry instead.", sentiment_input = "all")
Also you could change the sentiment parameter to only see words with one type of sentiment
sentiment_plot(text = "This week, show us a smile (yours or someone else's), make us smile, or both. Share a photo of something that has brought a moment of joy into your life recently, or focus on the outcome of that joy. If you're not feeling particularly cheerful at the moment — it's still 2018, after all — no need to fake your way into the challenge, either. Smiles come in all shades and flavors, including the half-hearted, tired, bitter, and resigned (to name a few). So whether the emotions you channel in your photo are full of cheer or not, I can't wait to see your take on this theme." , sentiment_input = "joy")
Lastly, you might want to visualize the emotions in this statement in a
different way. This packages allows you to see the emotional words
replaced with corresponding emojis for each type of emotion.
textsentiment_to_emoji("I was happily walking. I then saw a monster and I got scared. However, when I found out it was a prank I became angry instead.")
“➕” “😨” “😄” “➖” “➖”
This package was created with Devtools from R packages by Hadley Wickham and Jenny Bryan (https://r-pkgs.org/index.html).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.