Comments (1)
Hey, I did not develop the rvlcdip model but from working with donut for a bit I understood that the authors add classes as their own tokens so the model learns them from scratch and assigns a unique ID to them instead of using the wordpiece tokens to piece them together.
In a bit more detail, when generating an output the decoder uses the vocabulary to put one token after the other, like any other generative transformer. So let's say the model should predict "scientific_publication" as a class, it needs to check the vocabulary for tokens like for example: ["<", "scientficic", "_", "publication", "/>"] and piece them together. Each of these tokens has it's own ID and is part of the predicted output sequence. This works fine but the model needs to "forget and relearn" what these tokens mean during finetuning and it also needs to predict different amounts of tokens for each class. So what you could to is to add a new token ID for "<scientific_publication/>". Then the model can learn what this new token means and will just have to predict a single token ID to make a classification. You can do this by calling add_tokenson the tokenizer and resize_token_embeddings on the decoder before training, but for more information you should check out the example notebooks from NielsRogge.
Hope this helps and good luck with your experiments!
from donut.
Related Issues (20)
- getting no module named lightning module when trying to run the fine tuning code in train.py file of donut model. HOT 1
- DOCVQA data set format ? HOT 3
- Prediction and Answer differ by dataset-specific tag HOT 1
- The latest update has the model weights twice the embedding dim size of the actual model installed through github or pip HOT 2
- VisionEncoderDecoderModel convert HOT 2
- Integrate a customized internal OCR engine to Donut HOT 1
- Request: Dataset and pretrained model for language detection
- Problem with getting predictions HOT 7
- Does synthdog data has MiT or afl-3.0 license? HOT 1
- Error "A configuraton of type donut cannot be instantiated because not both `encoder` and `decoder` sub-configurations are passed" when run inference after finetuned docvqa without pushing to hugging face?
- custom json schema - ASAP HOT 2
- Multi GPU support for fine tuning
- How to extract complete text from the document? HOT 3
- confidence 값의 공식적인 지원
- Classification inference
- Update donut-python Python Package to be compatible with latest versions of transformers
- donut inference시 sub task가 변경?
- Not getting prediction correctly using the model trained on the custom dataset (similar format as CORD-V2 dataset)
- not work this app.py
- Can synthdog insert text for a specified bbox? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from donut.