Skip to main content

Sentiment analysis Bot for Taranis AI

Project description

Taranis AI Sentiment Analysis

This project integrates sentiment analysis into Taranis AI, allowing for the classification of news items as positive, negative, or neutral using transformer models.

Features

  • Multi-language Support with XLM-RoBERTa.
  • Pre-trained Models for high-accuracy sentiment classification.
  • Flask API for external calls to the sentiment analysis.

Setup

Prerequisites

  • Python 3.8+

Installation

To install dependencies:

pip install -r requirements.txt

Running the API

To start the Flask API:

python -m sentiment_analysis.api_xlmrobertabase

By default, the API runs at http://127.0.0.1:5003/.

Example API Call

To test the API with a POST request, use curl:

curl -X POST http://127.0.0.1:5003/analyze_xlmrobertabase \
  -H "Content-Type: application/json" \
  -d '{"text": "This is an example sentence to analyze sentiment."}'

Example Response

{
  "sentiment": {
    "label": "POSITIVE",
    "score": 0.94
  }
}

License

EUROPEAN UNION PUBLIC LICENCE v. 1.2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

taranis_sentiment_analysis-1.0.0.tar.gz (21.5 kB view hashes)

Uploaded Source

Built Distribution

taranis_sentiment_analysis-1.0.0-py3-none-any.whl (22.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page