https://github.com/pythainlp/thai-sentiment-analysis
Thai sentiment analysis
https://github.com/pythainlp/thai-sentiment-analysis
sentiment-analysis thai thai-language thai-nlp
Last synced: 24 days ago
JSON representation
Thai sentiment analysis
- Host: GitHub
- URL: https://github.com/pythainlp/thai-sentiment-analysis
- Owner: PyThaiNLP
- License: apache-2.0
- Created: 2018-03-14T06:17:14.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-09-27T16:36:03.000Z (over 6 years ago)
- Last Synced: 2025-04-06T23:18:11.943Z (about 1 year ago)
- Topics: sentiment-analysis, thai, thai-language, thai-nlp
- Language: Python
- Size: 29.3 KB
- Stars: 14
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python Thai Sentiment Analysis (PyThaiSA)
[](https://travis-ci.org/PyThaiNLP/thai-sentiment-analysis)
[](https://coveralls.io/github/PyThaiNLP/thai-sentiment-analysis?branch=master)
Python Thai sentiment analysis **(For Dev only)**
## Install
```
$ pip install https://github.com/PyThaiNLP/thai_sentiment_analysis/archive/master.zip
```
## Use
Google Colab : https://colab.research.google.com/drive/17y4tc69O6Z-dr1LbgR5FlPYZK46xCKbY
```python
from pythaisa import *
datatrain=[("ฉันรักคุณ","love"),("ผมก็รักคุณเหมือนกัน","love"),("เกลียดคุณ","neg"),("เกลียดเหมือนกัน","neg")]
m=model(name="test",train_dataset=datatrain)
m.train()
print(m.predict("ฉันรักคุณ"))
```
## Docs
```python
Model(name,model_type="naive_bayes",train_dataset=None,test_dataset=None,
path=None,features=basic_features)
```
- ```name``` is model name.
- ```model_type``` is type of model. (Now,)
- ```train_dataset``` is train dataset. ```[(text,tag),...]```
- ```test_dataset``` is test dataset. ```[(text,tag),...]```
- ```path``` is model path.
- ```features``` is features function. (function input string and output is dict)
### Trian
```python
Model().train()
```
### Predict
```python
Model().predict(text)
```