feat: MiniSBD support - #510
Merged
Merged
Conversation
Contributor
Author
|
Ok it was just my environment. Re-downloading the |
Contributor
Author
|
Ok this is ready for review. 🚀 The one thing that has changed compared to the previous version is the fallback behavior of stanza --> spacy, but otherwise the program should work the same unless a person explicitly enables MiniSBD support. Once merged I can bring this into LibreTranslate. |
|
Since spacy is now optional does it make sense to remove it from requirements.txt as well? |
Owner
|
This looks good thanks! |
Owner
|
This has been released on PyPI in Argos Translate 1.11.0! |
Stebalien
added a commit
to Stebalien/nixpkgs
that referenced
this pull request
Feb 20, 2026
1. Add a dependency on spacy, introduced in 1.10.0 [1]. 2. Add a dependency on minisbd, introduced in 1.11.0 [2]. [1] argosopentech/argos-translate#430 [2] argosopentech/argos-translate#510 foo
Stebalien
added a commit
to Stebalien/nixpkgs
that referenced
this pull request
Feb 21, 2026
1. Add a dependency on spacy, introduced in 1.10.0 [1]. 2. Add a dependency on minisbd, introduced in 1.11.0 [2]. [1] argosopentech/argos-translate#430 [2] argosopentech/argos-translate#510 foo
oneingan
pushed a commit
to oneingan/nixpkgs
that referenced
this pull request
Feb 21, 2026
1. Add a dependency on spacy, introduced in 1.10.0 [1]. 2. Add a dependency on minisbd, introduced in 1.11.0 [2]. [1] argosopentech/argos-translate#430 [2] argosopentech/argos-translate#510 foo
Stebalien
added a commit
to Stebalien/nixpkgs
that referenced
this pull request
Feb 23, 2026
1. Add a dependency on spacy, introduced in 1.10.0 [1]. 2. Add a dependency on minisbd, introduced in 1.11.0 [2]. [1] argosopentech/argos-translate#430 [2] argosopentech/argos-translate#510 foo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
minisbdpackage folder to contain a.onnxfile to use as the MiniSBD tokenizer -or- it downloads the model from GitHub (multi-process/multi-thread safe).Simple test:
test_trans.pyNotes
I've removed the fallback behavior of stanza to spacy; it's a strange way to handle missing languages support. I think if a language is missing from stanza (which ones?) we should just initialize the SpacySentencizerSmall directly. I tested all languages in the argos-pm index and only Arabic (
ar) is currently giving some issues.Another problem with the Spacy logic was that the spacy cache was initialized module wise, which was not process/thread safe and causing LibreTranslate/LibreTranslate#882. I've now set the spacy cache to initialize only if CHUNK_TYPE is SPACY (and spacy is installed). This is still a problem if you use Spacy in multi-process environment, but it's now mitigated by having the ability to disable Spacy.
azdoes not seem to work with Stanza (but works with MiniSBD), maybe it's just my environment