Skip to main content

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

Project description

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
name description
positive_words.txt put 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.txt all the negative words, example : mengganggu, menindas, kejam and etc
stop_words.txt all 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

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emotext-0.1.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file emotext-0.1.tar.gz.

File metadata

  • Download URL: emotext-0.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6

File hashes

Hashes for emotext-0.1.tar.gz
Algorithm Hash digest
SHA256 55672058889180ad6ecd17a079fefe727e1026765fba1267afc79381e8dacb80
MD5 98d263f500a9c53f2dce7b585dfbafd0
BLAKE2b-256 9711332c38a0f1ad6c6e44f504af543aa0eeb50eea65e21a129b44c49e428b3a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page