opus-mt-en-zh does not respect the end token
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 4.7k
- Forks
- 536
- Avg merge
- 12h 12m
- Merged PRs (30d)
- 4
Description
Using the code here (but in c++): https://opennmt.net/CTranslate2/guides/opus_mt.html
auto translationOptions = ctranslate2::TranslationOptions();
translationOptions.beam_size = 1;
translationOptions.return_scores = false;
const std::vector<std::vector<std::string>> batch = {pieces};
const std::vector<ctranslate2::TranslationResult> results = translators[modelPathStr]->translate_batch(batch, translationOptions);
Translating something simple like "Hello", gives the chinese characters "你好" again and again (up to 256 times), which I believe is the max sequence length. Interestingly, translating "Hello, World!" gives the expected result.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Opus-MT guide and reproduce the C++ translation using "Hello" and "Hello, World!". Compare the generated sequences and inspect how end-token handling differs between the two inputs; done means the short input terminates at the end token instead of repeating until the maximum length.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100