Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

emotext

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emotext

emotext is a python package created for analyze sentiment it can be negative, neutral or positive

  • 0.1
  • PyPI
  • Socket score

Maintainers
1

emotext

emotext is a python library to analize sentiment it can be negative (0), positive (4) or neutral (2).

Installation

pip3 install emotext

Instructions for use

from emotext import SentimentProbability

prob = SentimentProbability()
prob.fit("positive_words.txt", "negative_words.txt", "stop_words.txt")

pred = prob.predict("hari ini sangat indah sekali")
print(pred)

# outout
# 4 or positive
namedescription
positive_words.txtput all the positive words on this file it can be in any language. in this documentation i use indonesian language,so the positive words like example : optimis, kuat, menyenangkan and etc
negative_words.txtall the negative words, example : mengganggu, menindas, kejam and etc
stop_words.txtall the stop words, example : yang, di, dan itu, etc
*note

all of those file wrote in indonesian language, it possible to change with any language. just put all of the word into .txt file and make sure 1 line for 1 word, look at example below :

# do
optimis
kuat
menyenangkan

# don't
optimis kuat menyenangkan

If you are indonesian i have created all of those file just look at folder data

warning

You don't have to worry about noise on your text like

  • omoji : 🥸 😘 🤬
  • punctuation : #?!^&*%@, etc

all of that will be removed automatically and if you grab the data from twitter it automatically remove username and hastag

Keywords

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc