Sign inSign up

tiag0ss/speechanalyser-app

By tiag0ss

•Updated 10 months ago

Hate Speech Analyser for en,pt,es and it

Image
Machine learning & AI
0

986

tiag0ss/speechanalyser-app repository overview

⁠Speech Analyser API

API for sentiment analysis, hate speech detection, emotion analysis, and translation using PyTorch models.

⁠API Endpoints

⁠Health Check
curl http://localhost:8000/health
⁠Translate Text
curl -X POST http://localhost:8000/translate \
  -H "Content-Type: application/json" \
  -d '{"input": "Hello world", "target_lang": "pt"}'
⁠Analyze Text
curl -X POST http://localhost:8000/analyze \
  -H "Content-Type: application/json" \
  -d '{"input": "This is amazing!"}'

With fallback language:

curl -X POST http://localhost:8000/analyze \
  -H "Content-Type: application/json" \
  -d '{"input": "Bonjour!", "dfl_ln": "en"}'

⁠API Endpoints

⁠GET /

Returns a simple HTML page with "Speech Analyser" title.

⁠POST /analyze

Analyzes text sentiment, hate speech, emotion, and irony.

Request Body:

{
  "input": "your text here"
}

Response:

{
  "success": true,
  "detected_language": "pt",
  "original_text": "seu texto aqui",
  "sentiment": {
    "output": "POS",
    "probas": { "POS": 0.9, "NEU": 0.05, "NEG": 0.05 }
  },
  "hate_speech": {
    "output": "hateful",
    "probas": { "hateful": 0.1, "targeted": 0.05, "aggressive": 0.05 }
  },
  "emotion": {
    "output": "joy",
    "probas": { "joy": 0.8, "sadness": 0.1, "anger": 0.05, "fear": 0.05 }
  },
  "irony": {
    "output": "non-ironic",
    "probas": { "ironic": 0.1, "non-ironic": 0.9 }
  }
}
⁠POST /translate

Translates text to the specified language.

Request Body:

{
  "input": "Hello world",
  "ln": "pt"
}

Supported languages: en, pt, es, fr, it

Response:

{
  "success": true,
  "detected_language": "en",
  "target_language": "pt",
  "original_text": "Hello world",
  "translated_text": "Olá mundo"
}

Tag summary

Content type

Image

Digest

sha256:de6433842…

Size

4.2 GB

Last updated

10 months ago

docker pull tiag0ss/speechanalyser-app