CUNY-CL / yoyodyne

Small-vocabulary sequence-to-sequence generation with optional feature conditioning
Apache License 2.0
29 stars 16 forks source link

Beam search #17

Open kylebgorman opened 1 year ago

kylebgorman commented 1 year ago

Beam search is generally not supported by our models, though the flag exists. It appears to be supported in lstm; it is unclear to me whether it's supported by feature_invariant_transformer, transformer and transducer (if any of these silently ignore the flag, which is what I think happens, this is a serious but easy-to-fix bug), and it's explicitly not implemented in pointer_generator_lstm.

kylebgorman commented 5 months ago

Going to assign to @Adamits since I think he may be able to bring this back.

Summarizing some discussion we had in person, the heapq in CPython is actually a pretty snappy implementation (it delegates to a C-based impl called _heapq which is going to be widely available) so it's probably fine as is. (If you want you can write a wrapper class to make it cuter.) It just needs to be resurrected, tested, and documented.