Python 3 Wrapper for SentiStrength
Project description
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.
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
Built Distribution
File details
Details for the file PySentiStrength-1.0.1.tar.gz
.
File metadata
- Download URL: PySentiStrength-1.0.1.tar.gz
- Upload date:
- Size: 5.9 MB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 309d080a17da59ec0fea5ea483a896bcb727cc9f203ca782de1e4881bd6eb3b1 |
|
MD5 | 5e4ee71b11dba611cb2d912dce5a316b |
|
BLAKE2b-256 | 3d8b780c9fe441a8b77e01bfa73e7b3c2e6c27a28376705d6a93cec68f623369 |
File details
Details for the file PySentiStrength-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: PySentiStrength-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.9 MB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ee7987d622cce9e2a56af80aaeb6219bc2ca997e18c8cab44b4123fdf9fcf83 |
|
MD5 | 7c7937c179ceb74f41fe319cae06564a |
|
BLAKE2b-256 | 1789efaa125ecc30abaeaf04dd87982b974b58f67976593bb1ed0daa5b52cb57 |