tianyang/spider2-aifunc huggingface dataset:
Database: CYMBAL_INVESTMENTS
Task: What is the signed difference in average intrinsic value between trades using the 'Feeling-Lucky' strategy (PartyID starting with 'LUCKY') and those using the 'Momentum' strategy (PartyID starting with 'MOMO'), for long-side trades only?

Calculate intrinsic value as the greater of zero or (LastPx minus StrikePrice). Return the result as (Feeling-Lucky average) minus (Momentum average), rounded to 4 decimal places.

Classify the performance comparison into exactly one of ['Feeling-Lucky Outperforms', 'Momentum Outperforms', 'Similar Performance'], where 'Feeling-Lucky Outperforms' means 'the Feeling-Lucky strategy has meaningfully higher average intrinsic value', 'Momentum Outperforms' means 'the Momentum strategy has meaningfully higher average intrinsic value', and 'Similar Performance' means 'both strategies have comparable average intrinsic values'. The classification is based on a summary formatted as 'Feeling-Lucky: {count} trades, avg {value}. Momentum: {count} trades, avg {value}. Difference: {difference}'. Include the classification result in the output.

Additionally, calculate the semantic similarity between the performance summary and the reference statement 'The Momentum strategy demonstrates superior returns compared to Feeling-Lucky', and only include results where this similarity score is greater than 0.3.

Return two columns: the average intrinsic value difference and the performance classification.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: PATENTS
Task: For the assignee with the most distinct patent applications in category 'A61' (identified from either CPC or IPC classification codes starting with 'A61', using harmonized assignee names with fallback to raw assignee when harmonized is unavailable, normalized to uppercase), determine the year in which they filed the most applications. Classify this top assignee into exactly one of ['University', 'Corporation', 'Government', 'Research Institute', 'Other'] based on the assignee name. Then, for that peak year's patents, aggregate the English patent titles using the instruction: 'These patent titles are from a pharmaceutical company. What is the primary drug target or receptor type that unifies these patents? Respond with only the target name in 1-3 words, nothing else.'. Return the peak filing year, the assignee's organization type classification, and the dominant research area (the aggregation result trimmed of whitespace). If there are ties for the top assignee, select the one that comes first alphabetically. If there are ties for the peak year, select the earliest year.
Required AI functions: AI_AGG, AI_CLASSIFY
Database: CRYPTO
Task: In April 2023, among Dash addresses with extreme balance activity, identify those semantically similar to 'Major cryptocurrency market participant with extreme balance indicating whale-level accumulation or distribution activity' (similarity threshold above 0.3). For the similarity comparison, format each address's description as 'Cryptocurrency address with net balance [balance] units'. Calculate the net balance for each address using double-entry bookkeeping (inputs as debits/negative, outputs as credits/positive), filtering to transactions where block_timestamp_month='2023-04-01'. When addresses appear as arrays, concatenate elements into comma-separated strings. First identify candidate addresses by selecting the top 50 by highest balance and top 50 by lowest balance (ties broken alphabetically by address), then filter to those meeting the similarity threshold. From the filtered results, return only the single highest and single lowest balance entries. Return the address, type, and balance, ordered by balance descending.
Required AI functions: AI_SIMILARITY
Database: OPEN_TARGETS_PLATFORM_1
Task: For drugs that have completed clinical trials for pancreatic endocrine carcinoma (disease ID EFO_0007416), filter to those whose mechanism of action semantically indicates targeted molecular therapy by evaluating the condition 'This drug mechanism involves targeted molecular therapy: ' concatenated with the mechanism of action description. Rank the remaining drugs by semantic similarity to 'precision targeted therapy for cancer treatment' in descending order, and return the top 10 results showing each drug's name, target approved symbol, and clinical trial links (extracted from URLs where the niceName is 'ClinicalTrials', aggregated as an array per drug-target combination).
Required AI functions: AI_FILTER, AI_SIMILARITY
Database: OPEN_TARGETS_PLATFORM_1
Task: For drugs with completed clinical trials for pancreatic endocrine carcinoma (disease ID EFO_0007416), first filter to only those drugs whose mechanism of action involves inhibiting or blocking biological activity, using the filter condition 'This drug mechanism involves inhibiting or blocking biological activity: ' concatenated with the mechanism of action text. For the filtered drugs, extract mechanism details using the extraction questions: 'target_type': 'What type of biological target does this drug act on? Answer with a brief term like: enzyme, receptor, kinase, protein, growth factor', 'action_type': 'What is the pharmacological action? Answer with a brief term like: inhibitor, agonist, antagonist, modulator'. Return the drug name, target approved symbol, extracted target type, extracted action type, and clinical trial URLs aggregated into an array using ARRAY_AGG (filtered to ClinicalTrials sources only). Order by drug name, then by target approved symbol.
Required AI functions: AI_EXTRACT, AI_FILTER
Database: SDOH
Task: For Massachusetts regions (where GeoName ends with ', MA'), calculate the increase in average earnings per job between 2012 and 2017 (computed as the 2017 value minus the 2012 value of Earnings_per_job_avg). Classify each region into exactly one of ['Urban', 'Suburban', 'Rural', 'Coastal'] based on the GeoName. Filter to only regions classified as 'Urban' or 'Suburban', then rank them by similarity of a combined description formatted as '{GeoName} with earnings growth of ${increasing_amount}' to 'thriving urban economic center with strong wage growth' in descending order, with ties broken by increasing amount descending. Return the GeoName, region type, and increasing amount.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: NEW_YORK_PLUS
Task: For NYC yellow taxi trips where both pickup and dropoff occurred between January 1, 2016 00:00:00 UTC and January 8, 2016 00:00:00 UTC (i.e., the full week of January 1-7 inclusive), calculate the no-tip percentage for each pickup borough, rounded to 2 decimal places. Apply data quality filters: dropoff must occur after pickup, passenger count greater than zero, and non-negative values for trip distance, tip amount, tolls amount, MTA tax, fare amount, and total amount. Define "no tip" as trips where the tip rate equals zero, with tip rate calculated as (tip_amount × 100) / total_amount, treating it as zero when total_amount is zero.

