Using PIP#

Simply use PIP to install malaya,

pip3 install malaya

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

Make sure PyTorch >= 1.10.

Getting started#

import malaya
/home/husein/dev/malaya/malaya/ FutureWarning: Possible nested set at position 3397
  self.tok = re.compile(r'({})'.format('|'.join(pipeline)))
/home/husein/dev/malaya/malaya/ FutureWarning: Possible nested set at position 3927
  self.tok = re.compile(r'({})'.format('|'.join(pipeline)))

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

Simple sentiment analysis#

model = malaya.sentiment.huggingface()
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
model.predict(['Dia ni dlm pemerhatian kita,,,bole dkatakn "gertak kuat",,,bhsa utra kta "gempaq kuat",'])