sentimentr is a package for calculating the polarity of text at the sentence level. It uses dictionary-based sentiment analysis while accounting for surrounding words that can alter the meaning or strength of an emotional expression.
A straightforward sentiment dictionary may classify a sentence according to positive and negative words without considering their context. sentimentr extends this approach by recognising valence shifters such as negators, intensifiers and downtoners. These expressions can reverse, strengthen or weaken the polarity associated with particular words.
The package can calculate sentiment for individual sentences and aggregate the results across documents, speakers or other grouping variables. It is useful for analysing survey responses, conversations, customer feedback and other collections where sentence context matters.
This is free and open source software.
Key Features
- Calculates polarity scores for individual sentences.
- Accounts for negation when determining sentiment.
- Recognises intensifiers and downtoners that modify the strength of sentiment expressions.
- Supports adversative conjunctions that influence the interpretation of surrounding language.
- Aggregates sentiment scores by document, speaker or other grouping variables.
- Provides alternative averaging methods for summarising sentence-level scores.
- Supports custom sentiment dictionaries and valence-shifter tables.
- Offers functions for examining the contribution of sentiment-bearing words.
- Provides facilities for validating sentiment calculations against labelled data.
- Supports visualisation of sentiment distributions and grouped results.
- Works with sentence-segmented textual data.
- Provides functions for investigating positive, negative and mixed sentiment patterns.
- Supports comparative analysis of sentiment across multiple texts or categories.
Website: github.com/trinker/sentimentr
Support:
Developer: Tyler Wade Rinker
License: MIT License
sentimentr is written in R. Learn R with our recommended free books and free tutorials.
Related Software
| R Natural Language Processing Tools | |
|---|---|
| tidytext | Text mining using dplyr, ggplot2, and other tidy tools |
| quanteda | R package for Quantitative Analysis of Textual Data |
| text2vec | Framework with API for text analysis and natural language processing |
| tm | Text Mining Infrastructure in R |
| srtringi | Fast and portable character string processing in R |
| Stringr | String manipulation in R |
| UDPipe | Tokenization, Tagging, Lemmatization and Dependency Parsing |
| tokenizers | Convert natural language text into tokens |
| spacyr | R wrapper around the Python spaCy package |
| Word Vectors | Build and explore embedding models |
| syuzhet | Extraction of sentiment and sentiment-based plot arcs from text |
| textTinyR | Text processing for small or big data |
| textrecipes | Prepares text features for machine learning with tidymodels |
| stm | Fits structural topic models to analyse document collections |
| sentimentr | Dictionary based sentiment analysis |
| word2vec | Trains word embedding models and explores semantic relationships |
| textclean | Collection of tools to clean and normalize text |
| TALL | Explore, model, and visualize textual data |
| corpustools | Various tools for analyzing text corpora |
| wordvector | Trains and explores word and document vector representations |
| topicmodels | Interface to LDA and CTM models |
| text | Analyzing natural language with transformers-based large language models |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.