Spaces:
Runtime error
Runtime error
Sebastian Gehrmann
commited on
Commit
·
57616af
1
Parent(s):
de75832
Add previous results
Browse files- datacards/considerations.py +3 -3
- datacards/context.py +3 -3
- datacards/curation.py +85 -45
- datacards/gem.py +17 -10
- datacards/overview.py +43 -26
- datacards/results.py +61 -2
- datacards/streamlit_utils.py +13 -4
datacards/considerations.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
-
from .streamlit_utils import
|
| 4 |
-
make_text_input
|
| 5 |
-
)
|
| 6 |
|
| 7 |
N_FIELDS = 1
|
| 8 |
|
|
|
|
| 9 |
def considerations_page():
|
| 10 |
return None
|
| 11 |
|
|
|
|
| 12 |
def considerations_summary():
|
| 13 |
return None
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
+
from .streamlit_utils import make_text_input
|
|
|
|
|
|
|
| 4 |
|
| 5 |
N_FIELDS = 1
|
| 6 |
|
| 7 |
+
|
| 8 |
def considerations_page():
|
| 9 |
return None
|
| 10 |
|
| 11 |
+
|
| 12 |
def considerations_summary():
|
| 13 |
return None
|
datacards/context.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
-
from .streamlit_utils import
|
| 4 |
-
make_text_input
|
| 5 |
-
)
|
| 6 |
|
| 7 |
N_FIELDS = 1
|
| 8 |
|
|
|
|
| 9 |
def context_page():
|
| 10 |
return None
|
| 11 |
|
|
|
|
| 12 |
def context_summary():
|
| 13 |
return None
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
+
from .streamlit_utils import make_text_input
|
|
|
|
|
|
|
| 4 |
|
| 5 |
N_FIELDS = 1
|
| 6 |
|
| 7 |
+
|
| 8 |
def context_page():
|
| 9 |
return None
|
| 10 |
|
| 11 |
+
|
| 12 |
def context_summary():
|
| 13 |
return None
|
datacards/curation.py
CHANGED
|
@@ -1,8 +1,6 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
-
from .streamlit_utils import
|
| 4 |
-
make_text_input
|
| 5 |
-
)
|
| 6 |
|
| 7 |
from .streamlit_utils import (
|
| 8 |
make_multiselect,
|
|
@@ -20,33 +18,40 @@ N_FIELDS_PII = 0
|
|
| 20 |
N_FIELDS_MAINTENANCE = 0
|
| 21 |
N_FIELDS_GEM = 0
|
| 22 |
|
| 23 |
-
N_FIELDS =
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
| 30 |
|
| 31 |
|
| 32 |
"""
|
| 33 |
What was the selection criteria? [Describe the process for selecting instances to include in the dataset, including any tools used.]
|
| 34 |
"""
|
| 35 |
|
|
|
|
| 36 |
def curation_page():
|
| 37 |
-
st.session_state.card_dict["curation"] = st.session_state.card_dict.get(
|
|
|
|
|
|
|
| 38 |
with st.expander("Original Curation", expanded=False):
|
| 39 |
key_pref = ["curation", "original"]
|
| 40 |
-
st.session_state.card_dict["curation"]["original"] = st.session_state.card_dict[
|
|
|
|
|
|
|
| 41 |
make_text_area(
|
| 42 |
label="Original curation rationale",
|
| 43 |
key_list=key_pref + ["rationale"],
|
| 44 |
-
help="Describe the curation rationale behind the original dataset(s)."
|
| 45 |
)
|
| 46 |
make_text_area(
|
| 47 |
label="What was the communicative goal?",
|
| 48 |
key_list=key_pref + ["communicative"],
|
| 49 |
-
help="Describe the communicative goal that the original dataset(s) was trying to represent."
|
| 50 |
)
|
| 51 |
make_radio(
|
| 52 |
label="Is the dataset aggregated from different data sources?",
|
|
@@ -57,95 +62,130 @@ def curation_page():
|
|
| 57 |
make_text_area(
|
| 58 |
label="If yes, list the sources",
|
| 59 |
key_list=key_pref + ["aggregated-sources"],
|
| 60 |
-
help="Otherwise, type N/A"
|
| 61 |
)
|
| 62 |
with st.expander("Language Data", expanded=False):
|
| 63 |
key_pref = ["curation", "language"]
|
| 64 |
-
st.session_state.card_dict["curation"]["language"] = st.session_state.card_dict[
|
|
|
|
|
|
|
| 65 |
make_multiselect(
|
| 66 |
label="How was the language data obtained?",
|
| 67 |
-
options=[
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
)
|
| 70 |
make_multiselect(
|
| 71 |
label="If found, where from?",
|
| 72 |
options=["website", "offline media collection", "other", "N/A"],
|
| 73 |
-
key_list=key_pref+["found"],
|
| 74 |
-
help="select N/A if none of the language data was found"
|
| 75 |
)
|
| 76 |
make_multiselect(
|
| 77 |
label="If crowdsourced, where from?",
|
| 78 |
-
options=[
|
| 79 |
-
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
)
|
| 82 |
make_text_area(
|
| 83 |
label="If created for the dataset, describe the creation process.",
|
| 84 |
-
key_list=key_pref+["created"],
|
| 85 |
)
|
| 86 |
make_text_area(
|
| 87 |
label="What further information do we have on the language producers?",
|
| 88 |
-
key_list=key_pref+["producers-description"],
|
| 89 |
help="Provide a description of the context in which the language was produced and who produced it.",
|
| 90 |
)
|
| 91 |
make_text_input(
|
| 92 |
label="If text was machine-generated for the dataset, provide a link to the generation method if available (N/A otherwise).",
|
| 93 |
-
key_list=key_pref+["machine-generated"],
|
| 94 |
help="if the generation code is unavailable, enter N/A",
|
| 95 |
)
|
| 96 |
make_selectbox(
|
| 97 |
label="Was the text validated by a different worker or a data curator?",
|
| 98 |
-
options=[
|
| 99 |
-
|
| 100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
)
|
| 102 |
make_multiselect(
|
| 103 |
label="In what kind of organization did the curation happen?",
|
| 104 |
-
options=
|
| 105 |
-
key_list=key_pref+["organization-type"],
|
| 106 |
)
|
| 107 |
make_text_input(
|
| 108 |
label="Name the organization(s).",
|
| 109 |
-
key_list=key_pref+["organization-names"],
|
| 110 |
help="comma-separated",
|
| 111 |
)
|
| 112 |
make_text_area(
|
| 113 |
label="How was the text data pre-processed? (Enter N/A if the text was not pre-processed)",
|
| 114 |
-
key_list=key_pref+["pre-processed"],
|
| 115 |
-
help="List the steps in preprocessing the data for the dataset. Enter N/A if no steps were taken."
|
| 116 |
)
|
| 117 |
make_selectbox(
|
| 118 |
label="Were text instances selected or filtered?",
|
| 119 |
options=["not filtered", "manually", "algorithmically", "hybrid"],
|
| 120 |
-
key_list=key_pref+["is-filtered"],
|
| 121 |
)
|
| 122 |
make_text_area(
|
| 123 |
label="What were the selection criteria?",
|
| 124 |
-
key_list=key_pref+["filtered-criteria"],
|
| 125 |
-
help="Describe the process for selecting instances to include in the dataset, including any tools used. If no selection was done, enter N/A."
|
| 126 |
)
|
| 127 |
with st.expander("Structured Annotations", expanded=False):
|
| 128 |
key_pref = ["curation", "annotations"]
|
| 129 |
-
st.session_state.card_dict["curation"][
|
|
|
|
|
|
|
| 130 |
with st.expander("Consent", expanded=False):
|
| 131 |
key_pref = ["curation", "consent"]
|
| 132 |
-
st.session_state.card_dict["curation"]["consent"] = st.session_state.card_dict[
|
|
|
|
|
|
|
| 133 |
with st.expander("Private Identifying Information (PII)", expanded=False):
|
| 134 |
key_pref = ["curation", "pii"]
|
| 135 |
-
st.session_state.card_dict["curation"]["pii"] = st.session_state.card_dict[
|
|
|
|
|
|
|
| 136 |
with st.expander("Maintenance", expanded=False):
|
| 137 |
key_pref = ["curation", "maintenance"]
|
| 138 |
-
st.session_state.card_dict["curation"][
|
|
|
|
|
|
|
| 139 |
with st.expander("GEM Additional Curation", expanded=False):
|
| 140 |
key_pref = ["curation", "gem"]
|
| 141 |
-
st.session_state.card_dict["curation"]["gem"] = st.session_state.card_dict[
|
|
|
|
|
|
|
| 142 |
|
| 143 |
|
| 144 |
def curation_summary():
|
| 145 |
-
total_filled = sum(
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
completion_markdown = ""
|
| 148 |
-
completion_markdown +=
|
|
|
|
|
|
|
| 149 |
completion_markdown += f"- **Sub-section - Original Curation:**\n - {len(st.session_state.card_dict.get('curation', {}).get('original', {}))} of {N_FIELDS_ORIGINAL} fields\n"
|
| 150 |
completion_markdown += f"- **Sub-section - Language Data:**\n - {len(st.session_state.card_dict.get('curation', {}).get('language', {}))} of {N_FIELDS_LANGUAGE} fields\n"
|
| 151 |
completion_markdown += f"- **Sub-section - Structured Annotations:**\n - {len(st.session_state.card_dict.get('curation', {}).get('annotations', {}))} of {N_FIELDS_ANNOTATIONS} fields\n"
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
+
from .streamlit_utils import make_text_input
|
|
|
|
|
|
|
| 4 |
|
| 5 |
from .streamlit_utils import (
|
| 6 |
make_multiselect,
|
|
|
|
| 18 |
N_FIELDS_MAINTENANCE = 0
|
| 19 |
N_FIELDS_GEM = 0
|
| 20 |
|
| 21 |
+
N_FIELDS = (
|
| 22 |
+
N_FIELDS_ORIGINAL
|
| 23 |
+
+ N_FIELDS_LANGUAGE
|
| 24 |
+
+ N_FIELDS_ANNOTATIONS
|
| 25 |
+
+ N_FIELDS_CONSENT
|
| 26 |
+
+ N_FIELDS_PII
|
| 27 |
+
+ N_FIELDS_MAINTENANCE
|
| 28 |
+
+ N_FIELDS_GEM
|
| 29 |
+
)
|
| 30 |
|
| 31 |
|
| 32 |
"""
|
| 33 |
What was the selection criteria? [Describe the process for selecting instances to include in the dataset, including any tools used.]
|
| 34 |
"""
|
| 35 |
|
| 36 |
+
|
| 37 |
def curation_page():
|
| 38 |
+
st.session_state.card_dict["curation"] = st.session_state.card_dict.get(
|
| 39 |
+
"curation", {}
|
| 40 |
+
)
|
| 41 |
with st.expander("Original Curation", expanded=False):
|
| 42 |
key_pref = ["curation", "original"]
|
| 43 |
+
st.session_state.card_dict["curation"]["original"] = st.session_state.card_dict[
|
| 44 |
+
"curation"
|
| 45 |
+
].get("original", {})
|
| 46 |
make_text_area(
|
| 47 |
label="Original curation rationale",
|
| 48 |
key_list=key_pref + ["rationale"],
|
| 49 |
+
help="Describe the curation rationale behind the original dataset(s).",
|
| 50 |
)
|
| 51 |
make_text_area(
|
| 52 |
label="What was the communicative goal?",
|
| 53 |
key_list=key_pref + ["communicative"],
|
| 54 |
+
help="Describe the communicative goal that the original dataset(s) was trying to represent.",
|
| 55 |
)
|
| 56 |
make_radio(
|
| 57 |
label="Is the dataset aggregated from different data sources?",
|
|
|
|
| 62 |
make_text_area(
|
| 63 |
label="If yes, list the sources",
|
| 64 |
key_list=key_pref + ["aggregated-sources"],
|
| 65 |
+
help="Otherwise, type N/A",
|
| 66 |
)
|
| 67 |
with st.expander("Language Data", expanded=False):
|
| 68 |
key_pref = ["curation", "language"]
|
| 69 |
+
st.session_state.card_dict["curation"]["language"] = st.session_state.card_dict[
|
| 70 |
+
"curation"
|
| 71 |
+
].get("language", {})
|
| 72 |
make_multiselect(
|
| 73 |
label="How was the language data obtained?",
|
| 74 |
+
options=[
|
| 75 |
+
"found",
|
| 76 |
+
"created for the dataset",
|
| 77 |
+
"crowdsourced",
|
| 78 |
+
"machine-generated",
|
| 79 |
+
"other",
|
| 80 |
+
],
|
| 81 |
+
key_list=key_pref + ["obtained"],
|
| 82 |
)
|
| 83 |
make_multiselect(
|
| 84 |
label="If found, where from?",
|
| 85 |
options=["website", "offline media collection", "other", "N/A"],
|
| 86 |
+
key_list=key_pref + ["found"],
|
| 87 |
+
help="select N/A if none of the language data was found",
|
| 88 |
)
|
| 89 |
make_multiselect(
|
| 90 |
label="If crowdsourced, where from?",
|
| 91 |
+
options=[
|
| 92 |
+
"Amazon Mechanical Turk",
|
| 93 |
+
"other crowdworker platform",
|
| 94 |
+
"participatory experiment",
|
| 95 |
+
"other",
|
| 96 |
+
"N/A",
|
| 97 |
+
],
|
| 98 |
+
key_list=key_pref + ["crowdsourced"],
|
| 99 |
+
help="select N/A if none of the language data was crowdsourced",
|
| 100 |
)
|
| 101 |
make_text_area(
|
| 102 |
label="If created for the dataset, describe the creation process.",
|
| 103 |
+
key_list=key_pref + ["created"],
|
| 104 |
)
|
| 105 |
make_text_area(
|
| 106 |
label="What further information do we have on the language producers?",
|
| 107 |
+
key_list=key_pref + ["producers-description"],
|
| 108 |
help="Provide a description of the context in which the language was produced and who produced it.",
|
| 109 |
)
|
| 110 |
make_text_input(
|
| 111 |
label="If text was machine-generated for the dataset, provide a link to the generation method if available (N/A otherwise).",
|
| 112 |
+
key_list=key_pref + ["machine-generated"],
|
| 113 |
help="if the generation code is unavailable, enter N/A",
|
| 114 |
)
|
| 115 |
make_selectbox(
|
| 116 |
label="Was the text validated by a different worker or a data curator?",
|
| 117 |
+
options=[
|
| 118 |
+
"not validated",
|
| 119 |
+
"validated by crowdworker",
|
| 120 |
+
"validated by data curator",
|
| 121 |
+
"other",
|
| 122 |
+
],
|
| 123 |
+
key_list=key_pref + ["validated"],
|
| 124 |
+
help="this question is about human or human-in-the-loop validation only",
|
| 125 |
)
|
| 126 |
make_multiselect(
|
| 127 |
label="In what kind of organization did the curation happen?",
|
| 128 |
+
options=["industry", "academic", "independent", "other"],
|
| 129 |
+
key_list=key_pref + ["organization-type"],
|
| 130 |
)
|
| 131 |
make_text_input(
|
| 132 |
label="Name the organization(s).",
|
| 133 |
+
key_list=key_pref + ["organization-names"],
|
| 134 |
help="comma-separated",
|
| 135 |
)
|
| 136 |
make_text_area(
|
| 137 |
label="How was the text data pre-processed? (Enter N/A if the text was not pre-processed)",
|
| 138 |
+
key_list=key_pref + ["pre-processed"],
|
| 139 |
+
help="List the steps in preprocessing the data for the dataset. Enter N/A if no steps were taken.",
|
| 140 |
)
|
| 141 |
make_selectbox(
|
| 142 |
label="Were text instances selected or filtered?",
|
| 143 |
options=["not filtered", "manually", "algorithmically", "hybrid"],
|
| 144 |
+
key_list=key_pref + ["is-filtered"],
|
| 145 |
)
|
| 146 |
make_text_area(
|
| 147 |
label="What were the selection criteria?",
|
| 148 |
+
key_list=key_pref + ["filtered-criteria"],
|
| 149 |
+
help="Describe the process for selecting instances to include in the dataset, including any tools used. If no selection was done, enter N/A.",
|
| 150 |
)
|
| 151 |
with st.expander("Structured Annotations", expanded=False):
|
| 152 |
key_pref = ["curation", "annotations"]
|
| 153 |
+
st.session_state.card_dict["curation"][
|
| 154 |
+
"annotations"
|
| 155 |
+
] = st.session_state.card_dict["curation"].get("annotations", {})
|
| 156 |
with st.expander("Consent", expanded=False):
|
| 157 |
key_pref = ["curation", "consent"]
|
| 158 |
+
st.session_state.card_dict["curation"]["consent"] = st.session_state.card_dict[
|
| 159 |
+
"curation"
|
| 160 |
+
].get("consent", {})
|
| 161 |
with st.expander("Private Identifying Information (PII)", expanded=False):
|
| 162 |
key_pref = ["curation", "pii"]
|
| 163 |
+
st.session_state.card_dict["curation"]["pii"] = st.session_state.card_dict[
|
| 164 |
+
"curation"
|
| 165 |
+
].get("pii", {})
|
| 166 |
with st.expander("Maintenance", expanded=False):
|
| 167 |
key_pref = ["curation", "maintenance"]
|
| 168 |
+
st.session_state.card_dict["curation"][
|
| 169 |
+
"maintenance"
|
| 170 |
+
] = st.session_state.card_dict["curation"].get("maintenance", {})
|
| 171 |
with st.expander("GEM Additional Curation", expanded=False):
|
| 172 |
key_pref = ["curation", "gem"]
|
| 173 |
+
st.session_state.card_dict["curation"]["gem"] = st.session_state.card_dict[
|
| 174 |
+
"curation"
|
| 175 |
+
].get("gem", {})
|
| 176 |
|
| 177 |
|
| 178 |
def curation_summary():
|
| 179 |
+
total_filled = sum(
|
| 180 |
+
[len(dct) for dct in st.session_state.card_dict.get("curation", {}).values()]
|
| 181 |
+
)
|
| 182 |
+
with st.expander(
|
| 183 |
+
f"Dataset Curation Completion - {total_filled} of {N_FIELDS}", expanded=False
|
| 184 |
+
):
|
| 185 |
completion_markdown = ""
|
| 186 |
+
completion_markdown += (
|
| 187 |
+
f"- **Overall competion:**\n - {total_filled} of {N_FIELDS} fields\n"
|
| 188 |
+
)
|
| 189 |
completion_markdown += f"- **Sub-section - Original Curation:**\n - {len(st.session_state.card_dict.get('curation', {}).get('original', {}))} of {N_FIELDS_ORIGINAL} fields\n"
|
| 190 |
completion_markdown += f"- **Sub-section - Language Data:**\n - {len(st.session_state.card_dict.get('curation', {}).get('language', {}))} of {N_FIELDS_LANGUAGE} fields\n"
|
| 191 |
completion_markdown += f"- **Sub-section - Structured Annotations:**\n - {len(st.session_state.card_dict.get('curation', {}).get('annotations', {}))} of {N_FIELDS_ANNOTATIONS} fields\n"
|
datacards/gem.py
CHANGED
|
@@ -1,8 +1,6 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
-
from .streamlit_utils import
|
| 4 |
-
make_text_input
|
| 5 |
-
)
|
| 6 |
|
| 7 |
from .streamlit_utils import (
|
| 8 |
make_text_area,
|
|
@@ -12,15 +10,16 @@ from .streamlit_utils import (
|
|
| 12 |
N_FIELDS_RATIONALE = 5
|
| 13 |
N_FIELDS_STARTING = 2
|
| 14 |
|
| 15 |
-
N_FIELDS = N_FIELDS_RATIONALE +
|
| 16 |
-
N_FIELDS_STARTING
|
| 17 |
|
| 18 |
|
| 19 |
def gem_page():
|
| 20 |
st.session_state.card_dict["gem"] = st.session_state.card_dict.get("gem", {})
|
| 21 |
with st.expander("Rationale", expanded=False):
|
| 22 |
key_pref = ["gem", "rationale"]
|
| 23 |
-
st.session_state.card_dict["gem"]["rationale"] = st.session_state.card_dict[
|
|
|
|
|
|
|
| 24 |
make_text_area(
|
| 25 |
label="What does this dataset contribute toward better generation evaluation and why is it part of GEM?",
|
| 26 |
key_list=key_pref + ["contribution"],
|
|
@@ -50,7 +49,9 @@ def gem_page():
|
|
| 50 |
)
|
| 51 |
with st.expander("Getting Started", expanded=False):
|
| 52 |
key_pref = ["gem", "starting"]
|
| 53 |
-
st.session_state.card_dict["gem"]["starting"] = st.session_state.card_dict[
|
|
|
|
|
|
|
| 54 |
make_text_area(
|
| 55 |
label="Getting started with in-depth research on the task. Add relevant pointers to resources that researchers can consult when they want to get started digging deeper into the task.",
|
| 56 |
key_list=key_pref + ["research-pointers"],
|
|
@@ -64,10 +65,16 @@ def gem_page():
|
|
| 64 |
|
| 65 |
|
| 66 |
def gem_summary():
|
| 67 |
-
total_filled = sum(
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
completion_markdown = ""
|
| 70 |
-
completion_markdown +=
|
|
|
|
|
|
|
| 71 |
completion_markdown += f"- **Sub-section - Rationale:**\n - {len(st.session_state.card_dict.get('gem', {}).get('rationale', {}))} of {N_FIELDS_RATIONALE} fields\n"
|
| 72 |
completion_markdown += f"- **Sub-section - Getting Started:**\n - {len(st.session_state.card_dict.get('gem', {}).get('starting', {}))} of {N_FIELDS_STARTING} fields\n"
|
| 73 |
st.markdown(completion_markdown)
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
+
from .streamlit_utils import make_text_input
|
|
|
|
|
|
|
| 4 |
|
| 5 |
from .streamlit_utils import (
|
| 6 |
make_text_area,
|
|
|
|
| 10 |
N_FIELDS_RATIONALE = 5
|
| 11 |
N_FIELDS_STARTING = 2
|
| 12 |
|
| 13 |
+
N_FIELDS = N_FIELDS_RATIONALE + N_FIELDS_STARTING
|
|
|
|
| 14 |
|
| 15 |
|
| 16 |
def gem_page():
|
| 17 |
st.session_state.card_dict["gem"] = st.session_state.card_dict.get("gem", {})
|
| 18 |
with st.expander("Rationale", expanded=False):
|
| 19 |
key_pref = ["gem", "rationale"]
|
| 20 |
+
st.session_state.card_dict["gem"]["rationale"] = st.session_state.card_dict[
|
| 21 |
+
"gem"
|
| 22 |
+
].get("rationale", {})
|
| 23 |
make_text_area(
|
| 24 |
label="What does this dataset contribute toward better generation evaluation and why is it part of GEM?",
|
| 25 |
key_list=key_pref + ["contribution"],
|
|
|
|
| 49 |
)
|
| 50 |
with st.expander("Getting Started", expanded=False):
|
| 51 |
key_pref = ["gem", "starting"]
|
| 52 |
+
st.session_state.card_dict["gem"]["starting"] = st.session_state.card_dict[
|
| 53 |
+
"gem"
|
| 54 |
+
].get("starting", {})
|
| 55 |
make_text_area(
|
| 56 |
label="Getting started with in-depth research on the task. Add relevant pointers to resources that researchers can consult when they want to get started digging deeper into the task.",
|
| 57 |
key_list=key_pref + ["research-pointers"],
|
|
|
|
| 65 |
|
| 66 |
|
| 67 |
def gem_summary():
|
| 68 |
+
total_filled = sum(
|
| 69 |
+
[len(dct) for dct in st.session_state.card_dict.get("gem", {}).values()]
|
| 70 |
+
)
|
| 71 |
+
with st.expander(
|
| 72 |
+
f"Dataset in GEM Completion - {total_filled} of {N_FIELDS}", expanded=False
|
| 73 |
+
):
|
| 74 |
completion_markdown = ""
|
| 75 |
+
completion_markdown += (
|
| 76 |
+
f"- **Overall competion:**\n - {total_filled} of {N_FIELDS} fields\n"
|
| 77 |
+
)
|
| 78 |
completion_markdown += f"- **Sub-section - Rationale:**\n - {len(st.session_state.card_dict.get('gem', {}).get('rationale', {}))} of {N_FIELDS_RATIONALE} fields\n"
|
| 79 |
completion_markdown += f"- **Sub-section - Getting Started:**\n - {len(st.session_state.card_dict.get('gem', {}).get('starting', {}))} of {N_FIELDS_STARTING} fields\n"
|
| 80 |
st.markdown(completion_markdown)
|
datacards/overview.py
CHANGED
|
@@ -16,25 +16,29 @@ N_FIELDS_LANGUAGES = 8
|
|
| 16 |
N_FIELDS_CREDIT = 3
|
| 17 |
N_FIELDS_STRUCTURE = 7
|
| 18 |
|
| 19 |
-
N_FIELDS = N_FIELDS_WHERE +
|
| 20 |
-
N_FIELDS_LANGUAGES + \
|
| 21 |
-
N_FIELDS_CREDIT + \
|
| 22 |
-
N_FIELDS_STRUCTURE
|
| 23 |
|
| 24 |
|
| 25 |
languages_bcp47 = [
|
| 26 |
x
|
| 27 |
-
for x in json.load(open(pjoin("resources", "bcp47.json"), encoding="utf-8"))[
|
|
|
|
|
|
|
| 28 |
if x["type"] == "language"
|
| 29 |
]
|
| 30 |
|
| 31 |
license_list = json.load(open(pjoin("resources", "licenses.json"), encoding="utf-8"))
|
| 32 |
|
|
|
|
| 33 |
def overview_page():
|
| 34 |
-
st.session_state.card_dict["overview"] = st.session_state.card_dict.get(
|
|
|
|
|
|
|
| 35 |
with st.expander("Where to find the data and its documentation", expanded=False):
|
| 36 |
key_pref = ["overview", "where"]
|
| 37 |
-
st.session_state.card_dict["overview"]["where"] = st.session_state.card_dict[
|
|
|
|
|
|
|
| 38 |
make_text_input(
|
| 39 |
label="What is the webpage for the dataset (if it exists)?",
|
| 40 |
key_list=key_pref + ["website"],
|
|
@@ -83,7 +87,9 @@ def overview_page():
|
|
| 83 |
)
|
| 84 |
with st.expander("Languages and Intended Use", expanded=False):
|
| 85 |
key_pref = ["overview", "languages"]
|
| 86 |
-
st.session_state.card_dict["overview"][
|
|
|
|
|
|
|
| 87 |
make_radio(
|
| 88 |
label="Is the dataset multilingual?",
|
| 89 |
options=["no", "yes"],
|
|
@@ -93,9 +99,7 @@ def overview_page():
|
|
| 93 |
make_multiselect(
|
| 94 |
label="What languages/dialects are covered in the dataset?",
|
| 95 |
key_list=key_pref + ["language-names"],
|
| 96 |
-
options=[
|
| 97 |
-
", ".join(x["description"]) for x in languages_bcp47
|
| 98 |
-
],
|
| 99 |
help="This is a comprehensive list of languages obtained from the BCP-47 standard list.",
|
| 100 |
)
|
| 101 |
make_text_area(
|
|
@@ -117,20 +121,23 @@ def overview_page():
|
|
| 117 |
label="What is the license of the dataset?",
|
| 118 |
key_list=key_pref + ["license"],
|
| 119 |
options=license_list,
|
| 120 |
-
help="select `other` if missing from list, `unkown` if not provided."
|
| 121 |
)
|
| 122 |
make_selectbox(
|
| 123 |
label="What primary task does the dataset support?",
|
| 124 |
key_list=key_pref + ["task"],
|
| 125 |
-
options=[
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
| 134 |
help="Select `other` if the task is not included in the list.",
|
| 135 |
)
|
| 136 |
make_text_area(
|
|
@@ -140,7 +147,9 @@ def overview_page():
|
|
| 140 |
)
|
| 141 |
with st.expander("Credit", expanded=False):
|
| 142 |
key_pref = ["overview", "credit"]
|
| 143 |
-
st.session_state.card_dict["overview"][
|
|
|
|
|
|
|
| 144 |
make_text_input(
|
| 145 |
label="Who created the original dataset? List the people involved in collecting the dataset and their affiliation(s).",
|
| 146 |
key_list=key_pref + ["creators"],
|
|
@@ -158,7 +167,9 @@ def overview_page():
|
|
| 158 |
)
|
| 159 |
with st.expander("Structure", expanded=False):
|
| 160 |
key_pref = ["overview", "structure"]
|
| 161 |
-
st.session_state.card_dict["overview"][
|
|
|
|
|
|
|
| 162 |
data_fields_help = """
|
| 163 |
[free text; paragraphs]
|
| 164 |
- Mention their data type, and whether and how they are used as part of the generation pipeline.
|
|
@@ -203,10 +214,16 @@ def overview_page():
|
|
| 203 |
|
| 204 |
|
| 205 |
def overview_summary():
|
| 206 |
-
total_filled = sum(
|
| 207 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
completion_markdown = ""
|
| 209 |
-
completion_markdown +=
|
|
|
|
|
|
|
| 210 |
completion_markdown += f"- **Sub-section - Where to find:**\n - {len(st.session_state.card_dict.get('overview', {}).get('where', {}))} of {N_FIELDS_WHERE} fields\n"
|
| 211 |
completion_markdown += f"- **Sub-section - Languages and Intended Use:**\n - {len(st.session_state.card_dict.get('overview', {}).get('languages', {}))} of {N_FIELDS_LANGUAGES} fields\n"
|
| 212 |
completion_markdown += f"- **Sub-section - Credit:**\n - {len(st.session_state.card_dict.get('overview', {}).get('credit', {}))} of {N_FIELDS_CREDIT} fields\n"
|
|
|
|
| 16 |
N_FIELDS_CREDIT = 3
|
| 17 |
N_FIELDS_STRUCTURE = 7
|
| 18 |
|
| 19 |
+
N_FIELDS = N_FIELDS_WHERE + N_FIELDS_LANGUAGES + N_FIELDS_CREDIT + N_FIELDS_STRUCTURE
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
|
| 22 |
languages_bcp47 = [
|
| 23 |
x
|
| 24 |
+
for x in json.load(open(pjoin("resources", "bcp47.json"), encoding="utf-8"))[
|
| 25 |
+
"subtags"
|
| 26 |
+
]
|
| 27 |
if x["type"] == "language"
|
| 28 |
]
|
| 29 |
|
| 30 |
license_list = json.load(open(pjoin("resources", "licenses.json"), encoding="utf-8"))
|
| 31 |
|
| 32 |
+
|
| 33 |
def overview_page():
|
| 34 |
+
st.session_state.card_dict["overview"] = st.session_state.card_dict.get(
|
| 35 |
+
"overview", {}
|
| 36 |
+
)
|
| 37 |
with st.expander("Where to find the data and its documentation", expanded=False):
|
| 38 |
key_pref = ["overview", "where"]
|
| 39 |
+
st.session_state.card_dict["overview"]["where"] = st.session_state.card_dict[
|
| 40 |
+
"overview"
|
| 41 |
+
].get("where", {})
|
| 42 |
make_text_input(
|
| 43 |
label="What is the webpage for the dataset (if it exists)?",
|
| 44 |
key_list=key_pref + ["website"],
|
|
|
|
| 87 |
)
|
| 88 |
with st.expander("Languages and Intended Use", expanded=False):
|
| 89 |
key_pref = ["overview", "languages"]
|
| 90 |
+
st.session_state.card_dict["overview"][
|
| 91 |
+
"languages"
|
| 92 |
+
] = st.session_state.card_dict["overview"].get("languages", {})
|
| 93 |
make_radio(
|
| 94 |
label="Is the dataset multilingual?",
|
| 95 |
options=["no", "yes"],
|
|
|
|
| 99 |
make_multiselect(
|
| 100 |
label="What languages/dialects are covered in the dataset?",
|
| 101 |
key_list=key_pref + ["language-names"],
|
| 102 |
+
options=[", ".join(x["description"]) for x in languages_bcp47],
|
|
|
|
|
|
|
| 103 |
help="This is a comprehensive list of languages obtained from the BCP-47 standard list.",
|
| 104 |
)
|
| 105 |
make_text_area(
|
|
|
|
| 121 |
label="What is the license of the dataset?",
|
| 122 |
key_list=key_pref + ["license"],
|
| 123 |
options=license_list,
|
| 124 |
+
help="select `other` if missing from list, `unkown` if not provided.",
|
| 125 |
)
|
| 126 |
make_selectbox(
|
| 127 |
label="What primary task does the dataset support?",
|
| 128 |
key_list=key_pref + ["task"],
|
| 129 |
+
options=[
|
| 130 |
+
"Content Transfer",
|
| 131 |
+
"Data-to-Text",
|
| 132 |
+
"Dialog Response Generation",
|
| 133 |
+
"Paraphrasing",
|
| 134 |
+
"Question Generation",
|
| 135 |
+
"Reasoning",
|
| 136 |
+
"Simplification",
|
| 137 |
+
"Style Transfer",
|
| 138 |
+
"Summarization",
|
| 139 |
+
"Text-to-Slide",
|
| 140 |
+
],
|
| 141 |
help="Select `other` if the task is not included in the list.",
|
| 142 |
)
|
| 143 |
make_text_area(
|
|
|
|
| 147 |
)
|
| 148 |
with st.expander("Credit", expanded=False):
|
| 149 |
key_pref = ["overview", "credit"]
|
| 150 |
+
st.session_state.card_dict["overview"][
|
| 151 |
+
"credit"
|
| 152 |
+
] = st.session_state.card_dict.get("credit", {})
|
| 153 |
make_text_input(
|
| 154 |
label="Who created the original dataset? List the people involved in collecting the dataset and their affiliation(s).",
|
| 155 |
key_list=key_pref + ["creators"],
|
|
|
|
| 167 |
)
|
| 168 |
with st.expander("Structure", expanded=False):
|
| 169 |
key_pref = ["overview", "structure"]
|
| 170 |
+
st.session_state.card_dict["overview"][
|
| 171 |
+
"structure"
|
| 172 |
+
] = st.session_state.card_dict.get("structure", {})
|
| 173 |
data_fields_help = """
|
| 174 |
[free text; paragraphs]
|
| 175 |
- Mention their data type, and whether and how they are used as part of the generation pipeline.
|
|
|
|
| 214 |
|
| 215 |
|
| 216 |
def overview_summary():
|
| 217 |
+
total_filled = sum(
|
| 218 |
+
[len(dct) for dct in st.session_state.card_dict.get("overview", {}).values()]
|
| 219 |
+
)
|
| 220 |
+
with st.expander(
|
| 221 |
+
f"Dataset Overview Completion - {total_filled} of {N_FIELDS}", expanded=False
|
| 222 |
+
):
|
| 223 |
completion_markdown = ""
|
| 224 |
+
completion_markdown += (
|
| 225 |
+
f"- **Overall competion:**\n - {total_filled} of {N_FIELDS} fields\n"
|
| 226 |
+
)
|
| 227 |
completion_markdown += f"- **Sub-section - Where to find:**\n - {len(st.session_state.card_dict.get('overview', {}).get('where', {}))} of {N_FIELDS_WHERE} fields\n"
|
| 228 |
completion_markdown += f"- **Sub-section - Languages and Intended Use:**\n - {len(st.session_state.card_dict.get('overview', {}).get('languages', {}))} of {N_FIELDS_LANGUAGES} fields\n"
|
| 229 |
completion_markdown += f"- **Sub-section - Credit:**\n - {len(st.session_state.card_dict.get('overview', {}).get('credit', {}))} of {N_FIELDS_CREDIT} fields\n"
|
datacards/results.py
CHANGED
|
@@ -1,13 +1,72 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
from .streamlit_utils import (
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
)
|
| 6 |
|
| 7 |
N_FIELDS = 1
|
| 8 |
|
|
|
|
| 9 |
def results_page():
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
def results_summary():
|
| 13 |
return None
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
from .streamlit_utils import (
|
| 4 |
+
make_multiselect,
|
| 5 |
+
make_selectbox,
|
| 6 |
+
make_text_area,
|
| 7 |
+
make_text_input,
|
| 8 |
+
make_radio,
|
| 9 |
)
|
| 10 |
|
| 11 |
N_FIELDS = 1
|
| 12 |
|
| 13 |
+
|
| 14 |
def results_page():
|
| 15 |
+
with st.expander("Previous Results", expanded=False):
|
| 16 |
+
key_pref = ["results", "results"]
|
| 17 |
+
st.session_state.card_dict["results"]["results"] = st.session_state.card_dict[
|
| 18 |
+
"results"
|
| 19 |
+
].get("results", {})
|
| 20 |
+
make_multiselect(
|
| 21 |
+
label="What metrics are typically used for this task?",
|
| 22 |
+
key_list=key_pref + ["metrics"],
|
| 23 |
+
options=[
|
| 24 |
+
"BERT-Score",
|
| 25 |
+
"BLEU",
|
| 26 |
+
"BLEURT",
|
| 27 |
+
"ChrF",
|
| 28 |
+
"Entailment",
|
| 29 |
+
"FeQA",
|
| 30 |
+
"METEOR" "MoverScore",
|
| 31 |
+
"QAGS",
|
| 32 |
+
"ROUGE",
|
| 33 |
+
"WER",
|
| 34 |
+
],
|
| 35 |
+
help="Select all metrics that are typically used when evaluating models for this task.",
|
| 36 |
+
)
|
| 37 |
+
make_text_area(
|
| 38 |
+
label="Describe the metrics and evaluation methodology that the dataset creators used when introducing this task.",
|
| 39 |
+
key_list=key_pref + ["original-evaluation"],
|
| 40 |
+
help="When the generation task was not evaluated when this dataset was introduced, write N/A.",
|
| 41 |
+
)
|
| 42 |
+
make_radio(
|
| 43 |
+
label="Are previous results available?",
|
| 44 |
+
options=["no", "yes"],
|
| 45 |
+
key_list=key_pref + ["has-previous-results"],
|
| 46 |
+
help="Have papers evaluated models on this task? If no, write N/A for the following three questions.",
|
| 47 |
+
)
|
| 48 |
+
make_text_area(
|
| 49 |
+
label="What evaluation approaches have others used?",
|
| 50 |
+
key_list=key_pref + ["modern-evaluation"],
|
| 51 |
+
help="If the modern evaluation strategy diverts from the original, describe how models are being evaluated.",
|
| 52 |
+
)
|
| 53 |
+
make_text_area(
|
| 54 |
+
label="What are previous results",
|
| 55 |
+
key_list=key_pref + ["previous-results"],
|
| 56 |
+
help="List the source and performance metrics for models on this dataset.",
|
| 57 |
+
)
|
| 58 |
+
make_text_area(
|
| 59 |
+
label="Definitions",
|
| 60 |
+
key_list=key_pref + ["definitions"],
|
| 61 |
+
help="If the evaluation strategies in the previous questions go beyond the list of metrics above, add descriptions and/or definitions for each metric.",
|
| 62 |
+
)
|
| 63 |
+
make_text_area(
|
| 64 |
+
label="What aspect of model ability can be measured with this dataset?",
|
| 65 |
+
key_list=key_pref + ["model-abilities"],
|
| 66 |
+
help="What kind of abilities should a model exhibit that performs well on the task of this dataset (e.g., reasoning capability, morphological inflection)?.",
|
| 67 |
+
)
|
| 68 |
+
|
| 69 |
+
|
| 70 |
|
| 71 |
def results_summary():
|
| 72 |
return None
|
datacards/streamlit_utils.py
CHANGED
|
@@ -4,10 +4,13 @@ import streamlit as st
|
|
| 4 |
# Streamlit widgets with persistence
|
| 5 |
def is_filled(key_list):
|
| 6 |
state_filled_key = "_".join(key_list) + "_filled"
|
|
|
|
| 7 |
def on_change_action():
|
| 8 |
st.session_state.save_state[state_filled_key] = True
|
|
|
|
| 9 |
return on_change_action
|
| 10 |
|
|
|
|
| 11 |
def update_card_dict(key_list, use_default=None):
|
| 12 |
state_key = "_".join(key_list)
|
| 13 |
if st.session_state.save_state.get(state_key + "_filled", False) or use_default:
|
|
@@ -39,7 +42,9 @@ def make_multiselect(
|
|
| 39 |
return res
|
| 40 |
|
| 41 |
|
| 42 |
-
def make_selectbox(
|
|
|
|
|
|
|
| 43 |
key = "_".join(key_list)
|
| 44 |
if key in st.session_state:
|
| 45 |
st.session_state.save_state[key] = st.session_state[key]
|
|
@@ -56,7 +61,9 @@ def make_selectbox(key_list, label, options, format_func=lambda x: x, help="", i
|
|
| 56 |
on_change=is_filled(key_list),
|
| 57 |
help=help,
|
| 58 |
)
|
| 59 |
-
update_card_dict(
|
|
|
|
|
|
|
| 60 |
return res
|
| 61 |
|
| 62 |
|
|
@@ -75,7 +82,9 @@ def make_radio(key_list, label, options, format_func=lambda x: x, help="", index
|
|
| 75 |
on_change=is_filled(key_list),
|
| 76 |
help=help,
|
| 77 |
)
|
| 78 |
-
update_card_dict(
|
|
|
|
|
|
|
| 79 |
return res
|
| 80 |
|
| 81 |
|
|
@@ -102,7 +111,7 @@ def make_text_area(key_list, label, help="", value=None):
|
|
| 102 |
st.session_state.save_state[key] = st.session_state[key]
|
| 103 |
elif value is not None:
|
| 104 |
st.session_state.save_state[key] = value
|
| 105 |
-
res =
|
| 106 |
label=label,
|
| 107 |
key=key,
|
| 108 |
value=st.session_state.save_state.get(key, ""),
|
|
|
|
| 4 |
# Streamlit widgets with persistence
|
| 5 |
def is_filled(key_list):
|
| 6 |
state_filled_key = "_".join(key_list) + "_filled"
|
| 7 |
+
|
| 8 |
def on_change_action():
|
| 9 |
st.session_state.save_state[state_filled_key] = True
|
| 10 |
+
|
| 11 |
return on_change_action
|
| 12 |
|
| 13 |
+
|
| 14 |
def update_card_dict(key_list, use_default=None):
|
| 15 |
state_key = "_".join(key_list)
|
| 16 |
if st.session_state.save_state.get(state_key + "_filled", False) or use_default:
|
|
|
|
| 42 |
return res
|
| 43 |
|
| 44 |
|
| 45 |
+
def make_selectbox(
|
| 46 |
+
key_list, label, options, format_func=lambda x: x, help="", index=None
|
| 47 |
+
):
|
| 48 |
key = "_".join(key_list)
|
| 49 |
if key in st.session_state:
|
| 50 |
st.session_state.save_state[key] = st.session_state[key]
|
|
|
|
| 61 |
on_change=is_filled(key_list),
|
| 62 |
help=help,
|
| 63 |
)
|
| 64 |
+
update_card_dict(
|
| 65 |
+
key_list, use_default=st.session_state.save_state.get(key, options[0])
|
| 66 |
+
) # use the default value even without interactions
|
| 67 |
return res
|
| 68 |
|
| 69 |
|
|
|
|
| 82 |
on_change=is_filled(key_list),
|
| 83 |
help=help,
|
| 84 |
)
|
| 85 |
+
update_card_dict(
|
| 86 |
+
key_list, use_default=st.session_state.save_state.get(key, options[0])
|
| 87 |
+
) # use the default value even without interactions
|
| 88 |
return res
|
| 89 |
|
| 90 |
|
|
|
|
| 111 |
st.session_state.save_state[key] = st.session_state[key]
|
| 112 |
elif value is not None:
|
| 113 |
st.session_state.save_state[key] = value
|
| 114 |
+
res = st.text_area(
|
| 115 |
label=label,
|
| 116 |
key=key,
|
| 117 |
value=st.session_state.save_state.get(key, ""),
|