OpenNMT Forum

Unk_replace for opennmt tf

In the Opennmt-tf, I didn’t find the unk_replace option in the inference part.

So the option (like returning attetion score, beam size) is not already implemented?

Thanks :slight_smile:


This is tracked by this issue:

There is currently a limitation in TensorFlow that prevents returning alignment information when using beam search. A pull request has been open there but interactions with the reviewer has been slower lately.

1 Like

Thanks :smile:

The issue is closed.
So how to replace unk words in opennmt-tf?
Does it support replace_unk like opennmt-py?

Yes, with the following configuration:

  replace_unknown_target: true

Oh,I have used this params. And I also check this ticket:

With opennmt-py, the params replace_unk will let the OOV words just copied in target.
Maybe it’s now working as expected in oopennmt-tf.