Deepwatch

Keyboard shortcuts

Space or k
Play or pause
j and l
Back or forward 10 seconds
Left and right arrows
Back or forward 5 seconds
f
Fullscreen
m
Mute or unmute
Shift and < or >
Slower or faster
?
Show or hide this list

What is Transformers.js?

The Coding Train, 29 min, 53.3K views, Oct 25, 2025

Chapters

Show description

Welcome to a new series all about working with machine learning models in JavaScript in the browser using the Transformers.js library! In this introduction, I cover what Transformers.js is, how to load it into a p5.js sketch, explain the pipeline API, and demonstrate sentiment analysis and language detection examples. Code: https://thecodingtrain.com/tracks/transformers-js/transformers-js/introduction šŸš€ Watch this video ad-free on Nebula https://nebula.tv/videos/codingtrain-machine-learning-in-the-browser p5.js Web Editor Sketches: šŸ•¹ļø Sentiment Analysis: https://editor.p5js.org/codingtrain/sketches/JaXqVSHxM šŸ•¹ļø Language Detection: https://editor.p5js.org/codingtrain/sketches/VmS9V6-0o References: šŸ’» Transformers.js Documentation: https://huggingface.co/docs/transformers.js šŸ¤— Hugging Face: https://huggingface.co/ šŸ¤— Hugging Face Models: https://huggingface.co/models?library=transformers.js šŸ¤— Xenova on Hugging Face: https://huggingface.co/Xenova šŸ¤— Whisper Web: https://huggingface.co/spaces/Xenova/whisper-web šŸ’» p5.js 2.0 reference: https://beta.p5js.org/ šŸ““ ES6 Modules: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules šŸ““ Quantization: https://huggingface.co/docs/optimum/concept_guides/quantization Videos: šŸš‚ https://www.youtube.com/playlist?list=PLRqwX-V7Uu6YPSwT06y_AEYTqIwbeam3y šŸš‚ https://youtu.be/0Ad5Frf8NBM Timestamps: 0:00 Welcome! 1:53 Why JavaScript and not Python? 3:01 What is Hugging Face? 4:03 Transformers.js Documentation 4:18 Pipeline API 5:41 import syntax and ES6 modules 8:34 Object Destructuring 11:33 Creating a Pipeline 13:18 Sentiment Analysis Example 19:04 Tasks and Models on Hugging Face 20:20 Language Detection Example 22:27 Device: WebGPU, CPU and more 24:25 Data Types and Quantization 27:54 See you next time! Editing by Mathieu Blanchette Animations by Jason Heglund Music from Epidemic Sound šŸš‚ Website: https://thecodingtrain.com/ šŸ‘¾ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide 🚩 Suggest Topics: https://github.com/CodingTrain/Suggestion-Box šŸ’” GitHub: https://github.com/CodingTrain šŸ’¬ Discord: https://thecodingtrain.com/discord šŸ’– Membership: http://youtube.com/thecodingtrain/join šŸ›’ Store: https://standard.tv/codingtrain šŸ–‹ļø Twitter: https://twitter.com/thecodingtrain šŸ“ø Instagram: https://www.instagram.com/the.coding.train/ šŸŽ„ https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH šŸŽ„ https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA šŸ”— p5.js: https://p5js.org šŸ”— p5.js Web Editor: https://editor.p5js.org/ šŸ”— Processing: https://processing.org šŸ“„ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new #machinelearning #transformersjs #huggingface #sentimentanalysis #languagedetection #naturallanguageprocessing #pipelineapi #asyncawait #es6modules #javascript #p5js #transformersjs

When you're done