Cross-Topic Sentiment Transfer in YouTube Comment Classification: Replication Package
Replication package for the study "Does Sentiment Transfer? Label Granularity and Cross-Topic Generalisation in YouTube Comment Classification". The study evaluates how much sentiment-classification accuracy survives when a model is applied to a topic it was not trained on, and how that cost compares with the cost of predicting more sentiment classes. It uses 34,305 English YouTube comments collected under a single protocol across three domains — artificial intelligence and job displacement, electric vehicle adoption, and the global energy crisis — drawn from 204 videos. One lexicon labelling pass (VADER) is expressed at three granularities (binary, ternary, and a four-class graded scheme), and eleven models spanning classical machine learning, deep learning and transformer architectures are evaluated under four transfer conditions using video-disjoint, size-equalised splits. Principal findings: pretrained transformers lead in-domain (0.807 mean accuracy at three classes, against 0.641 for classical models) and also degrade least under topic shift, retaining 97.8% of in-domain accuracy versus 94.9%; deep models trained from scratch improve on neither axis. Moving from two to four classes costs 0.249 accuracy while changing topic costs 0.028, making label granularity roughly nine times the more binding constraint. Finally, the apparent ease of cross-topic transfer is shown to be partly an artefact of lexicon labelling: the three corpora are lexically distant (proxy A-distance 1.42-1.69, vocabulary Jaccard overlap 0.18-0.24) yet receive nearly identical label distributions (Jensen-Shannon divergence below 0.003), so what transfers is the labelling rule rather than topic-grounded sentiment. CONTENTS. Full analysis pipeline (data collection, preprocessing, lexicon labelling, classical and neural experiments, figure generation); a Colab notebook for the neural arm; all result tables; publication figures at 300 dpi and as vector PDF; run logs and QA report; the manuscript draft; a manuscript-preparation specification; and a dehydrated dataset of 34,305 rows. DATA AVAILABILITY. The dataset is distributed in dehydrated form: it contains stable comment and video identifiers, all derived labels and features, and the lexicon scores, but not the comment text. Redistributing YouTube comment text is restricted by the platform's terms and the comment authors did not consent to republication. The included script rehydrate.py restores the text from the YouTube Data API using the reader's own credentials (approximately 700 quota units). No API keys, cached API responses, or author identifiers are included in this package. This work extends the authors' prior study, D. Hidayatullah, H. G. Musa, A. Ramadhan, T. N. Fahrozi and A. Z. Firlaudy, "Global Energy Crisis Sentiment: A Comparative AI Study on Imbalanced Data," 2026 IEEE International Conference on Signals and Systems (ICSigSys), pp. 154-160, doi:10.1109/ICSigSys71160.2026.11613899. The energy-crisis domain is deliberately shared with that study; the comments analysed here were independently re-collected and none of the earlier corpus is reused.