<jupyter_start><jupyter_text>List available deep learning NER models<jupyter_code>malaya.entity.available_deep_model()<jupyter_output><empty_output><jupyter_text>Describe supported entities<jupyter_code>malaya.describe_entities()
string = 'KUALA LUMPUR: Sempena sambutan Aidilfitri minggu depan, Perdana Menteri Tun Dr <NAME> dan Menter<NAME> <NAME> menitipkan pesanan khas kepada orang ramai yang mahu pulang ke kampung halaman masing-masing. Dalam video pendek terbitan Jabatan Keselamatan Jalan Raya (JKJR) itu, Dr Mahathir menasihati mereka supaya berhenti berehat dan tidur sebentar  sekiranya mengantuk ketika memandu.'<jupyter_output><empty_output><jupyter_text>Load CRF model<jupyter_code>crf = malaya.entity.crf()
crf.predict(string)<jupyter_output><empty_output><jupyter_text>Print important features from CRF model<jupyter_code>crf.print_features(10)<jupyter_output>Top-10 positive:
15.295689 person   word:pengarah
12.352726 location word:dibuat-buat
11.206675 organization word:pas
10.718764 person   word:solana
10.579257 person   word:anggodo
10.205311 location word:kenya
10.178896 time     word:jumat
10.138113 person   word:terpantas
9.938075 OTHER    word:sudah
9.896239 location word:pakistan

Top-10 negative:
-6.265843 OTHER    word:memintanya
-6.318719 OTHER    prefix-3:pah
-6.365330 time     next_word-suffix-3:nin
-6.443976 person   is_numeric
-6.508225 event    suffix-1:u
-6.535034 OTHER    prefix-3:wir
-7.109250 OTHER    prefix-3:di-
-7.176552 OTHER    word:ramadan
-7.470627 organization suffix-3:ari
-7.846867 time     next_word-prefix-1:n<jupyter_text>Print important transitions from CRF Model<jupyter_code>crf.print_transitions(10)<jupyter_output>Top-10 likely transitions:
quantity -> quantity 4.731903
location -> location 4.547566
organization -> organization 4.322757
OTHER  -> OTHER   4.267569
event  -> event   3.796581
law    -> law     3.234600
person -> person  3.178005
time   -> time    2.716374
location -> OTHER   0.057188
OTHER  -> location -0.033477

Top-10 unlikely transitions:
event  -> person  -4.618084
event  -> quantity -4.649371
time   -> law     -4.748618
organization -> event   -4.763703
event  -> location -4.995439
organization -> law     -5.343159
person -> law     -6.000496
time   -> quantity -6.551308
organization -> time    -6.602369
quantity -> time    -8.047114<jupyter_text>Load deep learning models<jupyter_code>for i in malaya.entity.available_deep_model():
    print('Testing %s model'%(i))
    model = malaya.entity.deep_model(i)
    print(model.predict(string))
    print()<jupyter_output>Testing concat model
[('kuala', 'location'), ('lumpur', 'location'), ('sempena', 'OTHER'), ('sambutan', 'event'), ('aidilfitri', 'event'), ('minggu', 'time'), ('depan', 'time'), ('perdana', 'person'), ('menteri', 'person'), ('tun', 'person'), ('dr', 'person'), ('mahathir', 'person'), ('mohamad', 'person'), ('dan', 'OTHER'), ('menteri', 'organization'), ('pengangkutan', 'organization'), ('anthony', 'person'), ('loke', 'person'), ('siew', 'person'), ('fook', 'person'), ('menitipkan', 'OTHER'), ('pesanan', 'OTHER'), ('khas', 'OTHER'), ('kepada', 'OTHER'), ('orang', 'OTHER'), ('ramai', 'OTHER'), ('yang', 'OTHER'), ('mahu', 'OTHER'), ('pulang', 'OTHER'), ('ke', 'OTHER'), ('kampung', 'OTHER'), ('halaman', 'location'), ('masing-masing', 'OTHER'), ('dalam', 'OTHER'), ('video', 'OTHER'), ('pendek', 'OTHER'), ('terbitan', 'OTHER'), ('jabatan', 'organization'), ('keselamatan', 'organization'), ('jalan', 'organization'), ('raya', 'organization'), ('jkjr', 'location'), ('itu', 'OTHER'), ('dr', 'per[...]<jupyter_text>Voting stack model<jupyter_code>entity_network = malaya.entity.deep_model('entity-network')
bahdanau = malaya.entity.deep_model('bahdanau')
luong = malaya.entity.deep_model('luong')
malaya.stack.voting_stack([entity_network, bahdanau, crf], string)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup