Skip to main content

apiverve_sentimentanalysis 1.2.6 copy "apiverve_sentimentanalysis: ^1.2.6" to clipboard
apiverve_sentimentanalysis: ^1.2.6 copied to clipboard

Sentiment Analysis evaluates the emotional tone of any text string. It returns an AFINN valence score, a comparative word-normalized score, and a five-tier sentiment label from very negative to very p [...]

Sentiment Analysis API - Dart/Flutter Client #

Sentiment Analysis evaluates the emotional tone of any text string. It returns an AFINN valence score, a comparative word-normalized score, and a five-tier sentiment label from very negative to very positive. Paid plans add sentence-level labels from a transformer model, a mixed-sentiment flag, magnitude, and the words that drove the score.

pub package License: MIT

This is the Dart/Flutter client for the Sentiment Analysis API.

Installation #

Add this to your pubspec.yaml:

dependencies:
  apiverve_sentimentanalysis: ^1.2.6

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage #

import 'package:apiverve_sentimentanalysis/apiverve_sentimentanalysis.dart';

void main() async {
  final client = SentimentanalysisClient('YOUR_API_KEY');

  try {
    final response = await client.execute({
      'text': 'I\'m so excited that tomorrow is going to be sunny! Can\'t wait!'
    });

    print('Status: ${response.status}');
    print('Data: ${response.data}');
  } catch (e) {
    print('Error: $e');
  }
}

Response #

{
  "status": "ok",
  "error": null,
  "data": {
    "comparative": 0.25,
    "sentimentText": "positive",
    "sentiment": 3,
    "isPositive": true,
    "isNegative": false,
    "normalizedScore": 0.3,
    "magnitude": 3,
    "positiveWords": [
      "excited"
    ],
    "negativeWords": [],
    "modelSentiment": "positive",
    "modelScore": 0.98,
    "isMixed": false,
    "sentences": [
      {
        "text": "I'm so excited that tomorrow is going to be sunny!",
        "label": "positive",
        "confidence": 0.992,
        "scores": {
          "positive": 0.992,
          "neutral": 0.006,
          "negative": 0.002
        }
      },
      {
        "text": "Can't wait!",
        "label": "positive",
        "confidence": 0.973,
        "scores": {
          "positive": 0.973,
          "neutral": 0.024,
          "negative": 0.003
        }
      }
    ]
  }
}

API Reference #

Authentication #

All requests require an API key. Get yours at apiverve.com.

License #

MIT License - see LICENSE for details.


Built with Dart for APIVerve

0
likes
120
points
53
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Sentiment Analysis evaluates the emotional tone of any text string. It returns an AFINN valence score, a comparative word-normalized score, and a five-tier sentiment label from very negative to very positive. Paid plans add sentence-level labels from a transformer model, a mixed-sentiment flag, magnitude, and the words that drove the score.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

http, http_parser

More

Packages that depend on apiverve_sentimentanalysis