Beyond Words: Solving Multilingual Sentiment Analysis with N-Gram Graphs

Using N-Gram Graphs for Sentiment Analysis: An Extended Study on Twitter

2016-03-01
Fotis Aisopos, Dimitrios Tzannetos, John Violos, Theodora A. Varvarigou
Summary
Problem
Method
Results
Takeaways
Abstract

This paper presents an extended study of a language-independent Sentiment Analysis framework using the n-gram graphs technique. By representing tweets as graphs of overlapping character sequences and employing an Ensemble Voting system with multiple classifiers, the authors achieve high accuracy across a massive, manually annotated multilingual dataset.

TL;DR

Determining the "vibe" of a tweet is notoriously difficult due to slang, typos, and the sheer variety of languages. This paper moves away from traditional word-counting, instead treating text as a graph of character n-grams. By focusing on the structural relationships between character sequences, the authors built a system that is robust against noise and works across 6+ languages with a high accuracy of ~71%, even when training data is scarce.

Background: The Chaos of the Twitter-verse

Text mining on social media isn't like analyzing a textbook. It’s "dirty" data. The authors identify six core pain points:

  1. Sparsity: 140 characters provide very little context.
  2. Non-standard Vocabulary: "Gr8" vs "Great", "Koo" vs "Cool".
  3. Noise: Grammar is often ignored.
  4. Multilinguality: Global platforms host a cocktail of languages simultaneously.

Traditional NLP (Natural Language Processing) often relies on "Unigrams" (individual words). But if a word is misspelled, a unigram model fails. If the language changes, the dictionary must change. The authors’ insight? Characters and their relative positions are more stable than words.

The Core Methodology: N-Gram Graphs

Instead of a "Bag of Words," this paper uses N-Gram Graphs.

1. How it works

  • Take the phrase "test texts".
  • Break it into trigrams: tes, est, st , t t, etc.
  • Instead of just counting them, draw an edge between trigrams that appear near each other.
  • The weight of the edge represents how often these sequences are neighbors.

Model Architecture: Deriving the feature vector

2. From Graphs to Features

To classify a new tweet, the system compares the "Tweet Graph" to three "Class Graphs" (Positive, Negative, Neutral) built during training. It calculates three specific similarity scores:

  • Containment Similarity (CS): Do they share the same edges?
  • Value Similarity (VS): Do the shared edges have similar weights?
  • Normalized Value Similarity (NVS): A size-agnostic version of VS.

Experimental Results: Strength in Diversity

The authors didn't just use one classifier; they tested six (SVM, Naive Bayes, MLP, etc.) and combined them using Voting Ensembles.

1. Key Performance Metrics

The study used a massive aggregate of 95,608 manually annotated tweets.

  • Best Configuration: 4-gram graphs consistently outperformed 3-gram or 5-gram versions.
  • Top Accuracy: 71.23% using a weighted vote of MLP, Logistic Regression, and k-NN.
  • Language Agnostic: The system performed equally well on Spanish, English, Portuguese, Dutch, German, and French without needing translated dictionaries.

Experimental Results: Accuracy across different Split Ratios

2. The "Discretization" Trick

One of the most interesting findings was that for certain classifiers like Naive Bayes, converting numerical similarity scores into simple nominal labels (e.g., "Positive Score > Negative Score") boosted performance by as much as 27%. This suggests that for noisy social data, the relative rank of sentiment is more important than the absolute value.

Critical Analysis & Conclusion

Takeaways

The n-gram graph approach is a "low-resource" hero. It doesn't need huge GPU clusters or massive pre-trained transformers to understand the sentiment of a misspelled tweet in Dutch. It thrives on the structural signature of language.

Limitations

The primary drawback is computational complexity. Building and comparing graphs for millions of tweets in real-time is significantly slower than simple keyword matching. There is a clear trade-off between the depth of the graph analysis and its throughput.

Future Work

The authors suggest that the next frontier is "denoising"—removing the common subgraphs (the "stop-words" of the graph world) that appear in all sentiment classes to further sharpen the classification boundaries.

Final Verdict: A robust, mathematically elegant alternative to dictionary-based sentiment analysis that proves you don't always need to "understand" a language to "feel" its sentiment.

Find Similar Papers

Try Our Examples

  • Search for recent papers that apply graph-based text representation for cross-lingual sentiment analysis in the era of Large Language Models.
  • Which paper first established the formal definition of n-gram graphs for document summarization, and how did this paper adapt those similarity metrics for classification?
  • Explore research that applies n-gram graph techniques to non-textual sequential data, such as DNA sequences or IoT sensor logs, for pattern classification.
Contents
Beyond Words: Solving Multilingual Sentiment Analysis with N-Gram Graphs
1. TL;DR
2. Background: The Chaos of the Twitter-verse
3. The Core Methodology: N-Gram Graphs
3.1. 1. How it works
3.2. 2. From Graphs to Features
4. Experimental Results: Strength in Diversity
4.1. 1. Key Performance Metrics
4.2. 2. The "Discretization" Trick
5. Critical Analysis & Conclusion
5.1. Takeaways
5.2. Limitations
5.3. Future Work