
What is Transformers.js?
The Coding Train, 29 min, 53.3K views, Oct 25, 2025
Chapters
Show descriptionHide 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