Metadata-Version: 2.1
Name: helasentilex
Version: 0.1.1
Summary: Python API for Sinhala Sentiment Lexicon
Home-page: https://github.com/binodmx/helasentilex
Author: Binod Karunanayake
Author-email: binod.16@cse.mrt.ac.lk
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown

# HelaSentiLex (Hela Sentiment Lexicon)
Python API for Sinhala Sentiment Lexicon with 14000+ sentiment tagged Sinhala words

### Setup environment
1. Make sure you have Python >= 3.6 by `python --version`
2. Additionally, you’ll need to make sure you have pip available by running `pip --version`
3. To install pip see [installing pip](https://pip.pypa.io/en/stable/installing/)
4. Install helasentilex package using the command `pip install helasentilex`

### Getting started
Let's begin with showing how easy it is to find sentiments of Sinhala words using helasentilex
```
>>> import helasentilex
>>> helasentilex.sentiment('යහපත්')
1
>>> helasentilex.sentiment('අමිහිරි')
-1
>>> helasentilex.sentiment('පුටුව')
0
```

If the input word does not exist in our sentiment lexicon or the input is invalid then it will return `None`
```
>>> helasentilex.sentiment(23)
None
```

You can enter a sentence as a string and get sentiment scores for available words in the sentiment lexicon
```
>>> helasentilex.sentiments('ඔබේ සැප දුක කෙසේද')
{'ඔබේ': 0, 'සැප': 1, 'දුක': -1, 'කෙසේද': None}
```

If the input is invalid then it will return an empty dictionary
```
>>> helasentilex.sentiments(23)
{}
```

### Defining labels
```
 1: POSITIVE (ධනාත්මක)
-1: NEGATIVE (ඍණාත්මක)
 0: OBJECTIVE (මධ්‍යස්ථ හෝ උදාසීන)
```


### Contributing
Want to report a bug, contribute some code, or improve documentation? Excellent! fork our repository and start 
contributing.

#### Adding new words to the sentiment lexicon
To add new words along with their sentiment scores 

1. Open `helasentilex/lexicon.csv` file
2. Append `new_word,sentiment_score`
3. Sort words in ascending order
4. Save changes to your forked repo and make a pull request

_Love helasentilex? Give our repo a **[star](https://github.com/BrainstormersLK/helasentilex)**!_


