Datasets:
Download quickstart_codegen_vector_search.py from beatsprom/ai-code-generation-swe-agents-2026: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/datasets/beatsprom/ai-code-generation-swe-agents-2026/resolve/main/quickstart_codegen_vector_search.py
- Command line
-
hf download hf://datasets/beatsprom/ai-code-generation-swe-agents-2026/quickstart_codegen_vector_search.py
-
curl -L -o quickstart_codegen_vector_search.py https://huggingface.co/datasets/beatsprom/ai-code-generation-swe-agents-2026/resolve/main/quickstart_codegen_vector_search.py
1.27 kB
| # Quickstart: Semantic Search on AI Code Generation & SWE Agents Dataset (Universal V17.0 Platinum) | |
| import pyarrow.parquet as pq | |
| import numpy as np | |
| # 1. Load Parquet Dataset | |
| table = pq.read_table("AI_CODE_GENERATION_SWE_AGENTS_PROGRAM_SYNTHESIS_2026_FULL.parquet") | |
| df = table.to_pandas() | |
| print(f"Loaded {len(df)} AI Code Generation & SWE Agent research papers.") | |
| print(f"Top Paper: {df['title'].iloc[0]} (Citations: {df['academic_citations_count'].iloc[0]} | Stars: {df['github_stars'].iloc[0]})") | |
| print(f"Execution Mode: {df['code_agent_execution_mode'].iloc[0]}") | |
| print(f"Backbone: {df['coding_foundation_backbone'].iloc[0]}") | |
| print(f"Cluster: {df['cluster_topic_name'].iloc[0]}") | |
| # 2. Example Semantic Vector Search | |
| query_vector = np.random.randn(384).astype(np.float32) | |
| query_vector /= np.linalg.norm(query_vector) | |
| abstract_vectors = np.vstack(df['abstract_vector_384d'].values) | |
| similarities = np.dot(abstract_vectors, query_vector) | |
| top_5_idx = np.argsort(similarities)[::-1][:5] | |
| print("\n--- TOP 5 AI CODING AGENT VECTOR SEARCH RESULTS ---") | |
| for idx in top_5_idx: | |
| print(f"Score: {similarities[idx]:.4f} | {df['title'].iloc[idx]} (Mode: {df['code_agent_execution_mode'].iloc[idx]} | Cluster: {df['cluster_topic_name'].iloc[idx]})") | |