搜索插件、代码仓与 APP 分类

GitHub 代码仓buckthorndev/sentiment_dart

sentiment_dart

Sentiment Dart 是一个 Dart 模块,它使用 AFINN-165 词表和 Emoji 情感评分排名来对任意输入文本执行情感分析。Sentiment Dart 在很大程度上受到 JavaScript 包 sentiment 的启发。

sentiment_dart 项目封面
星标
10
复刻
7
最近推送(UTC)
2022年3月11日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

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

Buckthorn GitHub avatar
GitHub 作者

Buckthorn ↗

Pushing the possibilities of the Internet

语言Dart

分类

此仓库发布的插件

使用的依赖

依赖清单 3 项

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