パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.0.9

dart_sentiment

Dart Sentiment は、AFINN-165 の語彙リストと絵文字の感情ランキングを使用して、任意の入力テキストブロックに対して感情分析を行う Dart モジュールです。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
168
いいね数
36
Pub ポイント
145

パッケージをインストール

flutter pub add dart_sentiment

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Dart Sentiment は、AFINN-165語彙リストおよび絵文字センチメントランクを使用してテキストの感情分析を実行する軽量なDartパッケージです。入力テキストに感情スコアを割り当てることで、開発者がユーザー生成コンテンツの感情的なトーンを把握できるようにします。Android、iOS、Web、macOS、Windows、Linuxなど複数のプラットフォームをサポートしており、リアルタイムでの感情評価が必要なクロスプラットフォームアプリケーションに最適です。コアDartライブラリ以外の外部依存関係は一切ありません。

用途

  • ユーザーのレビューを分析する
  • ソーシャルメディアの感情をモニタリングする
  • カスタマーフィードバックの評価
  • チャットボットの応答を強化する
  • ブランド認識の追跡

主な機能

  • AFINN-165 および絵文字感情データを使用
  • クロスプラットフォーム互換性
  • シンプルなAPI統合
  • リアルタイム感情スコアリング
  • 外部の依存関係なし

適している対象

  • モバイルおよびウェブアプリ
  • カスタマーエクスペリエンスツール
  • 感情駆動型の分析
  • ソーシャルメディアモニタリング
  • フィードバックシステム

注意事項

  • 事前に定義された語彙に限定
  • カスタムセンチメント辞書をサポートしていません
  • 文脈や皮肉を捉えることができない可能性があります
  • 正確性は入力テキストのスタイルに依存します
  • マルチリンガルな感情分析には適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Dart Sentiment

Flutter Community: dart_sentiment

pub package

AFINN-based sentiment analysis for dart

Dart Sentiment is a dart package that uses
the AFINN-165
wordlist
and Emoji Sentiment Ranking
to perform sentiment analysis on arbitrary
blocks of input text. Dart Sentiment provides several things:

  • Provide Language support for English, Italian, French and German.
  • Provide support for various emojis.
  • Based on analysis of text, provide an integer value in the range -n to +n (see details below)

Installation

add following dependency to your pubspec.yaml

  
dependencies:    
   dart_sentiment: <latest-version>  
   

Example


 import 'package:dart_sentiment/dart_sentiment.dart';    
 void main() {
 
	 final sentiment = Sentiment();    
    
	 print(sentiment.analysis("The cake she made was terrible 😐"));    
    
	 print(sentiment.analysis("The cake she made was terrible 😐", emoji: true));    
    
	 print(sentiment.analysis("I love cats, but I am allergic to them.",));    
    
	 print(sentiment.analysis("J'adore les chats, mais j'y suis allergique.",    
	 languageCode: LanguageCode.french));    
    
	print(sentiment.analysis("Le gâteau qu'elle a fait était horrible 😐",    
	emoji: true, languageCode: LanguageCode.french)); 

}  

Function defination
Param Description
String text Input phrase to analyze
bool emoji = false Input emoji is present in the phrase to analyze
LanguageCode languageCode = LanguageCode.english Language to use for sentiment analysis. LanguageCode { english, italian, french, german }

How it works

AFINN

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. The comparative score is
simply: sum of each token / number of tokens. So for example let's take the following:

I love cats, but I am allergic to them.

That string results in the following:

{
    score: 1, 
	comparative: 0.1111111111111111,  
    tokens: [    
       "i",    
       "love",    
       "cats",    
       "but",    
       "i",    
       "am",    
       "allergic",    
       "to",    
       "them"    
    ],
    positive: [[love, 3]], 
    negative: [[allergic, 2]]
} 
  • Returned Objects
    • Score: Score calculated by adding the sentiment values of recognized words.
    • Comparative: Comparative score of the input string.
    • Token: All the tokens like words or emojis found in the input string.
    • Words: List of words from input string that were found in AFINN list.
    • Positive: List of positive words in input string that were found in AFINN list.
    • Negative: List of negative words in input string that were found in AFINN list.

In this case, love has a value of 3, allergic has a value of -2, and the remaining tokens are
neutral with a value of 0. Because the string has 9 tokens the resulting comparative score looks
like: (3 + -2) / 9 = 0.111111111

This approach leaves you with a mid-point of 0 and the upper and lower bounds are constrained to
positive and negative 5 respectively. For example, let's imagine an incredibly "positive" string
with 200 tokens and where each token has an AFINN score of 5. Our resulting comparative score would
look like this:

(max positive score * number of tokens) / number of tokens (5 * 200) / 200 = 5

Contribute

If you have any suggestions, improvements or issues, feel free to contribute to this project. You
can either submit a new issue or propose a pull request. Direct your pull requests into the dev
branch.

License

Dart Sentiment is released under
the MIT License

Credit

Dart Sentiment inspired by the Javascript
package sentiment

About me

I am India based flutter developer

pub package [](mailto:akashlilhare14@gmail.com) twitter website

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

このパッケージを使用しているプロジェクト