Skip to main content

Spacy extension for sentiment polarity

Project description

spacy-polarity

pyversion

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


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)

Uploaded Source

Built Distribution

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

spacy_polarity-0.1.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

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

Hashes for spacy_polarity-0.1.2.tar.gz
Algorithm Hash digest
SHA256 25c1b3c7026ae422e267929d114b18ed56689bbd54c88054be5c27516bbcf226
MD5 7408b621a7adf9fa2e92e68594525e29
BLAKE2b-256 d10a8443128c9c10f636573e34f4308d3f0369acd8c2cb3407657dd135842240

See more details on using hashes here.

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

Hashes for spacy_polarity-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 38cc772d37e51f0718c832a749d582ed210539a1d9d9db3b69767807a7dccf8a
MD5 f9c50c5535a5012f4f88c16fcef945ad
BLAKE2b-256 ff1444c6cd29d413d231c12daa67dcf2a76318e929c0167f1b898455f59f12e6

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