Views
No views yet
pipeline('token-classification') in Transformers.js1import { pipeline } from '@huggingface/transformers';
2
3const ner = await pipeline('token-classification', 'Berk/mdeberta-ner-ontonotes5-onnx', {
4 quantized: true,
5});
6
7const result = await ner('I want to book best western in amsterdam');
8// [{ word: 'best western', entity_group: 'ORGANIZATION' }, { word: 'amsterdam', entity_group: 'GPE' }]| Input | Entities found |
|---|---|
| "best western in amsterdam" (lowercase) | best western (ORG), amsterdam (GPE) |
| "Louvre, Notre-Dame, Montmartre" | Louvre (FAC), Notre-Dame (FAC), Montmartre (FAC) |
| "Kilimanjaro Airport" | Kilimanjaro Airport (FAC) |
| "Falaise d'Aval" | Falaise d'Aval (LOCATION) |