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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Franck Dary
RL-Parsing
Commits
e29d000f
Commit
e29d000f
authored
3 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
mproved pvalue computation
parent
d65a4f60
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
outputs/evalAndStats.py
+14
-10
14 additions, 10 deletions
outputs/evalAndStats.py
outputs/pvalues/pvalues.sh
+38
-20
38 additions, 20 deletions
outputs/pvalues/pvalues.sh
with
52 additions
and
30 deletions
outputs/evalAndStats.py
+
14
−
10
View file @
e29d000f
...
...
@@ -14,7 +14,7 @@ groups = {}
splits
=
set
()
for
filename
in
os
.
listdir
()
:
if
len
(
filename
)
<
7
or
filename
[
-
7
:]
!=
"
.conllu
"
:
if
len
(
filename
)
<
7
or
filename
[
-
7
:]
!=
"
.conllu
"
or
"
bt2
"
in
filename
:
continue
splitNum
=
int
(
filename
.
split
(
"
_
"
)[
0
])
splits
.
add
(
splitNum
)
...
...
@@ -27,15 +27,19 @@ for filename in os.listdir() :
refs
=
"
"
.
join
([
"
%sUD_French-GSD_%d/test.conllu
"
%
(
data
,
split
)
for
split
in
splits
])
os
.
system
(
"
cat %s > %s%s_corpus.conllu
"
%
(
refs
,
gold
,
"
,
"
.
join
(
list
(
map
(
str
,
splits
)))))
btTraces
=
[]
for
group
in
groups
:
groupdir
=
"
%s%s/
"
%
(
pvalues
,
group
)
os
.
makedirs
(
groupdir
,
exist_ok
=
True
)
for
elem
in
groups
[
group
]
:
ins
=
"
"
.
join
([
"
%d_%s.conllu
"
%
(
split
,
elem
)
for
split
in
splits
])
os
.
makedirs
(
"
%s%s/
"
%
(
groupdir
,
elem
),
exist_ok
=
True
)
os
.
system
(
"
cat %s > %s%s/%s_corpus.conllu
"
%
(
ins
,
groupdir
,
elem
,
"
,
"
.
join
(
list
(
map
(
str
,
splits
)))))
groupDir
=
"
%s%s/
"
%
(
pvalues
,
group
)
for
model
in
groups
[
group
]
:
modeloutputs
=
"
"
.
join
([
"
%d_%s.conllu
"
%
(
split
,
model
)
for
split
in
splits
])
modelDir
=
"
%s%s/
"
%
(
groupDir
,
model
)
os
.
makedirs
(
"
%s
"
%
(
modelDir
),
exist_ok
=
True
)
os
.
system
(
"
cat %s > %s%s_corpus.conllu
"
%
(
modeloutputs
,
modelDir
,
"
,
"
.
join
(
list
(
map
(
str
,
splits
)))))
btTraces
.
append
([
"
%d_%s.trace
"
%
(
list
(
splits
)[
0
],
elem
)
for
elem
in
groups
[
group
]
if
"
bt
"
in
elem
and
"
nobt
"
not
in
elem
and
"
1
"
in
elem
][
0
])
traces
=
"
"
.
join
([
"
%d_%s.trace
"
%
(
list
(
splits
)[
0
],
elem
)
for
elem
in
groups
[
group
]])
os
.
system
(
"
%s %s --stats > stats_%s.txt
"
%
(
readTrace
,
traces
,
group
))
os
.
system
(
"
%s %s --steps > steps_%s.txt
"
%
(
readTrace
,
traces
,
group
))
os
.
system
(
"
%s %s --stats > stats_bt.txt
"
%
(
readTrace
,
"
"
.
join
(
btTraces
)))
This diff is collapsed.
Click to expand it.
outputs/pvalues/pvalues.sh
+
38
−
20
View file @
e29d000f
#!/bin/bash
NAME
=
'tagparser'
SYSTEMS
=
`
ls
$NAME
`
METRICS
=
"UAS UPOS"
RUNS
=
10000
RUNS
=
50000
GRPS
=(
'eager'
'tagger'
'tagparser'
)
computePVal
()
{
rm
-r
results
NAME
=
"
$1
"
OUTPUT
=
"
$1
.res"
METRICS
=
"UAS UPOS"
if
[
"
$OUTPUT
"
=
"tagger.res"
]
;
then
METRICS
=
"UPOS"
fi
if
[
"
$OUTPUT
"
=
"eager.res"
]
;
then
METRICS
=
"UAS"
fi
SYSTEMS
=
$(
ls
$NAME
)
>
$OUTPUT
for
metric
in
$METRICS
;
do
[[
$#
-ne
0
]]
&&
SYSTEMS
=
$@
set
-x
set
-e
for
sys
in
$SYSTEMS
;
do
...
...
@@ -18,7 +30,13 @@ for metric in $METRICS; do
>
results/
$sys
/
${
testset
%.conllu
}
done
done
echo
$metric
python3
`
python3
-c
'import conll18 as x; print(x.__file__)'
`
-r
$RUNS
echo
""
echo
$metric
>>
$OUTPUT
python3
`
python3
-c
'import conll18 as x; print(x.__file__)'
`
-r
$RUNS
>>
$OUTPUT
echo
""
>>
$OUTPUT
done
}
for
grp
in
${
GRPS
[@]
}
;
do
computePVal
$grp
done
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