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
466115b2
Unverified
Commit
466115b2
authored
Oct 16, 2020
by
Quentin Lhoest
Committed by
GitHub
Oct 16, 2020
Browse files
Fix missing reference titles in retrieval evaluation of RAG (#7817)
parent
464b53f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/rag/eval_rag.py
examples/rag/eval_rag.py
+1
-1
No files found.
examples/rag/eval_rag.py
View file @
466115b2
...
...
@@ -72,7 +72,7 @@ def get_precision_at_k(args, preds_path, gold_data_path):
em
=
total
=
0
for
hypo
,
reference
in
zip
(
hypos
,
references
):
hypo_provenance
=
set
(
hypo
.
split
(
"
\t
"
)[:
k
])
ref_provenance
=
set
(
reference
.
split
(
"
\t
"
)
[
1
:
(
k
+
1
)]
)
ref_provenance
=
set
(
reference
.
split
(
"
\t
"
))
total
+=
1
em
+=
len
(
hypo_provenance
&
ref_provenance
)
/
k
...
...
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