sentimental-onix


Namesentimental-onix JSON
Version 0.0.2 PyPI version JSON
download
home_page
Summaryspacy pipeline component for sentiment analysis using onnx
upload_time2023-03-15 21:56:53
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT License Copyright (c) 2023 sloev / Johannes Valbjørn Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords spacy onnx sentiment english nlp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![spacy syllables](https://raw.githubusercontent.com/sloev/sentimental-onix/master/.github/onix.webp) <a href="https://www.buymeacoffee.com/sloev" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-pink.png" alt="Buy Me A Coffee" height="51px" width="217px"></a>

![example workflow](https://github.com/sloev/sentimental-onix/actions/workflows/test.yml/badge.svg) [![Latest Version](https://img.shields.io/pypi/v/sentimental-onix.svg)](https://pypi.python.org/pypi/sentimental-onix) [![Python Support](https://img.shields.io/pypi/pyversions/sentimental-onix.svg)](https://pypi.python.org/pypi/sentimental-onix)

# Sentimental Onix

Sentiment Analysis using [onnx](https://github.com/onnx/onnx) for python with a focus on being [spacy](https://github.com/explosion/spaCy) compatible *and EEEEEASY to use*.

**Features**
- [x] English sentiment analysis
- [x] Spacy pipeline component
- [x] Sentiment model downloading from github

## Install

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

## Usage

```python
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

|         library|   result|
|----------------|---------|
|   spacytextblob|    58.9%|
|sentimental_onix|      69%|
 
See [./benchmark/](./benchmark/) for info

## Dev setup / testing

<details><summary>expand</summary>


### Install

install the dev package and pyenv versions

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

### Run tests

```bash
$ black .
$ pytest -vvl
```


### Packaging and publishing

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

</details>

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "sentimental-onix",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "spacy,onnx,sentiment,english,nlp",
    "author": "",
    "author_email": "sloev <johannes.valbjorn@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/6f/1f/5dfc2d38a498f3429a01a2fd627fc9d2741c4ee69ccb4480c3e89f3d269c/sentimental-onix-0.0.2.tar.gz",
    "platform": null,
    "description": "![spacy syllables](https://raw.githubusercontent.com/sloev/sentimental-onix/master/.github/onix.webp) <a href=\"https://www.buymeacoffee.com/sloev\" target=\"_blank\"><img src=\"https://cdn.buymeacoffee.com/buttons/default-pink.png\" alt=\"Buy Me A Coffee\" height=\"51px\" width=\"217px\"></a>\n\n![example workflow](https://github.com/sloev/sentimental-onix/actions/workflows/test.yml/badge.svg) [![Latest Version](https://img.shields.io/pypi/v/sentimental-onix.svg)](https://pypi.python.org/pypi/sentimental-onix) [![Python Support](https://img.shields.io/pypi/pyversions/sentimental-onix.svg)](https://pypi.python.org/pypi/sentimental-onix)\n\n# Sentimental Onix\n\nSentiment Analysis using [onnx](https://github.com/onnx/onnx) for python with a focus on being [spacy](https://github.com/explosion/spaCy) compatible *and EEEEEASY to use*.\n\n**Features**\n- [x] English sentiment analysis\n- [x] Spacy pipeline component\n- [x] Sentiment model downloading from github\n\n## Install\n\n```bash\n$ pip install sentimental_onix\n# download english sentiment model\n$ python -m sentimental_onix download en\n```\n\n## Usage\n\n```python\nimport spacy\nfrom sentimental_onix import pipeline\n\nnlp = spacy.load(\"en_core_web_sm\")\nnlp.add_pipe(\"sentencizer\")\nnlp.add_pipe(\"sentimental_onix\", after=\"sentencizer\")\n\nsentences = [\n    (sent.text, sent._.sentiment)\n    for doc in nlp.pipe(\n        [\n            \"i hate pasta on tuesdays\",\n            \"i like movies on wednesdays\",\n            \"i find your argument ridiculous\",\n            \"soda with straws are my favorite\",\n        ]\n    )\n    for sent in doc.sents\n]\n\nassert sentences == [\n    (\"i hate pasta on tuesdays\", \"Negative\"),\n    (\"i like movies on wednesdays\", \"Positive\"),\n    (\"i find your argument ridiculous\", \"Negative\"),\n    (\"soda with straws are my favorite\", \"Positive\"),\n]\n\n```\n\n# Benchmark\n\n|         library|   result|\n|----------------|---------|\n|   spacytextblob|    58.9%|\n|sentimental_onix|      69%|\n \nSee [./benchmark/](./benchmark/) for info\n\n## Dev setup / testing\n\n<details><summary>expand</summary>\n\n\n### Install\n\ninstall the dev package and pyenv versions\n\n```bash\n$ pip install -e \".[dev]\"\n$ python -m spacy download en_core_web_sm\n$ python -m sentimental_onix download en\n```\n\n### Run tests\n\n```bash\n$ black .\n$ pytest -vvl\n```\n\n\n### Packaging and publishing\n\n```bash\npython3 -m pip install --upgrade build twine\npython3 -m build\npython3 -m twine upload dist/*\n```\n\n</details>\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 sloev / Johannes Valbj\u00f8rn  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "spacy pipeline component for sentiment analysis using onnx",
    "version": "0.0.2",
    "split_keywords": [
        "spacy",
        "onnx",
        "sentiment",
        "english",
        "nlp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "095db90febf1cb286b1fde87560b5366622f39c6cc2411e4e3497ab2c0902ead",
                "md5": "dc02cbea89589b7986ad8ac7d39bf5cc",
                "sha256": "0a0a2e164042b0d2079e7ea6019ef778b889eb43875204211fd3ae18e8ae1388"
            },
            "downloads": -1,
            "filename": "sentimental_onix-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dc02cbea89589b7986ad8ac7d39bf5cc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10549,
            "upload_time": "2023-03-15T21:56:51",
            "upload_time_iso_8601": "2023-03-15T21:56:51.867551Z",
            "url": "https://files.pythonhosted.org/packages/09/5d/b90febf1cb286b1fde87560b5366622f39c6cc2411e4e3497ab2c0902ead/sentimental_onix-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6f1f5dfc2d38a498f3429a01a2fd627fc9d2741c4ee69ccb4480c3e89f3d269c",
                "md5": "27d2f0aaf31c8a3dbe52fe1ee4656ac7",
                "sha256": "fe7604b86d3258aa3766aa7aa3c481511cd2e4c3f150954197d900ea28c8505a"
            },
            "downloads": -1,
            "filename": "sentimental-onix-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "27d2f0aaf31c8a3dbe52fe1ee4656ac7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 10940,
            "upload_time": "2023-03-15T21:56:53",
            "upload_time_iso_8601": "2023-03-15T21:56:53.859350Z",
            "url": "https://files.pythonhosted.org/packages/6f/1f/5dfc2d38a498f3429a01a2fd627fc9d2741c4ee69ccb4480c3e89f3d269c/sentimental-onix-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-15 21:56:53",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "sentimental-onix"
}
        
Elapsed time: 0.05178s