What is Transformers.js?
Summary
This video introduces the Transformers.js library, demonstrating how to implement machine learning models like sentiment analysis and language detection directly in the browser using JavaScript and p5.js. It's highly useful for students and educators who want to learn practical AI/ML development and understand how AI models can be integrated into web applications.
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




