Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
anonymizer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nlpworkers
anonymizer
Commits
d62da8a9
Commit
d62da8a9
authored
1 year ago
by
Paweł Walkowiak
Browse files
Options
Downloads
Patches
Plain Diff
Fix
parent
c96cc8e3
1 merge request
!13
Fix anonymizer errors
Pipeline
#15141
passed with stages
in 1 minute and 33 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/dictionaries/morphosyntactic/ner_file.py
+2
-1
2 additions, 1 deletion
src/dictionaries/morphosyntactic/ner_file.py
src/replacers/ner_replacer.py
+1
-1
1 addition, 1 deletion
src/replacers/ner_replacer.py
with
3 additions
and
2 deletions
src/dictionaries/morphosyntactic/ner_file.py
+
2
−
1
View file @
d62da8a9
...
@@ -93,7 +93,8 @@ class NERFileMorphosyntacticDictionary(MorphosyntacticDictionary):
...
@@ -93,7 +93,8 @@ class NERFileMorphosyntacticDictionary(MorphosyntacticDictionary):
if
original_entry_type_name
in
self
.
_dictionary
:
if
original_entry_type_name
in
self
.
_dictionary
:
entry_type
=
original_entry_type_name
entry_type
=
original_entry_type_name
if
morpho_tag
in
self
.
_dictionary
[
entry_type
]:
if
morpho_tag
in
self
.
_dictionary
[
entry_type
]
\
and
morpho_tag
in
self
.
_dictionary
[
entry_type
]:
lemma
=
random
.
choice
(
lemma
=
random
.
choice
(
list
(
self
.
_dictionary
[
entry_type
][
morpho_tag
].
keys
())
list
(
self
.
_dictionary
[
entry_type
][
morpho_tag
].
keys
())
)
)
...
...
This diff is collapsed.
Click to expand it.
src/replacers/ner_replacer.py
+
1
−
1
View file @
d62da8a9
...
@@ -61,7 +61,7 @@ class NERReplacer(ReplacerInterface):
...
@@ -61,7 +61,7 @@ class NERReplacer(ReplacerInterface):
)
)
morpho_detections
[
key
].
append
(
detection
)
morpho_detections
[
key
].
append
(
detection
)
else
:
else
:
key
=
(
text
[
start
:
end
],
detection
.
TYPE_NAME
)
key
=
(
text
[
start
:
end
],
detection
_entry
.
TYPE_NAME
)
non_morpho_detections
[
key
].
append
(
detection
)
non_morpho_detections
[
key
].
append
(
detection
)
# Replace morphosyntactic detections
# Replace morphosyntactic detections
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment