This project is part of a scholarship submission. The goal is to perform sentiment analysis using IndoBERT and various machine learning algorithms to achieve maximum accuracy. The dataset used in this project was scraped from the Google Play Store.
The repository is organized as follows:
data/: Contains the scraped dataset.notebooks/: Jupyter notebooks used for data exploration, preprocessing, and modeling.src/: Source code for data preprocessing, feature extraction, and model training.models/: Saved models and results.README.md: Project documentation.
The dataset consists of reviews scraped from the Google Play Store. It includes reviews in Indonesian, along with their corresponding sentiment labels (positive, negative, neutral).
- Text Cleaning: Removal of HTML tags, special characters, and other noise.
- Tokenization: Splitting text into words or subwords.
- Stopwords Removal: Removal of common words that do not contribute much to the sentiment.
- Case Folding: to lowercase.
- toSentence: merge bunchs of words to sentence.
- TF-IDF: Term Frequency-Inverse Document Frequency used to convert text to numerical features.
- Word Embeddings: Using IndoBERT to obtain contextual word embeddings.
- IndoBERT: Fine-tuning IndoBERT for sentiment classification.
- Machine Learning Algorithms: Training models like Random Forest, SVM, and Logistic Regression on the extracted features.
The results of the project are as follows:
- IndoBERT: Achieved an accuracy of >96%
- Random Forest: Achieved an accuracy of >90%
- SVM: Achieved an accuracy of >91%
- Logistic Regression: Achieved an accuracy of >91%
- Voting Classifer: Achieved an accuracy of >92%
To run this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/sentiment-analysis-indobert-ml.git cd sentiment-analysis-indobert-ml -
Install the required packages:
pip install -r requirements.txt
-
Download the dataset (if not included in the repository) and place it in the
data/directory.
To train the models and evaluate their performance, run the notebooks in the notebooks/ directory in the following order:
Scraping_Dataset.ipynbSentiment-NLP-IndoBert.ipynb.ipynb