Spacy extension for sentiment polarity
Project description
spacy-polarity
Measure sentiment polarity of sentences and documents
Installation
pip install spacy-polarity
Usage
import spacy
import spacy_polarity
nlp = spacy.load("en_core_web_sm")
nlp.add_pipe("spacy_polarity")
doc = nlp("The financial markets are performing well, bringing good returns to investors. The stock markets in USA grew by 5% this year.")
# Sentence level polarity
for sent in doc.sents:
print(sent._.polarity)
# Document level polarity
print(doc._.polarity)
Development
Style and linting
ruff check
ruff format
Testing
pip install ".[test]"
pytest -vvv
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
spacy_polarity-0.1.2.tar.gz
(3.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spacy_polarity-0.1.2.tar.gz.
File metadata
- Download URL: spacy_polarity-0.1.2.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25c1b3c7026ae422e267929d114b18ed56689bbd54c88054be5c27516bbcf226
|
|
| MD5 |
7408b621a7adf9fa2e92e68594525e29
|
|
| BLAKE2b-256 |
d10a8443128c9c10f636573e34f4308d3f0369acd8c2cb3407657dd135842240
|
File details
Details for the file spacy_polarity-0.1.2-py3-none-any.whl.
File metadata
- Download URL: spacy_polarity-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38cc772d37e51f0718c832a749d582ed210539a1d9d9db3b69767807a7dccf8a
|
|
| MD5 |
f9c50c5535a5012f4f88c16fcef945ad
|
|
| BLAKE2b-256 |
ff1444c6cd29d413d231c12daa67dcf2a76318e929c0167f1b898455f59f12e6
|