You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to extend select so that it can return the top_n best options out of a list of options instead of only returning the best one?
A cumbersome alternative is to wrap the selection within #geneach and use a function remove_option that removes the selected answer from the list of options after each selection:
"""{{#geneach 'item' num_iterations=top_n join=', '}}{{select 'ans' options=valid_options}}{{~#block hidden=True}}{{remove_option ans valid_options}}{{~/block}}{{/geneach}}"""
However, this is highly inefficient, as it does not leverage the fact that, if the current best option shares the initial part of the encoding with other words, in future iterations it does make sense to focus only on the words sharing that part of the encoding.
For example, say we have 'airplane' encoded by [200, 203], 'aircraft' by [200, 206] and 'boat' by [99, 100]. 'airplane' is selected as the best option. At this point, we know that token 200 is better than 99, so during the next selection, it does not make sense to check again whether 'boat' could be the best option, because we already know that the first token to be selected would be 200.
The text was updated successfully, but these errors were encountered:
Would it be possible to extend
select
so that it can return the top_n best options out of a list of options instead of only returning the best one?A cumbersome alternative is to wrap the selection within #geneach and use a function
remove_option
that removes the selected answer from the list of options after each selection:However, this is highly inefficient, as it does not leverage the fact that, if the current best option shares the initial part of the encoding with other words, in future iterations it does make sense to focus only on the words sharing that part of the encoding.
For example, say we have 'airplane' encoded by [200, 203], 'aircraft' by [200, 206] and 'boat' by [99, 100]. 'airplane' is selected as the best option. At this point, we know that token 200 is better than 99, so during the next selection, it does not make sense to check again whether 'boat' could be the best option, because we already know that the first token to be selected would be 200.
The text was updated successfully, but these errors were encountered: