Sponsorship Remover Prototype
This is the codebase for sponsorship remover/blocker.
Usage
Training
python src/python/train.py
Prediction
Python
python src/python/predict.py
Javascript
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.
Directory Guide
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