Support n_best option for CTranslate

ctranslate

(Guillaume Klein) #1

Like translate.lua, CTranslate should support the n_best option.


(Stephen Wu) #2

Which version the n_best option will be supported for CTranslate ?

You could give some tips for us to finish it if you are busy for something else.

Be wish to take n_best as soon as possible.


(Guillaume Klein) #3

No definite plans for it. Are you building an application around CTranslate? In the meantime, is using translate.lua an option in your use case?


(Stephen Wu) #4

Yes, I’m planning to build an application around CTranslate.

And could you give some advice for supporting n_best output ?


(Guillaume Klein) #5

If you want to take a look:

These data structures hold the beam search result. In particular, you want to extract N hypotheses from next_ys (with their corresponding next_features, scores and all_attention) following beam paths described in prev_ks.

Here is the piece of code that extracts the best hypotheses for a batch: