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. The API intelligently chooses the appropriate model based on the text length, utilizing XLM-RoBERTa for shorter texts and Longformer for longer texts.
Features
- Multi-language Support with XLM-RoBERTa and Longformer.
- 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.api_multimodel
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_sentiment \
-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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file taranis_sentiment_analysis-1.2.0.tar.gz.
File metadata
- Download URL: taranis_sentiment_analysis-1.2.0.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50de015ca2a0674dece08780354c1bfedaf8ed12aba4e4bcdd07361eba96cb36
|
|
| MD5 |
c134b8c77e8e9837a952078a56df58ef
|
|
| BLAKE2b-256 |
2b806f29353722a01add44e59c821482dd5f8be6c9743468353c528feb036e18
|
Provenance
The following attestation bundles were made for taranis_sentiment_analysis-1.2.0.tar.gz:
Publisher:
build.yml on taranis-ai/sentiment-analysis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
taranis_sentiment_analysis-1.2.0.tar.gz -
Subject digest:
50de015ca2a0674dece08780354c1bfedaf8ed12aba4e4bcdd07361eba96cb36 - Sigstore transparency entry: 148707207
- Sigstore integration time:
-
Permalink:
taranis-ai/sentiment-analysis@03b5b8c56726e84e44d16d76e74cab2f2f835602 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/taranis-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@03b5b8c56726e84e44d16d76e74cab2f2f835602 -
Trigger Event:
push
-
Statement type:
File details
Details for the file taranis_sentiment_analysis-1.2.0-py3-none-any.whl.
File metadata
- Download URL: taranis_sentiment_analysis-1.2.0-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8050e31a4c5299cd7c6eead70246d11749c41018f66c707c98040fee88a2f7e
|
|
| MD5 |
7f8260a396c53e811805083896406f3a
|
|
| BLAKE2b-256 |
98dddc56f65463f0c2990d08b9457ca4222002d71fd37ddeadd2f1cffe383825
|
Provenance
The following attestation bundles were made for taranis_sentiment_analysis-1.2.0-py3-none-any.whl:
Publisher:
build.yml on taranis-ai/sentiment-analysis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
taranis_sentiment_analysis-1.2.0-py3-none-any.whl -
Subject digest:
f8050e31a4c5299cd7c6eead70246d11749c41018f66c707c98040fee88a2f7e - Sigstore transparency entry: 148707211
- Sigstore integration time:
-
Permalink:
taranis-ai/sentiment-analysis@03b5b8c56726e84e44d16d76e74cab2f2f835602 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/taranis-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@03b5b8c56726e84e44d16d76e74cab2f2f835602 -
Trigger Event:
push
-
Statement type: