tianyang/spider2-aifunc huggingface dataset:
Database: PATENTSVIEW
Task: For U.S. patents filed between January 1, 2014 and February 1, 2014 (inclusive) in biotechnology-related CPC classifications (subsection IDs C05-C13 or group IDs in A01G, A01H, A61K, A61P, A61Q, B01F, B01J, B81B, B82B, B82Y, G01N, G16H), retrieve the top 20 patents most semantically similar to 'cancer treatment and drug delivery systems' based on their title and abstract concatenated with a single space (formatted as '{title} {abstract}').

For each patent, provide: the patent title, abstract, publication date, backward citations count (number of distinct US patents cited by the current patent where the citation date is before the patent's filing date), and forward citations count within 5 years (number of distinct US patents that cited the current patent where the citing patent's publication date is between the current patent's publication date and 5 years after, inclusive).

Additionally, classify each patent into exactly one of ['Biotechnology', 'Pharmaceuticals', 'Nanotechnology', 'Medical Devices', 'Chemical Engineering', 'Other'] based on a combined description formatted as 'Title: {title}. Abstract: {abstract}'.

Order results by semantic similarity to 'cancer treatment and drug delivery systems' in descending order, with ties broken by patent ID ascending, limited to the top 20.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: CRYPTO
Task: Among successful transactions (where success is true) from the Zilliqa TRANSACTIONS table before 2022, for each of the top 10 dates by total transaction amount, calculate the semantic similarity of their transaction data to the reference text 'staking rewards withdrawal and delegation'. For the similarity calculation, concatenate all transaction data values for each date using ' | ' as delimiter (ordered by amount descending, then by block_timestamp ascending as tie-breaker), then use the first 5000 characters of this combined text. Among dates with similarity score above 0.3, which calendar date (YYYY-MM-DD format) had the highest total transaction amount? For that date, also provide a summary of the transaction activity using the aggregation instruction: 'List the top 3 transaction operation types observed, formatted as: Op1; Op2; Op3'. Return the date, total amount, and activity summary. When sampling transactions for the activity summary, select the top 300 transactions ordered by amount descending, then by block_timestamp ascending as a tie-breaker.
Required AI functions: AI_AGG, AI_SIMILARITY
Database: CENSUS_BUREAU_USA
Task: Find all zip code areas located within 10 kilometers of the coordinates (-122.3321, 47.6062) by joining the 2010 census population data (summing male and female populations where minimum_age is NULL, indicating no lower age bound) and the zip code area information. For classification: first determine if an area is 'Waterfront' using the rule that water area must exceed 30% of total area (water + land); for non-Waterfront areas, classify into exactly one of ['High-Density Urban', 'Medium-Density Urban', 'Low-Density Suburban'] based on a description formatted as 'City: {city}, County: {county}, Population: {total_population}, Land Area: {area_land_meters} sq meters'. Then filter to only areas classified as 'High-Density Urban' or 'Waterfront', and order results by similarity of a description formatted as 'City: {city}, County: {county}, Population: {total_population}' to 'densely populated downtown urban center with commercial activity' in descending order, with ties broken by zipcode ascending. Return the top 15 results showing each area's zipcode, polygon geometry, land and water area in meters, latitude, longitude, state code, state name, city, county, total population, and the assigned urban classification.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: CENSUS_BUREAU_USA
Task: For zip code areas within 10 kilometers of coordinates (-122.3321, 47.6062), group by county and state code to report: county name, state name (taking the maximum value when inconsistent), state code, number of zip codes, total population (summing male and female populations from 2010 census data where gender is not null and minimum_age is null), total land area in meters, total water area in meters, and a characterization of the area aggregated using the instruction 'Classify this area as exactly one of [Urban Core, Urban, Suburban, Rural] based on population density and city composition. Also identify the primary city. Format: Area type: [classification]; Primary city: [name]' where each zip code is described as 'Zip {zipcode} in {city}: population {population}, land area {land_area} sq m'.
Required AI functions: AI_AGG
Database: CPTAC_PDC
Task: Using CPTAC proteomics and RNAseq data for Clear Cell Renal Cell Carcinoma, join 'Primary Tumor' and 'Solid Tissue Normal' samples (filtered to Kidney primary site and CPTAC-3 project) on sample submitter IDs and gene symbols through the aliquot mapping table (project 'CPTAC3 Discovery and Confirmatory'). Calculate the correlation between protein abundance (log2 ratio) and gene expression (log base 2 of FPKM + 1) for each gene within each sample type. For genes showing weak protein-RNA correlation (absolute correlation value at most 0.5 and not NULL), aggregate their gene symbols by sample type using the instruction: 'Given this list of human gene symbols, determine which ONE category best describes the majority: METABOLISM (energy, biosynthesis), SIGNALING (receptors, kinases, transduction), or STRUCTURAL (cytoskeleton, adhesion, transport). Reply with exactly one word: METABOLISM, SIGNALING, or STRUCTURAL.'.
Required AI functions: AI_AGG
Database: TCGA_HG19_DATA_V0
Task: Assess whether different functional categories of TP53 genetic variants affect log10-transformed TP53 expression levels in TCGA-BRCA primary tumor samples (sample type '01'). Classify each Variant_Classification into exactly one of ['Loss_of_Function', 'Missense', 'Silent', 'Other'] based on the mutation type description, where 'Loss_of_Function' means 'mutations that eliminate gene function such as nonsense, frameshift, or splice site mutations', 'Missense' means 'single amino acid substitutions', 'Silent' means 'synonymous mutations with no amino acid change', and 'Other' means 'any other mutation type'.

For sample matching, use shortened barcodes (first 15 characters). Include all samples with valid TP53 expression data; samples without any TP53 mutation are labeled 'Wild_Type', and samples with mutations in multiple different functional categories are labeled 'Multiple'. Average expression values when a sample has multiple expression measurements.

Report the total number of samples, the number of mutation types (count of distinct groups in the ANOVA), the mean square between groups, the mean square within groups, the F-statistic, and an AI-generated interpretation. The interpretation should be generated by aggregating a description formatted as 'Total samples: {total_samples}, Groups: {number_of_mutation_types}, F-statistic: {F_statistic rounded to 4 decimals}' using the aggregation instruction: 'Based on the F-statistic value, return exactly one statement: If F-statistic < 2.0, return "Interpretation: F-statistic below 2.0 indicates no significant difference between mutation groups." If F-statistic >= 2.0, return "Interpretation: F-statistic at or above 2.0 suggests potential significant difference between mutation groups."'
Required AI functions: AI_AGG, AI_CLASSIFY
Database: PANCANCER_ATLAS_1
Task: What is the Kruskal-Wallis H-score for IGF2 gene expression among LGG study patients grouped by semantic tumor type category?

For each patient, calculate their IGF2 expression as the average of log10(normalized_count + 1) across all their samples where normalized_count is not null. Filter histological types to only those where the condition 'This histological type represents a specific glioma brain tumor subtype: {histological_type}' evaluates to true. Classify each valid histological type into exactly one of ['Astrocytic Tumor', 'Oligodendroglial Tumor', 'Mixed Glial Tumor', 'Other'] based on the histological type text. Group patients by their classified tumor category, including only categories with more than one patient. Return the total number of tumor categories, the total number of patients included, and the Kruskal-Wallis H-score, ordered by H-score descending.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: PANCANCER_ATLAS_1
Task: Compute the t-score (rounded to 2 decimals) comparing mean expression levels of gene DRG2 between two groups in the LGG study: (1) participants with functionally significant TP53 mutations and (2) participants without any TP53 mutations.

Expression levels are calculated as log10(normalized_count + 1) for primary tumor samples (SampleTypeLetterCode = 'TP').

A TP53 mutation is considered functionally significant if the semantic filter condition 'This mutation type is likely to affect protein function: ' concatenated with the Variant_Classification value evaluates to true.

Only include TP53 mutations where FILTER status is 'PASS'. Exclude any group with fewer than 10 samples or zero variance.
Required AI functions: AI_FILTER
Database: PANCANCER_ATLAS_1
Task: Compute the T-score measuring the statistical difference in DRG2 gene expression between LGG patients with and without loss-of-function TP53 mutations. For each patient, calculate the average of log10(normalized_count + 1) for DRG2 expression across all their samples, including only samples that appear in the MC3_MAF_V5_ONE_PER_TUMOR_SAMPLE table for the LGG study. Identify patients with loss-of-function TP53 mutations by filtering TP53 mutations (Hugo_Symbol = 'TP53' and FILTER = 'PASS') using the semantic condition 'This genetic variant likely causes loss of protein function based on: Variant type: {Variant_Classification}, Protein change: {HGVSp_Short}' where HGVSp_Short defaults to 'N/A' if null. Calculate the T-score as (mean expression of patients without loss-of-function TP53 mutations minus mean expression of patients with loss-of-function TP53 mutations) divided by the square root of (variance of non-LOF group divided by its sample count plus variance of LOF group divided by its sample count).
Required AI functions: AI_FILTER
Database: PANCANCER_ATLAS_1
Task: Among breast cancer (BRCA) patients in the PanCancer Atlas who have tumor samples in the mutation data, which five histological types exhibit the highest percentage of patients with CDH1 gene mutations? Consider only non-silent, coding mutations (excluding Silent, Intron, IGR, 3'UTR, 5'UTR, lincRNA, RNA, 3'Flank, and 5'Flank variant classifications). For each histological type, classify it into one of ['Ductal Carcinoma', 'Lobular Carcinoma', 'Special Type Carcinoma', 'Mixed/Unspecified'] based on the histological type name, and report the histological type, its classified cancer category, and the mutation percentage rounded to 2 decimal places. Order results by mutation percentage descending, with ties broken by semantic similarity to 'invasive lobular carcinoma with CDH1 mutation' (descending), then alphabetically by histological type.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: META_KAGGLE
Task: What are the earliest 5 forum topics from sub-forums under the parent forum titled "General" that are classified as either 'Feature Request' or 'Bug Report' based on their title, using the categories ['Feature Request', 'Bug Report', 'Technical Question', 'General Discussion', 'Other'], and where the condition 'This forum topic title indicates the user is reporting a problem or requesting a new feature: ' concatenated with the topic title evaluates to true?

For each topic, show the creation date as a timestamp, the topic title, the parent forum title ('General'), the reply count (total messages in the topic), distinct user replies count (unique users who posted), total upvotes (on all messages in the topic), and total views. Treat missing values as zero.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: META_KAGGLE
Task: For the earliest five forum topics belonging to any sub-forum under the parent forum titled "General", provide the creation date (as a timestamp), topic title, parent forum title, reply count (total messages in the topic), distinct user replies count (unique users who posted), total upvotes (across all messages in the topic), and total views. Additionally, for each topic, identify the discussion focus using the aggregation instruction 'State the single most dominant topic keyword from the discussion, formatted as: Topic: [keyword]' and analyze the overall sentiment of that topic keyword, returning the sentiment value ('positive', 'negative', 'neutral', 'mixed', or 'unknown'). Treat missing values as zero. Order by creation date ascending, then by discussion sentiment priority (positive first, then neutral, then mixed, then negative, then unknown).
Required AI functions: AI_AGG, AI_SENTIMENT
Database: HTAN_1
Task: For the HTAN WUSTL center in the 5th revision (r5) data, list all imaging assay types that have Level2 data available, along with any higher-level data (Level3, Level4) derived from them through entityId relationships traced via the ID_PROVENANCE_R5 table to the actual IMAGING_LEVEL3_SEGMENTATION_METADATA_R5 and IMAGING_LEVEL4_METADATA_R5 tables. Exclude any records where Component is NULL or contains 'Auxiliary' or 'OtherAssay', and exclude Electron Microscopy assay types. For each assay type, show whether Level2, Level3, and Level4 data are available using 'Yes' or 'No' indicators. Classify each assay type into exactly one of ['Multiplexed Protein Imaging', 'Standard Histology', 'Mass Spectrometry Imaging', 'Other'] based on the assay type name, and order the results by relevance to 'multiplexed protein analysis for tumor microenvironment' (most relevant first), with ties broken alphabetically by assay type name.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: HTAN_2
Task: In the HTAN scRNAseq MSK-SCLC combined samples dataset, among epithelial cells in cluster 41 of 74-year-old human stage patients, identify genes that satisfy the semantic condition evaluated by concatenating 'The gene ' with the gene name followed by ' has known associations with cancer biology, tumor development, or oncogenic pathways: '. For these cancer-associated genes, classify each into exactly one of ['Oncogene', 'Tumor Suppressor', 'Cell Cycle Regulator', 'Metabolic', 'Other'] based on the gene name, keeping only those classified as 'Oncogene', 'Tumor Suppressor', or 'Cell Cycle Regulator'. Calculate the expression difference as female average X_value minus male average X_value (excluding genes where either sex lacks data). What are the top 20 genes with the greatest expression difference (descending, with ties broken alphabetically by gene name), showing gene name, expression difference rounded to 4 decimal places, and functional classification?
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: META_KAGGLE
Task: Find the Kaggle user pair with the strongest 'One-way Admirer' voting relationship in ForumMessageVotes, where one user has given the other the most distinct upvotes. Consider only valid user pairs (excluding user IDs of -1 or NULL, and excluding self-votes) where the giver has given at least 50 distinct upvotes. Classify each relationship into exactly one of ['Mutual Supporters', 'One-way Admirer', 'Balanced Exchange'] based on the description formatted as 'Voting pattern: Giver sent {received_count} distinct upvotes, receiver returned {returned_count} upvotes'. From the pairs classified as 'One-way Admirer', return the top result sorted by highest distinct upvotes received, then by lowest upvotes returned, then by highest semantic similarity between a description formatted as 'Giver sent {received_count} upvotes, received {returned_count} back' and the reference text 'A dedicated one-way supporter who gives many upvotes but receives very few or none in return'. Display the giver's username, receiver's username, the distinct upvotes received, the upvotes returned, and the relationship classification.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: TCGA_MITELMAN
Task: For breast cancer cases (TCGA-BRCA) from Release 23 of the active GDC archive, analyze copy number variations (CNVs) across all cytobands on every chromosome. For each cytoband and case, compute the overlap between the cytoband region and the case's copy number segments, then calculate the overlap-weighted average copy number, rounding to the nearest whole number. Classify the rounded copy number into: homozygous deletions (0), heterozygous deletions (1), normal diploid (2), gains (3), and amplifications (greater than 3). For each cytoband, calculate the frequency of each CNV type as a percentage of total BRCA cases, rounded to two decimal places.

Pre-filter to exclude cytobands where diploid percentage is 80% or higher (these are clearly genomically stable). Then, classify each remaining cytoband's genomic stability profile into exactly one of ['Minor Alterations', 'Significant Deletions', 'Significant Amplifications', 'Highly Unstable'] based on a profile description formatted as 'Homozygous deletion: {hom_del}%, Heterozygous deletion: {het_del}%, Diploid: {diploid}%, Gain: {gain}%, Amplification: {amp}%', where 'Minor Alterations' means 'mostly diploid but with noticeable alterations that are not dominant', 'Significant Deletions' means 'deletions are the dominant alteration type', 'Significant Amplifications' means 'gains and amplifications together are the dominant alteration type', and 'Highly Unstable' means 'diploid cases are a minority with widespread alterations'.

Additionally, rank cytobands by their similarity to a high-risk amplification reference pattern 'Homozygous deletion: 0%, Heterozygous deletion: 0%, Diploid: 20%, Gain: 20%, Amplification: 60%'. For ranking purposes, round the similarity score to 2 decimal places so that cytobands with very close similarity are grouped together and ordered deterministically by the tie-breakers.

Return the top 30 cytobands most similar to the high-risk pattern, showing the cytoband name, chromosome, start position, end position, all five CNV type percentages, and the stability classification. Order by similarity to the high-risk pattern (most similar first, using rounded scores), with ties broken by chromosome name alphabetically then by start position ascending.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY
Database: CMS_DATA
Task: Among the top 30 drugs by prescription count in New York State during 2014, classify each drug's generic name into exactly one of ['Cardiovascular', 'Pain Management', 'Diabetes', 'Respiratory', 'Mental Health', 'Other']. From the drugs classified as 'Cardiovascular', filter to only those where the condition 'This medication is commonly prescribed for blood pressure or heart-related conditions: ' concatenated with the generic name evaluates to true. For the remaining drug with the highest total prescription count in NY (matching by brand name across states), identify the top 5 states nationwide with the highest total claim counts. Include each state's total claim count and total drug cost.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: TCGA_MITELMAN
Task: For TCGA-LAML study cases, identify those with the highest weighted average copy number in the proximal long arm region of chromosome 15. First, select cytobands from chromosome 15 where the condition 'This cytoband represents the proximal long arm region band 11 of chromosome 15 (15q11): {cytoband_name}' evaluates to true. Then calculate each case's weighted average copy number using overlap lengths between segment positions and cytoband boundaries (GREATEST/LEAST). Classify each case's finding into exactly one of ['Gain', 'Loss', 'Neutral'] based on a description formatted as 'Copy number analysis result: log2 ratio = {value rounded to 4 decimals} in chromosomal region'. Return the top 10 case barcodes classified as either 'Gain' or 'Neutral' (excluding 'Loss'), ordered by weighted average copy number descending, with ties broken by case barcode alphabetically ascending. Use COPY_NUMBER_SEGMENT_MASKED_HG38_GDC_R14 for segment data and CYTOBANDS_HG38 for cytoband coordinates.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: CMS_DATA
Task: For the provider with the highest total inpatient Medicare cost from 2011 through 2015 (computed as the sum of average_medicare_payments multiplied by total_discharges), list that provider's yearly average inpatient cost and yearly average outpatient cost for each calendar year in this period, with costs rounded to 2 decimal places. The inpatient cost is calculated as the average of (average_medicare_payments × total_discharges) and the outpatient cost is calculated as the average of (average_total_payments × outpatient_services). Additionally, classify the provider into exactly one of ['Academic Medical Center', 'Community Hospital', 'Regional Health System', 'Specialty Hospital'] based on the provider name. Only include results where the provider classification is 'Academic Medical Center' and where the condition 'This provider name indicates a major hospital or medical center: ' concatenated with the provider name evaluates to true. Order results by year ascending.
Required AI functions: AI_CLASSIFY, AI_FILTER
Database: SAN_FRANCISCO
Task: For each year-month combination (formatted as YYYYMM) derived from San Francisco bike share trips where the start station's landmark is 'San Francisco', calculate the first trip duration in minutes, the last trip duration in minutes, the highest trip duration in minutes, and the lowest trip duration in minutes. The 'first' and 'last' trips are determined by chronological order of start_date, with trip_id ascending as the tie-breaker when start_dates are identical.

Create a trip pattern description for each month formatted as 'Monthly trip pattern: First trip={first} min, Last trip={last} min, Maximum={max} min, Minimum={min} min, Range={max-min} min' where values are rounded to 1 decimal place.

Find the top 10 months with trip patterns most similar to 'high activity variance with extremely long maximum trip durations exceeding several thousand minutes and very short minimum trips around one minute'. Similarity scores should be rounded to 1 decimal place for ranking purposes, and in case of similarity ties after rounding, sort by year_month ascending.

For each of these top 10 months, also classify the month's seasonal activity into exactly one of ['Peak Activity', 'Moderate Activity', 'Low Activity'] based on the same trip pattern description, where 'Peak Activity' means 'maximum trip duration suggests heavy recreational or tourist usage with trips lasting hours', 'Moderate Activity' means 'typical commuter patterns with moderate trip lengths', and 'Low Activity' means 'minimal usage with short trips only'.

Return the year-month, first trip duration, last trip duration, highest trip duration, lowest trip duration (all durations rounded to 1 decimal place), and seasonal activity classification, sorted by rounded similarity score (most similar first), with year_month ascending as tie-breaker.
Required AI functions: AI_CLASSIFY, AI_SIMILARITY