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
ModelZoo
ResNet50_tensorflow
Commits
ce93cb75
Commit
ce93cb75
authored
Jul 23, 2020
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 322923416
parent
acb34644
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
official/nlp/tasks/question_answering.py
official/nlp/tasks/question_answering.py
+13
-0
No files found.
official/nlp/tasks/question_answering.py
View file @
ce93cb75
...
@@ -274,8 +274,21 @@ class QuestionAnsweringTask(base_task.Task):
...
@@ -274,8 +274,21 @@ class QuestionAnsweringTask(base_task.Task):
if
self
.
task_config
.
validation_data
.
version_2_with_negative
:
if
self
.
task_config
.
validation_data
.
version_2_with_negative
:
eval_metrics
=
squad_evaluate_v2_0
.
evaluate
(
eval_metrics
=
squad_evaluate_v2_0
.
evaluate
(
pred_dataset
,
all_predictions
,
scores_diff
)
pred_dataset
,
all_predictions
,
scores_diff
)
# Filter out useless metrics, such as start_position_accuracy that
# we did not actually compute.
eval_metrics
=
{
'exact_match'
:
eval_metrics
[
'final_exact'
],
'exact_match_threshold'
:
eval_metrics
[
'final_exact_thresh'
],
'final_f1'
:
eval_metrics
[
'final_f1'
]
/
100.0
,
# scale back to [0, 1].
'f1_threshold'
:
eval_metrics
[
'final_f1_thresh'
],
'has_answer_exact_match'
:
eval_metrics
[
'HasAns_exact'
],
'has_answer_f1'
:
eval_metrics
[
'HasAns_f1'
]}
else
:
else
:
eval_metrics
=
squad_evaluate_v1_1
.
evaluate
(
pred_dataset
,
all_predictions
)
eval_metrics
=
squad_evaluate_v1_1
.
evaluate
(
pred_dataset
,
all_predictions
)
# Filter out useless metrics, such as start_position_accuracy that
# we did not actually compute.
eval_metrics
=
{
'exact_match'
:
eval_metrics
[
'exact_match'
],
'final_f1'
:
eval_metrics
[
'final_f1'
]}
return
eval_metrics
return
eval_metrics
def
initialize
(
self
,
model
):
def
initialize
(
self
,
model
):
...
...
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