Installation#

Using PIP#

Simply use PIP to install malaya,

pip3 install malaya

It will automatically all dependencies except for Tensorflow and PyTorch. So you can choose your own Tensorflow CPU / GPU version and PyTorch CPU / GPU version.

Make sure Tensorflow >= 1.15.0, and PyTorch >= 1.10.

Getting started#

[1]:
import malaya

If no error or warning, you are good to go!

Simple sentiment analysis#

[6]:
model = malaya.sentiment.transformer(model = 'tiny-albert')
[8]:
model.predict_words('Dia ni dlm pemerhatian kita,,,bole dkatakn "gertak kuat",,,bhsa utra kta "gempaq kuat",', bins_size = 0.01)