-
Notifications
You must be signed in to change notification settings - Fork 254
feat: Add better language support presidio #3209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c8bbbd5
add proper support for other languages
sjrl c7f89b4
Improve tests
sjrl 09cfc80
improve docstrings
sjrl a462bcc
Add integration tests for other languages
sjrl fa550cd
formatting
sjrl bcc4545
Create default language mappings to models
sjrl 598ed16
refactor default mapping location and add it as a class var
sjrl f6fc3a9
formatting
sjrl e020b08
Update integrations/presidio/src/haystack_integrations/components/ext…
sjrl 49be284
Update integrations/presidio/src/haystack_integrations/components/pre…
sjrl efe5b8b
Update integrations/presidio/src/haystack_integrations/components/pre…
sjrl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
integrations/presidio/src/haystack_integrations/components/common/presidio/__init__.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai> | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 |
33 changes: 33 additions & 0 deletions
33
integrations/presidio/src/haystack_integrations/components/common/presidio/utils.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai> | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # Maps ISO 639-1 language codes to the largest available spaCy model for that language. | ||
| # Used to automatically configure the NLP engine when only `language` is specified. | ||
| # See https://spacy.io/models for the full list of available models. | ||
| SPACY_DEFAULT_MODELS: dict[str, str] = { | ||
| "ca": "ca_core_news_lg", | ||
| "zh": "zh_core_web_lg", | ||
| "hr": "hr_core_news_lg", | ||
| "da": "da_core_news_lg", | ||
| "nl": "nl_core_news_lg", | ||
| "en": "en_core_web_lg", | ||
| "fi": "fi_core_news_lg", | ||
| "fr": "fr_core_news_lg", | ||
| "de": "de_core_news_lg", | ||
| "el": "el_core_news_lg", | ||
| "it": "it_core_news_lg", | ||
| "ja": "ja_core_news_lg", | ||
| "ko": "ko_core_news_lg", | ||
| "lt": "lt_core_news_lg", | ||
| "mk": "mk_core_news_lg", | ||
| "nb": "nb_core_news_lg", | ||
| "pl": "pl_core_news_lg", | ||
| "pt": "pt_core_news_lg", | ||
| "ro": "ro_core_news_lg", | ||
| "ru": "ru_core_news_lg", | ||
| "sl": "sl_core_news_lg", | ||
| "es": "es_core_news_lg", | ||
| "sv": "sv_core_news_lg", | ||
| "uk": "uk_core_news_lg", | ||
| } | ||
Empty file.
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.