For YouTrending This WeekAI AgentsAI Tools & ReviewsMachine LearningMediumLarge Language ModelsTutorialsIndustry NewsGeneral
Medium

Hugging Face Pipelines

Hugging Face Pipelines

This post was originally published on Medium.

Member-only story

Hugging Face Pipelines

2 min read

Nov 21, 2023

Are you searching for a quick way to use machine learning models, all in just a few lines of code? Are you interested in utilizing machine learning models without requiring an extensive understanding of the intricacies of machine learning?

Press enter or click to view image in full size

Photo by Claudio Schwarz on Unsplash

I have always been interested in artificial intelligence and have always wanted to learn how it works and develop my own AI applications. But considering the fact that AI is a very technical field it can be very difficult sometimes to know where to start.

I have been on Hugging Face for some time now but a few weeks back I came across their learning hub, started learning from there, and discovered their pipeline function and since then it has proved to be by far the easiest way to use ML models, IMHO.

Hugging Face pipelines provide a convenient and straightforward method for utilizing models in inference. So these pipelines allow you to use models that are hosted on Hugging Face without you knowing the intricacies of how the model works. These pipelines provide APIs for tasks such as Sentiment Analysis, Text Generation, and Named Entity Recognition. Too much of me talking, let’s get our hands dirty.

from transformers import pipeline

classifier = pipeline("sentiment-analysis")
classifier("I feel not so good today")
[{'label': 'NEGATIVE', 'score': 0.999760091304779}]
Share: 𝕏 Twitter in LinkedIn

Yitzkak Agu

AI & ML Writer

AI and machine learning writer at AI 'n Skills. I cover LLMs, AI tools, and developer workflows — breaking down complex concepts for developers and curious minds.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top