Giter Site home page Giter Site logo

Comments (1)

felixvor avatar felixvor commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.