Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
punctuator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nlpworkers
punctuator
Commits
d6961fef
Commit
d6961fef
authored
Jul 22, 2021
by
Michal Pogoda
Browse files
Options
Downloads
Patches
Plain Diff
Language is now optional and defaults to 'pl'
parent
978ef6b8
No related branches found
No related tags found
No related merge requests found
Pipeline
#3670
passed
Sep 14, 2021
Stage: check_style
Stage: testing
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+6
-4
6 additions, 4 deletions
README.md
worker.py
+4
-2
4 additions, 2 deletions
worker.py
with
10 additions
and
6 deletions
README.md
+
6
−
4
View file @
d6961fef
...
...
@@ -10,15 +10,17 @@ A service that automatically adds punctuation to raw word-stream (eg. from speec
## Config
```
ini
[deployment]
device
=
cpu ; Device on which inference will be made (eg. cpu, cuda:0 etc)
model_path
=
/model/punctuator ; Path where the model will be placed
languagetool_path
=
/model/languagetool ; Path where languagetool server will be placed
model_path_pl
=
/home/worker/model/punctuator_pl ; Path where the polish model is located
model_path_en
=
/home/worker/model/punctuator_en ; Path where the polish model is located
model_path_ru
=
/home/worker/model/punctuator_ru ; Path where the polish model is located
languagetool_path
=
/home/worker/model/languagetool ; Path where languagetool server will be placed
max_context_size
=
256 ; Number of tokens that will be oonsidered in prediciton at once. Must be between in range 2*overlap+1 to 512
overlap
=
20 ; The number of tokens from the environment that will be taken at inference for a text fragment
device
=
cpu ; Device on which inference will be made (eg. cpu, cuda:0 etc)
```
## LPMN
Punctuator have one argument
`language`
with options:
`pl`
`ru`
`en`
:
Punctuator have one
optional
argument
`language`
with options:
`pl`
`ru`
`en`
(defaults to pl)
:
```
filedir(/users/michal.pogoda)|any2txt|punctuator({"language":"en"})
```
...
...
This diff is collapsed.
Click to expand it.
worker.py
+
4
−
2
View file @
d6961fef
...
...
@@ -63,12 +63,14 @@ class Worker(nlp_ws.NLPWorker):
def
process
(
self
,
input_path
:
str
,
task_options
:
dict
,
output_path
:
str
)
->
None
:
if
task_options
[
'
language
'
]
==
'
en
'
:
language
=
task_options
.
get
(
"
language
"
,
"
pl
"
)
if
language
==
'
en
'
:
bpe
=
True
else
:
bpe
=
False
tool
,
model
,
tokenizer
,
mapping
=
self
.
get_setup_for_language
(
task_options
[
'
language
'
]
)
language
)
with
open
(
input_path
,
"
r
"
)
as
f
:
text
=
f
.
read
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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