This project explores text analysis tasks using the NusaX dataset, a multilingual corpus for Indonesian and Javanese languages. The focus is on two key NLP tasks:
- Machine Translation: Translating between Indonesian-English and Indonesian-Javanese using pre-trained models.
- Sentiment Analysis: Implementing classical and advanced machine learning models for sentiment classification of Indonesian text.
- Machine Translation Models:
- Helsinki-NLP/opus-mt-id-en: Pre-trained model for Indonesian-English translation.
- IndoBenchmark/IndoBART: Pre-trained model for Indonesian-Javanese translation.
- Sentiment Analysis Models:
- Classical Models: SVM, MLP, and Word2Vec embeddings.
- Pretrained Models: VADER and RoBERTa.
Ensure you have the following libraries installed:
scikit-learntorchtransformersnltkgensimmatplotlib
Run this in a cell within the Jupyter Notebook to install all dependencies:
!pip install scikit-learn torch transformers nltk gensim matplotlib- Download the NusaX dataset from its official repository.
- Organize the dataset into:
- Machine Translation: Pairwise datasets for Indonesian-English and Indonesian-Javanese.
- Sentiment Analysis: Labeled datasets for sentiment classification in Indonesian.
Run the machine translation cells in the notebook to:
- Perform translations using the following models:
- Indonesian-English:
Helsinki-NLP/opus-mt-id-en. - Indonesian-Javanese:
IndoBenchmark/IndoBART.
- Indonesian-English:
Run the sentiment analysis cells in the notebook to:
- Train and evaluate the following models:
- Classical Models: SVM, MLP.
- Transformer-Based Models: RoBERTa and other pretrained models.
- Visualize confusion matrices and accuracy trends for sentiment analysis models.
- Evaluate BLEU scores for machine translation tasks.
| Model | Translation Task | BLEU Score |
|---|---|---|
| Helsinki-NLP/opus-mt-id-en | Indonesian to English | 32.4 |
| IndoBenchmark/IndoBART | Indonesian to Javanese | 27.8 |
| Model | Accuracy | Precision (Macro Avg) | Recall (Macro Avg) | F1-Score (Macro Avg) |
|---|---|---|---|---|
| SVM | 79% | 0.77 | 0.77 | 0.77 |
| MLP | 77% | 0.78 | 0.75 | 0.76 |
| VADER | 37.25% | 0.16 | 0.33 | 0.19 |
| Word2Vec + SVM | 48% | 0.43 | 0.39 | 0.39 |
- Helsinki-NLP. opus-mt-id-en. Hugging Face. Retrieved from https://huggingface.co/Helsinki-NLP/opus-mt-id-en.
- IndoBenchmark. IndoBART. Hugging Face. Retrieved from https://huggingface.co/indobenchmark/indobart.
- IndoNLP. NusaX: Multilingual Parallel Corpus for Indonesian Local Languages. GitHub. Retrieved from https://github.com/IndoNLP/nusax.
- Expand analysis to include additional local languages supported by NusaX.
- Fine-tune transformer models with a more diverse and larger dataset for improved sentiment classification.
- Optimize models for computational efficiency to enable broader deployment in resource-constrained environments.
This project was made possible through the use of pre-trained models and datasets available on Hugging Face and the NusaX repository.