For each borough, classify its geographic type into exactly one of ['Major Urban Center', 'Residential Borough', 'Airport or Transit Hub', 'Other'] based on the borough name alone. Exclude boroughs classified as 'Airport or Transit Hub' since tipping patterns differ significantly for airport trips. From the remaining boroughs, further filter to only those where the condition 'A no-tip rate of {percentage} percent is notably high, exceeding typical urban taxi tipping patterns where 30-45 percent of trips have no tip.' evaluates to true. Return the pickup borough, no-tip percentage, and borough type classification, ordered by no-tip percentage descending.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: PATENTS
Task: For patent class A01B3, analyze the top 3 corporate assignees based on total number of distinct applications. First, classify each assignee into exactly one of ['Corporation', 'Research Institution', 'Government Agency', 'Individual', 'Other'] based on the assignee name, and only consider those classified as 'Corporation'. Then, for each of these top 3 corporate assignees, provide: the assignee name, organization type classification, total number of applications, the year with the most applications (if multiple years tie, select the most recent year), the number of applications in that year, and the country code with the most applications during that year (if multiple countries tie, select the one that comes first alphabetically). Rank the top 3 by total applications descending, with ties broken by semantic similarity to 'agricultural machinery and farming equipment manufacturer' descending, then by assignee name ascending.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: GNOMAD
Task: Identify which start positions are associated with missense variants in the BRCA1 gene on chromosome 17, where the reference base is 'C' and the alternate base is 'T', using gnomAD v2.1.1 data from both exomes and genomes tables. For matching, split the Consequence field by '&' and require an exact match to 'missense_variant', and verify that the VEP annotation allele matches the queried alternate base. For each distinct start position, compute the maximum semantic similarity of its annotations to 'pathogenic missense variant in BRCA1 tumor suppressor gene with high clinical significance for hereditary breast cancer' based on a description formatted as 'Gene: {SYMBOL}, Consequence: {Consequence}, Impact: {IMPACT}'. Return all start positions where this maximum similarity score is greater than 0.5, ordered by start position in ascending order.
Required AI functions: AI_SIMILARITY
Database: GNOMAD
Task: Generate summary statistics on genetic variants in the genomic region chr1:55039447-55064852 from gnomAD v3 data. Calculate the number of variants, total allele count, total number of alleles, distinct gene symbols from VEP annotations (comma-separated without spaces, sorted alphabetically), and mutation density as (region length / variant count) where region length equals (55064852 - 55039447 + 1) for inclusive boundaries, rounded to 4 decimal places.

Classify the variant burden of this region into exactly one of ['High Mutation Burden', 'Moderate Mutation Burden', 'Low Mutation Burden'] based on a description formatted as 'Region chr1:55039447-55064852 contains {variant_count} variants across {gene_count} genes ({gene_symbols}). Mutation density: {density} bp/variant. Total allele count: {AC}. Total alleles: {AN}.' Return the classification as a plain string label, not as JSON.

Determine whether this region requires priority clinical investigation by evaluating the condition 'This genomic region should be prioritized for clinical investigation based on high variant count and known disease-associated genes: ' concatenated with the same region description.

