KomDetek: Cyberbullying Detection in TikTok Comments
A Natural Language Processing (NLP) project built with Python to analyze sentiment and automatically detect cyberbullying behavior within TikTok comments.
๐ Project Overview
KomDetek (Komentar Deteksi) is a Machine Learning and Natural Language Processing (NLP) project designed to tackle a growing issue in the digital age: online toxicity. Specifically focusing on the popular short-video platform TikTok, this project analyzes user comments to identify and classify cyberbullying and negative sentiment in the Indonesian language.
โLeveraging Machine Learning to foster safer and more positive digital communities on social media.โ
๐ฏ Mission
To build a robust sentiment analysis classification model capable of understanding Indonesian internet slang, effectively distinguishing between normal commentary and harmful cyberbullying.
โจ Key Features & Methodology
๐ง Natural Language Processing (NLP)
- ๐งน Text Preprocessing - Advanced cleaning of raw TikTok comments (removing emojis, special characters, URLs, and transforming text to lowercase).
- ๐ Stopword Removal & Stemming - Utilizing NLP libraries to extract the root words and remove non-essential vocabulary.
- ๐ Slang Normalization - Processing Indonesian internet slang into structured formats for better model understanding.
๐ค Machine Learning Pipeline
- ๐ข Feature Extraction - Transforming text data into numerical vectors using techniques like TF-IDF (Term Frequency-Inverse Document Frequency) or Count Vectorizer.
- ๐ Model Training - Training classification models to accurately categorize comments into specific sentiment classes.
- ๐ Performance Evaluation - Assessing model reliability using metrics like Accuracy, Precision, Recall, and F1-Score, complete with visual confusion matrices.
๐ ๏ธ Technology Stack
| Category | Technology | Purpose |
|---|---|---|
| Language | Python 3 | 100% Core development language |
| Environment | Google Colab | Cloud-based Jupyter environment for ML |
| Data Manipulation | Pandas, NumPy | Data structuring and numerical computation |
| NLP Processing | NLTK, Sastrawi | Text processing for Bahasa Indonesia |
| Machine Learning | Scikit-Learn | Model building, training, and evaluation |
| Data Visualization | Matplotlib, Seaborn | Visualizing distributions and metrics |
๐๏ธ The Machine Learning Architecture
NLP Data Pipeline
1
2
3
4
5
6
7
8
9
๐ก๏ธ KomDetek Workflow
โโโ ๐ฅ 1. Data Collection (Raw TikTok comments dataset)
โโโ ๐งน 2. Text Preprocessing
โ โโโ Case Folding & Cleansing
โ โโโ Tokenization
โ โโโ Stopword Removal & Stemming
โโโ ๐งฎ 3. Feature Extraction (Text to Vector)
โโโ ๐ค 4. Model Training (Classification Algorithms)
โโโ ๐ 5. Evaluation (Confusion Matrix & Accuracy Scores)
๐ How to Run the Project
Since this project is fully developed in Google Colaboratory, you can easily run and interact with the code without installing anything locally!
- Open the Notebook: Click the Open in Colab button at the top of this page.
- Copy to Drive: Go to
File > Save a copy in Driveso you can make your own edits. - Run the Cells: Click
Runtime > Run allto execute the data pipeline from preprocessing to model evaluation.
(Alternatively, you can clone the GitHub Repository and run the .ipynb file locally using Jupyter Notebook).
๐ Future Development Plans
| Phase | Feature | Timeline | Status |
|---|---|---|---|
| Phase 1 | ๐ Data Collection & Preprocessing Pipeline | Completed | โ Finished |
| Phase 2 | ๐ค Machine Learning Model Training | Completed | โ Finished |
| Phase 3 | ๐ธ๏ธ Web Interface / Dashboard Deployment | Planned | ๐ Planned |
| Phase 4 | ๐ง Deep Learning Integration (LSTM / BERT) | Planned | ๐ญ Concept |
๐ Project Highlights
Key Achievements
- โ Cloud-Native Development - Successfully utilized Google Colab for seamless model training and experimentation.
- โ High-Quality Preprocessing - Handled the complex, unstructured nature of social media text (TikTok comments) using robust normalization techniques.
- โ Accurate Classification - Built a model capable of distinguishing toxic behavior with high reliability.
๐ก Conclusion
KomDetek proves that Machine Learning can be a powerful ally in the fight against online toxicity. By accurately detecting cyberbullying in TikTok comments, this project demonstrates a complete end-to-end Natural Language Processing pipeline.
By leveraging cloud environments like Google Colab, the barrier to reproducing this research is eliminated, allowing anyone to explore the modelโs logic step-by-step. This project lays the groundwork for automated moderation tools that can help creators and platforms maintain a healthy, positive environment for their users.
๐ Links & Resources
Developed with โค๏ธ by aipunpratama
