Skip to content

Commit

Permalink
[demo] Fix token-classification (Closes huggingface#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
xenova committed May 19, 2023
1 parent 8d8f511 commit 4a6b8cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/demo-site/src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ async function token_classification(data) {
let currentChunk = { type: '', text: [] };

for (let i = 0; i < outputs.length; i++) {
let word = pipeline.tokenizer.model.tokens_to_ids[outputs[i].word];
let word = pipeline.tokenizer.model.tokens_to_ids.get(outputs[i].word);
let entity = outputs[i].entity;

if (entity.startsWith('B-')) { // beginning of a new chunk
Expand Down

0 comments on commit 4a6b8cc

Please sign in to comment.