Search packages, repositories and app categories

Package detailsv0.0.5

sentiment_dart

Sentiment Dart is a dart module that uses the AFINN-165 wordlist to perform sentiment analysis on arbitrary blocks of text

AndroidiOSWebmacOSWindowsLinux
30-day downloads
1.5K
Likes
19
Pub points
150

Install package

flutter pub add sentiment_dart

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Sentiment Dart is a lightweight Dart package that performs sentiment analysis on text using the AFINN-165 wordlist, assigning numerical scores to words based on their emotional polarity. It enables developers to quickly assess the sentiment of user input, reviews, or social media content within Flutter applications across multiple platforms. The package is simple to integrate and ideal for basic sentiment detection without requiring external APIs. It supports Android, iOS, Web, macOS, Windows, and Linux, making it versatile for cross-platform use.

Use cases

  • Analyzing user reviews
  • Monitoring social media sentiment
  • Evaluating customer feedback
  • Detecting emotion in chat messages
  • Content moderation

Key features

  • Uses AFINN-165 wordlist
  • Lightweight and fast
  • Cross-platform support
  • Simple API integration
  • No external dependencies

Suitable for

  • Basic sentiment analysis
  • Flutter apps with text input
  • Real-time feedback systems
  • Educational projects
  • Low-latency sentiment checks

Considerations

  • Limited to predefined word scores
  • No deep learning or context awareness
  • May not handle sarcasm or complex language nuances
  • Not suitable for high-accuracy enterprise use cases

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Sentiment Dart

Sentiment Dart is a dart module that uses the AFINN-165 wordlist and Emoji Sentiment Ranking to perform sentiment analysis on arbitrary blocks of input text. Sentiment Dart heavily inspired by the Javascript package sentiment

Usage

import 'package:sentiment_dart/sentiment_dart.dart';

main() {
  void main() {

  print(Sentiment.analysis('i hate you piece of shit 💩'));

  print(Sentiment.analysis('i hate you piece of shit 💩',emoji: true));
}
}

output

{score: -7, comparative: -1.1666666666666667, words: [i, hate, you, piece, of, shit], good words: [], badword: [[hate, -3], [shit, -4]]}

{score: -8, comparative: -1.1428571428571428, words: [i, hate, you, piece, of, shit, 💩], good words: [], badword: [[hate, -3], [shit, -4], [💩, -1]]}
Other language

example

import 'package:sentiment_dart/sentiment_dart.dart';

main() {
  void main() {


  print(Sentiment.analysis('ti odio un pezzo di merda 💩',languageCode: 'it'));

  print(Sentiment.analysis('ti odio un pezzo di merda 💩',emoji: true,languageCode: 'it'));

}
}

output

{score: -7, comparative: -1.1666666666666667, words: [ti, odio, un, pezzo, di, merda], good words: [], badword: [[odio, -3], [merda, -4]]}

{score: -8, comparative: -1.1428571428571428, words: [ti, odio, un, pezzo, di, merda, 💩], good words: [], badword: [[odio, -3], [merda, -4], [💩, -1]]}
Custom language

example

import 'package:sentiment_dart/sentiment_dart.dart';

main() {
  void main() {


  var customLang = {'i': 1, 'love': 1, 'dart': 5,'car':2};
  print(Sentiment.analysis('i love dart',customLang: customLang));
}
}

output

{score: 7, comparative: 2.3333333333333335, words: [i, love, dart], good words: [[i, 1], [love, 1], [dart, 5]], badword: []}

How it works ?

AFINN is a list of words rated for valence with an integer between minus five (negative) and plus five (positive). Sentiment analysis is performed by cross-checking the string tokens (words, emojis) with the AFINN list and getting their respective scores.

source

Languages and code

language code
English en
Italian it
french fr
german de

Contribution 🤓

Happy 😍 to recieve or provide contributions related to this package.

Features and bugs 🐛

Please file feature requests and bugs at the issue tracker.

Contact 📧

if you have any questions , feel free to wite us on

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.