tianyang/spider2-aifunc huggingface dataset:
Database: THELOOK_ECOMMERCE
Task: For the top-selling product category (determined by total purchase quantity from order items excluding those with status 'Cancelled', with alphabetical tie-breaking if categories have equal quantities), identify the top 30 products whose names are most semantically similar to 'comfortable everyday basics for daily wear'. Then classify each of these products into exactly one of ['Everyday Comfort', 'Fashion Forward', 'Basic Essential', 'Specialty Item'] based on the product name. For each classification that has product page visits, calculate the average time in minutes that users spend on product page visits, where time is measured as the difference between the product page view timestamp and the next event timestamp (of any event type) within the same session (with events ordered by timestamp then sequence number within each session). Return only the classifications and their average page visit times rounded to 2 decimal places, excluding any products that could not be classified.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: THELOOK_ECOMMERCE
Task: Among all product categories in the dataset, identify the category with the highest total purchase quantity (counting all order items regardless of status, with ties broken by category name alphabetically), and for that specific category, calculate the average time in minutes that users spend on each product page visit, rounded to 2 decimal places. The average time is calculated as the difference between the timestamp when a user views a product page and the timestamp of the next event within the same session (ordered by created_at ascending, with ties broken by event id ascending), including only visits where the next event time is at or after the current event time. Additionally, for a sample of up to 300 distinct product names viewed in this category (ordered alphabetically by product name), aggregate them using the instruction: 'Identify the top 5 most common product types or styles being viewed, formatted as: Type1; Type2; Type3; Type4; Type5'. Return the category name, average viewing time in minutes, and the aggregated product types summary.
Required AI functions: AI_AGG
Database: GITHUB_REPOS_DATE
Task: What are the top 2 repositories from the 2017 GitHub WatchEvent data with more than 300 distinct watchers (joined with sample_files) that are most semantically similar to 'modern software development frameworks and libraries'? Only consider repositories classified as 'Machine Learning/AI' or 'Web Development' based on repository name, using the categories ['Machine Learning/AI', 'Web Development', 'Mobile Development', 'DevOps/Infrastructure', 'Other']. Show each repository's name and distinct watcher count.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: GITHUB_REPOS_DATE
Task: From the 2017 GitHub WatchEvent data, which two repositories have the most distinct watchers (with more than 300 watchers each), and what programming languages does each repository primarily use? For each repository, aggregate its file paths using the instruction: 'Based on these file paths, identify the main programming languages used in this repository by analyzing file extensions. Return a semicolon-separated list of up to 3 languages.'. Return the repository name, distinct watcher count, and the identified languages, ordered by watcher count descending.
Required AI functions: AI_AGG
Database: GITHUB_REPOS_DATE
Task: Among Python repositories with open-source licenses ('artistic-2.0', 'isc', 'mit', 'apache-2.0') that have `.py` files on the master branch and had at least one activity event in April 2022, find the repository most semantically related to 'container orchestration and cloud deployment'. Classify each repository into exactly one of ['Infrastructure', 'Web Development', 'Data Science', 'DevOps', 'Other'] based on the repository name, and only consider repositories classified as either 'Infrastructure' or 'DevOps'. Activity is measured as the sum of distinct watcher actor IDs, distinct issue event IDs, and distinct fork event IDs. Return the repository name and its assigned category for the single repository with the highest semantic similarity to 'container orchestration and cloud deployment'.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: GITHUB_REPOS
Task: Among all Python (*.py), R (*.r, *.R, *.Rmd, *.rmd), and IPython notebook (*.ipynb) files in the GitHub sample dataset, extract import statements and identify the library/module names. From the top 100 most frequently imported libraries, classify each into exactly one of ['Data Science', 'System Utility', 'Web Development', 'Testing', 'Other'] based on the input formatted as 'Library: {library_name}'. Then, among only those classified as 'Data Science', further filter to libraries where the condition 'The library named "{library_name}" is primarily used for numerical computing, data manipulation, or statistical analysis: ' evaluates to true. Which library is the second most frequently imported among these filtered results? In case of ties in import count, rank alphabetically by library name.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: CRYPTO
Task: What are the top 10 Ethereum addresses by balance before September 1, 2021, considering only successful transactions (status=1 for traces, receipt_status=1 for transactions) with no call type or call type 'call'? Gas fees should be deducted from transaction senders using receipt_effective_gas_price only for successful transactions (receipt_status=1), not credited to miners. For each address in the top 50 by balance, create a profile formatted as 'Ethereum address with balance of {balance_in_whole_ETH} ETH. {contract_description}' where balance_in_whole_ETH is the balance divided by 1e18 and rounded to 0 decimal places, and contract_description is 'This is an ERC20 token contract.' for ERC20 contracts, 'This is an ERC721 NFT contract.' for ERC721 contracts, 'This is a smart contract.' for other contracts, or 'This is an externally owned account (EOA/wallet).' otherwise. Classify each address into exactly one of ['Exchange Wallet', 'DeFi Protocol', 'Token Contract', 'Whale Wallet', 'Other'] based on the profile. Only include addresses classified as 'Whale Wallet'. Order by balance descending, with semantic similarity to 'Major cryptocurrency whale holding substantial ETH reserves' as a secondary sort. Return the address and balance in wei.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: THELOOK_ECOMMERCE
Task: For each month prior to July 2024, among the top 5 best-selling products (determined by highest sales volume with total revenue as tiebreaker, then product name alphabetically) from completed orders with non-null brands, identify the single product most semantically similar to 'premium outdoor athletic performance gear' based on a description formatted as '{product_name} - {category}' (with product name alphabetically as tiebreaker if similarity scores are equal). Return the month (formatted as 'YYYY-MM'), product name, brand, category, total sales, rounded total revenue, order status, and market segment classified into exactly one of ['Premium Fashion', 'Athletic & Sports', 'Casual Everyday', 'Formal Business'] based on a description formatted as 'Product: {product_name}, Category: {category}'. Order results by month descending.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: NCAA_BASKETBALL
Task: List the top 5 universities with the most seasons where they achieved the maximum wins in their respective NCAA basketball seasons between 1900-2000, showing each university's total number of such peak-performance seasons. Exclude entries with missing team names. Only include entries where the condition 'This is a legitimate university or college institution: ' concatenated with the university market name evaluates to true. Additionally, classify each university into exactly one of ['Power Conference', 'Mid-Major', 'Ivy League', 'HBCU', 'Other'] based on the university market name, and show the classification. If there is a tie in peak-performance seasons, order alphabetically by university name.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: IOWA_LIQUOR_SALES
Task: Identify the top 10 liquor categories in Iowa in 2021 by calculating, for each category, the average per-liter retail price across all sales transactions (computed as state_bottle_retail divided by bottle_volume_ml converted to liters). Group by category code and include category name. From these top 10 categories, filter to only those classified as 'Whiskey/Bourbon' based on the category_name, using the classification categories ['Whiskey/Bourbon', 'Liqueur/Cordial', 'Gin/Vodka', 'Specialty/Other']. For the filtered categories, provide their average per-liter retail prices (calculated the same way) for the years 2019, 2020, and 2021, with separate columns for each year. Order results by semantic similarity to 'premium aged whiskey' in descending order based on category_name, with category code as tie-breaker.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: NEW_YORK_PLUS
Task: Among the top 50 busiest Citibike stations by trip count in 2018 (with ties broken by smallest station ID first), filter to those whose names satisfy the condition 'This station name indicates a commercial, business, or high-traffic transit area location: ' concatenated with the station name. From these filtered stations, find the one with the highest number of trips starting there (with ties broken by smallest station ID first). For that station, determine which numeric day of the week (0=Sunday through 6=Saturday) and which hour of the day (0-23) had the greatest number of trips based on start time (with ties broken by earliest day of week, then earliest hour). Also classify that station's location type into exactly one of ['Transit Hub', 'Commercial District', 'Residential Area', 'Park/Recreation', 'Other'] based on its name.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: ECLIPSE_MEGAMOVIE
Task: Among a sample of 15 photos from Missouri (state = 'MO') in the PHOTOS_V_0_1 collection that contain 'corona' in their vision_labels (ordered by photo id to ensure consistent selection), classify each photo into one of ['Totality', 'Partial Eclipse', 'Corona', 'Atmosphere', 'Other'] based on its vision_labels field. Filter to photos classified as 'Totality' or 'Corona', then find the user with the highest count of such photos (using user identifier as tie-breaker). Return that user's identifier, their count of totality/corona photos, and an aggregated summary of their photo themes using the instruction: 'Summarize the dominant photography themes, formatted as: Theme1; Theme2; Theme3'.
Required AI functions: AI_AGG, AI_CLASSIFY
Database: PATENTS_USPTO
Task: Among the 100 longest independent patent claims (filtered by ind_flg='1', with ties in word count broken by patent number ascending then claim number numerically ascending), identify those that describe computer software, data processing, or digital technology by filtering where the condition 'The following patent claim describes computer software, data processing, or digital technology methods: ' prepended to the first 2000 characters of the claim text evaluates to true. Return the top 50 qualifying claims by word count (with ties broken by alphabetically first publication number ascending, then claim number numerically ascending), showing each claim's alphabetically first publication number from the MATCH table, application number (in DOCDB format from the publications table via LEFT JOIN, which may be NULL if not found), claim number, word count, and technology domain classified into exactly one of ['Software', 'Electronics', 'Biotechnology', 'Mechanical', 'Chemical', 'Other'] based on the first 3000 characters of the claim text.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: NEW_YORK_NOAA
Task: For weather stations within a 20-mile radius of Chappaqua, New York (Latitude: 41.197, Longitude: -73.764), classify each station into exactly one of ['Airport', 'Marine', 'Land-Based', 'Other'] based on the station name, then filter to show only non-marine stations (those classified as 'Airport', 'Land-Based', or 'Other'). For each qualifying station that has at least one valid temperature observation, provide the station identifier (formatted as usaf-wban), station name, station type classification, and the count of valid temperature observations recorded from 2011 to 2020, excluding any temperature readings that are NULL or equal to 9999.9. Order results by semantic similarity to 'professional airport weather monitoring facility' (most similar first) based on the station name, with ties broken by station identifier alphabetically ascending.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: PATENTS
Task: For utility patents granted in 2010 that received exactly one forward citation within 10 years of their filing date, what is the count of patents per technology category? Classify each patent's title into exactly one of ['Electronics', 'Biotechnology', 'Software', 'Mechanical', 'Chemical', 'Other']. Only include patents whose title semantically satisfies the condition 'This patent title describes a novel technological improvement or innovation: ' concatenated with the title text. Forward citations are counted as distinct citing application numbers from patents whose citation arrays reference the 2010 patent's publication number, where the citing patent's filing date is between the cited patent's filing date and 10 years later (filing_date + 100000 in YYYYMMDD format). Order results by patent count descending, then by category name alphabetically.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: PATENTS
Task: Among patents granted between 2010 and 2023 in CN that belong to families with more than one distinct application, how many have titles indicating they describe chemical or pharmaceutical inventions? Use the first available title from the title_localized array for each patent. First filter using the condition 'This patent title describes a chemical compound, pharmaceutical drug, or biochemical process: ' concatenated with the title text, then classify each filtered patent into exactly one of ['Pharmaceutical Drug', 'Chemical Compound', 'Biochemical Process', 'Medical Device', 'Other'] based on the title text, and show the count per category ordered by count descending, then by category name alphabetically for ties.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: PATENTS
Task: For United States utility patents under the B2 classification granted between June and September of 2022, identify the most frequent 4-digit IPC code for each patent (in case of ties, select the alphabetically first IPC code). From patents where this most frequent IPC code appears 10 or more times within that patent's IPC classifications, classify each patent into exactly one of ['Electronics', 'Life Sciences', 'Chemistry', 'Mechanical', 'Computing', 'Other'] based on the patent title. Then filter to only include patents where the condition 'This patent represents an invention in the semiconductor or integrated circuit domain: ' concatenated with the patent title evaluates to true. List the publication numbers, IPC4 codes, and technology sector for these patents.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: PATENTS
Task: For United States utility patents (B2 kind code) granted between June and September 2022, identify the most frequent 4-digit IPC code for each patent. For patents where this dominant IPC code appears 10 or more times within the patent, perform two analyses on the patent abstract: (1) extract the primary technological innovation using the extraction question 'What is the primary technological innovation? Respond with a brief noun phrase only, 3-5 words maximum, no articles, no verbs.' into a field named 'primary_innovation', and (2) analyze the overall sentiment of the abstract. List the publication numbers, their dominant IPC4 codes, the extracted primary innovations, and the overall sentiment (one of 'positive', 'negative', 'neutral', 'mixed', or 'unknown').
Required AI functions: AI_EXTRACT, AI_SENTIMENT
Database: PATENTS
Task: Among US patents with B2 kind code and grant dates between 2015 and 2018, identify the patent with the highest originality score that is both related to medical device innovation and classified as either 'Biotechnology' or 'Electronics'. The originality score is calculated as 1 minus the sum of squared occurrences of distinct 4-digit IPC codes (formatted as letter-2digits-letter, e.g., 'A61K') in backward citations divided by the square of total occurrences. For each cited patent, use its primary IPC code (the one marked with first=true), breaking ties by highest frequency then alphabetically by IPC code. First compute originality scores for all qualifying patents, then consider only the top 50 most original (breaking ties by publication number alphabetically). Among these, keep only patents where the condition 'This patent title describes a medical device or healthcare technology innovation: ' concatenated with the title evaluates to true. Classify each remaining patent into exactly one of ['Biotechnology', 'Electronics', 'Mechanical', 'Chemical', 'Software', 'Other'] based on its title, and keep only those classified as 'Biotechnology' or 'Electronics'. Return the publication number, originality score (rounded to 6 decimal places), and technology classification of the single highest-scoring patent, breaking ties by publication number alphabetically.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: PATENTS_GOOGLE
Task: Among patents filed in 2016 with CPC codes containing 'G11C' (memory technology), find the top 5 that are most semantically similar to patent 'US-9741766-B2' based on comparing their abstract text to the abstract of 'US-9741766-B2'. Return only the publication numbers, excluding 'US-9741766-B2' itself.
Required AI functions: AI_SIMILARITY
Database: PATENTS_GOOGLE
Task: What common technological theme is shared by the top 5 patents filed in 2016 (the same year as US-9741766-B2) that are most similar to it based on embedding similarity? Aggregate their information formatted as 'Rank [n]: [publication_number] - [first 400 characters of abstract]' using the instruction: 'List the 5 publication numbers in rank order (Rank 1 first through Rank 5), then describe their shared technological theme in 20 words or less. Format exactly as: Patents: [rank1]; [rank2]; [rank3]; [rank4]; [rank5] | Theme: [description]'
Required AI functions: AI_AGG
Database: GITHUB_REPOS_DATE
Task: For pull request creation events on January 18, 2023, in GitHub repositories that include JavaScript as one of their programming languages, filter to only those PRs where the condition 'The following pull request title describes a code-related change (not just documentation, formatting, or trivial edits): ' concatenated with the PR title evaluates to true. Then classify each remaining PR into exactly one of ['Feature', 'Bug Fix', 'Dependency Update', 'Refactoring', 'Other'] based on its title. How many PRs fall into each category?
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: GITHUB_REPOS_DATE
Task: What is the sentiment distribution of pull request titles created on January 18, 2023 in GitHub repositories that include JavaScript as one of their programming languages? For each overall sentiment category ('positive', 'negative', 'neutral', 'mixed', or 'unknown'), show the count of pull requests and a summary of the main types of changes being made, aggregated using the instruction: 'Categorize these PR titles into the following change types and list which types are present: Dependency Updates (titles starting with Bump or containing dependency/version updates), Bug Fixes (titles starting with fix or containing bug/issue fixes), New Features (titles starting with feat or Add), Code Maintenance (titles starting with chore or refactor). List only the categories that have at least one matching PR title, in the order listed above. Format as: Category1; Category2; Category3'. Use case-sensitive matching when joining repository names between the events and languages tables.
Required AI functions: AI_AGG, AI_SENTIMENT
Database: IOWA_LIQUOR_SALES
Task: In the Iowa Liquor Sales dataset, from January 1, 2022 through August 31, 2024, find the pair of liquor categories with the lowest Pearson correlation coefficient in their monthly percentages of total sales volume. Each category must contribute an average of at least 1% to monthly sales volume and have data for at least 24 months. Additionally, classify each eligible category into exactly one of ['Premium Spirits', 'Flavored Liquors', 'Traditional Whiskeys', 'Everyday Mixers', 'Specialty Products'] based on the category name, and only consider pairs where the two categories are classified into DIFFERENT market segments AND have semantic similarity below 0.4 when comparing their category names. Return the two category names. If there is a tie in correlation, order alphabetically by the first category name, then by the second category name.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: USFS_FIA
Task: For the years 2015, 2016, and 2017, using forest inventory data where evaluation_type is 'EXPCURR' and condition_status_code equals 1, identify which states had the largest average subplot size and largest average macroplot size for each year. Only include states where the condition 'This US state is known for significant forest coverage and natural wilderness areas: ' concatenated with the state name evaluates to true. For each winning state, classify it into one of ['Pacific West', 'Rocky Mountain', 'Great Plains', 'Southern', 'Northeastern', 'Alaska-Pacific Islands'] based on the state name. Return the plot type (labeled as 'SUBPLOT' or 'MACROPLOT'), year, state name, forest region classification, and the corresponding average size, ordered by plot type then year.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: PATENTS
Task: For German patents granted in December 2016, identify the CPC technology areas (at level 4, defined as the first 4 characters of the CPC code) that had the highest exponential moving average (EMA) of patent filings per year using a smoothing factor of 0.1. For each CPC group, calculate EMA across all German patent filings in that CPC group (not just December 2016 grants), where the first year's EMA equals its patent count and subsequent years use EMA = 0.1 × current_count + 0.9 × previous_EMA, with EMA values rounded to 2 decimal places at each step.

Rank these CPC technology areas by their semantic relevance to 'advanced manufacturing, industrial automation, and precision engineering' based on the full title, and return the top 5 most relevant. If there are ties in relevance, break ties by CPC group code alphabetically. For each result, show the CPC group code, full title, the year with the highest EMA value (if multiple years tie for the highest EMA, select the most recent year), and classify the technology area into exactly one of ['Transportation & Vehicles', 'Electronics & Communication', 'Manufacturing & Materials', 'Energy & Industrial', 'Other'] based on the full title.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY