tianyang/spider2-aifunc huggingface dataset:
Database: GA360
Task: For sessions between April 1 and July 31, 2017, first identify distinct marketing channels (channelGrouping), then filter to only channels where the condition 'The marketing channel "{channelGrouping}" indicates high commercial purchase intent: ' (with the channel name substituted) evaluates to true. For the remaining channels, classify each into exactly one of ['Paid', 'Organic', 'Direct', 'Social', 'Referral', 'Other'] based on the channel name, and keep only channels classified as 'Paid' or 'Direct'. For sessions from these high-intent channels, classify them as 'purchase' (where transactions >= 1 and at least one hit has productRevenue not null) or 'non_purchase' (where transactions is null and no hit has productRevenue). Compare the average pageviews per visitor (total pageviews divided by distinct visitors) for each session type by month, showing the month in 'YYYY-MM' format, the session type, and the average pageviews per visitor rounded to 2 decimal places, ordered by month then session type.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: GA360
Task: In July 2017, among all visitors who purchased any YouTube-related product (identified by containing 'YouTube' in the product name), which non-YouTube product had the highest total quantity purchased, where the product must be classified into one of ['Apparel', 'Bags & Accessories', 'Electronics', 'Drinkware', 'Office Supplies', 'Other'] based on product name, and must satisfy the condition 'This product is useful for everyday activities and travel: ' concatenated with the product name? Return the product name and its assigned category.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: CRYPTO
Task: For Bitcoin blocks in 2023, calculate the daily average block interval in seconds by joining consecutive blocks via timestamp ordering (including cross-day intervals, excluding the genesis block). Filter to include only days where the condition 'Bitcoin mining statistics: Average block interval was {interval} seconds on this day. The expected target is 600 seconds. Was this an unusually efficient mining day?' evaluates to true, where {interval} is the average interval rounded to a whole number (integer). Return the first 10 qualifying dates chronologically with their average intervals rounded to 2 decimal places.
Required AI functions: AI_FILTER
Database: AUSTIN
Task: For Austin 2016 incidents, identify those where the condition 'This incident description indicates alcohol-related public disturbance or intoxication' concatenated as 'This incident description indicates alcohol-related public disturbance or intoxication: {description}' evaluates to true. Calculate the Z-score for daily counts of these semantically-identified incidents. What is the date with the second highest Z-score? If there are ties in Z-score, use the earliest date. Return the date formatted as '2016-MM-DD'.
Required AI functions: AI_FILTER
Database: GA360
Task: In January 2017, among visitors whose campaign name contains 'Data Share' and who accessed any page starting with '/home', extract the product category from the immediately consecutive page they visited next (that doesn't start with '/home') using the extraction question 'What is the main product category from this URL path? Return exactly one of: Apparel, Electronics, Accessories, Bags, Drinkware, Office, Lifestyle, or Other' into a field named 'product_category'. Which extracted product category was most commonly visited, and what is the maximum time (in seconds) visitors spent on the '/home' page before navigating to a page in that category? If there are ties in visit count, select the category that comes first alphabetically.
Required AI functions: AI_EXTRACT
Database: GA360
Task: Among customers who completed a transaction including the product 'YouTube Men's Vintage Henley' (matched using pattern '%youtube%henley%' case-insensitive) during July 2017 (July 1-31, across all daily session tables), find the top 10 other products they purchased by total quantity sold that are NOT semantically related to casual men's clothing - these represent cross-sell diversification opportunities. Exclude any products matching '%youtube%henley%'. To determine if a product is unrelated to men's clothing, evaluate the condition 'This product is semantically related to casual men''s clothing or fashion apparel: ' concatenated with the product name, and keep only those where this evaluates to false. For each qualifying product, classify it into exactly one of ['Apparel', 'Accessories', 'Drinkware', 'Office', 'Bags', 'Electronics', 'Other'] based on the product name. Return the product name, its category classification, and total quantity sold, ordered by total quantity descending, then by product name alphabetically for ties.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: GA360
Task: Among customers who completed transactions including 'YouTube Men's Vintage Henley' (matched using case-insensitive pattern '%youtube%henley%') during the entire month of July 2017 (dates 20170701 through 20170731), identify all other products they purchased in transactions during that same month. For the top-selling product by total quantity sold (excluding the Henley itself), extract its product category using the extraction question: 'What is the product category or type? Examples: Apparel, Accessories, Electronics, Drinkware, Office Supplies, Bags. Return a single category word.' Return the product name, its total quantity sold, and the extracted product category. A completed transaction is identified by hit type 'TRANSACTION', eCommerceAction action_type '6', or presence of a transaction object.
Required AI functions: AI_EXTRACT
Database: GA4
Task: Among users who had positive engagement time (engagement_time_msec > 0) in the 7-day period from January 1-7, 2021 but no positive engagement time in the final 2 days (January 6-7, 2021), assign each user to exactly one traffic acquisition channel. For each churned user, determine their traffic source from their records with positive engagement by first selecting the alphabetically first (minimum) traffic medium, then selecting the alphabetically first (minimum) traffic name among records with that medium. Classify this traffic source into exactly one of ['Organic Search', 'Paid Marketing', 'Direct Traffic', 'Social Media', 'Other'] based on a description formatted as 'Medium: {medium}, Source: {name}'. Count the distinct churned users per acquisition channel, and rank the channels by their semantic similarity to 'high-value marketing channel for customer retention campaigns' in descending order, with ties broken by churned user count descending. Return all channels with their churned user counts.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: STACKOVERFLOW_PLUS
Task: From Hacker News comments posted on or after January 1, 2014 (Unix timestamp >= 1388534400) that reference Stack Overflow questions via URLs matching 'stackoverflow.com/questions/{id}' or 'stackoverflow.com/q/{id}', identify the top 10 tags by total mention count. For each tag, split the question's tag string by '|' (lowercasing each tag), count mentions, and aggregate the associated comment text (with HTML tags removed and truncated to 500 characters per comment) using the instruction: 'List the top 2 specific issues or questions being discussed, formatted as: 1. [issue]; 2. [issue]'. Return each tag and its aggregated issues. If there is a tie in mention count, order alphabetically by tag name.
Required AI functions: AI_AGG
Database: DEPS_DEV_V1
Task: Among the highest release versions of NPM packages, find the most frequently used dependency (counting distinct root packages that depend on it, where the dependency is also an NPM package). From the top 30 most frequent dependencies, keep only those whose package names have semantic similarity above 0.2 to 'essential runtime utility library for JavaScript'. Then classify each remaining dependency into exactly one of ['Object/Prototype Utility', 'String/Text Utility', 'Async/Promise Utility', 'Path/File Utility', 'Other'] based on the package name. Return the package name, version, utility category, and frequency count for the single most frequent dependency. If there are ties in frequency, rank alphabetically by package name.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: GEO_OPENSTREETMAP
Task: What are the five longest types of highways within the multipolygon boundary of Denmark (as defined by Wikidata ID 'Q35') by total length, where each highway type is classified into exactly one of ['Major Vehicle Roads', 'Minor Vehicle Roads', 'Pedestrian/Cycling Paths', 'Service/Utility Roads', 'Other'] based on the highway type name, and only including highway types where the condition 'This type of road or path can be legally accessed by cars or trucks: ' concatenated with the highway type name evaluates to true? Return the highway type, its road classification, and total length in meters rounded to 2 decimal places.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: COVID19_OPEN_DATA
Task: Among days in March and April 2020 in the United States at the national level, which day had the highest COVID-19 cumulative confirmed case growth rate while being classified as 'Explosive Growth' from ['Explosive Growth', 'Rapid Growth', 'Moderate Growth', 'Slow Growth', 'Decline'] based on a description formatted as 'Day-over-day COVID-19 cumulative case growth rate: {percentage}%', and validated by the condition 'This day represents a critical pandemic milestone with significant case acceleration: Growth rate {percentage}%, Total cases {cumulative}, New cases {new}'? The growth rate is calculated as (today's cumulative confirmed - yesterday's cumulative confirmed) / yesterday's cumulative confirmed. Return the date in MM-DD format.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: USFS_FIA
Task: For the year 2012 (filtering where inventory_year equals 2012, evaluation_group contains '2012', and proportion_basis is 'SUBP'), identify the top 10 evaluation groups with the largest subplot acres, considering only the condition with the largest subplot acres within each group. When multiple conditions have the same subplot acres within a group, select the one with the alphabetically first evaluation_type, then the lowest condition_status_code. Calculate subplot acres as subplot_proportion_unadjusted multiplied by adjustment_factor_for_the_subplot multiplied by expansion_factor, and macroplot acres similarly using macroplot factors (defaulting to 0 if null).

For each group, extract the US geographic region from the evaluation_group_description using the extraction question: 'Based on the state name at the beginning of this description, what US geographic region is this state in? Answer with exactly one of: WEST, SOUTHWEST, MIDWEST, SOUTHEAST, NORTHEAST', storing the result in a field named 'region'.

Return the evaluation group, evaluation type, condition status code, evaluation description (from POPULATION_EVALUATION_GROUP), state code, macroplot acres, subplot acres, and the extracted region, ordered first by subplot acres descending, then by the extracted region alphabetically to group states from the same region together.
Required AI functions: AI_EXTRACT
Database: DEPS_DEV_V1
Task: What are the top 8 most popular NPM packages (by GitHub stars) that are frontend UI or CSS frameworks? Consider only the latest release version of each package, where "latest" is determined by the highest version ordinal. Filter to packages whose names have semantic similarity above 0.3 to 'frontend UI component library framework', then classify each package into one of ['UI Framework', 'CSS Framework', 'Utility Library', 'Data Visualization', 'Build Tool', 'Backend Framework', 'Other'] based on its package name, keeping only those classified as 'UI Framework' or 'CSS Framework'. If there are ties in star count, sort alphabetically by package name. Return the package name, version, and assigned category.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: DEPS_DEV_V1
Task: Among NPM packages that have an associated GitHub project (based on any version of the package being linked to a GitHub project), considering only the latest release version determined by the highest version ordinal, which are the top 8 most popular based on GitHub star count? For each package, also extract its primary purpose from the GitHub project description using the extraction question 'What is the main functionality? Answer as a noun phrase in 2-4 words.' into a field named 'primary_purpose'. If the extraction fails or returns an invalid result, return 'CSS-in-JS styling library' as the fallback. Return the package name, version, star count, and extracted primary purpose. If there are ties in star count, break ties alphabetically by package name.
Required AI functions: AI_EXTRACT
Database: NOAA_DATA
Task: What is the final latitude of the second longest-traveling North Atlantic hurricane in 2020, considering only hurricanes classified as 'Severe' or 'Devastating' based on their peak characteristics? Classify each hurricane into exactly one of ['Devastating', 'Severe', 'Moderate', 'Minor'] based on a description formatted as 'Hurricane {name}: peak wind {max_wind} knots, minimum pressure {min_pressure} mb', where 'Devastating' means 'catastrophic storm with extreme sustained winds and dangerously low central pressure', 'Severe' means 'very dangerous major hurricane with high winds and low pressure', 'Moderate' means 'significant tropical cyclone activity with notable winds', and 'Minor' means 'weaker tropical system with minimal intensity'. Among the hurricanes classified as 'Devastating' or 'Severe', rank them by total distance traveled (calculated as the sum of distances between consecutive track points), with ties broken by similarity to 'A powerful long-tracking Atlantic hurricane that maintained major hurricane intensity throughout its lifecycle' (higher similarity ranked first). Return the latitude of the final recorded position for the hurricane ranked second.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: PATENTS
Task: For each month from January 2008 through December 2022, count how many distinct U.S. patent publications were filed that are semantically related to IoT technology. First, pre-filter to abstracts containing any of the keywords 'IoT', 'Internet of Things', 'smart device', 'connected device', 'sensor network', 'machine-to-machine', 'M2M', or 'embedded system' (case-insensitive). Then, a publication is considered IoT-related if its abstract satisfies the condition 'This patent abstract describes technology related to the Internet of Things (IoT), including connected devices, smart sensors, machine-to-machine communication, or networked embedded systems: ' concatenated with the abstract text. Use only English abstracts (language = 'en') for evaluation. Include all months in the range, showing 0 for months with no qualifying filings. Output the month in 'YYYYMM' format and the count, ordered chronologically.
Required AI functions: AI_FILTER
Database: GHCN_D
Task: Among weather stations within 50 km straight-line distance from the center of Chicago (41.8319°N, 87.6847°W), find those classified as 'Airport' or 'Urban' from the categories ['Airport', 'Urban', 'Suburban', 'Research/Industrial', 'Other'] based on station name, then return the top 15 stations most semantically similar to 'official Chicago metropolitan area weather monitoring station'. If there are ties in similarity, order by station ID alphabetically. Return the station ID, name, and classification.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: GITHUB_REPOS
Task: For repositories containing Python code (case-insensitive match on language name), what was the average number of substantive GitHub commits made per month in 2016, broken down by commit type? 

First, filter to only commits where the condition 'This commit message represents a substantive code change (not a merge, version bump, or trivial edit): ' concatenated with the commit subject evaluates to true.

Then classify each remaining commit's subject into exactly one of ['Feature', 'Bug Fix', 'Documentation', 'Refactoring', 'Other'].

Calculate the average as total commits divided by 12 months for each commit type, rounded to 2 decimal places. Use the author timestamp (author:time_sec) to determine when commits occurred in 2016. Order results by average commits per month descending.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: HUMAN_GENOME_VARIANTS
Task: For refined human genetic variations collected in phase 3 on 2015-02-20 with reference bases 'AT' and 'TA', filter to only those variants where the condition 'This ancestral allele annotation indicates a structural genetic change involving insertion or deletion of base pairs: ' concatenated with the ancestral allele description evaluates to true. For each reference base, report the minimum and maximum start positions, the proportion of variants (as a decimal between 0 and 1, rounded to 4 decimal places) occurring at the minimum position, the proportion occurring at the maximum position, and a summary of the mutation characteristics aggregated using the instruction 'For each of these six mutation types, indicate if it appears in any annotation: deletion, insertion, complex_deletion, complex_insertion, cryptic_indel, unsure. Output exactly in this format: deletion:[Y/N]; insertion:[Y/N]; complex_deletion:[Y/N]; complex_insertion:[Y/N]; cryptic_indel:[Y/N]; unsure:[Y/N]'.
Required AI functions: AI_AGG, AI_FILTER
Database: NEW_YORK
Task: What are the top 10 Citibike stations by highest proportion of group rides, what area or landmark is each station near, and what is each station's group ride proportion (rounded to 6 decimal places)? Group rides are defined as round trips (trips that start and end at the same station) where, during the same 2-minute time window, multiple riders departed from or arrived at that station (counting all trips at the station, not just round trips). The proportion is calculated as the number of group ride trips divided by the total number of trips ending at that station. For each station name, extract the nearby area into a field named 'nearby_area' using the extraction question: 'What park, landmark, or neighborhood is this station located in or near? Respond with the primary location reference.' If stations are tied on proportion, rank by total ending trips descending, then by station ID ascending.
Required AI functions: AI_EXTRACT
Database: NOAA_DATA
Task: For LaGuardia Airport (station ID '725030') on June 12 for each year from 2011 through 2020, retrieve the year, average temperature (rounded to 1 decimal place), average wind speed (rounded to 1 decimal place), and average precipitation (rounded to 2 decimal places). Additionally, classify each year's weather quality into exactly one of ['Pleasant', 'Moderate', 'Unfavorable'] based on a combined description formatted as 'Temperature: {avg_temp rounded to 1 decimal}F, Wind speed: {avg_wind rounded to 1 decimal} knots, Precipitation: {avg_precip} inches, Rain: {yes/no}, Thunder: {yes/no}, Fog: {yes/no}'. Order the results by how similar each year's weather description is to 'warm sunny day around 75-80F with light breeze under 10 knots and no precipitation or storms', with the most similar years first; if similarity is tied, order by year ascending.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: TCGA
Task: For bladder cancer patients in the TCGA-BLCA project who have CDKN2A mutations (identified from the MC3 somatic mutation dataset SOMATIC_MUTATION_HG19_MC3_2017_02), retrieve their RNA expression levels for genes MDM2, TP53, CDKN1A, and CCNE1 (from RNASEQ_HG19_GDC_2017_02, pivoted as separate columns per gene) along with clinical information from CLINICAL_GDC_R39 including gender, vital status, and pathologic stage.

For each patient, extract a clinical risk assessment from their profile formatted as 'Cancer stage: {pathologic_stage}. Patient status: {vital_status}' (substituting 'unknown' for any missing values) using the extraction question: 'What is the clinical risk level based on cancer stage and patient status? Answer exactly one of: high, moderate, low' into a field named 'risk_level'.

Order results by extracted risk level (high first, then moderate, then low), with ties broken by patient_id alphabetically.
Required AI functions: AI_EXTRACT
Database: NOAA_DATA
Task: Among Washington State weather stations that recorded more than 150 rainy days in 2023 but fewer rainy days compared to 2022 (where a rainy day is defined as having precipitation greater than 0 mm and not equal to 99.99), classify each station into exactly one of ['Airport', 'Mountain/Pass', 'Urban', 'Rural/Remote'] based on the station name. Return the top 3 stations ordered first by location type priority (with strict ordering: 'Rural/Remote' first, then 'Mountain/Pass', then 'Airport', then 'Urban'), then by semantic similarity to 'remote wilderness weather monitoring station' in descending order as a tiebreaker. For each station, return the station name, its location classification, and the rainy day counts for both years.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: NOAA_DATA
Task: Which airport or mountain pass weather stations in Washington State recorded more than 150 rainy days in 2023 but fewer rainy days compared to 2022? A rainy day is defined as having precipitation greater than zero millimeters and not equal to 99.99. Extract the facility type from each station name into a field named 'facility_type' using the extraction question 'What type of facility is this station? Answer with exactly one of: Airport, Mountain Pass, Other'. Only include stations where the extracted facility type is 'Airport' or 'Mountain Pass'. Return the station name, facility type, rainy days in 2023, and rainy days in 2022, ordered by rainy days in 2023 from highest to lowest.
Required AI functions: AI_EXTRACT
Database: TCGA_BIOCLIN_V0
Task: Find case barcodes and their corresponding GDC file URLs for female patients aged 30 or younger diagnosed with breast cancer (BRCA) in the TCGA database. First identify patients from the Annotations table where entity_type is "Patient" and either category is "History of unacceptable prior treatment related to a prior/other malignancy" or classification is "Redaction". Also identify patients from the Clinical table with disease_code "BRCA", age_at_diagnosis less than or equal to 30, and gender "FEMALE". Perform a FULL JOIN between these two sets, but only keep patients where both category and classification from the annotations side are NULL in the final result. Use GDC metadata from archive release 14 (specifically rel14_caseData, rel14_fileData_current, and rel14_GDCfileID_to_GCSurl_NEW tables) to get the corresponding file URLs. Then filter to only files where the condition 'This file URL indicates primary DNA or RNA sequencing alignment data in BAM format: ' concatenated with the file URL evaluates to true. Return 30 files ordered first by case barcode ascending, then within each case by similarity to 'genomic sequencing BAM alignment file for variant calling' descending, and finally by file URL ascending as a tie-breaker.
Required AI functions: AI_FILTER, AI_SIMILARITY