Questions tagged [sentimentr]

33 questions
3
votes
1 answer

Apply Sentimentr on Dataframe with Multiple Sentences in 1 String Per Row

I have a dataset where I am trying to get the sentiment by article. I have about 1000 articles. Each article is a string. This string has multiple sentences within it. I ideally would like to add another column that would summarise the sentiment for…
nak5120
  • 4,089
  • 4
  • 35
  • 94
3
votes
2 answers

Performance issue while trying to match a list of words with a list of sentences in R

I am trying to match a list of words with a list of sentences and form a data frame with the matching words and sentences. For example: words <- c("far better","good","great","sombre","happy") sentences <- c("This document is far better","This is a…
Venu
  • 239
  • 4
  • 18
2
votes
1 answer

dplyr mutate throws "Error: invalid subscript type 'closure'" error

I'm trying to use the sentiment_by in sentimentR with dplyr's mutate This for example works: content <- mutate(content, word_count = sentiment_by(story)$word_count) but This for example works: content.sd <- mutate(content, word_count =…
Joseph Noirre
  • 387
  • 4
  • 20
2
votes
0 answers

Modifying sentimentr (R package) data dictionaries

I am using sentiment analysis function sentiment_by() from R package sentimentr (by trinker). Would like to understand how to modify the negators, amplifiers, de-amplifiers. I could update the polarity table & valence shifters. Would like to tinker…
Swsankar
  • 21
  • 1
1
vote
0 answers

Creating a progress bar for sentiment analysis in R

I am trying to do a sentiment analysis using the vader package in R. The vader package involves the vader_df() function to get sentiments for entire columns of data frames. I got a big data frame with approximately 3 million entries, where the…
wieco23
  • 11
  • 1
1
vote
1 answer

Question about how the sentimentr lexicon dictionary was built

I have used the Sentimentr package to do some sentiment analysis because it includes valence shifters. However I cannot find how this lexicon lexicon::hash_sentiment_jockers_rinker was built, how individual words were scored. From what I understand,…
Gabriella
  • 421
  • 3
  • 11
1
vote
1 answer

modifying polarity words in sentimentr package

Is there a way to modify words in the sentimentr package? For example I want to change the word "please" to have a negative score rather than a positive one. Now I'm using the function: text$sentiment <- sentiment_by(text$Comment) to evaluate…
1
vote
1 answer

Compare the bag of words in two document and find the matching word and their frequency in second document

I have calculated the bag of words for 'yelp.csv', 'yelpp.csv', 'yelpn.csv' and created the matrix of individuals dataset's word frequency. Now, I want to compare the bag of words of yelp with yelpn and check how many words in yelp appears in yelpn…
Ash
  • 23
  • 1
  • 5
1
vote
1 answer

Need clarification on the calculation of average polarity score returned by sentiment function of sentimentr(trinker)

I am using sentiment analysis function sentiment_by() from R package sentimentr (by trinker). I have a dataframe containing the following columns: review comments month year I ran the sentiment_by function on the dataframe to find the average…
Venu
  • 239
  • 4
  • 18
0
votes
0 answers

sentiment analysis-training for 3 classes sentiment using 2 classes dataset

I'm going to build a model for twitter sentiment on Financial market using transformers. I have access to StockTwits data for training, which only contains positive and negative sentiments. However, I would like to consider 3 classes, positive,…
0
votes
1 answer

Can't get update_polarity_table in Sentimentr to update polarity

I'm trying to do a sentiment analysis using hash_sentiment_socal_google in Sentimentr. Looking through the responses, I've noticed that one word responses of "unsure", or "unknown", get an average sentiment score of -.5. And "yes", gets .8. I would…
Jasmine B
  • 53
  • 1
  • 6
0
votes
1 answer

Does sentimentr package account for number of words in sentence and number of sentence in paragraph?

Can anyone help explain whether sentimentr package accounts for word number? I am trying to work out how the number of words affects the sentiment score. Does it take into account if people have more sentences in an answer or more words per…
Gabriella
  • 421
  • 3
  • 11
0
votes
1 answer

Changing color of points in R Sentimentr plot() function

I am trying to change the color of the red points in the plot() function used by the Sentimentr package. I think plot() returns a ggplot2 object, but when I try to add parameters to the plot() function (e.g., color = 'blue' or fill = 'blue'),…
Byron Pop
  • 31
  • 1
  • 8
0
votes
1 answer

sentimentr - different results for different text partitioning

Using sentimentr to analyse the text: I haven’t been sad in a long time. I am extremely happy today. It’s a good day. I first used a sentence by sentence partitioning of the text library(sentimentr) ase1 <- c( "I haven't been sad in a long…
dorit
  • 41
  • 5
0
votes
1 answer

Calculate sentiment of each row in a big dataset using R

I having trouble calculating average sentiment of each row in a relatively big dataset (N=36140). My dataset containts review data from an app on Google Play Store (each row represents one review) and I would like to calculate sentiment of each…
tantal148
  • 57
  • 5
1
2 3