🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

sentimental-onix

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sentimental-onix

spacy pipeline component for sentiment analysis using onnx

0.0.2
PyPI
Maintainers
1

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"),
]

Benchmark

libraryresult
spacytextblob58.9%
sentimental_onix69%

See ./benchmark/ for info

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/*

Keywords

spacy

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts