Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RL-Parsing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Franck Dary
RL-Parsing
Commits
2d1ca2ab
Commit
2d1ca2ab
authored
4 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Corrected bug when using transitions=tagger
parent
b2cfa23e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Config.py
+5
-1
5 additions, 1 deletion
Config.py
Transition.py
+1
-1
1 addition, 1 deletion
Transition.py
with
6 additions
and
2 deletions
Config.py
+
5
−
1
View file @
2d1ca2ab
...
@@ -19,6 +19,9 @@ class Config :
...
@@ -19,6 +19,9 @@ class Config :
self
.
historyHistory
=
set
()
self
.
historyHistory
=
set
()
self
.
historyPop
=
[]
self
.
historyPop
=
[]
def
isPredicted
(
self
,
colname
)
:
return
colname
in
self
.
predicted
def
hasCol
(
self
,
colname
)
:
def
hasCol
(
self
,
colname
)
:
return
colname
in
self
.
col2index
return
colname
in
self
.
col2index
...
@@ -121,7 +124,7 @@ class Config :
...
@@ -121,7 +124,7 @@ class Config :
toPrint
=
[]
toPrint
=
[]
for
colIndex
in
range
(
len
(
self
.
lines
[
index
]))
:
for
colIndex
in
range
(
len
(
self
.
lines
[
index
]))
:
value
=
str
(
self
.
getAsFeature
(
index
,
self
.
index2col
[
colIndex
]))
value
=
str
(
self
.
getAsFeature
(
index
,
self
.
index2col
[
colIndex
]))
if
value
==
""
:
if
value
==
""
or
value
==
"
_
"
:
value
=
"
_
"
value
=
"
_
"
elif
self
.
index2col
[
colIndex
]
==
"
HEAD
"
and
value
!=
"
-1
"
:
elif
self
.
index2col
[
colIndex
]
==
"
HEAD
"
and
value
!=
"
-1
"
:
value
=
self
.
getAsFeature
(
int
(
value
),
"
ID
"
)
value
=
self
.
getAsFeature
(
int
(
value
),
"
ID
"
)
...
@@ -153,6 +156,7 @@ def readConllu(filename, predicted) :
...
@@ -153,6 +156,7 @@ def readConllu(filename, predicted) :
if
head
==
"
_
"
:
if
head
==
"
_
"
:
continue
continue
if
head
==
"
0
"
:
if
head
==
"
0
"
:
configs
[
-
1
].
set
(
index
,
"
HEAD
"
,
-
1
,
False
)
continue
continue
configs
[
-
1
].
set
(
index
,
"
HEAD
"
,
id2index
[
head
],
False
)
configs
[
-
1
].
set
(
index
,
"
HEAD
"
,
id2index
[
head
],
False
)
configs
[
-
1
].
goldChilds
[
int
(
id2index
[
head
])].
append
(
index
)
configs
[
-
1
].
goldChilds
[
int
(
id2index
[
head
])].
append
(
index
)
...
...
This diff is collapsed.
Click to expand it.
Transition.py
+
1
−
1
View file @
2d1ca2ab
...
@@ -266,7 +266,7 @@ def applyReduce(config) :
...
@@ -266,7 +266,7 @@ def applyReduce(config) :
################################################################################
################################################################################
def
applyEOS
(
config
)
:
def
applyEOS
(
config
)
:
if
not
config
.
hasCol
(
"
HEAD
"
)
:
if
not
config
.
hasCol
(
"
HEAD
"
)
or
not
config
.
isPredicted
(
"
HEAD
"
)
:
return
return
rootCandidates
=
[
index
for
index
in
config
.
stack
if
not
config
.
isMultiword
(
index
)
and
isEmpty
(
config
.
getAsFeature
(
index
,
"
HEAD
"
))]
rootCandidates
=
[
index
for
index
in
config
.
stack
if
not
config
.
isMultiword
(
index
)
and
isEmpty
(
config
.
getAsFeature
(
index
,
"
HEAD
"
))]
...
...
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