Skip to main content

Python-SentiStrength

Python 3 Wrapper for SentiStrength.

Note: This package has the SentiStrength JAR file built in to simplify access. However, the original author did not release the JAR free for commercial use. If you are using this for commercial purposes, please email the original author Dr. Mike Thelwall to buy the commercial license. More details about licensing at (http://sentistrength.wlv.ac.uk/).

Installation

You have to install python >= 3.7 and java JRE >= 1.8.0 first. Then, install this library with pip.

pip install pysenti

Examples

Single string example:

import pysenti

s = pysenti.get_senti('What a lovely day')
# SentiResult(positive=2, negative=-1, neutral=1)

s.scale()
# 1
s.is_positive()
# True

Multiple strings example:

If you have a list of strings, please use this function and don't call get_senti in a loop. This is because this function only opens one subprocess to process all strings in the list, whereas get_senti opens a new subprocess every time.

import pysenti

pysenti.get_senti_list(['What a lovely day', 'I love cats'])

Acknowledgments

  • Big thanks to Dr. Mike Thelwall for access to SentiStrength.

Metadata

Release files for PySentiStrength 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PySentiStrength 1.0.1
File Size Uploaded
PySentiStrength-1.0.1.tar.gz 5.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for PySentiStrength 1.0.1
File Interpreter ABI Platform
PySentiStrength-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.8 MB

Release files / PySentiStrength-1.0.1.tar.gz

Download URL PySentiStrength-1.0.1.tar.gz
Size 5.9 MB
Tags Source
SHA-256 checksum
How to use checksums
309d080a17da59ec0fea5ea483a896bcb727cc9f203ca782de1e4881bd6eb3b1
BLAKE2b-256 checksum
How to use checksums
3d8b780c9fe441a8b77e01bfa73e7b3c2e6c27a28376705d6a93cec68f623369
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

Release files / PySentiStrength-1.0.1-py3-none-any.whl

Download URL PySentiStrength-1.0.1-py3-none-any.whl
Size 5.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4ee7987d622cce9e2a56af80aaeb6219bc2ca997e18c8cab44b4123fdf9fcf83
BLAKE2b-256 checksum
How to use checksums
1789efaa125ecc30abaeaf04dd87982b974b58f67976593bb1ed0daa5b52cb57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page