tianyang/spider2-aifunc huggingface dataset:
Database: GITHUB_REPOS
Task: For GitHub repositories with JavaScript as the primary language (determined by highest byte count among all languages), first identify the top 5 candidates by commit count. For each candidate, summarize their development work by aggregating commit subjects using the instruction: 'Identify the top 3 development focus areas from these commit messages, formatted as: Area1; Area2; Area3'. Then analyze the sentiment of each summary and keep only repositories where the summary sentiment is 'positive' or 'neutral', indicating healthy development activity. From these filtered repositories, return the top 2 by commit count with their repository name, commit count, and development focus summary.
Required AI functions: AI_AGG, AI_SENTIMENT
Database: NPPES
Task: Among healthcare providers whose practice location is in Mountain View, CA, identify the top 10 most common specializations based on the count of distinct NPIs across all 15 healthcare provider taxonomy specialization fields (with ties broken alphabetically by specialization name). From these top 10, find the 5 specializations most semantically similar to 'primary care and general medicine for routine patient visits' (with ties broken alphabetically by specialization name). Among those 5 most similar specializations, determine which one has a distinct NPI count closest to the average count across all 10 top specializations (with ties broken alphabetically by specialization name). Return only that specialization name.
Required AI functions: AI_SIMILARITY
Database: NPPES
Task: Among healthcare providers whose practice location is in Mountain View, CA, identify the top 10 most common specializations based on distinct NPI count (with ties broken by specialization name alphabetically). For these top 10 specializations, determine which one has a distinct NPI count closest to the average count across those 10 (if there's a tie in distance from average, pick the one with the alphabetically first name). Additionally, aggregate all 10 specialization names using the instruction: 'Identify the top 3 healthcare service domains these specializations represent, formatted as: 1. [domain]; 2. [domain]; 3. [domain]'. Return the specialization closest to average and the aggregated summary of healthcare domains.
Required AI functions: AI_AGG
Database: THELOOK_ECOMMERCE
Task: For the January 2020 first-purchase cohort (users whose first order was in January 2020), calculate the return proportion for each subsequent month of 2020 (February through December). Rank the months by semantic similarity to 'high customer engagement with strong repeat purchase behavior' using a description formatted as 'This month had {percentage}% of the cohort return to make another purchase'. Return the top 5 months with the strongest retention patterns, showing the month and return proportion. Order by similarity ranking (highest first), with ties broken by month chronologically (earliest first).
Required AI functions: AI_SIMILARITY
Database: CHICAGO
Task: Among traditional taxi cab companies (filtered using the condition 'This is a traditional taxi cab company name (not a ride-share service, limousine company, or private car service): ' concatenated with each company name), which three company-month combinations had the largest month-over-month increase in trip numbers during 2018? Return the company name, month number, and the increase amount, ordered by increase descending.
Required AI functions: AI_FILTER
Database: CHICAGO
Task: For taxi trips with durations between 1 and 50 minutes (trip_seconds between 60 and 3000), create 10 equal-sized quantile groups using NTILE(10) on distinct minute values (calculated as FLOOR(trip_seconds / 60)). For each quantile group, calculate the total number of trips and average fare rounded to 2 decimal places. Format each group's time range as 'XXm to XXm' where XX is zero-padded to two digits, representing the minimum and maximum duration minutes within that quantile.

Classify each group's commuter appeal into exactly one of ['Highly Appealing', 'Moderately Appealing', 'Less Appealing', 'Not Recommended'] based on a description formatted as 'Trip duration: {time_range}, Average fare: ${average_fare}', where 'Highly Appealing' means 'short duration under 15 minutes with affordable fare under $15, ideal for daily commute', 'Moderately Appealing' means 'reasonable duration 15-30 minutes with moderate fare $15-30', 'Less Appealing' means 'longer duration 30-45 minutes or higher fare $30-40', and 'Not Recommended' means 'very long over 45 minutes or expensive over $40, not suitable for regular commute'.

Filter to only groups classified as 'Highly Appealing' or 'Moderately Appealing'. Rank the filtered results by similarity to 'quick affordable 10 minute trip costing around $8' in descending order, where similarity is calculated on a description formatted as 'Duration: {time_range}, Fare: ${average_fare}'. Display the time range, total trips, average fare, and commuter appeal classification.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: THE_MET
Task: For The Met's collection, identify the top three most frequently associated labels with artworks from each historical period, considering only labels linked to 500 or more artworks overall. For each qualifying label, classify it into exactly one of ['Artistic Medium', 'Material', 'Subject', 'Style', 'Form'] based on the label text. Exclude periods that are empty or whitespace-only. Return the period, label, its category classification, and the artwork count. When multiple labels have the same count within a period, break ties by semantic similarity to 'specific artistic technique or visual medium' rounded to 1 decimal place (higher similarity first), then alphabetically by label name.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: WIDE_WORLD_IMPORTERS
Task: Among customers classified as 'Other' from the categories ['Retail Store', 'Wholesale Distributor', 'Corporate Account', 'Other'] based on customer name, find the top 100 whose names are most similar to 'individual person with European name'. For these customers, how many have orders and invoices that perfectly match at the line-item level (where matching means identical StockItemID, UnitPrice, TaxRate, and aggregated Quantity per order-invoice pair), and when aggregated at the customer level, have an equal total count of orders (from the orders table) and invoices (from the invoices table, excluding credit notes), with the number of perfectly matched order-invoice pairs also equaling these counts, as well as identical total monetary values (where order value is calculated as Quantity × UnitPrice × (1 + TaxRate/100) rounded to 2 decimal places, and invoice value uses ExtendedPrice rounded to 2 decimal places)? Exclude credit notes from the analysis.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: WIDE_WORLD_IMPORTERS
Task: How many customers have orders and invoices that match at the line-item level—where each invoice is paired with its corresponding order (via the invoice's OrderID), and within each such order-invoice pair, line items are matched by StockItemID, UnitPrice, and TaxRate with equal aggregated quantities, excluding credit notes (IsCreditNote = 0)—and when aggregated per customer, have equal counts of orders and invoices (where all order-invoice pairs must match at the line-item level), as well as identical total values (where order value is calculated as Quantity × UnitPrice × (1 + TaxRate/100) rounded to 2 decimal places, and invoice value is the sum of ExtendedPrice rounded to 2 decimal places)?

Additionally, for these matched customers, aggregate their distinct delivery instructions from invoices using the instruction: 'List exactly 3 common address prefixes seen (like Unit, Suite, Shop) in alphabetical order. Format strictly as: prefix1; prefix2; prefix3'
Required AI functions: AI_AGG
Database: WIDE_WORLD_IMPORTERS
Task: Among all orders that do not appear in the invoice table (lost orders), classify each customer category into exactly one of ['Retail', 'Wholesale', 'Specialty', 'Other'] based on the category name. For each classified business type, calculate the maximum lost order value, where an order's value is the sum of (quantity × unit price × (1 + tax rate / 100)) across all its order lines. Which business type's maximum lost order value is closest to the overall average of these maximum values across all business types? In case of ties in distance to average, prefer the business type most semantically similar to 'typical consumer retail business'.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: WIDE_WORLD_IMPORTERS
Task: Among customers who purchased at least one item in 2014 that is both classified as 'USB Flash Drives' from the categories ['Joke Mugs', 'USB Flash Drives', 'USB Gadgets', 'Office Items', 'Other'] based on product description AND satisfies the condition 'This product is shaped like food or a snack item: ' concatenated with the product description, what is the median of their average monthly spending? For each qualifying customer, calculate their total spending across all their 2014 purchases, divide by 12 months to get average monthly spending, then find the median across all qualifying customers.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: GA360
Task: For new users whose initial visit occurred in the first week of October 2016 (between October 1, 2016, and October 7, 2016), rank each user's marketing channel by its semantic similarity to 'direct product purchase intent marketing channel' and filter to only those with similarity score above 0.2. For users passing this filter, classify each into one of ['High Purchase Intent', 'Research Intent', 'Casual Browsing'] based on their channelGrouping field, where 'High Purchase Intent' means 'users from paid advertising or affiliate marketing channels actively seeking products', 'Research Intent' means 'users from organic search or direct navigation researching products', and 'Casual Browsing' means 'users from social media or referral links casually discovering products'. For each intent category, calculate the percentage of new users who both stayed on the site for more than 5 minutes (300 seconds) during their initial visit and made a purchase on any subsequent visit within that week, relative to the total new users in that category, rounded to 4 decimal places. A user's "initial visit" is defined as their earliest session by visitStartTime, and a "subsequent purchase" is any session with totalTransactionRevenue > 0 occurring after the initial visit. Order results by conversion percentage descending, with ties broken alphabetically by intent category.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: GITHUB_REPOS
Task: For each vendor namespace (the part before "/" in package names) extracted from the require section of JSON-formatted files, what is the total usage count and primary domain classification? Aggregate the package names using the instruction: 'Classify the primary domain of these packages as exactly one of: framework, database, utility, testing, logging, email, or other'. Return the top 5 vendors by total usage count, with ties broken alphabetically by vendor name.
Required AI functions: AI_AGG
Database: OPEN_TARGETS_PLATFORM_1
Task: Among psoriasis-associated targets whose approved name has semantic similarity greater than 0.3 to 'protein involved in immune regulation and inflammatory signaling', which one has the overall association score closest to the mean score for psoriasis? Classify each target into exactly one of ['Kinase', 'Phosphatase', 'Receptor', 'Transcription Factor', 'Cytokine', 'Other'] based on its approved name, and return the approved symbol along with its classification.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: OPEN_TARGETS_PLATFORM_1
Task: Which target approved symbol has the overall association score closest to the mean score for psoriasis (diseaseId 'EFO_0000676')? If multiple targets have the same distance from the mean, select the one with the alphabetically first approved symbol. For the identified target, extract structured information from its approved name using the extraction questions: 'protein_family' with question 'What is the protein family or class (e.g., kinase, phosphatase, receptor)?', and 'subtype' with question 'What is the specific subtype designation (e.g., type 1, alpha, non-receptor)?'. Additionally, extract information about the disease from its description using: 'disease_category' with question 'What type of disease is this (e.g., autoimmune, inflammatory, infectious)?', and 'affected_system' with question 'What body system or organ is primarily affected?'. Return the approved symbol, protein family, subtype, disease category, and affected system.
Required AI functions: AI_EXTRACT
Database: META_KAGGLE
Task: Among the top 100 Kaggle forum users ranked by distinct upvotes received (where "distinct upvotes received" means the count of unique users who gave them upvotes, i.e., distinct FromUserId values), identify those whose DisplayName suggests they are an individual person rather than an organization or team, using the filter condition 'This display name appears to belong to an individual person rather than an organization or team: ' concatenated with their DisplayName. Further restrict to users classified as 'Expert' or 'Contributor' from the categories ['Expert', 'Contributor', 'Learner', 'Organization'] based on their DisplayName. Return the top 3 users by upvotes received, showing their username, total distinct upvotes received, and total distinct upvotes given (count of unique users they upvoted, i.e., distinct ToUserId values). Sort by upvotes received descending, with ties broken by username alphabetically.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: GHCN_D
Task: For each year from 2013 to 2016, what was the highest precipitation (in mm), lowest minimum temperature (in °C), and highest maximum temperature (in °C) recorded during the last 15 days of December at weather station USW00094846, using only validated data (non-null values with no quality flags)? Classify each year's winter conditions into exactly one of ['Harsh Winter', 'Moderate Winter', 'Mild Winter'] based on a description formatted as 'Precipitation: {max_precip_mm}mm, Min Temp: {min_temp_c}°C, Max Temp: {max_temp_c}°C', where 'Harsh Winter' means 'minimum temperature below -15°C or precipitation above 20mm', 'Moderate Winter' means 'temperatures between -15°C and -5°C with moderate precipitation', and 'Mild Winter' means 'temperatures above -5°C with low precipitation'. Order results by similarity to 'dangerous winter conditions with extreme cold and heavy precipitation' (most similar first), and return the year, winter classification, maximum precipitation, minimum temperature, and maximum temperature.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: EPA_HISTORICAL_AIR_QUALITY
Task: For California's 2020 air quality data, calculate the monthly average levels of PM10, PM2.5 FRM, PM2.5 non-FRM, volatile organic compounds (VOC), SO2 (scaled by factor of 10), and Lead (scaled by factor of 100). For each month, create a pollution profile description formatted as 'Monthly pollution levels - PM10: {value} µg/m³, PM2.5 FRM: {value} µg/m³, PM2.5 non-FRM: {value} µg/m³, VOC: {value} ppb, SO2 (x10): {value}, Lead (x100): {value}'. Classify each month's air quality into exactly one of ['Low Risk', 'Moderate Risk', 'High Risk', 'Very High Risk', 'Hazardous'] based on this pollution profile description. Filter to only include months classified as 'Moderate Risk', 'High Risk', 'Very High Risk', or 'Hazardous'. Then rank the filtered months by semantic similarity to 'extremely hazardous air quality emergency with dangerous particulate matter levels' (most similar first). Return the month number, all six pollutant averages (rounded to 2 decimal places), and the air quality classification.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: FHIR_SYNTHEA
Task: Among living patients whose official last names begin with 'A' and who each have exactly one distinct condition (determined by condition name), which diagnosable medical conditions have the highest number of different active medications prescribed to any single patient? Classify conditions into ['Cardiovascular', 'Respiratory', 'Metabolic', 'Dermatological', 'Infectious', 'Neurological', 'Other'] based on condition name, excluding those classified as 'Other'. Additionally, only include conditions where 'This is a diagnosable medical condition (not a symptom or observation): ' concatenated with the condition name evaluates to true. Return the top 8 condition names and their codes, ordered by maximum medication count descending, with ties broken alphabetically by condition name.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: NOAA_GSOD
Task: Among the days in October 2009 at weather station 723758, what are the top 3 dates with the highest average temperature that had favorable weather conditions?

Each day's weather should be classified into exactly one of ['Clear', 'Light Precipitation', 'Severe Weather', 'Mixed Conditions'] based on a description formatted as 'Fog: {Yes/No}, Rain/Drizzle: {Yes/No}, Thunder: {Yes/No}, Snow/Ice: {Yes/No}, Hail: {Yes/No}, Tornado: {Yes/No}' where Yes indicates the condition was reported and No indicates it was not.

Only include days classified as 'Clear' that also satisfy the condition 'The weather described is ideal for outdoor activities: ' concatenated with the weather description.

For each qualifying day, what is the date (in YYYY-MM-DD format) and its weather classification? If there are ties in average temperature, order by date ascending.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: HACKER_NEWS
Task: Identify Hacker News users who had activity followed by inactivity. Specifically, find users who have at least one gap month within their activity span (months where they were expected to be active but had no records). For each such user, calculate their "inactive month number" as the month immediately following their last recorded activity month, counting from their first activity month (where the first activity month is month 1). Only consider activity data up until September 10, 2024.

From these users with gaps, focus on those whose post content is semantically similar to 'technical programming, software development, and technology industry discussions'. Filter to users whose content has a similarity score above 0.3 to this reference phrase.

Among the filtered users, find the one with the highest inactive month number. If there is a tie on inactive month number, select the user whose username comes first alphabetically.

Additionally, classify the selected user's primary content type into exactly one of ['Technical Discussion', 'Opinion/Commentary', 'Question/Help', 'News/Link Sharing', 'Other'] based on a sample of their post text.

Return the user ID, their inactive month number, and their content classification.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: SDOH
Task: For the five states whose percentage change in unsheltered homelessness from 2015 to 2018 is closest to the national average of all state percentage changes, provide the state abbreviation and a summary of the Continuum of Care regions they contain. The percentage change for each state is calculated by summing unsheltered homeless counts across all CoCs within that state for each year, then computing ((2018_total - 2015_total) / 2015_total) * 100. Only include records where the state code (extracted as the uppercase portion of CoC_Number before the hyphen) is one of the 50 US state abbreviations or DC. The summary for each state should be generated using the aggregation instruction: 'Identify the main cities and counties covered by these Continuum of Care regions, formatted as: City1/County1; City2/County2; City3/County3 (list up to 3 main areas)'. Order results by closeness to the national average (ascending), with ties broken alphabetically by state abbreviation.
Required AI functions: AI_AGG
Database: NHTSA_TRAFFIC_FATALITIES
Task: Which top 3 states had the largest absolute differences in weekend traffic accident counts between weather conditions semantically similar to 'Rain' (with similarity score above 0.7) versus conditions similar to 'Clear' (with similarity score above 0.7) during 2016? For each state, provide the accident count difference. Order by difference descending, with ties broken by state name alphabetically.
Required AI functions: AI_SIMILARITY
Database: WORLD_BANK
Task: What are the top three principal repayment debt indicators for Russia and their total cumulative debt values? The debt transaction type should be extracted from each indicator description using the question 'What type of debt transaction is this? Answer with exactly one of: Principal Repayment, Interest Payment, Disbursement, Debt Stock, Other', filtering to only those indicators classified as 'Principal Repayment'.
Required AI functions: AI_EXTRACT
Database: WORLD_BANK
Task: For each region, which high-income country had the highest average crude birth rate during the 1980s (1980-1989)? Classify each country into exactly one of ['Oil-based Economy', 'Service-based Economy', 'Manufacturing Economy', 'Tourism Economy', 'Mixed Economy'] based on a description formatted as '{country_name} in {region}'. If there is a tie in birth rate, break ties first by economy classification alphabetically, then by semantic similarity of the country name to 'rapidly developing nation' (higher similarity ranked first). Return the country name, economy classification, and average birth rate (rounded to 2 decimal places).
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: WORLD_BANK
Task: For each region, which high-income country had the highest average crude birth rate during the 1980s (years 1980-1989), and what is that country's average birth rate rounded to 2 decimal places? In case of ties, select the country that comes first alphabetically. For each region, aggregate up to 3 special notes from high-income countries (selecting notes from countries in alphabetical order by country name) using the instruction: 'Summarize the key data quality and economic characteristics mentioned in these notes, formatted as: Key points: [point1; point2; point3]'. Then, analyze the overall sentiment of each regional summary to assess data quality concerns, returning the sentiment as one of 'positive', 'negative', 'neutral', 'mixed', or 'unknown'. Return the country name, average birth rate, regional notes summary, and the sentiment assessment of the regional notes, ordered by region name alphabetically.
Required AI functions: AI_AGG, AI_SENTIMENT
Database: SAN_FRANCISCO_PLUS
Task: For trips where 'Clay St & Drumm St' occurs before 'Sacramento St & Davis St' in the stop sequence, classify each trip headsign into one of ['Residential Area', 'Commercial Area', 'Recreational Area', 'Transit Hub'] based on the destination name. Filter to only routes where the headsign is classified as 'Residential Area', then rank the results by semantic similarity to 'quiet residential street in San Francisco' (highest similarity first). For each qualifying route, show the trip headsign, destination classification, earliest departure time from 'Clay St & Drumm St', and latest arrival time at 'Sacramento St & Davis St' in HH:MM:SS format.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: ECOMMERCE
Task: For marketing channels that satisfy the filter condition 'This marketing channel represents a primary acquisition source for e-commerce analytics: {channel}', classify each into one of ['Paid Acquisition', 'Organic Discovery', 'Direct/Brand', 'Social/Referral', 'Other'] based on the channel name. A purchaser is defined as a visitor with at least one transaction recorded. Calculate by acquisition category: the conversion rate (unique purchasers divided by unique visitors, expressed as a decimal rounded to 4 decimal places) and average transactions per purchaser (rounded to 4 decimal places). Order results by conversion rate in descending order.
Required AI functions: AI_CLASSIFY, AI_FILTER