Views
No views yet
goeswith for subwords), optimized for deployment in JavaScript/TypeScript environments (Node.js, Deno, or directly in the browser) without requiring Python.1import { pipeline } from "@huggingface/transformers";
2
3// Initialize the token classification pipeline targeting this specific ONNX repository
4const modelId = "ghotriw/roberta-base-english-ud-goeswith-onnx";
5const tagger = await pipeline("token-classification", modelId);
6
7// Use aggregation_strategy: 'none' to get raw labels for each subword
8const rawTokens = await tagger("I saw a horse", { aggregation_strategy: 'none' });
9
10for (const token of rawTokens) {
11 const [pos, features, deprel] = token.entity.split('|');
12 console.log(`Word: ${token.word}, POS: ${pos}, Dep: ${deprel}`);
13}