Giter VIP home page Giter VIP logo

Comments (6)

FeiWang96 avatar FeiWang96 commented on July 23, 2024 2

Hi Paul,

If you want to construct a complete attention flow, then yes. You can use type_edge to mask any specific attention flow from one type of nodes to another type of nodes.

Best regards,
Fei

from lattice.

FeiWang96 avatar FeiWang96 commented on July 23, 2024

Hi Paul,

First of all, thank you for the great work!

Thank you!

Is type_edges fixed?

Yes.

If it is, then why?

We use type_edges to create the attention mask based on token types. (a,b) means there are attention flows from a to b. As written in the docstring, we assign 1&2 for metadata tokens and 3 for cell tokens. (We assign type ids during preprocessing.) So the default type_edges will mask attention flows between all cell tokens. And the attention between cell tokens in the same row/column is unmasked later.

Best regards,
Fei

from lattice.

cws7777 avatar cws7777 commented on July 23, 2024

Thank you for kindly answering my question! :)

I have one more quick question.
Does each value of type_ids, row_ids and col_ids indicate each token or each character of tokens?
It seems counting all of the characters of text (one of type_ids in train.csv has 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1~~).
Am I understanding correctly?

Thank you once again! :)

Hope you have a great one!

Best,
Paul

from lattice.

FeiWang96 avatar FeiWang96 commented on July 23, 2024

Hi Paul,

Yes, in train.csv, type_ids, row_ids, and col_ids are character-level, which are assigned during preprocessing.
These character-level ids are then mapped to token-level after tokenization at the beginning of training.

Best regards,
Fei

from lattice.

cws7777 avatar cws7777 commented on July 23, 2024

Thank you for quick response! :)
Also, if there are two token types (type_ids), then should type_edge also be changed like ((1, 1), (2, 2), (1, 2), (2, 1))?
This might be depended on the what type_ids are, but I'm just asking!

I'm new to this kind of task with using PLMs.

Sorry for bothering and thank you once again for your kindness!

Best,
Paul

from lattice.

cws7777 avatar cws7777 commented on July 23, 2024

Thank you!
Hope you have a great one! :)

Best,
Paul

from lattice.

Related Issues (9)

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.