Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Michal Štefánik
ARQMath-eval
Commits
7239538f
Commit
7239538f
authored
Apr 15, 2020
by
Vít Novotný
Browse files
Only use train and test subsets in get_judged_documents and get_topics
parent
e7279bfa
Pipeline
#58282
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
scripts/common.py
View file @
7239538f
...
...
@@ -23,7 +23,10 @@ def remove_nonjudged_topics_and_documents(parsed_run, task, subset):
def
get_topics
(
task
=
'task1-votes'
,
subset
=
None
):
topics
=
set
()
subsets
=
PARSED_RELEVANCE_JUDGEMENTS
.
values
()
if
subset
is
None
else
[
PARSED_RELEVANCE_JUDGEMENTS
[
subset
]]
subsets
=
[
PARSED_RELEVANCE_JUDGEMENTS
[
'train'
],
PARSED_RELEVANCE_JUDGEMENTS
[
'test'
],
]
if
subset
is
None
else
[
PARSED_RELEVANCE_JUDGEMENTS
[
subset
]]
for
subset
in
subsets
:
for
topic
in
subset
[
task
].
keys
():
topics
.
add
(
topic
)
...
...
@@ -32,11 +35,13 @@ def get_topics(task='task1-votes', subset=None):
def
get_judged_documents
(
task
=
'task1-votes'
,
subset
=
None
,
topic
=
None
):
judged_documents
=
set
()
subsets
=
PARSED_RELEVANCE_JUDGEMENTS
.
values
()
if
subset
is
None
else
[
PARSED_RELEVANCE_JUDGEMENTS
[
subset
]]
subsets
=
[
PARSED_RELEVANCE_JUDGEMENTS
[
'train'
],
PARSED_RELEVANCE_JUDGEMENTS
[
'test'
],
]
if
subset
is
None
else
[
PARSED_RELEVANCE_JUDGEMENTS
[
subset
]]
for
subset
in
subsets
:
topics
=
subset
[
task
].
values
()
if
topic
is
None
else
[
subset
[
task
][
topic
]]
for
topic
in
topics
:
documents
=
topic
.
keys
()
for
documents
in
topics
:
judged_documents
.
update
(
documents
)
return
judged_documents
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment