Giter VIP home page Giter VIP logo

Comments (4)

rsennrich avatar rsennrich commented on May 18, 2024

BPE always starts with a character-level segmentation so you start with {d i r e c t} and apply pairwise merge operations until you've reached the maximum number of merge operations (at training time), or until there is no more valid merge operation in your learned list (at test time).

So I'm not sure why you're asking about the smallest subunits (this is always characters). Instead, maybe you should be interested in the largest subword units that are still in-vocabulary. If your segmentation produces "di@@ rect", then "di@@" and "rect" are both in-vocabulary subword units, but "direct" is out-of-vocabulary.

from subword-nmt.

CodingJonas avatar CodingJonas commented on May 18, 2024

Thank you for your response, you are right, it is more relevant to think about the largest subwords.

I understand your explanation. I hope I don't bother you too much with another question. Just so I get my understanding right, if the final segmentation would be di@@ rec@@ t, how would I know if rec would be the largest subunit, or could it also be re (belonging to the first binary pair di-re) and c (belonging to the second binary pair c-t), but rec is not a learned subword?

from subword-nmt.

rsennrich avatar rsennrich commented on May 18, 2024

I'm not sure I get your question.

The final segmentation is produced by a greedy algorithm that iteratively applies the most frequent pairwise merge operation that has been learned on the training set. If you reach the intermediate segmentation (di - re - c - t), and di - re and c - t are the most frequent subword pairs and merged by the algorithm next (instead of re - c), the final segmentation would be dire@@ ct.

from subword-nmt.

CodingJonas avatar CodingJonas commented on May 18, 2024

Thank you, your explanations helped me understanding how you program works!

from subword-nmt.

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.