Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DAN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Automatic Text Recognition
DAN
Merge requests
!11
Implement extraction command
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Implement extraction command
implement-extraction-command
into
main
Overview
1
Commits
12
Pipelines
0
Changes
3
Merged
Yoann Schneider
requested to merge
implement-extraction-command
into
main
2 years ago
Overview
1
Commits
12
Pipelines
0
Changes
3
Expand
Requires
!9 (merged)
Closes
#9 (closed)
0
0
Merge request reports
Viewing commit
e42d071d
Prev
Next
Show latest version
3 files
+
26
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
Verified
e42d071d
remove not needed files, reorganize inside dan module
· e42d071d
Yoann Schneider
authored
2 years ago
dan/datasets/extract/utils.py
+
25
−
1
Options
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@@ -25,6 +24,13 @@ def get_cli_args():
help
=
"
Name of the corpus from which the data will be retrieved.
"
,
required
=
True
,
)
parser
.
add_argument
(
"
--element-type
"
,
nargs
=
"
+
"
,
type
=
str
,
help
=
"
Type of elements to retrieve
"
,
required
=
True
,
)
parser
.
add_argument
(
"
--parents-types
"
,
nargs
=
"
+
"
,
@@ -47,4 +53,22 @@ def get_cli_args():
help
=
"
Names of parents of the elements.
"
,
default
=
None
,
)
parser
.
add_argument
(
"
--no-entities
"
,
action
=
"
store_true
"
,
help
=
"
Extract text without entities
"
)
parser
.
add_argument
(
"
--use-existing-split
"
,
action
=
"
store_true
"
,
help
=
"
Do not partition pages into train/val/test
"
,
)
parser
.
add_argument
(
"
--train-prob
"
,
type
=
float
,
default
=
0.7
,
help
=
"
Training set probability
"
)
parser
.
add_argument
(
"
--val-prob
"
,
type
=
float
,
default
=
0.15
,
help
=
"
Validation set probability
"
)
return
parser
.
parse_args
()
Loading