Skip to content

Tutorials

Hands-on guides for every malaysian-manglish-nlp module - from basic usage to production pipelines.


Each tutorial walks through a single capability with realistic Manglish examples, progressive complexity, and CLI usage. All code runs with zero external dependencies unless noted.


  • Sentiment Analysis


    Positive / negative / neutral with aspect-based, sarcasm-aware, and batch support.

  • Named Entity Recognition


    Extract persons, organisations, locations, and Malaysian-specific entities.

  • Translation


    BM ↔ EN ↔ Manglish with entity preservation and formal output.

  • Text Normalization


    Expand shortforms, clean noise, formalize, and correct spelling.

  • Language Detection


    Detect BM, EN, Manglish, code-switching, and 6 regional dialects.

  • Word Embeddings


    Word2Vec and FastText trained on 10M+ Malaysian texts.

  • Summarization


    Extractive summarization with TextRank and length control.

  • Question Answering


    Extractive QA with TF-IDF retrieval and Malaysian context.

  • Emotion Detection


    8 emotion categories with intensity scoring.

  • Hate Speech Detection


    6 categories, severity levels, and leetspeak evasion handling.

  • Code-Switching


    Detect switching points, switch ratio, and language segmentation.

  • Pipeline Usage


    Chain modules, batch processing, and custom workflows.

  • REST API


    FastAPI server with all endpoints, batch support, and Docker deployment.


How to Use These Tutorials

  1. Pick a module - each page is self-contained
  2. Copy the code - all examples are runnable as-is
  3. Start simple - each tutorial progresses from basic to advanced
  4. Check the CLI - every module works from the terminal too

Prerequisites

pip install malaysian-manglish-nlp           # core modules
pip install malaysian-manglish-nlp[ml]       # + transformer models
pip install malaysian-manglish-nlp[api]      # + REST API server
pip install malaysian-manglish-nlp[all]      # everything

Quick Reference

Tutorial Module CLI Dependency
Sentiment mnlp.sentiment() mnlp sentiment Core
NER mnlp.ner_tag() mnlp ner Core
Translation mnlp.translate() mnlp translate Core
Normalization mnlp.normalize() mnlp normalize Core
Language Detection mnlp.detect_language() mnlp language Core
Embeddings mnlp.word_embeddings - Core
Summarization mnlp.summarize() mnlp summarize Core
QA mnlp.qa_answer() - Core
Emotion mnlp.detect_emotion() - Core
Hate Speech mnlp.detect_hate_speech() - Core
Code-Switching mnlp.code_switching - Core
Pipeline mnlp.pipeline() mnlp analyze Core
REST API FastAPI server uvicorn [api]