How I Used Data Journalism and NLP to Analyze Public Opinion on a Viral Political Debate
The project analyzes 8,062 YouTube comments regarding Indonesian political figure Dedi Mulyadi (KDM) using a data journalism workflow to uncover public sentiment and narrative themes. Natural Language Processing (NLP) is utilized as a tool for evidence-based investigation rather than an end goal, focusing on extracting stories from large-scale text data. Data collection was automated via the YouTube Data API v3, capturing metadata such as usernames, timestamps, and engagement metrics alongside c
Analysis
TL;DR
- The project analyzes 8,062 YouTube comments regarding Indonesian political figure Dedi Mulyadi (KDM) using a data journalism workflow to uncover public sentiment and narrative themes.
- Natural Language Processing (NLP) is utilized as a tool for evidence-based investigation rather than an end goal, focusing on extracting stories from large-scale text data.
- Data collection was automated via the YouTube Data API v3, capturing metadata such as usernames, timestamps, and engagement metrics alongside comment text.
- Text preprocessing involved rigorous cleaning including deduplication, lowercasing, tokenization, slang normalization, stopword removal, and stemming using the Sastrawi library for Indonesian language processing.
- The analysis aims to determine if public discourse focuses on policies, personalities, or media narratives without taking a political stance on the correctness of the subjects involved.
Why It Matters
This case study demonstrates the practical application of NLP in social science and political analysis, showing how practitioners can move beyond simple accuracy metrics to investigate complex human behaviors and societal trends at scale. It highlights the importance of domain-specific text preprocessing (such as handling Indonesian slang and morphology) which is critical for effective sentiment analysis in non-English contexts. Furthermore, it reinforces the value of the data journalism methodology—starting with a specific investigative question—to ensure that technical efforts yield actionable insights about public opinion rather than just model performance.
Technical Details
- Dataset: A collection of 8,062 comments generated by 7,409 unique users from a Tempo YouTube video discussing Governor Dedi Mulyadi.
- Data Acquisition: Utilized the YouTube Data API version 3 to programmatically retrieve comment threads, user handles, like counts, and publication timestamps, ensuring reproducibility compared to manual scraping.
- Preprocessing Pipeline: Implemented a multi-step cleaning process specifically tailored for informal social media text, including removing duplicates, converting to lowercase, tokenizing strings, normalizing repetitive characters and internet slang, filtering stopwords, and applying lemmatization/stemming via the Sastrawi library alongside NLTK utilities.
- Analytical Framework: Followed a structured data journalism workflow involving story ideation, data collection, preparation, analysis, visualization, and narrative construction to answer questions regarding sentiment polarity (supportive vs. critical), dominant emotions, and recurring topics within the discourse.
Industry Insight
AI professionals should recognize that successful deployment of NLP in real-world scenarios often requires significant investment in domain-specific data cleaning and linguistic adaptation, particularly when dealing with colloquial languages or regional dialects where standard models may fail. Adopting a "question-first" approach, similar to data journalism, helps align technical capabilities with business or societal goals, ensuring that machine learning projects deliver meaningful interpretability and impact rather than merely optimizing abstract performance scores. Additionally, leveraging public APIs for data extraction offers a scalable and ethical method for gathering large volumes of conversational data while maintaining compliance with platform terms of service.
Disclaimer: The above content is generated by AI and is for reference only.