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
d65a4f60
Commit
d65a4f60
authored
3 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Improved latex tab generator
parent
f6d89f91
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/pvalues/res2latex.py
+50
-43
50 additions, 43 deletions
outputs/pvalues/res2latex.py
outputs/stats2latex.py
+10
-4
10 additions, 4 deletions
outputs/stats2latex.py
with
60 additions
and
47 deletions
outputs/pvalues/res2latex.py
+
50
−
43
View file @
d65a4f60
...
...
@@ -2,28 +2,31 @@
import
sys
metrics
=
[]
def
toIgnore
(
model
)
:
return
"
bt2
"
in
model
def
modelName
(
model
)
:
if
"
bt1
"
in
model
.
lower
()
:
return
"
RL_BT1
"
return
"
RL
\
_BT1
"
if
"
no
"
in
model
.
lower
()
:
return
"
RL_NOBT
"
return
"
RL
\
_NOBT
"
if
"
oracle
"
in
model
.
lower
()
:
return
"
SUPERVISED
"
return
"
SL
"
print
(
"
ERROR %s not found
"
%
model
)
exit
(
1
)
return
"
NOT FOUND
"
def
nicePValue
(
p
)
:
if
p
==
"
_
"
:
return
p
return
"
\_
"
return
"
%.3f
"
%
p
for
line
in
open
(
sys
.
argv
[
1
])
:
for
filename
in
sys
.
argv
[
1
:]
:
metrics
=
[]
for
line
in
open
(
filename
)
:
line
=
line
.
strip
()
if
len
(
line
)
==
0
:
if
len
(
line
)
==
0
or
"
------
"
in
line
:
continue
splited
=
line
.
split
()
if
len
(
splited
)
==
1
:
...
...
@@ -36,7 +39,7 @@ for line in open(sys.argv[1]) :
if
len
(
splited
)
==
9
:
metrics
[
-
1
][
1
][
-
1
].
append
(
splited
[
8
].
split
(
'
=
'
)[
-
1
])
else
:
metrics
[
-
1
][
1
][
-
1
].
append
(
"
_
"
)
metrics
[
-
1
][
1
][
-
1
].
append
(
"
\
_
"
)
asTab
=
[[
"
\\
textbf{Model}
"
]
+
[
"
\\
textbf{%s}
"
%
[
m
[
0
],
"
p
"
][
i
]
for
m
in
metrics
for
i
in
[
0
,
1
]]]
models
=
{}
...
...
@@ -52,13 +55,17 @@ for model in models :
asTab
.
append
([
modelName
(
model
)])
asTab
[
-
1
]
+=
[
models
[
model
][
i
][
0
][
j
]
for
i
in
range
(
len
(
metrics
))
for
j
in
[
0
,
2
]]
print
(
"""
\\
begin{table}[]
\\
begin{tabular}{|l|l|l|l|}
print
(
"""
\\
begin{table}
\centering
\\
tabcolsep=0.8mm
\\
begin{tabular}{|l|l|l|l|l|}
\hline
"""
)
for
line
in
asTab
:
print
(
"
&
"
.
join
(
line
),
"
\\\\
\hline
"
)
print
(
"""
\end{tabular}
\caption{}
\label{tab:my-table}
\end{table}
"""
)
\caption{%s on UD\_French-GSD}
\label{tab:res_%s}
\end{table}
"""
%
(
filename
.
split
(
'
.
'
)[
0
],
filename
.
split
(
'
.
'
)[
0
]))
This diff is collapsed.
Click to expand it.
outputs/stats2latex.py
+
10
−
4
View file @
d65a4f60
...
...
@@ -8,6 +8,12 @@ def toIgnore(model) :
return
"
bt2
"
in
model
def
modelName
(
model
)
:
if
"
tagger
"
in
model
.
lower
()
:
return
"
TAGGER
"
if
"
tagparser
"
in
model
.
lower
()
:
return
"
TAPARSER
"
if
"
parser
"
in
model
.
lower
()
:
return
"
PARSER
"
if
"
bt1
"
in
model
.
lower
()
:
return
"
RL\_BT1
"
if
"
no
"
in
model
.
lower
()
:
...
...
@@ -34,10 +40,10 @@ targetValues = {"nbActions" : ("\#Actions",prettyInt),
"
nbBack
"
:
(
"
\#Backs
"
,
prettyInt
),
"
backPrecision
"
:
(
"
bPrec
"
,
percent
),
"
backRecall
"
:
(
"
bRec
"
,
percent
),
"
nbRedoneCorrectCorrect
"
:
(
"
\%
C$
\\
rightarrow$C
"
,
percent
),
"
nbRedoneErrErr
"
:
(
"
\%
E$
\\
rightarrow$E
"
,
percent
),
"
nbRedoneCorrectErr
"
:
(
"
\%
C$
\\
rightarrow$E
"
,
percent
),
"
nbRedoneErrCorrect
"
:
(
"
\%
E$
\\
rightarrow$C
"
,
percent
)}
"
nbRedoneCorrectCorrect
"
:
(
"
C$
\\
rightarrow$C
"
,
percent
),
"
nbRedoneErrErr
"
:
(
"
E$
\\
rightarrow$E
"
,
percent
),
"
nbRedoneCorrectErr
"
:
(
"
C$
\\
rightarrow$E
"
,
percent
),
"
nbRedoneErrCorrect
"
:
(
"
E$
\\
rightarrow$C
"
,
percent
)}
for
t
in
targetValues
:
old
=
targetValues
[
t
]
targetValues
[
t
]
=
(
"
\\
texttt{%s}
"
%
old
[
0
],
old
[
1
])
...
...
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