spacy-onnx-sentiment-english


Namespacy-onnx-sentiment-english JSON
Version 0.0.2 PyPI version JSON
download
home_page
Summaryspacy pipeline component for english sentiment analysis using onnx
upload_time2023-03-14 23:35:01
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/spacy_onnx_sentiment_english/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/spacy_onnx_sentiment_english/actions/workflows/test.yml/badge.svg) [![Latest Version](https://img.shields.io/pypi/v/spacy_onnx_sentiment_english.svg)](https://pypi.python.org/pypi/spacy_onnx_sentiment_english) [![Python Support](https://img.shields.io/pypi/pyversions/spacy_onnx_sentiment_english.svg)](https://pypi.python.org/pypi/spacy_onnx_sentiment_english)

# spacy sentiment english 


English sentiment component for spacy 2x and 3x

annotates sentences with negative, neutral, positive sentiment using a onnx model

## install

```bash
pip install spacy_onnx_sentiment_english
```

## usage

```python
import pytest
import spacy
from spacy_onnx_sentiment_english import OnnxSentimentEnglish

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

sentences = [
    (sent.text, sent._.onnx_sentiment_en)
    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

### install

install the dev package and pyenv versions

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

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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "spacy-onnx-sentiment-english",
    "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/ca/48/5d0c1dd5208bcdd61358a6fd85124988ca0f58348bb697ce73817fe0538a/spacy_onnx_sentiment_english-0.0.2.tar.gz",
    "platform": null,
    "description": "![spacy syllables](https://raw.githubusercontent.com/sloev/spacy_onnx_sentiment_english/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/spacy_onnx_sentiment_english/actions/workflows/test.yml/badge.svg) [![Latest Version](https://img.shields.io/pypi/v/spacy_onnx_sentiment_english.svg)](https://pypi.python.org/pypi/spacy_onnx_sentiment_english) [![Python Support](https://img.shields.io/pypi/pyversions/spacy_onnx_sentiment_english.svg)](https://pypi.python.org/pypi/spacy_onnx_sentiment_english)\n\n# spacy sentiment english \n\n\nEnglish sentiment component for spacy 2x and 3x\n\nannotates sentences with negative, neutral, positive sentiment using a onnx model\n\n## install\n\n```bash\npip install spacy_onnx_sentiment_english\n```\n\n## usage\n\n```python\nimport pytest\nimport spacy\nfrom spacy_onnx_sentiment_english import OnnxSentimentEnglish\n\nnlp = spacy.load(\"en_core_web_sm\")\nnlp.add_pipe(\"sentencizer\")\nnlp.add_pipe(\"onnx_sentiment_en\", after=\"sentencizer\")\n\nsentences = [\n    (sent.text, sent._.onnx_sentiment_en)\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## Dev setup / testing\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```\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",
    "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 english sentiment analysis using onnx",
    "version": "0.0.2",
    "split_keywords": [
        "spacy",
        "onnx",
        "sentiment",
        "english",
        "nlp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eef69e492fc46172c6b6a2a3f7411c4e177f267369c7344fdf9ac84501f08d11",
                "md5": "01d6d46319dc7ad37a4da9f43f40ab1f",
                "sha256": "83614bd82021b3b853c5538c1676b7e429a743d2f50d8c60ac2d3a33a7a60d4d"
            },
            "downloads": -1,
            "filename": "spacy_onnx_sentiment_english-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "01d6d46319dc7ad37a4da9f43f40ab1f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 9928,
            "upload_time": "2023-03-14T23:34:59",
            "upload_time_iso_8601": "2023-03-14T23:34:59.007625Z",
            "url": "https://files.pythonhosted.org/packages/ee/f6/9e492fc46172c6b6a2a3f7411c4e177f267369c7344fdf9ac84501f08d11/spacy_onnx_sentiment_english-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ca485d0c1dd5208bcdd61358a6fd85124988ca0f58348bb697ce73817fe0538a",
                "md5": "d6f5b68610333c5cad337576d0008cf1",
                "sha256": "f7767fd3c2a270ff6aba678c3687a76590cf83d19e6b78c2151acc4b64d3daf9"
            },
            "downloads": -1,
            "filename": "spacy_onnx_sentiment_english-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d6f5b68610333c5cad337576d0008cf1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 10235,
            "upload_time": "2023-03-14T23:35:01",
            "upload_time_iso_8601": "2023-03-14T23:35:01.493721Z",
            "url": "https://files.pythonhosted.org/packages/ca/48/5d0c1dd5208bcdd61358a6fd85124988ca0f58348bb697ce73817fe0538a/spacy_onnx_sentiment_english-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-14 23:35:01",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "spacy-onnx-sentiment-english"
}
        
Elapsed time: 0.04890s