Return all seven metrics: variant count, total allele count, total number of alleles, gene symbols, mutation density, burden classification, and priority investigation flag.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: GOOGLE_TRENDS
Task: Based on the most recent refresh date in the TOP_RISING_TERMS table, find the week closest to exactly one year prior to the latest available week (using DATEADD(YEAR, -1, latest_week) as the target date). From the rank-1 rising search terms of that week, take the top 50 terms by percent_gain (descending). For each of these terms, extract its topic type using the question 'What type of topic is this search term about? Answer with exactly one of: Person, Sports, Entertainment, News, Brand, Other' into a field named 'topic_type', and analyze its overall sentiment. Return only terms classified as 'Person', and show the term with the highest percent_gain along with its topic type and sentiment. In case of ties on percent_gain, use alphabetical order by term as the tie-breaker.
Required AI functions: AI_EXTRACT, AI_SENTIMENT
Database: NHTSA_TRAFFIC_FATALITIES
Task: For the first 1000 accidents (by consecutive_number) from the 2015 dataset occurring January through August that involved more than one distinct person (i.e., filter to multi-person accidents first, then take the first 1000 by consecutive_number), classify each accident's injury profile into exactly one of ['Multiple Critical Casualties', 'Single Critical with Collateral'], where 'Multiple Critical Casualties' means 'the injury description indicates more than one person suffered fatal or serious injuries' and 'Single Critical with Collateral' means 'the injury description indicates one fatality with others having minor or no injuries'. The injury profile is constructed as the distinct injury severity names for each accident, concatenated with '; ' separator and ordered alphabetically. Only include accidents where the condition 'This traffic accident resulted in significant casualties: ' concatenated with the injury profile evaluates to true. For each classification, what percentage of accidents had more than one distinct person with severe injury (injury_severity = 4)? Return the classification and percentage rounded to 2 decimal places. Order results by percentage descending, then by classification name alphabetically if tied.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: OPEN_TARGETS_GENETICS_1
Task: Find the average, variance, and max-min difference of log2(h4/h3), along with the QTL source name and its category classification (as a plain string label, not JSON) for the maximum log2(h4/h3) value, from colocalization data where: right gene id is 'ENSG00000169174', h4 > 0.8, h3 < 0.02, the reported trait is semantically similar to 'cholesterol levels' with similarity score greater than 0.5, right biological feature is 'IPSC', and the variant components are chromosome '1', position 55029009, reference allele 'C', and alternate allele 'T'. Classify the QTL source into exactly one of ['Academic Research Lab', 'Consortium Project', 'Biobank Initiative', 'Other'] based on the study name.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: SDOH
Task: For New York CoC regions with homeless veteran data available in both 2012 and 2018, classify each region into exactly one of ['Major Metropolitan', 'Urban', 'Suburban', 'Rural'] based on the CoC region name. Show only regions classified as 'Major Metropolitan' or 'Urban', ranked by semantic similarity to 'densely populated metropolitan area with significant urban development' (top 10 most similar), displaying the region name, classification, and the change in homeless veterans (2018 count minus 2012 count).
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: BLS
Task: Among Utah counties where the semantic condition 'This county experienced a significant construction boom with substantial job growth: ' concatenated with the county name, ' had ', the percentage increase value, '% growth in construction employment from 2000 to 2018' evaluates to true, which county had the greatest percentage increase in construction employment? Calculate the percentage increase by averaging construction employment levels (month3_emplvl_23_construction) across all four quarters of 2000 and 2018 separately, then computing ((2018_average - 2000_average) / 2000_average) * 100, rounded to 2 decimal places. Return the county name in lsad_name format (e.g., 'Utah County') and the percentage increase.
Required AI functions: AI_FILTER
Database: OPENAQ
Task: Which three cities show the largest absolute PM2.5 difference between 1990 EPA measurements (using units_of_measure = 'Micrograms/cubic meter (LC)' and parameter_name = 'Acceptable PM2.5 AQI & Speciation Mass') and 2020 OpenAQ measurements (where pollutant = 'pm25', year extracted from timestamp), matched by latitude and longitude rounded to two decimals? Include only cities where the condition 'The PM2.5 change of {difference} micrograms/cubic meter in {city} represents a notable shift in air quality over 30 years: ' evaluates to true, with difference rounded to 2 decimal places. For each qualifying city, classify the health implication into exactly one of ['Positive Health Outcome', 'Negative Health Outcome', 'Neutral'] based on a description formatted as 'PM2.5 pollution in {city} showed a {direction} of {difference} micrograms/cubic meter from 1990 to 2020. Assess the environmental health implication.', where difference is rounded to 2 decimal places, and direction is 'decrease' if 1990 value exceeded 2020 value, otherwise 'increase'. Return the city name and its health implication classification, ordered by difference from greatest to least, with ties broken alphabetically by city name.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: OPENAQ
Task: Among monitoring sites in protected natural areas, which three cities show the largest absolute difference between 1990 EPA PM2.5 measurements (using units_of_measure = 'Micrograms/cubic meter (LC)' and parameter_name = 'Acceptable PM2.5 AQI & Speciation Mass') and 2020 OpenAQ PM2.5 measurements (where pollutant = 'pm25' based on the year extracted from the timestamp), matched by latitude and longitude rounded to two decimals? Filter to protected natural areas using the condition 'This site name indicates a protected natural area such as a national park, wilderness area, or nature preserve: ' concatenated with the local_site_name. For each city, extract the site type into a field named 'site_type' from the local_site_name using the extraction question: 'What type of monitoring site is this? Answer with one of: National Park, Research Site, Urban Station, or Other'. Return the city name, the extracted site type, and the absolute difference rounded to two decimals, ordered by difference from greatest to least.
Required AI functions: AI_EXTRACT, AI_FILTER
Database: CENSUS_BUREAU_INTERNATIONAL
Task: Among countries classified as either 'Developing Nation' or 'Emerging Economy' from the categories ['Developed Nation', 'Developing Nation', 'Emerging Economy', 'Other'] based on country name, and where the semantic similarity between the demographic profile formatted as '{country_name} has {percentage rounded to 1 decimal place}% of population under age 25' and the reference text 'a young developing nation with extremely high youth population percentage' exceeds 0.3, which country in 2017 has the highest actual percentage of population under the age of 25?
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: NOAA_DATA
Task: Among storm events from the past 15 years (where NULL property damage is treated as 0), first identify the top 500 events by property damage as candidates. From these candidates, filter to only events where the condition 'This weather event type represents a severe or catastrophic weather phenomenon that typically causes major property damage: ' concatenated with the event_type field evaluates to true. From the filtered severe events, take the top 100 by property damage, breaking ties by event timestamp descending, then by event_id ascending. What is the count of events in the calendar month (1-12) that has the highest number of these top 100 severe storm events?
Required AI functions: AI_FILTER
Database: SDOH
Task: Using SNAP enrollment data from January 1, 2017 and 2017 5-year ACS county-level data, identify the top 10 counties by total SNAP-participating households, where SNAP households are summed across all sub-county records per county FIPS code. Exclude counties with zero SNAP participation. Only include counties where the program description semantically matches the condition 'This is a primary county-level social services department that administers SNAP/EBT benefits directly to county residents (not a nursing home, specialized facility, or regional sub-office): ' concatenated with the GeoDesc field. For each qualifying county, calculate the ratio of households earning under $20,000 (sum of income_less_10000, income_10000_14999, and income_15000_19999) to total SNAP-participating households. Order results by total SNAP households descending, with ties broken by semantic similarity to 'major urban county social services department' (higher similarity ranks first).
Required AI functions: AI_FILTER, AI_SIMILARITY
Database: SDOH
Task: Using the 2017 5-year ACS county-level data and SNAP enrollment data from January 1, 2017, identify the top 10 counties with the highest total SNAP-participating households (summed across all subcounties per FIPS code), excluding counties where total SNAP participation is zero. For each county, extract from the geographic description field into a field named 'state' the state abbreviation using the extraction question 'What is the two-letter US state abbreviation?' and into a field named 'county_name' the county name using the extraction question 'What is the county name? Return only the county name without any numeric codes, program identifiers like EBT or DPSS, or administrative suffixes.' Also calculate the ratio of households earning under $20,000 (sum of income_less_10000, income_10000_14999, and income_15000_19999) to the total SNAP-participating households, rounded to 4 decimal places.
Required AI functions: AI_EXTRACT
Database: THE_MET
Task: For objects in the 'Photographs' department with 'Photograph' in their object name, created by a known artist (where artist_display_name is not null and not 'Unknown'), with an object end date of 1839 or earlier, classify each object's medium into exactly one of ['Photogenic Drawing', 'Calotype', 'Direct Positive', 'Daguerreotype', 'Other'] based on the medium description. Return the title, artist name, medium, one representative original image URL per object (selecting the first URL alphabetically when multiple images exist), and the technique classification. Select the top 20 works ranked by semantic similarity between their medium description and 'pioneering experimental photographic process using light-sensitive materials', using title alphabetically as a tiebreaker for selection purposes.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: THE_MET
Task: What are the titles, artist names, and extracted technique details for photographs with 'Photograph' in their object names from the 'Photographs' department, created by known artists (not NULL or 'Unknown'), with an object end date of 1839 or earlier? Show one representative image per object (the first alphabetically by URL). Extract from the medium field: the 'technique' using the question 'What is the primary photographic technique or process? Examples: Photogenic drawing, Direct positive, Salted paper print' and the 'substrate' using the question 'What is the substrate or material the image was made on or from? Examples: paper negative, glass negative, paper. Return "unspecified" if not mentioned.' Also classify each photograph's subject matter based on its title into exactly one of ['Botanical', 'Architectural', 'Landscape', 'Still Life', 'Other']. Order results by subject category alphabetically, then by title alphabetically.
Required AI functions: AI_CLASSIFY, AI_EXTRACT