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
840a9853
Commit
840a9853
authored
1 year ago
by
Paweł Walkowiak
Browse files
Options
Downloads
Patches
Plain Diff
Update logging
parent
23c05436
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!13
Fix anonymizer errors
Pipeline
#15158
passed with stages
in 1 minute and 38 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dictionaries/morphosyntactic/ner_file.py
+8
-3
8 additions, 3 deletions
src/dictionaries/morphosyntactic/ner_file.py
with
8 additions
and
3 deletions
src/dictionaries/morphosyntactic/ner_file.py
+
8
−
3
View file @
840a9853
...
@@ -7,6 +7,10 @@ from typing import List, Optional, Type, Dict
...
@@ -7,6 +7,10 @@ from typing import List, Optional, Type, Dict
from
src.detections
import
DETECTION_CLASSES_MAP
,
Detection
,
MorphosyntacticInfoMixin
from
src.detections
import
DETECTION_CLASSES_MAP
,
Detection
,
MorphosyntacticInfoMixin
from
src.dictionaries.morphosyntactic.interface
import
MorphosyntacticDictionary
from
src.dictionaries.morphosyntactic.interface
import
MorphosyntacticDictionary
import
logging
_log
=
logging
.
getLogger
(
__name__
)
class
NERFileMorphosyntacticDictionary
(
MorphosyntacticDictionary
):
class
NERFileMorphosyntacticDictionary
(
MorphosyntacticDictionary
):
"""
Morphosyntactic dictionary that uses a tsv file with NER tags as a source.
"""
Morphosyntactic dictionary that uses a tsv file with NER tags as a source.
...
@@ -113,9 +117,10 @@ class NERFileMorphosyntacticDictionary(MorphosyntacticDictionary):
...
@@ -113,9 +117,10 @@ class NERFileMorphosyntacticDictionary(MorphosyntacticDictionary):
)
)
word
=
lemma
word
=
lemma
except
IndexError
as
exp
:
except
IndexError
as
exp
:
print
(
f
"
IndexError entry_type
{
entry_type
}
morpho_tag
{
morpho_tag
}
"
)
_log
.
info
(
f
"
IndexError entry_type
"
print
(
exp
)
f
"
{
entry_type
}
morpho_tag
{
morpho_tag
}
"
)
print
(
f
"
Dictionary
{
self
.
_dictionary
[
entry_type
][
morpho_tag
]
}
"
)
_log
.
info
(
exp
)
_log
.
info
(
f
"
Dictionary
{
self
.
_dictionary
[
entry_type
][
morpho_tag
]
}
"
)
if
word
is
None
and
self
.
_always_replace
:
if
word
is
None
and
self
.
_always_replace
:
entry_type
=
random
.
choice
(
list
(
self
.
_dictionary
.
keys
()))
entry_type
=
random
.
choice
(
list
(
self
.
_dictionary
.
keys
()))
...
...
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