Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
combo
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
Syntactic Tools
combo
Merge requests
!19
Release 1.0.0b2.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Release 1.0.0b2.
config_package
into
develop
Overview
0
Commits
4
Pipelines
1
Changes
13
Merged
Release 1.0.0b2.
Mateusz Klimaszewski
requested to merge
config_package
into
develop
Jan 13, 2021
Overview
0
Commits
4
Pipelines
1
Changes
13
0
0
Merge request reports
Compare
develop
develop (base)
and
latest version
latest version
6943a267
4 commits,
Jan 13, 2021
13 files
+
68
−
72
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
13
combo/data/dataset.py
+
4
−
1
View file @ 6943a267
Edit in single-file editor
Open in Web IDE
Show full file
import
copy
import
logging
import
pathlib
from
typing
import
Union
,
List
,
Dict
,
Iterable
,
Optional
,
Any
,
Tuple
import
conllu
@@ -79,7 +80,9 @@ class UniversalDependenciesDatasetReader(allen_data.DatasetReader):
file_path
=
[
file_path
]
if
len
(
file_path
.
split
(
"
,
"
))
==
0
else
file_path
.
split
(
"
,
"
)
for
conllu_file
in
file_path
:
with
open
(
conllu_file
,
"
r
"
)
as
file
:
file
=
pathlib
.
Path
(
conllu_file
)
assert
conllu_file
and
file
.
exists
(),
f
"
File with path
'
{
conllu_file
}
'
does not exists!
"
with
file
.
open
(
"
r
"
):
for
annotation
in
conllu
.
parse_incr
(
file
,
fields
=
self
.
fields
,
field_parsers
=
self
.
field_parsers
):
yield
self
.
text_to_instance
(
annotation
)
Loading