Giter VIP home page Giter VIP logo

Comments (1)

cdpierse avatar cdpierse commented on June 30, 2024 1

Hi @hardianlawi, this is an interesting question. The short answer is that I think what you would like to do is possible. While the tokenized text is not super UX friendly it's important to remember that that tokenized text IS what the model is fed as input so attribution with respect to the tokens is for me the best way to try and represent the model's behaviour.

Bert like models tend to use the wordpiece method for tokenization and there are times in the explainer when you can see a model giving a negative attribution to the starting word piece and positive attribution to the negative wordpiece. For researchers and ML users interpreting their model's this could be quite useful information. To get rid of this information would be detrimental to the true interpretation of what is happening with the model.

I don't personally think I will implement a feature for mapping the attributions back to the exact text, or at least I'll have to think on it for a bit, but if you were to do this yourself you would just need to write some logic that could identify certain when a wordpiece occurs e.g. ["gp", "##u"] and then you could average the two raw attributions for gp and ##u together for a single attribution score, this will then correspond back to the original text.

Hope this helps.

from transformers-interpret.

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.