Skip to content

Conversation

@xenova
Copy link
Collaborator

@xenova xenova commented Mar 1, 2023

Adding functionality to use the familiar pipeline syntax!

This means you can now do the following:

from transformers import pipeline

# Allocate a pipeline for sentiment-analysis
classifier = pipeline('sentiment-analysis')

output = classifier('I love transformers!')
# [{'label': 'POSITIVE', 'score': 0.9998069405555725}]

(Python)

import { pipeline } from "transformers.js";

// Allocate a pipeline for sentiment-analysis
let classifier = await pipeline('sentiment-analysis')

let output = await classifier('I love transformers!')
// [{label: 'POSITIVE', score: 0.9998176857266375}]

(JavaScript)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants