Toggle navigation
Toggle navigation
This project
Loading...
Sign in
graykode
/
commit-autosuggestions
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
graykode
2020-11-01 22:13:52 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
26618a00e69f698bf760ca3437644bde6b9ca109
26618a00
1 parent
ad248582
(fixed) type of gold.target change from list to str
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
code2nl/run.py
code2nl/run.py
View file @
26618a0
...
...
@@ -466,7 +466,7 @@ def main():
for
ref
,
gold
in
zip
(
p
,
eval_examples
):
predictions
.
append
(
str
(
gold
.
idx
)
+
'
\t
'
+
ref
)
f
.
write
(
str
(
gold
.
idx
)
+
'
\t
'
+
ref
+
'
\n
'
)
f1
.
write
(
str
(
gold
.
idx
)
+
'
\t
'
+
gold
.
target
+
'
\n
'
)
f1
.
write
(
str
(
gold
.
idx
)
+
'
\t
'
+
' '
.
join
(
gold
.
target
)
+
'
\n
'
)
(
goldMap
,
predictionMap
)
=
bleu
.
computeMaps
(
predictions
,
os
.
path
.
join
(
args
.
output_dir
,
"dev.gold"
))
dev_bleu
=
round
(
bleu
.
bleuFromMaps
(
goldMap
,
predictionMap
)[
0
],
2
)
...
...
@@ -523,7 +523,7 @@ def main():
for
ref
,
gold
in
zip
(
p
,
eval_examples
):
predictions
.
append
(
str
(
gold
.
idx
)
+
'
\t
'
+
ref
)
f
.
write
(
str
(
gold
.
idx
)
+
'
\t
'
+
ref
+
'
\n
'
)
f1
.
write
(
str
(
gold
.
idx
)
+
'
\t
'
+
gold
.
target
+
'
\n
'
)
f1
.
write
(
str
(
gold
.
idx
)
+
'
\t
'
+
' '
.
join
(
gold
.
target
)
+
'
\n
'
)
(
goldMap
,
predictionMap
)
=
bleu
.
computeMaps
(
predictions
,
os
.
path
.
join
(
args
.
output_dir
,
"test_{}.gold"
.
format
(
idx
)))
dev_bleu
=
round
(
bleu
.
bleuFromMaps
(
goldMap
,
predictionMap
)[
0
],
2
)
...
...
Please
register
or
login
to post a comment