Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
This package performs sentiment analysis on the given texts and summarizes information from the text.
When a survey asks for written comments, it is often tedious to read through every response to extract useful information or just to get a quick summary. By using this package, responses can be quickly summarized to get a general idea of the sentiments of the comments, which can be useful such as when a PR team wants to know the overall sentiment on a company or when instructors want to know the overall sentiment on a course. The goal is to provide a quick summary that is easily interpretable by combining results from a pre-trained Python natural language processing package with the use of visualizations.
Ensure that your python version is <=3.9. To install the package, run the following.
pip install pysentimentanalyzer
This package provides the following 4 functions:
generate_wordcloud
- Create a wordcloud of the most common positive and negative words.aggregate_sentiment_score
- Calculates the overall sentiment score of the input texts.convert_to_likert
- Converts the sentiment score to a likert scale ranging from 1-5.sentiment_score_plot
- Creates a binned histogram showing count of reviews against the sentiment score.All functions take a Pandas DataFrame and string of the column name containing the texts as arguments.
See below for an example of how to use the package.
import pandas as pd
from pysentimentanalyzer.generate_wordcloud import *
from pysentimentanalyzer.get_aggregated_sentiment_score import *
from pysentimentanalyzer.likert_scale import *
from pysentimentanalyzer.sentiment_score_plot import *
df = pd.read_csv("test_tweets.csv") # assuming the csv exists in the current directory
df = df.head(200)
aggregate_sentiment_score(df, "text")
>>> -0.143
convert_to_likert(df, "text")
>>> ('neutral', 3)
sentiment_score_plot(df, "text")
wordcloud_list = generate_wordcloud(df, "text")
wordcloud_list[0]
While there exists many packages and libraries for sentiment analysis and many projects built on top of those packages, we could not find specific packages that combines the use of sentiment analysis with visualizations. However, we expect there to be many projects done by individuals that likely perform similar functions by making use of existing NLP packages. Our package aims enhance the existing NLP packages by providing a quick and simple way to generate summary visualizations. Some Python packages that perform sentiment analysis include:
This package was created by Group 8 of the DSCI 524 course with members Eric Tsai, Ranjit Sundaramurthi, Tanmay Agarwal and Ziyi Chen. Nonetheless, we welcome suggestions and improvements. See below for further details.
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
pysentimentanalyzer
was created by Eric Tsai, Ranjit Sundaramurthi, Tanmay Agarwal and Ziyi Chen. It is licensed under the terms of the MIT license.
pysentimentanalyzer
was created with cookiecutter
and the py-pkgs-cookiecutter
template.
FAQs
Perform sentiment analysis on text
We found that pysentimentanalyzer 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 malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.