Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
9e7bc51b
Unverified
Commit
9e7bc51b
authored
May 22, 2019
by
tguens
Committed by
GitHub
May 22, 2019
Browse files
Update run_squad.py
Indentation change so that the output "nbest_predictions.json" is not empty.
parent
3fc63f12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/run_squad.py
examples/run_squad.py
+1
-1
No files found.
examples/run_squad.py
View file @
9e7bc51b
...
@@ -617,7 +617,7 @@ def write_predictions(all_examples, all_features, all_results, n_best_size,
...
@@ -617,7 +617,7 @@ def write_predictions(all_examples, all_features, all_results, n_best_size,
all_predictions
[
example
.
qas_id
]
=
""
all_predictions
[
example
.
qas_id
]
=
""
else
:
else
:
all_predictions
[
example
.
qas_id
]
=
best_non_null_entry
.
text
all_predictions
[
example
.
qas_id
]
=
best_non_null_entry
.
text
all_nbest_json
[
example
.
qas_id
]
=
nbest_json
all_nbest_json
[
example
.
qas_id
]
=
nbest_json
with
open
(
output_prediction_file
,
"w"
)
as
writer
:
with
open
(
output_prediction_file
,
"w"
)
as
writer
:
writer
.
write
(
json
.
dumps
(
all_predictions
,
indent
=
4
)
+
"
\n
"
)
writer
.
write
(
json
.
dumps
(
all_predictions
,
indent
=
4
)
+
"
\n
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment