Skip to main content

A Python SDK for interacting with the Sentor ML API for sentiment analysis

Project description

Sentor Python SDK

A Python SDK for interacting with the Sentor ML API for sentiment analysis. This SDK provides a simple and intuitive interface for sentiment analysis operations.

Installation

pip install sentor-ml

Features

  • 🚀 Python 3.7+ support
  • ⚡ Simple and intuitive API
  • 🌍 Support for multiple languages
  • 📦 Batch processing capabilities
  • 🛡️ Comprehensive error handling
  • 🔄 Real-time sentiment analysis

Usage

Basic Usage

from sentor import SentorClient

# Initialize the client
client = SentorClient('your-api-key')

# Analyze sentiment
input_data = [
    {
        "doc": "Apple's new iPhone is amazing!",
        "doc_id": "1",
        "entities": [
            "Apple",
            "iPhone"
        ]
    },
    {
        "doc": "Samsung's new phone is amazing!",
        "doc_id": "2",
        "entities": [
            "Samsung",
            "phone"
        ]
    }
]
result = client.analyze(input_data)
print(result)

Sample Output

{
  "results": [
    {
      "doc_id": "1",
      "predicted_class": 2,
      "predicted_label": "positive",
      "probabilities": {
        "negative": 0.00010637386003509164,
        "neutral": 0.0002509312762413174,
        "positive": 0.9996427297592163
      }
    },
    {
      "doc_id": "2",
      "predicted_class": 2,
      "predicted_label": "positive",
      "probabilities": {
        "negative": 0.00010637386003509164,
        "neutral": 0.0002509312762413174,
        "positive": 0.9996427297592163
      }
    }
  ]
}

API Reference

Please refer to the Sentor ML API Documentation for more details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see the LICENSE file for details.

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

sentor_ml-1.0.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sentor_ml-1.0.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file sentor_ml-1.0.0.tar.gz.

File metadata

  • Download URL: sentor_ml-1.0.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for sentor_ml-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7d1825379c5ca97c21438e4e40f9678588c89a141ebb9a921b258a76ea08063a
MD5 649f206edab34a3776b4bfdca8fe9b2c
BLAKE2b-256 2e37e044e004e3de9ca0880579212ae2f5fe8cf7ff532dc86aa4adc031c36c7a

See more details on using hashes here.

File details

Details for the file sentor_ml-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: sentor_ml-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for sentor_ml-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 361d2f99c85698db37d6ec57341de37791e8cb4a0a853a453d1007c845869b09
MD5 cb85ed46319b747cf1b7d8e517245987
BLAKE2b-256 da623bfa67bcb20a418cbaef6a54799107fba175a2d9114f41deedb88aeb3093

See more details on using hashes here.

Supported by

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