Skip to content

Upgrade stanza to 1.10.1 + add translation tests - #488

Merged
argosopentech merged 9 commits into
argosopentech:masterfrom
yudelevi:master
Aug 12, 2025
Merged

Upgrade stanza to 1.10.1 + add translation tests#488
argosopentech merged 9 commits into
argosopentech:masterfrom
yudelevi:master

Conversation

@yudelevi

@yudelevi yudelevi commented Aug 8, 2025

Copy link
Copy Markdown
Contributor

A few fixes here:

  1. Stanza initialization now has SpaCy fallback for the few languages not supported (yet?) in the latest version.
  2. Stanza is updated, allowing dependencies to be updated as well (tested on numpy 2.3.2, CTranslate 4.6.0 and torch 2.7.1)
  3. Created a simple test suite to translate from/to English. it was very helpful in hunting down bugs.
  4. Cleared ▁ (U+2581) from output, looks like leftover from sentencepiece ?
  5. Few mypy fixes and formatting according to the scripts/

Tested on all -> English in our pipelines, throughput is pretty good.

Daniel Yudelevich added 9 commits August 7, 2025 09:43
- Add language code mapping for Chinese Traditional (zt→zh-hant) and Brazilian Portuguese (pb→pt)
- Implement SpaCy fallback for unsupported Stanza languages
- Fix segmentation faults by using tokenize_pretokenized=True to prevent MWT processing
…ntheses for multi-line return statement

feat(tests): add comprehensive test suite for English translations including basic, directional, and non-English pairs to ensure translation accuracy and reliability
@yudelevi

yudelevi commented Aug 8, 2025

Copy link
Copy Markdown
Contributor Author

@argosopentech, please let me know if you want those tests or not; they will not run in actions unless we add at least one language installation.
If you could point me to the VI model, I'm willing to try and make it work with Stanza 1.10.1 as well.

@argosopentech

Copy link
Copy Markdown
Owner

This all looks good but I'm not sure about upgrading Stanza. When we've tried to do that in the past it's caused issues.

@yudelevi

Copy link
Copy Markdown
Contributor Author

Well I was one of the people complaining that some of the languages stopped working last time; that's why I added the tests (and they may suck, but it's better than nothing).

I'm not going to try and force a solution, but as a community we could really use some guidance, especially since Stanza 1.1.1 support is really maintainable moving forward. I was originally under the assumption we were getting rid of Stanza completely until you merged #460 , but now I'm not so sure anymore?

I'm happy to conform this PR to the direction you see the project going; just let us know where.

@PJ-Finlay

PJ-Finlay commented Aug 11, 2025

Copy link
Copy Markdown
Collaborator

Figuring out what to do about Stanza/SBD is still a work in progress. For the near term the plan is to support both Stanza and Spacy like in the merged pull request. I'm open to upgrading the Stanza version if you've tested it but I remember in the past upgrading it has broken things.

The more tests the better, I'll definitely merge the tests.

@yudelevi

Copy link
Copy Markdown
Contributor Author

For reference, this is the closed ticket from the last upgrade : #400

@argosopentech
argosopentech merged commit 9602167 into argosopentech:master Aug 12, 2025
1 check passed
@argosopentech

Copy link
Copy Markdown
Owner

I ran this myself and it seems to work. Thanks!

Stanza is still kind of a mess but hopefully this will help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants