tianyang/spider2-aifunc huggingface dataset:
Database: IRS_990
Task: Among years 2012-2017 for IRS 990 nonprofit filings, which three years show the most balanced nonprofit sector finances? For each year, compute the median total revenue and median total functional expenses across all organizations (excluding nulls), then classify each year's financial balance into one of ['Highly Balanced', 'Moderately Balanced', 'Less Balanced'] based on a description formatted as 'Year {year}: median nonprofit revenue of ${median_revenue}, median expenses of ${median_expenses}, difference of ${abs_difference}' where all dollar values are rounded to 2 decimal places. Filter to only years classified as 'Highly Balanced' or 'Moderately Balanced', then rank by similarity to 'ideal nonprofit financial balance with minimal difference between revenue and expenses'. Return the year and absolute difference (computed from unrounded medians) for the top 3 most balanced years.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: COVID19_USA
Task: Find the top 3 counties with populations over 50,000 (using 2020 5-year census data) that had the highest COVID-19 case fatality rates on August 27, 2020. For each county, provide the name, state, median age, total population, confirmed cases per 100,000 people, deaths per 100,000 people, and case fatality rate as a percentage (all numeric values rounded to 2 decimal places). Additionally, generate a comparative vulnerability summary for these top 3 counties by aggregating their profiles using the instruction 'Identify the common demographic pattern among these high-fatality counties. Format as: Common pattern: [pattern in 10 words or less]' where each county profile is formatted as 'County: {county_name}, State: {state}, Median Age: {median_age}, Population: {total_pop}, Case Fatality Rate: {cfr}%'. If there are ties in case fatality rate, rank alphabetically by county name.
Required AI functions: AI_AGG
Database: CENSUS_BUREAU_ACS_2
Task: Among states with the smallest adjusted non-labor force populations using 2017 ACS tract-level data, find the top 3 states where the economic profile indicates positive workforce development potential. Calculate adjusted non-labor force as (unemployed_pop + not_in_labor_force - group_quarters) clamped to zero minimum at the tract level. For each qualifying state, classify its economic trajectory into exactly one of ['Strong Growth', 'Moderate Growth', 'Stable', 'Declining'] based on a description formatted as 'Income change: ${total_income_change}, Non-labor proportion: {proportion}%'. Filter to states where the condition 'This state shows positive workforce development potential based on: Income change ${income_change}, non-labor proportion {proportion}%' evaluates to true. Display the state abbreviation, total median income change between 2015 and 2018, total adjusted non-labor force population, average population-adjusted proportion as a decimal ratio (ratio of adjusted non-labor force to total population at tract level, not multiplied by 100), and economic trajectory classification. Join tract data to states using the 2-character state FIPS code extracted from the position after 'US' in the geo_id. Only include tracts where median income exists in both 2015 and 2018 datasets. Sort by adjusted non-labor force population ascending.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: DIMENSIONS_AI_COVID19
Task: Among publications added to the database from January 1, 2021 onwards (based on date_inserted) that are associated with research organizations located in the city 'Qianjiang' (by matching organization IDs from the GRID table), retrieve the venue titles (prioritizing journal title, then proceedings title, then book title, then book series title). Classify each venue into exactly one of ['Medical/Health Sciences', 'Chemistry/Materials', 'General Science', 'Other'] based on the venue title, then filter to only those classified as 'Medical/Health Sciences'. Rank the results by semantic similarity to 'immunology and vaccine research' in descending order, with ties broken alphabetically by venue title.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: DIMENSIONS_AI_COVID19
Task: For publications inserted from 2021 onwards (where date_inserted >= 1609459200000000) that are associated with research organizations located in the city 'Qianjiang', retrieve the venue title by prioritizing: journal title first, then proceedings title, then book title, then book series title. For each publication, analyze the overall sentiment of its abstract (or title if abstract is unavailable), and extract the main research finding into a field named 'main_finding' using the extraction question 'What is the primary conclusion or finding? Answer in one sentence.' Order the results by sentiment priority: 'positive' first, followed by 'neutral', 'mixed', 'negative', and 'unknown' last. If multiple publications share the same sentiment, order them alphabetically by venue title.
Required AI functions: AI_EXTRACT, AI_SENTIMENT
Database: THE_MET
Task: What are the top 10 book and manuscript items in 'The Libraries' department (where cropConfidence > 0.5) most semantically related to 'rare books, manuscripts, and printed literary works'? Each item's title should be classified into exactly one of ['Book', 'Manuscript', 'Periodical', 'Other'], filtering to only those classified as 'Book' or 'Manuscript'. Rank by semantic similarity descending (rounded to 2 decimal places for consistency), with ties broken by object_id ascending. Return the object id, title, and metadata date formatted as YYYY-MM-DD.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: HUMAN_GENOME_VARIANTS
Task: Among samples in the genome data where each position has exactly one alternate allele and the sample's genotype is homozygous for the reference allele (both alleles are 0), identify the top 10 samples with the highest counts of such positions. Join with sample metadata to get population information. First, include only samples whose population description is classified as 'African' when categorized into exactly one of ['African', 'South Asian', 'East Asian', 'European', 'American', 'Other'] based on the population description field. Then, further filter to only include samples where the condition evaluates to true when concatenating 'This population is geographically located within the African continent, not African diaspora populations in other regions: ' with the population description. Order by count descending, then by sample name ascending alphabetically for tie-breaking. Return the sample name, population description, and the count.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: TARGETOME_REACTOME
Task: Among the top 50 lowest-level Reactome pathways (with TAS evidence) for Homo sapiens ranked by chi-squared enrichment statistics for sorafenib targets, classify each pathway into exactly one of ['Signal Transduction', 'Metabolic Process', 'Gene Regulation', 'Cell Cycle', 'Immune Response', 'Other'] based on pathway name. Then, among pathways classified as 'Signal Transduction', find the top 3 most similar to 'receptor tyrosine kinase activation and phosphorylation cascade'. If there are ties in similarity, order by pathway_id alphabetically.

Consider only Homo sapiens targets (using exact species match 'Homo sapiens') associated with sorafenib where the median assay value is ≤ 100 and both low and high assay values are ≤ 100 or null. Use UniProt IDs as provided in the database without transformation.

For each pathway, report the pathway ID, pathway name, and the counts of: targets within the pathway, targets outside the pathway, non-targets within the pathway, and non-targets outside the pathway.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: IDC
Task: For the unique pairs of embedding medium and staining substance code meanings from 'SM' modality DICOM specimen preparation sequences (using SCT coding scheme codes), what are the total occurrence counts aggregated by histological preparation category? Each pair should be classified into exactly one of ['Paraffin-based Preparation', 'Frozen Section Preparation', 'Other Preparation'] based on a combined description formatted as 'Embedding: {embedding_medium}, Stain: {staining_substance}'. Only include pairs where the condition 'This describes a tissue embedding and staining method used in microscopy: {embedding_medium} and {staining_substance}' evaluates to true. Return the preparation category and total occurrences for each category.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: GOOGLE_ADS
Task: Among image-type advertisements on the topic of Health, published by verified advertisers located in Cyprus and shown in Croatia, where times_shown_availability_date is NULL (indicating times shown data is available), first_shown is strictly after January 1, 2023, last_shown is strictly before January 1, 2024, and all five audience selection methods (demographic_info, geo_location, contextual_signals, customer_lists, topics_of_interest) are utilized (none equal to 'CRITERIA_UNUSED'), filter to only those where the condition 'This company name suggests a business involved in media, marketing, healthcare, or wellness content: ' concatenated with the advertiser's disclosed name evaluates to true. Among the qualifying ads, return the page URL of the one with the highest times_shown_upper_bound. If there are ties in times_shown_upper_bound, use semantic similarity to 'healthcare media and wellness content provider' based on the advertiser's disclosed name as a tie-breaker (higher similarity first).
Required AI functions: AI_FILTER, AI_SIMILARITY
Database: WORLD_BANK
Task: Among countries classified as either 'Emerging Market' or 'Developing Economy' (from the categories ['Emerging Market', 'Advanced Economy', 'Developing Economy', 'Other'] based on a description formatted as 'Country: {long_name}, Region: {region}'), list the top 10 by their most recent year's long-term external debt (indicator code 'DT.DOD.DLXF.CD') in descending order. Exclude countries without a specified region. As a secondary ordering criterion for countries with similar debt levels, rank by semantic similarity to 'major emerging market economy with significant external borrowing and growing international trade' in descending order. Return the country's long name, region, economic classification, and debt amount.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: WORLD_BANK
Task: Among countries with the highest long-term external debt (using the most recent year's data for indicator code 'DT.DOD.DLXF.CD'), identify those whose special notes mention data limitations or reporting concerns. Use AI extraction with the following fields: 'has_limitation' using the question 'Does this text mention any data limitations, alternative exchange rates, or reporting concerns? Answer exactly: yes or no', and 'concern_type' using the question 'What type of data concern is primarily mentioned? Answer exactly one of: exchange_rate, fiscal_year, data_coverage, sovereignty, or other'. Filter to countries where has_limitation is 'yes', then list the top 10 by debt amount in descending order, excluding countries without a specified region or without special notes. Return the country name, total long-term debt amount, and the concern type.
Required AI functions: AI_EXTRACT
Database: NCAA_BASKETBALL
Task: For each shot type, calculate the average adjusted x and y coordinates (normalized to the left basket using: adj_x = event_coord_x if event_coord_x < 564, otherwise 1128 - event_coord_x; adj_y = 600 - event_coord_y if event_coord_x < 564, otherwise event_coord_y), the average shot attempts per game, and the average successful shots per game. Consider only shots where: the game's scheduled_date is before March 15, 2018; shot_type, event_coord_x, and event_coord_y are not null; team_basket is 'left' or 'right'; and the shot is on the correct side of the court (team_basket = 'left' with event_coord_x < 564, or team_basket = 'right' with event_coord_x >= 564). Calculate average coordinates as a simple global average across all filtered shots. For attempts and made shots, calculate per-game averages by first counting attempts and made shots per game, then averaging across games. Classify each shot type into one of ['High Efficiency', 'Variable Efficiency', 'Low Efficiency'] where 'High Efficiency' means 'shots typically made at high percentage near the basket', 'Variable Efficiency' means 'shots with moderate success rate from various ranges', and 'Low Efficiency' means 'difficult shots with lower success rate'. Only include shot types classified as 'High Efficiency' or 'Variable Efficiency'. Order results by shot type semantic similarity to 'reliable close-range scoring opportunity' in descending order.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: NCAA_BASKETBALL
Task: For each shot type in NCAA men's basketball, determine the average adjusted x and y coordinates (where coordinates are normalized to the left half of the court by mirroring shots from the right side: x becomes 1128 minus x when x >= 564, and y becomes 600 minus y when x < 564), the average number of shot attempts per team per game, and the average number of successful shots per team per game. Additionally, characterize each shot type by aggregating a sample of up to 200 event descriptions per shot type (sampled by ordering first by game_id ascending, then by event_description ascending, and taking the first 200) using the instruction: 'List exactly 3 most common play patterns as lowercase phrases separated by semicolons, format: pattern1; pattern2; pattern3'. Only include shots taken before March 15, 2018 (based on the timestamp field converted to date), excluding those with null shot types, coordinates, or team basket values, and ensuring shots are on the correct side of the court (left basket shots must have x < 564, right basket shots must have x >= 564). Order results alphabetically by shot type.
Required AI functions: AI_AGG
Database: NCAA_BASKETBALL
Task: For the top five team markets with the highest number of distinct players who scored at least 15 points during the second period of games between 2010 and 2018, retrieve their NCAA basketball historical tournament games from the same period. Classify each game's outcome into exactly one of ['Cinderella Victory', 'Dominant Win', 'Shocking Upset Loss', 'Expected Defeat'] based on a description formatted as '{market} {label} as the {favorite_status} (seed {seed} vs opponent seed {opponent_seed}) in round {round}' where favorite_status is 'FAVORITE' if the team's seed number is lower than opponent's, 'UNDERDOG' if higher, or 'EVEN' if equal. The categories mean: 'Cinderella Victory' is 'the team won as the UNDERDOG', 'Dominant Win' is 'the team won as the FAVORITE', 'Shocking Upset Loss' is 'the team lost as the FAVORITE', and 'Expected Defeat' is 'the team lost as the UNDERDOG'. Filter to only include games classified as 'Cinderella Victory' or 'Shocking Upset Loss', rank them by semantic similarity to 'memorable March Madness Cinderella run or shocking bracket buster elimination', and return the top 20 most similar games. If similarity scores are tied, order by game_date ascending then by market alphabetically. Include the season, round, game_date, day, label, seed, market, name, alias, school_ncaa, opponent_seed, opponent_market, opponent_name, opponent_alias, opponent_school_ncaa, and the game narrative classification.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: NCAA_BASKETBALL
Task: For the top five team markets with the highest number of distinct players who scored at least 15 points during the second period of games between 2010 and 2018 (with ties broken alphabetically by market name), provide a tournament performance analysis for each market based on their NCAA basketball historical tournament games during the same period.

For each market, compute the total wins, total losses, and deepest tournament round reached (where lower round number indicates deeper advancement: 2=Championship, 4=Final Four, 8=Elite Eight, 16=Sweet Sixteen, 32=Second Round, 64=First Round). Then, for qualitative analysis, aggregate game descriptions formatted as 'Round {round}: {Win/Loss} vs {opponent} (seed {opponent_seed}) as seed {own_seed}' using the instruction: 'Based on these tournament games, assess whether this team typically met seeding expectations, exceeded them, or underperformed. Note any patterns of upsets (wins or losses against significantly higher/lower seeds). Provide a one-sentence performance assessment.'

Finally, classify each market into exactly one of the following categories based on a combined input formatted as 'Record: {wins}-{losses}, Deepest Round: {round} ({round_name}). Assessment: {qualitative_assessment}':
- 'Championship Contender': Reached Championship (round 2) or Final Four (round 4), primary criterion is deepest round achieved
- 'Tournament Regular': Deepest round is Elite Eight (round 8) or Sweet Sixteen (round 16) with winning record
- 'Inconsistent Performer': Mixed results with deepest round of Sweet Sixteen (round 16) or worse, or .500 or losing record
- 'Early Exit Prone': Deepest round is Second Round (round 32) or First Round (round 64) with losing record

Order results alphabetically by market name.
Required AI functions: AI_AGG, AI_CLASSIFY
Database: CENSUS_BUREAU_ACS_2
Task: Among US states (filtered by the condition 'The following is a US state (not a territory): ' concatenated with state name evaluating to true), which are the top five with the greatest average absolute difference in median income between 2015 and 2018 at the ZIP code level? For each state, show its geographic region classified into exactly one of ['Northeast', 'Southeast', 'Midwest', 'Southwest', 'West', 'Pacific', 'Non-Continental'] based on state name, and the corresponding average number of vulnerable employees in 2017 calculated only for ZIP codes that have median income data in both 2015 and 2018. The vulnerable employees formula is: (wholesale trade employees × 0.38423645320197044) + ((construction employees + agriculture/forestry/fishing/hunting/mining employees) × 0.48071410777129553) + (arts/entertainment/recreation/accommodation/food employees × 0.89455676291236841) + (information employees × 0.31315240083507306) + (retail trade employees × 0.51). Use the ZIP_CODES tables from the ACS Census data for income and employment metrics, and the ZIP_CODES boundaries table for state mapping.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: EBI_CHEMBL
Task: Find pairs of different molecules tested in the same assay and standard type where both molecules have 10-15 heavy atoms, fewer than 5 activities in that assay per molecule, fewer than 2 duplicate activities per molecule, non-null standard values, and pChEMBL values over 10. Consider only activities with the lowest 100 activity_id values that meet these criteria. For each qualifying pair, filter to only those where the document title with the higher document ID contains a biological target by checking if the condition 'This scientific title mentions a specific biological target such as a receptor, enzyme, protein, kinase, or channel: ' concatenated with the title evaluates to true. For qualifying pairs, extract the research target using the extraction question 'Extract the biological target name from this scientific title. Return only the target name in lowercase, nothing else.' Report: the maximum heavy atom count between the two molecules, the latest publication date (the maximum of both documents' synthetic dates, where each synthetic date has the year from the document, the month as FLOOR(percent_rank * 11) + 1 based on the document's first_page rank within its journal and year, and the day as MOD(FLOOR(percent_rank * 308), 28) + 1), the higher document ID, the extracted research target, the overall sentiment of the higher document's title (one of 'positive', 'negative', 'neutral', 'mixed', 'unknown'), and a UUID generated by applying HEX_ENCODE to the MD5 hash of a JSON array containing the two activity IDs ordered with the smaller ID first (resulting in a 64-character hex string). Order results by highest_doc_id ascending, then by uuid_from_activity_ids ascending. Return the first 50 results.
Required AI functions: AI_EXTRACT, AI_FILTER, AI_SENTIMENT
Database: FDA
Task: For food events where both date_created and date_started fall between January 1 and January 31, 2015, filter to only those events where the condition 'The reactions described indicate gastrointestinal distress such as nausea, vomiting, diarrhea, or abdominal discomfort: ' concatenated with the reactions field evaluates to true. For each qualifying event, classify the severity based on a description formatted as 'Reactions: {reactions}. Outcomes: {outcomes}' into exactly one of ['Critical', 'Serious', 'Moderate', 'Minor'], where 'Critical' means 'life-threatening conditions, hospitalization required, or death', 'Serious' means 'significant medical intervention needed or disability', 'Moderate' means 'required medical attention but not life-threatening', and 'Minor' means 'mild symptoms with no lasting effects'. Apply these data cleansing steps: split reactions and outcomes fields into arrays by comma-space (', '), handle numeric patterns in products_brand_name where a digit is followed by comma-space and another digit by preserving those numeric patterns while replacing other ', ' with ' -- ', replace ', ' with ' -- ' in products_industry_code, products_role, and products_industry_name fields, and calculate industry_code_length and brand_name_length as the array lengths after splitting the cleaned fields by ' -- '. Return the report_number, severity classification, reactions_array, outcomes_array, cleaned_products_brand_name, cleaned_products_industry_code, cleaned_products_role, cleaned_products_industry_name, date_created, date_started, consumer_gender, consumer_age, consumer_age_unit, industry_code_length, and brand_name_length.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: NHTSA_TRAFFIC_FATALITIES
Task: Among the 2015 traffic accident records (joining accident, person, and vehicle data where all three are available), focus on accidents that occurred in dark unlighted conditions (where light_condition_name is 'Dark – Not Lighted') with adverse weather (where atmospheric_conditions_1_name is not 'Clear'). Classify each accident's severity into one of ['Critical', 'Severe', 'Moderate'] based on a combined description formatted as 'Lighting: {light_condition_name}, Weather: {atmospheric_conditions_1_name}, Hour: {hour_of_crash}, Person Age: {age}', where 'Critical' means 'extremely dangerous conditions with high fatality risk such as night snow or fog with vulnerable age groups under 18 or over 65', 'Severe' means 'dangerous conditions with significant risk requiring caution', and 'Moderate' means 'adverse but manageable conditions with lower risk'. Then find the top 50 accidents classified as 'Critical' or 'Severe', ranked by similarity to 'Dark unlighted road at night with snow, rain, or fog causing dangerous driving conditions' based on a description formatted as 'Lighting: {light_condition_name}, Weather: {atmospheric_conditions_1_name}, Hour: {hour_of_crash}', with similarity scores rounded to 1 decimal place for stable ordering. If there are ties in rounded similarity, order by consecutive_number ascending, then by age ascending. Return the consecutive number, county, light condition, weather condition, hour of crash, person age, person type, and severity classification.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY