Spaces:
Runtime error
Runtime error
Yacine Jernite
commited on
Commit
•
969e2c4
1
Parent(s):
fcb0120
social-previous-underserved
Browse files- datacards/considerations.py +1 -1
- datacards/context.py +44 -37
datacards/considerations.py
CHANGED
@@ -101,7 +101,7 @@ def considerations_summary():
|
|
101 |
):
|
102 |
completion_markdown = ""
|
103 |
completion_markdown += (
|
104 |
-
f"- **Overall
|
105 |
)
|
106 |
completion_markdown += f"- **Sub-section - PII Risks and Liability:**\n - {len(st.session_state.card_dict.get('considerations', {}).get('pii', {}))} of {N_FIELDS_PII} fields\n"
|
107 |
completion_markdown += f"- **Sub-section - Licenses:**\n - {len(st.session_state.card_dict.get('considerations', {}).get('licenses', {}))} of {N_FIELDS_LICENSES} fields\n"
|
|
|
101 |
):
|
102 |
completion_markdown = ""
|
103 |
completion_markdown += (
|
104 |
+
f"- **Overall completion:**\n - {total_filled} of {N_FIELDS} fields\n"
|
105 |
)
|
106 |
completion_markdown += f"- **Sub-section - PII Risks and Liability:**\n - {len(st.session_state.card_dict.get('considerations', {}).get('pii', {}))} of {N_FIELDS_PII} fields\n"
|
107 |
completion_markdown += f"- **Sub-section - Licenses:**\n - {len(st.session_state.card_dict.get('considerations', {}).get('licenses', {}))} of {N_FIELDS_LICENSES} fields\n"
|
datacards/context.py
CHANGED
@@ -8,58 +8,65 @@ from .streamlit_utils import (
|
|
8 |
make_radio,
|
9 |
)
|
10 |
|
11 |
-
|
12 |
-
N_FIELDS_UNDERSERVED_COMMUNITIES =
|
13 |
N_FIELDS_BIASES= 3
|
14 |
|
15 |
-
N_FIELDS =
|
16 |
|
17 |
def context_page():
|
18 |
st.session_state.card_dict["context"] = st.session_state.card_dict.get(
|
19 |
"context", {}
|
20 |
)
|
21 |
-
with st.expander("Social Impact of the Dataset", expanded=False):
|
22 |
-
key_pref = ["context", "
|
23 |
-
st.session_state.card_dict["context"]["
|
24 |
"context"
|
25 |
-
].get("
|
26 |
|
27 |
-
|
28 |
-
label="
|
29 |
-
|
30 |
-
|
31 |
-
)
|
32 |
-
|
33 |
-
make_text_area(
|
34 |
-
label="Did any of these previous uses result in observations about the dataset?",
|
35 |
-
key_list=key_pref + [""],
|
36 |
-
help="",
|
37 |
-
)
|
38 |
-
|
39 |
-
make_text_area(
|
40 |
-
label="Have any changes been made to the dataset as a result of these observations?",
|
41 |
-
key_list=key_pref + [""],
|
42 |
help="",
|
43 |
)
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
with st.expander("Impact on Under-Served Communities", expanded=False):
|
59 |
key_pref = ["context", "underserved"]
|
60 |
st.session_state.card_dict["context"]["underserved"] = st.session_state.card_dict[
|
61 |
"context"
|
62 |
].get("underserved", {})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
with st.expander("Discussion of Biases", expanded=False):
|
65 |
key_pref = ["context", "biases"]
|
@@ -101,9 +108,9 @@ def context_summary():
|
|
101 |
):
|
102 |
completion_markdown = ""
|
103 |
completion_markdown += (
|
104 |
-
f"- **Overall
|
105 |
)
|
106 |
-
completion_markdown += f"- **Sub-section - Social Impact of the Dataset:**\n - {len(st.session_state.card_dict.get('context', {}).get('
|
107 |
completion_markdown += f"- **Sub-section - Impact on Under-Served Communities:**\n - {len(st.session_state.card_dict.get('context', {}).get('underserved', {}))} of {N_FIELDS_UNDERSERVED_COMMUNITIES} fields\n"
|
108 |
completion_markdown += f"- **Sub-section - Discussion of Biases:**\n - {len(st.session_state.card_dict.get('context', {}).get('biases', {}))} of {N_FIELDS_BIASES} fields\n"
|
109 |
st.markdown(completion_markdown)
|
|
|
8 |
make_radio,
|
9 |
)
|
10 |
|
11 |
+
N_FIELDS_PREVIOUS = 3
|
12 |
+
N_FIELDS_UNDERSERVED_COMMUNITIES = 2
|
13 |
N_FIELDS_BIASES= 3
|
14 |
|
15 |
+
N_FIELDS = N_FIELDS_PREVIOUS + N_FIELDS_UNDERSERVED_COMMUNITIES + N_FIELDS_BIASES
|
16 |
|
17 |
def context_page():
|
18 |
st.session_state.card_dict["context"] = st.session_state.card_dict.get(
|
19 |
"context", {}
|
20 |
)
|
21 |
+
with st.expander("Previous Work on the Social Impact of the Dataset", expanded=False):
|
22 |
+
key_pref = ["context", "previous"]
|
23 |
+
st.session_state.card_dict["context"]["previous"] = st.session_state.card_dict[
|
24 |
"context"
|
25 |
+
].get("previous", {})
|
26 |
|
27 |
+
make_radio(
|
28 |
+
label="Are you aware of cases where models trained on the task featured in this dataset ore related tasks have been used in automated systems?",
|
29 |
+
options=["no", "yes - related tasks", "yes - other datasets featuring the same task", "yes - models trained on this dataset"],
|
30 |
+
key_list=key_pref + ["is-deployed"],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
help="",
|
32 |
)
|
33 |
+
if "yes" in st.session_state.card_dict["context"]["previous"]["is-deployed"]:
|
34 |
+
make_text_area(
|
35 |
+
label="Did any of these previous uses result in observations about the social impact of the systems? " + \
|
36 |
+
"In particular, has there been work outlining the risks and limitations of the system? Provide links and descriptions here:",
|
37 |
+
key_list=key_pref + ["described-risks"],
|
38 |
+
help="",
|
39 |
+
)
|
40 |
+
if st.session_state.card_dict["context"]["previous"]["is-deployed"] == "yes - models trained on this dataset":
|
41 |
+
make_text_area(
|
42 |
+
label="Have any changes been made to the dataset as a result of these observations?",
|
43 |
+
key_list=key_pref + ["changes-from-observation"],
|
44 |
+
help="",
|
45 |
+
)
|
46 |
+
else:
|
47 |
+
st.session_state.card_dict["context"]["previous"]["changes-from-observation"] = "N/A"
|
48 |
+
else:
|
49 |
+
st.session_state.card_dict["context"]["previous"]["described-risks"] = "N/A"
|
50 |
+
st.session_state.card_dict["context"]["previous"]["changes-from-observation"] = "N/A"
|
51 |
|
52 |
with st.expander("Impact on Under-Served Communities", expanded=False):
|
53 |
key_pref = ["context", "underserved"]
|
54 |
st.session_state.card_dict["context"]["underserved"] = st.session_state.card_dict[
|
55 |
"context"
|
56 |
].get("underserved", {})
|
57 |
+
make_radio(
|
58 |
+
label="Does this dataset address the needs of communities that are traditionally underserved in language technology, and particularly language generation technology?" + \
|
59 |
+
"Communities may be underserved for exemple because their language, language variety, or social or geographical context is underepresented in NLP and NLG resources (datasets and models).",
|
60 |
+
options=["no", "yes"],
|
61 |
+
key_list=key_pref+["helps-underserved"],
|
62 |
+
)
|
63 |
+
if st.session_state.card_dict["context"]["underserved"]["helps-underserved"] == "yes":
|
64 |
+
make_text_area(
|
65 |
+
label="Describe how this dataset addresses the needs of underserved communities",
|
66 |
+
key_list=key_pref+["underserved-description"],
|
67 |
+
)
|
68 |
+
else:
|
69 |
+
st.session_state.card_dict["context"]["underserved"]["underserved-description"] = "N/A"
|
70 |
|
71 |
with st.expander("Discussion of Biases", expanded=False):
|
72 |
key_pref = ["context", "biases"]
|
|
|
108 |
):
|
109 |
completion_markdown = ""
|
110 |
completion_markdown += (
|
111 |
+
f"- **Overall completion:**\n - {total_filled} of {N_FIELDS} fields\n"
|
112 |
)
|
113 |
+
completion_markdown += f"- **Sub-section - Social Impact of the Dataset:**\n - {len(st.session_state.card_dict.get('context', {}).get('previous', {}))} of {N_FIELDS_PREVIOUS} fields\n"
|
114 |
completion_markdown += f"- **Sub-section - Impact on Under-Served Communities:**\n - {len(st.session_state.card_dict.get('context', {}).get('underserved', {}))} of {N_FIELDS_UNDERSERVED_COMMUNITIES} fields\n"
|
115 |
completion_markdown += f"- **Sub-section - Discussion of Biases:**\n - {len(st.session_state.card_dict.get('context', {}).get('biases', {}))} of {N_FIELDS_BIASES} fields\n"
|
116 |
st.markdown(completion_markdown)
|