From what I read is that if replace_unknown_target is true and a source word is out of vocabulary, the network will copy this value in target.
But this case does not valid on my model. It still returns words that exists in train-vocab
I’m using opennmt-defaults.yml with replace_unknown_target: true added in params section.
I’m using OpenNMT-tf 5 with tensoflow 1.8.
model_type during train and eval is NMTSmall
Does anything wrong with my configuration? Or did I miss something?
Maybe you misread the documentation:
Replace unknown target tokens by the original source token with the highest attention
It looks at OOV target tokens, not source.
My case is that I want to keep name, address and others in source sentence exists in target sentence. Is this option will enable me to do that? Can I just set unk for that piece in tgt-train.val ?
This is a recurring question around here but it is not an easy task.
replace_unknown_target can partially do that if the produced target token is actually OOV and the attention returned by the model is “correct”.
A more robust approach would be to replace all entities with some sort of placeholder tokens, and use an external alignment tool as post-processing to replace them with their original value.
Thank you @guillaumekln
That is very helpful of you.
On this external alignment tool you said, is that mean that src-train/val, tgt-train/val passed to the trainer is the aligned file? Which also means src-train and tgt-train passed to vocab builder is this aligned file.
have you managed to find a solution for this kind of problem?
What external tool have you used?
Hi ptamass88, not yet, still in research.
We currently use our own NER tagging tool.