nextcloud / nextcloud/translate2
Support large input texts with more than 250 words
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6
- Forks
- 3
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 1
Description
How to use GitHub
- Please use the 👍 reaction to show that you are interested into the same feature.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Feature request
Which Nextcloud Version are you currently using: v32.0.0
Is your feature request related to a problem? Please describe.
Large input texts get cut off at some point in the corresponing translation/output text. This seems to vary based on the target language chosen and the max_decoding_length param does not help here much even with high values.
Describe the solution you'd like
Chunking of the input text, maybe in around 100 words, to keep the translation input chunks small and digestable by the model.
Note: split and join of the texts will need some special care depending on the language of the input text, for different separators, RTL languages and no-space languages.
Describe alternatives you've considered
Split the input text by hand.
Additional context
- related: #68
- this function can be used for this purpose. It uses the same
translate_batchfunction under the hood that we use here now: https://opennmt.net/CTranslate2/python/ctranslate2.Translator.html#ctranslate2.Translator.translate_iterable
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 by locating the current translation path that calls CTranslate2's translate_batch, then read the related issue #68 and the translate_iterable documentation. The work is done when texts over 250 words are chunked and reassembled without truncation across target languages, including separators, RTL languages, and languages without spaces.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100