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#

import malaya

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

Simple sentiment analysis#

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