This is the codebase for sponsorship remover/blocker.
python src/python/train.py
python src/python/predict.py
node src/javascript/predict.js
To try the extension, go to chrome://extensions/
and load the unpacked directory ./src/javascript/extension/chrome
.
You can see how it works here.
root/
βββ dataset/
β βββ data.csv : CSV file of sponsored (0) and non-sponsored (1) sequences
βββ output/
β βββ model.h5 : Keras model
β βββ js/
β β βββ ... : Tensorflow.js model
β βββ misc
β βββ word_index.json : Dictionary mapping unique words to token
βββ src/
βββ python/
β βββ predict.py : Runs a prediction on a trained model stored in output/
β βββ train.py : Trains a model and saves in output/
β βββ sponsorship_remover/
β β βββ ... : Internal functions used by predict.py & train.py
β βββ transcript_server
β βββ ... : Simple flask web server that wraps YouTubeTranscriptApi
βββ javascript/
βββ predict.py : Javascript implementation of predict.py using tf.js
βββ extension/
βββ chrome/
βββ manifest.json : Metadata for chrome extension
βββ popup.html : HTML template (with Vue.js) for extension popout
βββ js
β βββ content.js : Deployed within browser, contains code to handle predictions
β βββ popup.js : Logic for popup.html
β βββ libs
β βββ ... : Deployed dependencies
βββ style
βββ ... : Misc style files including CSS for popup.html