Python Thai sentiment analysis (For Dev only)
$ pip install https://github.com/PyThaiNLP/thai_sentiment_analysis/archive/master.zip
Google Colab : https://colab.research.google.com/drive/17y4tc69O6Z-dr1LbgR5FlPYZK46xCKbY
from pythaisa import *
datatrain=[("ฉันรักคุณ","love"),("ผมก็รักคุณเหมือนกัน","love"),("เกลียดคุณ","neg"),("เกลียดเหมือนกัน","neg")]
m=model(name="test",train_dataset=datatrain)
m.train()
print(m.predict("ฉันรักคุณ"))
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)
Model().train()
Model().predict(text)