Skip to main content
AmigoFish

What is Transformers.js?

From The Coding Train ยท ยท 29 min

The player loads from YouTube only when you click. It uses YouTube's privacy-enhanced mode.

If the video does not play, the owner may have turned off embedding. Watch it on YouTube instead.

Watch on YouTube

Not rated yet

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

Back to The Coding Train ยท Report a problem

What is Transformers.js? | The Coding Train | AmigoFish