Sentiment Analysis for Education with R: packages, methods and practical applications

This paper reviews and compares various R packages and methods for conducting Sentiment Analysis in educational contexts, demonstrating their practical application in processing student feedback to monitor teaching effectiveness and enhance learning experiences.

Michelangelo Misuraca, Alessia Forciniti, Germana Scepi, Maria Spano

Published 2026-03-09
📖 5 min read🧠 Deep dive

Imagine you are a teacher standing in front of a giant, noisy classroom. At the end of the semester, you ask your students for feedback. Instead of just giving you a simple "thumbs up" or "thumbs down" on a piece of paper, they write thousands of comments on a digital board. Some say, "This class was amazing!" while others grumble, "The lectures were boring and confusing."

Reading through thousands of handwritten notes is impossible for a human. You'd need a superpower to read them all instantly and understand the mood of the room. This is where Sentiment Analysis (SA) comes in. It's like a digital mood ring for text. It uses computers to read words and decide if they are happy (positive), sad (negative), or neutral.

This paper is essentially a review of five different "Mood-Reading Tools" (software packages) built for the R programming language, specifically designed to help educators understand student feedback better.

Here is a breakdown of the paper using simple analogies:

1. The Problem: Too Many Words, Not Enough Time

In the past, teachers only looked at numbers (like a 1-to-5 rating). But numbers don't tell the whole story. Students write long comments full of feelings.

  • The Challenge: Computers are great at math, but they struggle with human language. A phrase like "The test was not easy" is tricky. Is it negative? Or is it a compliment that the test was hard?
  • The Solution: The paper tests five different software tools (packages) to see which one is best at reading these student comments and figuring out if the student is happy or unhappy.

2. The Contestants: The Five "Mood Readers"

The authors tested five popular tools. Think of them as five different detectives trying to solve the mystery of "How do students feel?"

  • syuzhet (The Storyteller):

    • How it works: It uses pre-made lists of words (dictionaries) to count happy vs. sad words. It's like a detective who has a big book of "good words" and "bad words."
    • Special Power: It can tell you not just if a text is happy, but which emotion it has (anger, joy, fear, etc.). It's great for seeing the "emotional journey" of a story.
    • Weakness: It sometimes misses the nuance. If you say, "I didn't not like it," it might get confused.
  • RSentiment (The Grammar Police):

    • How it works: It looks at the grammar. It checks if a word is being used as a noun or a verb, and it pays close attention to words like "not" or "very."
    • Special Power: It's very strict about grammar rules.
    • Weakness: It is slow. It's like a detective who reads every single word very carefully but takes forever to finish the report.
  • sentimentr (The Context Detective):

    • How it works: This is the star of the show. It doesn't just count words; it looks at the context. It understands "valence shifters"—words that flip the meaning.
    • The Magic: If a student says, "The class was not good," a simple tool might see "good" and think it's positive. sentimentr sees the "not" and knows the student is actually unhappy. It's like a detective who understands sarcasm and double negatives.
    • Result: It was the most accurate at guessing the true mood of the students.
  • SentimentAnalysis (The Statistician):

    • How it works: It uses heavy math and statistics to compare words against huge databases. It's very flexible and can be customized.
    • Weakness: It can be a bit heavy and complex to set up, like a high-tech lab that requires a PhD to operate.
  • meanr (The Speedster):

    • How it works: It is incredibly fast. It just counts the good words and subtracts the bad words.
    • Weakness: It's fast but "dumb." It doesn't understand context or grammar. It's like a robot that just counts "happy" faces and "sad" faces without reading the sentences. It was the fastest but made the most mistakes.

3. The Race: Speed vs. Accuracy

The authors put these tools to the test using real student comments from a university. They measured two things:

  1. Speed: How long did it take to read the comments?
  2. Accuracy: How often did the tool guess the student's mood correctly compared to the actual truth?

The Results:

  • The Fastest: meanr finished the job in a blink of an eye. But, like a fast driver who doesn't look at the road, it made many mistakes.
  • The Most Accurate: sentimentr took a little longer (but still very fast), but it got the answer right most of the time. Because it understood context (like the word "not"), it didn't get tricked by tricky sentences.
  • The Middle Ground: syuzhet and RSentiment were okay, but they either lacked the context understanding of sentimentr or were too slow.

4. Why This Matters for Education

Imagine a school principal trying to improve a course.

  • If they use the Speedster (meanr), they might think a class is great because the tool counted more "good" words, even though the students were actually complaining about the teacher.
  • If they use the Context Detective (sentimentr), they will see that while students used the word "hard," they also said "challenging and fun," realizing the students actually loved the class.

The Bottom Line

This paper is a guide for teachers and researchers. It says: "Don't just grab the fastest tool. If you want to truly understand what your students are feeling, use sentimentr."

It's like choosing between a speed-reading machine and a thoughtful human reader. For a quick glance, the machine is fine. But if you want to understand the heart of the feedback, you need the tool that understands the nuance of human language.