MyGit

2.6.2

huggingface/transformers.js

版本发布时间: 2023-09-27 22:14:21

huggingface/transformers.js最新发布版本:2.17.2(2024-05-29 22:36:30)

What's new?

📝 New task: Document Question Answering

Document Question Answering is the task of answering questions based on an image of a document. Document Question Answering models take a (document, question) pair as input and return an answer in natural language. Check out the docs for more info!

image

Example code
// npm i @xenova/transformers
import { pipeline } from '@xenova/transformers';

let image = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/invoice.png';
let question = 'What is the invoice number?';

// Create document question answering pipeline
let qa_pipeline = await pipeline('document-question-answering', 'Xenova/donut-base-finetuned-docvqa');

// Run the pipeline
let output = await qa_pipeline(image, question);
// [{ answer: 'us-001' }]

🤖 New models

💻 New example application

🐛 Misc. improvements

Full Changelog: https://github.com/xenova/transformers.js/compare/2.6.1...2.6.2

相关地址:原始地址 下载(tar) 下载(zip)

查看:2023-09-27发行的版本