Skip to main content

AI Opinion Miner Cloud - API

Test Coverage Report

Name                            Stmts   Miss  Cover
---------------------------------------------------
opinion_miner_api/__init__.py       0      0   100%
opinion_miner_api/main.py          23      0   100%
opinion_miner_api/model.py         73      9    88%
tests/test_api.py                  48      0   100%
tests/test_main.py                 11      0   100%
tests/test_model.py                 8      0   100%
---------------------------------------------------
TOTAL                             163      9    94%

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/opinion-miner-api.git
    cd opinion-miner-api
    
  2. Create and activate a virtual environment:

    python -m venv venv-opinion-miner-api
    source venv-opinion-miner-api/bin/activate  # On Windows use `venv-opinion-miner-api\Scripts\activate`
    
  3. Install the dependencies:

    pip install -r requirements.txt  # NOTE: torch CPU installation
    
  4. Run the application:

    uvicorn opinion_miner_api.main:app --host 0.0.0.0 --port 8000
    
  5. Run the tests (optional):

    pytest --cov=opinion_miner_api tests/
    
  6. Build the Docker image (optional):

    docker build -t opinion-miner-api .
    
  7. Run the Docker container (optional):

    docker run -p 8000:8000 opinion-miner-api
    
  8. Test the API (optional):

    curl -X POST "http://localhost:8000/predict" -H "Content-Type: application/json" -d '{"text":"I love Docker!"}'
    

Download files

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

Source Distribution

opinion_miner_api-0.1.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

opinion_miner_api-0.1.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file opinion_miner_api-0.1.0.tar.gz.

File metadata

  • Download URL: opinion_miner_api-0.1.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for opinion_miner_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ee34c9c7d6ae09f09da612b8d6855daf93a6d071086b12573e4250253925aecd
MD5 8957e63f814ea4f7656003c56c11f14d
BLAKE2b-256 f4cbb352c2e34718bc123745c2497498c4b2655da7ab8d61c7e0f0d282dbc7e5

See more details on using hashes here.

File details

Details for the file opinion_miner_api-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for opinion_miner_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb2dd027cc8f5e141da09f019c189f194dcc9002c1aa3dce790c2cc478332d50
MD5 edea117ed34fe6587de8f8d108d3bc22
BLAKE2b-256 0dc5a66172dafb3abb6135185d55c8922e6b45f4976bbae554d9b4bbe02ba133

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

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