Skip to main content

spacy pipeline component for sentiment analysis using onnx

Project description

spacy syllables Buy Me A Coffee

example workflow Latest Version Python Support

Sentimental Onix

Sentiment Analysis using onnx for python with a focus on being spacy compatible and EEEEEASY to use.

Features

  • English sentiment analysis
  • Spacy pipeline component
  • Sentiment model downloading from github

Install

$ pip install sentimental_onix
# download english sentiment model
$ python -m sentimental_onix download en

Usage

import spacy
from sentimental_onix import pipeline

nlp = spacy.load("en_core_web_sm")
nlp.add_pipe("sentencizer")
nlp.add_pipe("sentimental_onix", after="sentencizer")

sentences = [
    (sent.text, sent._.sentiment)
    for doc in nlp.pipe(
        [
            "i hate pasta on tuesdays",
            "i like movies on wednesdays",
            "i find your argument ridiculous",
            "soda with straws are my favorite",
        ]
    )
    for sent in doc.sents
]

assert sentences == [
    ("i hate pasta on tuesdays", "Negative"),
    ("i like movies on wednesdays", "Positive"),
    ("i find your argument ridiculous", "Negative"),
    ("soda with straws are my favorite", "Positive"),
]

Dev setup / testing

expand

Install

install the dev package and pyenv versions

$ pip install -e ".[dev]"
$ python -m spacy download en_core_web_sm
$ python -m sentimental_onix download en

Run tests

$ black .
$ pytest -vvl

Packaging and publishing

python3 -m pip install --upgrade build twine
python3 -m build
python3 -m twine upload dist/*

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

sentimental_onix-0.0.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file sentimental_onix-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sentimental_onix-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 972ef06cd18d25a41d96f5f1f3b2029c1780ad1ba503153372679d89c46dfb5f
MD5 21ff907bede0e6406c1a63da95516693
BLAKE2b-256 52b124ecac3b4a5f3071ba1a2662a203eecb9f79312136e0abaec48ed8b7f3f8

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