Skip to content

NicGian/SentITA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SentITA

Sentiment polarity classification in Italian

This fork of SentITA has been tested with Tensorflow 2.0.0 and Spacy 2.3.2 with the models for Italian. Once installed Spacy it's necessary to run "python -m spacy download it_core_news_sm" to download the models for Italian.

How to install Sentita:

  1. Dowload Sentita from this link
  2. Unzip the archive
  3. cd into the unzipped folder from the console
  4. type in the console "pip install ." to install the package locally

How to use Sentita:

  1. Import the function to calculate the polarity scores with the following code:
from sentita import calculate_polarity
  1. Define your sentences as a list. e.g.:
sentences = ["il film era interessante",
"il cibo è davvero buono",
"il posto era davvero accogliente e i camerieri simpatici, consigliato!"]
  1. Estimate the sentence polarity by running:
results, polarities = calculate_polarity(sentences)

"results" is a list of strings with the sentence, the positive polarity score and the negative polarity scores. "polarities" is a list of lists with the positive and negative polarity score for each sentence, e.g.:

  • polarities[0][0] contains the positive polarity score of the 1st sentence
  • polarities[2][0] contains the positive polarity score of the 3rd sentence
  • polarities[2][1] contains the negative polarity score of the 3rd sentence

About

Sentiment polarity classification in Italian

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages