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
Commits
a8d5a666
Commit
a8d5a666
authored
10 months ago
by
Manon Blanco
Browse files
Options
Downloads
Patches
Plain Diff
Create missing folders if needed
parent
8c1ccd28
No related branches found
No related tags found
1 merge request
!419
Create missing folders if needed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dan/datasets/entities/extract.py
+2
-0
2 additions, 0 deletions
dan/datasets/entities/extract.py
dan/datasets/tokens/generate.py
+1
-0
1 addition, 0 deletions
dan/datasets/tokens/generate.py
with
3 additions
and
0 deletions
dan/datasets/entities/extract.py
+
2
−
0
View file @
a8d5a666
...
...
@@ -18,6 +18,8 @@ def run(database: Path, output_file: Path) -> None:
entities
=
list
(
map
(
itemgetter
(
0
),
EntityType
.
select
(
EntityType
.
name
).
distinct
().
tuples
())
)
output_file
.
parent
.
mkdir
(
exist_ok
=
True
,
parents
=
True
)
output_file
.
write_text
(
yaml
.
safe_dump
({
"
entities
"
:
entities
},
explicit_start
=
True
,
allow_unicode
=
True
)
)
This diff is collapsed.
Click to expand it.
dan/datasets/tokens/generate.py
+
1
−
0
View file @
a8d5a666
...
...
@@ -37,6 +37,7 @@ def run(entities: Path, end_tokens: bool, output_file: Path) -> None:
}
# Save entities & tokens to YAML
output_file
.
parent
.
mkdir
(
exist_ok
=
True
,
parents
=
True
)
output_file
.
write_text
(
yaml
.
safe_dump
(
tokens
,
explicit_start
=
True
,
allow_unicode
=
True
,
sort_keys
=
False
)
)
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