kmkurn / pytorch-crf

(Linear-chain) Conditional random field in PyTorch.
https://pytorch-crf.readthedocs.io
MIT License
935 stars 151 forks source link

Beam search #107

Closed logmms closed 1 year ago

logmms commented 1 year ago

Would it be possible to decode using beam search instead of the Viterbi algorithm, and if so, how?

kmkurn commented 1 year ago

Viterbi already gives you the optimal solution, so typically there's no need for an approximation algorithm like beam search. Do you have a particular reason to use beam search?