
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
This is a library for sentiment analysis in dictionary framework. Two dictionaries are provided in the library, namely, Harvard IV-4 and Loughran and McDonald Financial Sentiment Dictionaries, which are sentiment dictionaries for general and financial sentiment analysis.
See also http://www.wjh.harvard.edu/~inquirer/ and https://www3.nd.edu/~mcdonald/Word_Lists.html .
Positive
and Negative
are word counts for the words in positive and negative sets.
Polarity
and Subjectivity
are calculated in the same way of Lydia system.
See also http://www.cs.sunysb.edu/~skiena/lydia/
pip install pysent3
import pysent3
To use the Harvard IV-4 dictionary, create an instance of the HIV4
class
import pysent3 as ps
hiv4 = ps.HIV4()
tokens = hiv4.tokenize(text) # text can be tokenized by other ways
# however, dict in HIV4 is preprocessed
# by the default tokenizer in the library
score = hiv4.get_score(tokens)
HIV4
is a subclass for pysentiment3.base.BaseDict
. BaseDict
can be inherited by
implmenting init_dict
to initialize _posset
and _negset
for the dictionary
to calculate 'positive' or 'negative' scores for terms.
Similarly, to use the Loughran and McDonald dictionary:
import pysent3 as ps
lm = ps.LM()
tokens = lm.tokenize(text)
score = lm.get_score(tokens)
Largely based on pysentiment2
created by Nick DeRobertis and based on pysentiment
by Zhichao Han. GNU GPL License.
FAQs
Sentiment Analysis in Python using a Dictionary Approach
We found that pysent3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.