Skip to content

Commit

Permalink
added numeric QA columns for ACS tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreFCruz committed Aug 27, 2024
1 parent e9da007 commit 347093d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 7 deletions.
47 changes: 41 additions & 6 deletions folktexts/acs/acs_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@
"What is the probability that this person's estimated yearly income is "
"above $50,000 ?"
),
answer_probability=True,
num_forward_passes=2,
)

acs_income_target_col = ColumnToText(
Expand All @@ -221,7 +219,7 @@
),
)

acs_pubcov_og_target_col = ColumnToText(
acs_pubcov = ColumnToText(
"PUBCOV",
short_description="public health coverage status",
value_map={
Expand All @@ -241,6 +239,13 @@
),
)

acs_pubcov_numeric_qa = DirectNumericQA(
column=acs_public_coverage_threshold.apply_to_column_name("PUBCOV"),
text=(
"What is the probability that this person is covered by public health insurance?"
), # NOTE: value=1 for yes, 0 for no
)

acs_pubcov_target_col = ColumnToText(
name=acs_public_coverage_threshold.apply_to_column_name("PUBCOV"),
short_description="public health coverage status",
Expand Down Expand Up @@ -301,14 +306,21 @@

# MIG: Mobility Status (Thresholded)
acs_mobility_qa = MultipleChoiceQA(
column=acs_mobility_threshold.apply_to_column_name("MIG"),
column=acs_mobility_threshold.apply_to_column_name("MIG"), # NOTE: Thresholded by MIG!=1
text="Has this person moved in the last year?",
choices=(
Choice("No, person has lived in the same house for the last year", 1),
Choice("Yes, person has moved in the last year", 0),
Choice("No, person has lived in the same house for the last year", 0),
Choice("Yes, person has moved in the last year", 1),
),
)

acs_mobility_numeric_qa = DirectNumericQA(
column=acs_mobility_threshold.apply_to_column_name("MIG"), # NOTE: Thresholded by MIG!=1
text=(
"What is the probability that this person has moved in the last year?"
), # NOTE: Question should relate to probability of MIG!=1
)

acs_mobility_target_col = ColumnToText(
name=acs_mobility_threshold.apply_to_column_name("MIG"),
short_description="mobility status over the last year",
Expand Down Expand Up @@ -408,6 +420,14 @@
),
)

acs_employment_numeric_qa = DirectNumericQA(
column=acs_employment_threshold.apply_to_column_name("ESR"),
text=(
"What is the probability that this person is an employed civilian?"
# "What is the probability that this person is currently employed?"
), # NOTE: Question should relate to probability of ESR==1
)

acs_employment_target_col = ColumnToText(
name=acs_employment_threshold.apply_to_column_name("ESR"),
short_description="employment status",
Expand Down Expand Up @@ -456,6 +476,13 @@
),
)

acs_commute_time_numeric_qa = DirectNumericQA(
column=acs_travel_time_threshold.apply_to_column_name("JWMNP"),
text=(
"What is the probability that this person's commute time is longer than 20 minutes?"
), # NOTE: Question should relate to probability of JWMNP>20
)

acs_travel_time_target_col = ColumnToText(
name=acs_travel_time_threshold.apply_to_column_name("JWMNP"),
short_description="commute time",
Expand Down Expand Up @@ -545,6 +572,14 @@
),
)

acs_health_ins_2_numeric_qa = DirectNumericQA(
column=acs_health_insurance_threshold.apply_to_column_name("HINS2"),
text=(
"What is the probability that this person has purchased health "
"insurance directly through a private company?"
), # NOTE: Question should relate to probability of HINS2==1
)

acs_health_ins_2_target_col = ColumnToText(
name=acs_health_insurance_threshold.apply_to_column_name("HINS2"),
short_description="acquired health insurance directly from an insurance company",
Expand Down
2 changes: 1 addition & 1 deletion folktexts/acs/acs_thresholds.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
acs_public_coverage_threshold = Threshold(1, "==")

# ACSMobility task
acs_mobility_threshold = Threshold(1, "==")
acs_mobility_threshold = Threshold(1, "!=")

# ACSEmployment task
acs_employment_threshold = Threshold(1, "==")
Expand Down

0 comments on commit 347093d

Please sign in to comment.