搜尋套件、儲存庫與 APP 分類

套件詳情v0.0.5

sentiment_dart

Sentiment Dart 是一個 Dart 模組,使用 AFINN-165 詞表對任意文字區塊進行情感分析。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1540
喜歡數
19
Pub 分數
150

安裝套件

flutter pub add sentiment_dart

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Sentiment Dart 是一個輕量級的 Dart 套件,使用 AFINN-165 詞表對文字進行情感分析,根據詞語的情感極性分配數值分數。它讓開發者能快速評估使用者輸入、評論或社群媒體內容的情感,適用於跨平台的 Flutter 應用程式。此套件容易整合,無需外部 API 即可實現基本的情感偵測。支援 Android、iOS、Web、macOS、Windows 及 Linux,適用於多種跨平台用途。

適用情境

  • 分析用戶評論
  • 監控社交媒體情緒
  • 評估客戶反饋
  • 檢測聊天訊息中的情緒
  • 內容審核

主要特色

  • 使用 AFINN-165 詞表
  • 輕便且快速
  • 跨平台支援
  • 簡單 API 結合
  • 無外部依賴

適合對象

  • 基本情感分析
  • 帶有文字輸入的 Flutter 應用
  • 即時反饋系統
  • 教育專案
  • 低延遲情感檢查

使用建議

  • 限於預定義的單字分數
  • 無深度學習或上下文感知
  • 可能無法處理諷刺或複雜的語言細微差別
  • 不適合高精度企業使用情境

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

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

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。