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
817a6c9f
Commit
817a6c9f
authored
2 years ago
by
Bartosz Walkowiak
Browse files
Options
Downloads
Patches
Plain Diff
Update main.py
parent
046c75ef
Branches
Branches containing commit
1 merge request
!10
Anonimizer v2
Pipeline
#7904
passed with stage
in 46 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+39
-39
39 additions, 39 deletions
main.py
with
39 additions
and
39 deletions
main.py
+
39
−
39
View file @
817a6c9f
"""
Implementation of anonymizer service.
"""
import
nlp_ws
from
src.worker
_old
import
Worker
import
logging
import
nlp_ws
_log
=
logging
.
getLogger
(
__name__
)
class
AnonymizerWorker
(
nlp_ws
.
NLPWorker
):
"""
Class implementing TextFixerWorker worker.
"""
@classmethod
def
static_init
(
cls
,
config
):
"""
Initialize process.
"""
cls
.
_configuration
=
config
.
get
(
"
tool
"
).
get
(
"
configuration
"
,
"
ccl
"
)
cls
.
_default_language
=
config
.
get
(
"
tool
"
).
get
(
"
default_language
"
,
"
pl
"
)
cls
.
_default_replacer
=
config
.
get
(
"
tool
"
).
get
(
"
default_replacer
"
,
"
tag
"
)
_log
.
info
(
"
AnonymizerWorker initialized with configuration: %s, default language: %s, default replacer: %s
"
,
cls
.
_configuration
,
cls
.
_default_language
,
cls
.
_default_replacer
,
)
def
__init__
(
self
):
self
.
_worker
=
Worker
(
configuration
=
self
.
_configuration
,
default_language
=
self
.
_default_language
,
default_replacer
=
self
.
_default_replacer
,
)
def
process
(
self
,
input_file
,
task_options
,
output_file
):
self
.
_worker
.
process
(
input_file
,
task_options
,
output_file
)
if
__name__
==
"
__main__
"
:
nlp_ws
.
NLPService
.
main
(
AnonymizerWorker
,
pause_at_exit
=
False
)
"""
Implementation of anonymizer service.
"""
import
nlp_ws
from
src.worker
import
Worker
import
logging
import
nlp_ws
_log
=
logging
.
getLogger
(
__name__
)
class
AnonymizerWorker
(
nlp_ws
.
NLPWorker
):
"""
Class implementing TextFixerWorker worker.
"""
@classmethod
def
static_init
(
cls
,
config
):
"""
Initialize process.
"""
cls
.
_configuration
=
config
.
get
(
"
tool
"
).
get
(
"
configuration
"
,
"
ccl
"
)
cls
.
_default_language
=
config
.
get
(
"
tool
"
).
get
(
"
default_language
"
,
"
pl
"
)
cls
.
_default_replacer
=
config
.
get
(
"
tool
"
).
get
(
"
default_replacer
"
,
"
tag
"
)
_log
.
info
(
"
AnonymizerWorker initialized with configuration: %s, default language: %s, default replacer: %s
"
,
cls
.
_configuration
,
cls
.
_default_language
,
cls
.
_default_replacer
,
)
def
__init__
(
self
):
self
.
_worker
=
Worker
(
configuration
=
self
.
_configuration
,
default_language
=
self
.
_default_language
,
default_replacer
=
self
.
_default_replacer
,
)
def
process
(
self
,
input_file
,
task_options
,
output_file
):
self
.
_worker
.
process
(
input_file
,
task_options
,
output_file
)
if
__name__
==
"
__main__
"
:
nlp_ws
.
NLPService
.
main
(
AnonymizerWorker
,
pause_at_exit
=
False
)
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