<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Victor Muštar</title>
    <description>The latest articles on DEV Community by Victor Muštar (@gary149).</description>
    <link>https://dev.to/gary149</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F823054%2F7c0d81c5-d349-427b-a6f3-331d8f70f3cb.jpeg</url>
      <title>DEV Community: Victor Muštar</title>
      <link>https://dev.to/gary149</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gary149"/>
    <language>en</language>
    <item>
      <title>How to use machine learning in your JS applications</title>
      <dc:creator>Victor Muštar</dc:creator>
      <pubDate>Mon, 28 Feb 2022 15:38:07 +0000</pubDate>
      <link>https://dev.to/gary149/how-to-use-machine-learning-in-your-js-applications-462p</link>
      <guid>https://dev.to/gary149/how-to-use-machine-learning-in-your-js-applications-462p</guid>
      <description>&lt;p&gt;Maybe, like me, you always &lt;strong&gt;wanted to use machine learning in your JS applications&lt;/strong&gt;: you had some problems you think ML could solve (like summarization, sentiment analysis, object detection in images, etc, etc...) or you just wanted to have fun. &lt;/p&gt;

&lt;p&gt;But the need to learn python, Machine Learning, and the whole ML stack is pulling you away. Building a good front-end is already hard enough...&lt;/p&gt;

&lt;p&gt;So here is a &lt;strong&gt;super easy way to use machine learning in your apps&lt;/strong&gt; (through the Hugging Face inference API, note that &lt;a href="https://huggingface.co/pricing"&gt;the free-tier&lt;/a&gt; is quite generous). &lt;/p&gt;

&lt;p&gt;Start by choosing a model here: &lt;a href="https://huggingface.co/models"&gt;hf.co/models&lt;/a&gt; (+30k available models, a lot of them state-of-the-art). If you don't know which one to choose you can start by checking the different &lt;a href="https://huggingface.co/tasks"&gt;tasks available&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OH1IsC1R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h4ez4v85f9lglk16r7uh.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OH1IsC1R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h4ez4v85f9lglk16r7uh.jpg" alt="+30k models are available on the HuggingFace Hub" width="880" height="546"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you found a model that you like just click &lt;strong&gt;Deploy -&amp;gt; Inference API then select JavaScript&lt;/strong&gt;. For example, here is the one I usually use to do summarization: &lt;a href="https://huggingface.co/sshleifer/distilbart-cnn-6-6"&gt;https://huggingface.co/sshleifer/distilbart-cnn-6-6&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vjTpaFdi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o910bdhntpcngei0k6gd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vjTpaFdi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o910bdhntpcngei0k6gd.png" alt="The inference API with JavaScript code snippet selected" width="880" height="610"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;And that's it! You can now use this super powerful ML model anywhere you want, or even try it directly in your JS console by pasting the JS snippet (here is an example for summarization):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g3xlJ9eB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ia2fuo33xy2jaquij6e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g3xlJ9eB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ia2fuo33xy2jaquij6e.png" alt="Trying a Hugging Face model in the Google Chrome console" width="880" height="618"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Good luck and have fun!&lt;br&gt;
Victor&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
