mochirank / offline /_save_artifacts.py
DawnOfJustize's picture
Initial HF Spaces deployment (orphan — no history)
7a9cfa1
Raw
History Blame Contribute Delete
31.4 kB
"""Temporary script: save agent-generated artifacts to disk."""
import json
import pathlib
import docx
# ------------------------------------------------------------------ #
# 1. Hypothetical resumes (generated by agent)
# ------------------------------------------------------------------ #
RESUMES = [
{
"id": "ideal_1", "archetype": "IR veteran", "is_positive": True,
"headline": "Senior Search Engineer | Information Retrieval & Learning-to-Rank | 8 Years",
"summary": "Eight years working on search and ranking at product companies. Owned catalog search stack end-to-end at Meesho and Sharechat — query understanding, candidate retrieval, LambdaMART reranker. Migrated retrieval to dense embeddings using BGE-M3 with hybrid BM25+ANN on Elasticsearch and Qdrant. NDCG@10 is a first-class metric in everything I ship.",
"roles": [
{"title": "Senior Search Engineer", "company_type": "E-commerce product company (Series C)", "duration_months": 36,
"description": "Led ranking team for Meesho's catalog search (50M MAU). Migrated TF-IDF to hybrid BGE-M3+Elasticsearch ANN, +14pt NDCG@10 offline, +8% GMV in A/B. Built LambdaMART reranker on XGBoost with 200+ click/purchase signals. Owned evaluation harness and weekly regression dashboards."},
{"title": "Search Engineer", "company_type": "Social media product company (Series D)", "duration_months": 30,
"description": "Built content discovery ranking for Sharechat's video feed (10M DAU). Designed two-tower retrieval model in TensorFlow Serving, A/B tested six reranking strategies. Introduced BM25F in Solr. Led quarterly evaluation reviews with MAP and recall@k."},
],
"skills": [
{"name": "Information Retrieval", "years_experience": 8},
{"name": "Elasticsearch", "years_experience": 7},
{"name": "XGBoost LambdaMART", "years_experience": 4},
{"name": "Python", "years_experience": 8},
{"name": "BGE / Sentence Transformers", "years_experience": 2},
{"name": "NDCG / MRR evaluation", "years_experience": 6},
{"name": "A/B testing for ranking", "years_experience": 5},
],
},
{
"id": "ideal_2", "archetype": "Startup ML shipper", "is_positive": True,
"headline": "ML Engineer | RAG Systems & Recommendation Engines | Shipped to 1M+ Users Across 3 Startups",
"summary": "Six years of ML at startups with no platform team — own everything from training to production endpoint. Shipped job recommendation engine, semantic legal search, and enterprise RAG pipeline. All served real users under latency SLAs with proper eval loops and rollback plans.",
"roles": [
{"title": "Senior ML Engineer", "company_type": "Enterprise SaaS startup (Seed→Series A)", "duration_months": 22,
"description": "Built RAG retrieval pipeline for Docubase. Deployed Qdrant, fine-tuned E5-large with contrastive learning, built hybrid BM25+dense RRF. Eval framework: LLM-as-judge + 300 human-annotated pairs. Reduced MRR miss-rate 23% vs baseline OpenAI embeddings."},
{"title": "ML Engineer", "company_type": "Legal-tech startup (Series A)", "duration_months": 26,
"description": "Indexed 4M legal clauses in Weaviate, built query encoder with sentence-transformers then fine-tuned BGE, shipped cross-encoder reranker. Human relevance judgment pipeline: 1,000 query-clause pairs per quarter. Interleaved online tests before every reranking promotion."},
],
"skills": [
{"name": "RAG system design", "years_experience": 3},
{"name": "Sentence Transformers / BGE / E5", "years_experience": 4},
{"name": "Qdrant", "years_experience": 2},
{"name": "Weaviate", "years_experience": 2},
{"name": "FAISS", "years_experience": 4},
{"name": "NDCG / MAP / MRR", "years_experience": 4},
{"name": "Contrastive fine-tuning", "years_experience": 2},
],
},
{
"id": "ideal_3", "archetype": "Platform engineer", "is_positive": True,
"headline": "Search Infrastructure Engineer | Vector Databases, Hybrid Search at Scale | 7 Years",
"summary": "Career focused on the infrastructure layer that makes retrieval models useful in production. Built vector search clusters handling hundreds of millions of documents and tens of thousands of QPS. Strong opinions on HNSW vs IVF, sharding vs replication, and zero-downtime re-indexing.",
"roles": [
{"title": "Staff Search Infrastructure Engineer", "company_type": "Fintech product company (Series D)", "duration_months": 32,
"description": "Led search infra for Kredivo (300M docs). Migrated Solr to Elasticsearch 8.x ANN, built hybrid BM25+HNSW retrieval, architected Qdrant cluster with zero-downtime re-indexing. Reduced P99 query latency from 420ms to 85ms. Owned on-call."},
{"title": "Senior Platform Engineer — Search", "company_type": "EdTech product company (Series C)", "duration_months": 28,
"description": "Owned Elasticsearch cluster (12 nodes, 50M docs) for Unacademy course discovery. Designed FAISS-based ANN search, built Kafka pipeline keeping dense embeddings in sync, set up Prometheus/Grafana recall@k production monitoring."},
],
"skills": [
{"name": "Elasticsearch", "years_experience": 7},
{"name": "Qdrant", "years_experience": 3},
{"name": "FAISS", "years_experience": 4},
{"name": "Hybrid search (BM25 + dense)", "years_experience": 4},
{"name": "Python", "years_experience": 7},
{"name": "Kafka", "years_experience": 4},
{"name": "Vector database operations", "years_experience": 3},
],
},
{
"id": "ideal_4", "archetype": "Applied researcher", "is_positive": True,
"headline": "Applied ML Researcher → Engineer | Ranking Eval Frameworks, Embedding Fine-Tuning | MSc NLP",
"summary": "MSc Computational Linguistics from IIT Bombay, then five years moving toward full production ownership. Genuinely good at evaluation design — what offline metrics predict online gains, how to build annotation pipelines that don't drift. Last two roles: fine-tuned BGE/E5 with LoRA on domain data and ran A/B experiments confirming real gains.",
"roles": [
{"title": "Applied Research Engineer", "company_type": "HR-tech product company (Series B)", "duration_months": 28,
"description": "Owned candidate-job matching eval and improvement cycle. Designed offline harness: 2,000 annotated pairs, stratified by role family. Fine-tuned BGE-M3 with LoRA, +9pt NDCG@10. Ran six A/B experiments over 18 months, three shipped to production."},
{"title": "ML Engineer — Search Relevance", "company_type": "B2C marketplace (Series C)", "duration_months": 24,
"description": "Built relevance judgment pipeline (crowdsource + expert hybrid), trained first LTR model (XGBoost MART) on click logs, introduced NDCG@5 and MAP as primary offline metrics. Shipped cross-encoder reranker improving P@5 by 11 points."},
],
"skills": [
{"name": "Ranking evaluation (NDCG/MAP/MRR)", "years_experience": 5},
{"name": "Embedding fine-tuning (LoRA / contrastive)", "years_experience": 3},
{"name": "BGE / E5 / Sentence Transformers", "years_experience": 4},
{"name": "A/B testing design & analysis", "years_experience": 4},
{"name": "XGBoost LambdaMART", "years_experience": 3},
{"name": "Python", "years_experience": 5},
{"name": "Pinecone", "years_experience": 2},
],
},
{
"id": "ideal_5", "archetype": "Product-ML hybrid", "is_positive": True,
"headline": "Product Engineer (ex-PM) | Retrieval & Ranking Systems | 6 Years Building Things Users Use",
"summary": "Started as PM at a Series A HR-tech company, switched to engineering when I realized I couldn't evaluate technical trade-offs. PM background means I've translated NPS complaints about broken search into ranking signals. Owned full retrieval stack at two companies — embedding models, vector stores, reranking, A/B tests. Write production Python.",
"roles": [
{"title": "Senior ML Engineer — Search & Matching", "company_type": "HR-tech product company (Series B)", "duration_months": 30,
"description": "Migrated candidate-to-job retrieval from keyword Elasticsearch to E5-base+BM25 hybrid, reducing zero-result searches 34%. Built cross-encoder reranker. Eval harness: NDCG@10, 800 labeled pairs. Three sequential A/B tests over 12 months."},
{"title": "ML Engineer", "company_type": "EdTech startup (Series A)", "duration_months": 24,
"description": "Built course search from scratch: Weaviate vector store, sentence-transformers pipeline for 200K monthly users. Shipped relevance feedback loop using dwell time + completion rate signals, +8pt NDCG@5 over three months."},
],
"skills": [
{"name": "Python", "years_experience": 5},
{"name": "Retrieval system design", "years_experience": 4},
{"name": "Weaviate", "years_experience": 2},
{"name": "Elasticsearch", "years_experience": 4},
{"name": "E5 / Sentence Transformers", "years_experience": 3},
{"name": "A/B testing", "years_experience": 3},
{"name": "NDCG / MRR", "years_experience": 3},
],
},
{
"id": "anti_1", "archetype": "Keyword stuffer", "is_positive": False,
"headline": "Digital Marketing Manager | AI-Driven Growth | SEO, Content Strategy, LLM, RAG, Vector Search",
"summary": "Results-oriented marketing professional with 7 years driving digital growth for B2B SaaS. Recently upskilling in AI tools: LangChain for marketing automation, ChatGPT for content, AI-powered SEO tools. Familiar with RAG, embeddings, and vector databases from online courses and personal projects.",
"roles": [
{"title": "Senior Digital Marketing Manager", "company_type": "B2B SaaS company (Series B)", "duration_months": 30,
"description": "Led digital marketing across SEO, paid search, and content. Managed $400K annual paid media budget. Used ChatGPT to accelerate drafts. Added 'AI tools' to every team retrospective. Listed vector search and embeddings on LinkedIn after watching YouTube tutorials."},
{"title": "Marketing Manager", "company_type": "D2C e-commerce brand", "duration_months": 28,
"description": "Owned influencer partnerships and performance marketing. Listed 'machine learning' and 'NLP' on resume after reading a McKinsey report about AI in retail. No technical projects or code written."},
],
"skills": [
{"name": "Digital Marketing", "years_experience": 7},
{"name": "SEO", "years_experience": 6},
{"name": "LangChain", "years_experience": 1},
{"name": "Embeddings", "years_experience": 1},
{"name": "Vector Search", "years_experience": 1},
{"name": "RAG", "years_experience": 1},
{"name": "Machine Learning", "years_experience": 1},
],
},
{
"id": "anti_2", "archetype": "Pure researcher", "is_positive": False,
"headline": "Research Scientist | Neural IR, Dense Retrieval, Representation Learning | PhD + 2yr Postdoc",
"summary": "PhD from IISc in Information Retrieval, thesis on dense passage retrieval and bi-encoder architectures. Two-year postdoc at TIFR on multilingual retrieval. Published at SIGIR, ECIR, ACL. Deep theoretical grounding in retrieval models, but hands-on experience limited to research computing with curated benchmarks — no production serving infrastructure experience.",
"roles": [
{"title": "Postdoctoral Research Fellow", "company_type": "Academic research institute (TIFR)", "duration_months": 24,
"description": "Research on cross-lingual dense retrieval. Published three papers (SIGIR 2024, ACL 2025, ECIR 2025). All experiments on HPC with BEIR and MIRACL benchmarks. Zero deployment work: no users, no latency constraints, no production infra."},
{"title": "PhD Researcher", "company_type": "Academic institution (IISc)", "duration_months": 54,
"description": "Dissertation on bi-encoder hard negative mining in PyTorch on MS MARCO, NQ, TriviaQA. No production code, no real users. Five papers, best paper honorable mention ECIR 2023."},
],
"skills": [
{"name": "Dense retrieval (DPR, ColBERT)", "years_experience": 5},
{"name": "PyTorch", "years_experience": 5},
{"name": "BEIR benchmark evaluation", "years_experience": 4},
{"name": "Contrastive learning", "years_experience": 4},
{"name": "Python", "years_experience": 6},
{"name": "Hugging Face Transformers", "years_experience": 4},
],
},
{
"id": "anti_3", "archetype": "Consulting lifer", "is_positive": False,
"headline": "Technology Consultant | AI & Analytics Practice | Infosys BPM | 9 Years",
"summary": "Nine-year career at Infosys and TCS spanning analytics and AI practices. Led delivery teams on AI transformation engagements for BFSI and manufacturing clients. Advises on AI adoption roadmaps and oversees offshore ML model development. Hands-on building done by delivery team rather than personally in recent years.",
"roles": [
{"title": "Senior Technology Consultant — AI Practice", "company_type": "IT services (Infosys BPM)", "duration_months": 42,
"description": "Led 12-person delivery team on AI transformation for BFSI client. Oversaw OpenAI API-based document summarization tool built by juniors. Wrote solution architecture for semantic search POC handed to offshore team. No direct model training, no evaluation framework design, no production code written."},
{"title": "Technology Consultant", "company_type": "IT services (TCS)", "duration_months": 36,
"description": "Analytics practice: data warehousing and reporting. Managed a project to implement product recommendation — actually a rules-based engine. No ML model development, no retrieval systems."},
],
"skills": [
{"name": "Technology consulting", "years_experience": 9},
{"name": "SQL", "years_experience": 9},
{"name": "Python (review-level)", "years_experience": 3},
{"name": "Project management", "years_experience": 7},
{"name": "AI strategy (advisory)", "years_experience": 3},
],
},
{
"id": "anti_4", "archetype": "Framework enthusiast", "is_positive": False,
"headline": "AI Engineer | LangChain, OpenAI API, RAG Pipelines | Building LLM-Powered Applications",
"summary": "Pivoted to AI in early 2024 after discovering LangChain and the OpenAI API. Background is frontend development. Built a dozen RAG apps and chatbots. Deeply familiar with LangChain ecosystem and prompt engineering. No traditional ML background — strength is rapid prototyping using foundation models and off-the-shelf tooling.",
"roles": [
{"title": "AI Engineer (Freelance / Contract)", "company_type": "Self-employed / various clients", "duration_months": 14,
"description": "Built LLM applications: customer support chatbot (LangChain+GPT-4+Pinecone), document Q&A (LlamaIndex), AI recruiter bot calling OpenAI API. No custom model training, no evaluation frameworks. All projects are OpenAI API wrappers with text-embedding-3-small. Longest engagement: 3 months."},
{"title": "Frontend Developer", "company_type": "Digital agency", "duration_months": 24,
"description": "React and TypeScript developer. No ML or data science work. Switched to AI after ChatGPT wave. No prior ML, statistics, or information retrieval background before the LLM era."},
],
"skills": [
{"name": "LangChain", "years_experience": 1},
{"name": "OpenAI API", "years_experience": 1},
{"name": "LlamaIndex", "years_experience": 1},
{"name": "Prompt engineering", "years_experience": 1},
{"name": "Python", "years_experience": 2},
{"name": "React / TypeScript", "years_experience": 4},
],
},
{
"id": "anti_5", "archetype": "Title chaser", "is_positive": False,
"headline": "Staff ML Engineer | Ex-Swiggy, Ex-Razorpay, Ex-CRED, Ex-Groww | Search & Recommendations",
"summary": "Six years across five companies progressing from ML Engineer to Staff at each hop. Broad exposure across search and recommendation systems. Career progression fast by identifying quick-impact work and moving on when the growth ceiling appears. Looking for founding-team role where the first six months is peak impact.",
"roles": [
{"title": "Staff ML Engineer", "company_type": "Fintech product company (Groww)", "duration_months": 10,
"description": "Joined to lead fund recommendation revamp. Wrote design doc for two-tower retrieval model, got first prototype running. Left before system shipped to production for a more senior opportunity elsewhere. Work exists as design doc and notebook only — no production deployment."},
{"title": "Senior ML Engineer", "company_type": "Fintech product company (CRED)", "duration_months": 14,
"description": "Contributed to offer personalization retrieval pipeline: added one embedding feature, tuned XGBoost weights. Moved to Groww after 14 months for Staff title and 40% raise. Five engineers on same stack; did not own system end-to-end."},
{"title": "ML Engineer", "company_type": "Fintech (Razorpay)", "duration_months": 13,
"description": "Set up Elasticsearch cluster, added semantic search using sentence-transformers for developer docs. Left after 13 months. Project was reaching production when I departed — successor inherited half-complete migration."},
],
"skills": [
{"name": "Python", "years_experience": 6},
{"name": "Sentence Transformers", "years_experience": 3},
{"name": "Elasticsearch", "years_experience": 4},
{"name": "XGBoost", "years_experience": 3},
{"name": "Recommendation systems", "years_experience": 5},
{"name": "FAISS", "years_experience": 2},
],
},
]
# ------------------------------------------------------------------ #
# 2. Teacher labels (generated by 5 parallel agents)
# ------------------------------------------------------------------ #
LABELS_RAW = [
# Batch 0
{"candidate_id": "CAND_0000001", "score": 0.0, "rationale": "Worked at Dunder Mifflin (honeypot company), which is an automatic disqualifier regardless of skills."},
{"candidate_id": "CAND_0000002", "score": 0.0, "rationale": "Entire career at Infosys and Wipro (explicit disqualifier), with a non-technical operations/project management background and no real ML production experience."},
{"candidate_id": "CAND_0000003", "score": 0.4, "rationale": "Entire career at TCS (explicit disqualifier for whole-career consultancy), despite having relevant RAG/Pinecone/hybrid retrieval skills that would otherwise score higher."},
{"candidate_id": "CAND_0000004", "score": 0.2, "rationale": "Entire career at Accenture and Capgemini (explicit disqualifier), and core work is tabular/classification analytics rather than retrieval or ranking systems despite skills listing embeddings/retrieval."},
{"candidate_id": "CAND_0000005", "score": 1.0, "rationale": "Expert sentence-transformers and FAISS with production deployment at Meesho (dense retrieval, BM25 hybrid, P@10 optimization), LLM fine-tuning, 9+ years at product companies, matching every must-have requirement."},
{"candidate_id": "CAND_0000006", "score": 0.2, "rationale": "Pure research career at Microsoft Research India and IISc with explicitly no production deployments, directly triggering the pure research career disqualifier."},
{"candidate_id": "CAND_0000007", "score": 0.6, "rationale": "Hands-on production experience with embeddings, FAISS, and RAG at two AI startups, but only 3.2 years and lacks evidence of large-scale retrieval or evaluation frameworks like NDCG/MRR."},
{"candidate_id": "CAND_0000008", "score": 0.2, "rationale": "Entire career at Cognizant (explicit disqualifier), and current role is solution architecture/consulting with minimal hands-on coding rather than production ML engineering."},
{"candidate_id": "CAND_0000009", "score": 1.0, "rationale": "Expert FAISS and Elasticsearch with production dense+hybrid retrieval at Swiggy and 50k QPS embedding serving at InMobi, strong sentence-transformers and ranking systems experience at product companies across 6.8 years."},
{"candidate_id": "CAND_0000010", "score": 0.2, "rationale": "Primarily a data engineering profile (ETL, Spark, Airflow) with only 7 months of side-project vector DB/RAG exposure, insufficient depth in core retrieval and ranking requirements."},
# Batch 1
{"candidate_id": "CAND_0000011", "score": 0.0, "rationale": "Worked at Pied Piper (fictional company), automatic disqualifier scoring 0.0."},
{"candidate_id": "CAND_0000012", "score": 0.0, "rationale": "Worked at Stark Industries (fictional company), automatic disqualifier scoring 0.0."},
{"candidate_id": "CAND_0000013", "score": 0.0, "rationale": "Worked at Globex Inc (fictional company), automatic disqualifier scoring 0.0."},
{"candidate_id": "CAND_0000014", "score": 0.0, "rationale": "Worked at Dunder Mifflin (fictional company), automatic disqualifier scoring 0.0."},
{"candidate_id": "CAND_0000015", "score": 0.2, "rationale": "Has Qdrant (9 months) and PyTorch exposure, but 5.4 years are mostly cloud/DevOps/mobile with no production embeddings or retrieval engineering depth."},
{"candidate_id": "CAND_0000016", "score": 0.2, "rationale": "Entire substantive career at TCS and Infosys (disqualifying firms), with skills limited to SQL, Figma, Photoshop, and accounting — no embeddings, vector DB, or Python ML experience."},
{"candidate_id": "CAND_0000017", "score": 0.2, "rationale": "Career split across Wipro, Infosys (disqualifying firms), and Initech (fictional), with accounting/customer-support background and no embeddings, retrieval, or ML engineering skills."},
{"candidate_id": "CAND_0000018", "score": 0.0, "rationale": "Worked at Pied Piper and Initech (fictional companies), automatic disqualifiers scoring 0.0."},
{"candidate_id": "CAND_0000019", "score": 0.0, "rationale": "Entire career at Wayne Enterprises and Pied Piper (fictional companies), automatic disqualifiers scoring 0.0."},
{"candidate_id": "CAND_0000020", "score": 0.0, "rationale": "Worked at Dunder Mifflin (fictional company), automatic disqualifier scoring 0.0."},
# Batch 2
{"candidate_id": "CAND_0000021", "score": 0.0, "rationale": "Worked at Dunder Mifflin and Stark Industries (fictional), with entire career at Wipro/Infosys disqualifiers and zero AI engineering skills."},
{"candidate_id": "CAND_0000022", "score": 0.2, "rationale": "Only 1.1 years experience as a Mechanical Engineer with no AI/ML skills and no production embeddings, vector DB, or retrieval experience."},
{"candidate_id": "CAND_0000023", "score": 0.2, "rationale": "Backend software engineer with 3.7 years whose AI exposure is limited to a small RAG side project; no production embeddings, vector DB, or evaluation framework experience."},
{"candidate_id": "CAND_0000024", "score": 0.0, "rationale": "Entire career at TCS and Infosys (disqualifying firms) in HR Manager and Accountant roles with no AI engineering skills."},
{"candidate_id": "CAND_0000025", "score": 0.2, "rationale": "Frontend engineer with entire career at IT services firms (Tech Mahindra, Mindtree) and only LangChain wrapper experience — no pre-LLM ML, embeddings, or vector DB work."},
{"candidate_id": "CAND_0000026", "score": 0.0, "rationale": "Worked at Initech (fictional company disqualifier) as a Graphic Designer/Accountant with no AI engineering skills."},
{"candidate_id": "CAND_0000027", "score": 0.2, "rationale": "Entire career at Infosys and Wipro (disqualifying firms) despite advanced ML skills (PEFT, W&B, YOLO) and IIT Bombay PhD; the disqualifier overrides the strong ML signals."},
{"candidate_id": "CAND_0000028", "score": 0.0, "rationale": "Operations Manager with 1.1 years at Wipro (disqualifier) and no AI engineering skills; entirely non-technical."},
{"candidate_id": "CAND_0000029", "score": 0.0, "rationale": "Worked at Globex Inc (fictional disqualifier) with career at Wipro/TCS (disqualifying firms) in non-technical roles (Business Analyst, Civil Engineer)."},
{"candidate_id": "CAND_0000030", "score": 0.0, "rationale": "Worked at Dunder Mifflin (fictional disqualifier) as a Marketing Manager with no AI engineering skills."},
# Batch 3
{"candidate_id": "CAND_0000031", "score": 0.8, "rationale": "Expert-level embeddings (60 months), led migration to embedding-based retrieval at Swiggy, strong production ML with XGBoost/LightGBM ranking across reputable product companies (Uber, Swiggy, Zomato), though no explicit vector DB or NDCG evaluation framework mentioned."},
{"candidate_id": "CAND_0000032", "score": 0.0, "rationale": "Worked at Globex Inc (fictional disqualifier); career is primarily .NET/cloud/QA backend engineering with no production ML or retrieval systems experience."},
{"candidate_id": "CAND_0000033", "score": 0.0, "rationale": "Worked at Dunder Mifflin (fictional disqualifier); profile is a Graphic Designer/Marketing Manager with no AI engineering, embeddings, or retrieval skills."},
{"candidate_id": "CAND_0000034", "score": 0.2, "rationale": "Entire career at Wipro, Infosys, TCS (disqualifiers) as a Business Analyst with no production ML or retrieval engineering experience."},
{"candidate_id": "CAND_0000035", "score": 0.2, "rationale": "Worked at Globex Inc (fictional disqualifier) and Wipro; profile is Full Stack Developer with only side-project RAG experience and no production embeddings or vector DB work."},
{"candidate_id": "CAND_0000036", "score": 0.0, "rationale": "Worked at both Initech and Dunder Mifflin (two fictional disqualifiers); profile is Project Manager/HR with no AI engineering or retrieval skills."},
{"candidate_id": "CAND_0000037", "score": 0.0, "rationale": "Worked at Stark Industries (fictional disqualifier); profile is Business Analyst/Civil Engineer with no production ML, embeddings, or retrieval experience."},
{"candidate_id": "CAND_0000038", "score": 0.4, "rationale": "Advanced Weaviate skill (27 months, 37 endorsements) is directly relevant, but career is primarily Java/frontend/DevOps with no demonstrated production embeddings or evaluation framework, and worked at Globex Inc (fictional)."},
{"candidate_id": "CAND_0000039", "score": 0.0, "rationale": "Worked at Stark Industries (fictional disqualifier); profile is Marketing Manager/Mechanical Engineer with no AI engineering or retrieval experience."},
{"candidate_id": "CAND_0000040", "score": 0.0, "rationale": "Only 1.6 years in Customer Support at Globex Inc (fictional disqualifier) with no AI engineering skills."},
# Batch 4
{"candidate_id": "CAND_0000041", "score": 0.0, "rationale": "Worked at Wayne Enterprises (fictional disqualifier); background is operations/marketing management with no AI/ML engineering skills."},
{"candidate_id": "CAND_0000042", "score": 0.0, "rationale": "Worked at Wayne Enterprises (fictional disqualifier); career spans HR, business analysis, and marketing with no AI/ML or search engineering skills."},
{"candidate_id": "CAND_0000043", "score": 0.2, "rationale": "Has advanced Elasticsearch and OpenSearch skills relevant to hybrid search, but worked at Initech (fictional disqualifier) and career is primarily cloud/DevOps/mobile with no production embeddings or vector DB experience."},
{"candidate_id": "CAND_0000044", "score": 0.2, "rationale": "Entire career at Tech Mahindra (IT services disqualifier) with frontend/DevOps focus; only minor AI exposure via a small RAG side project."},
{"candidate_id": "CAND_0000045", "score": 0.0, "rationale": "Worked at both Initech and Pied Piper (fictional disqualifiers); career entirely in project management, sales, and marketing with zero AI/ML engineering skills."},
{"candidate_id": "CAND_0000046", "score": 0.0, "rationale": "Worked at Pied Piper (fictional disqualifier); career spans mechanical engineering, HR, and marketing operations with no AI/ML relevance."},
{"candidate_id": "CAND_0000047", "score": 0.2, "rationale": "Entire career at TCS (disqualifying firm) in project management/operations; only adjacent skills are SQL and Hadoop with no embeddings or vector DB experience."},
{"candidate_id": "CAND_0000048", "score": 0.0, "rationale": "Worked at both Stark Industries and Initech (fictional disqualifiers), disqualifying the candidate regardless of mobile development background."},
{"candidate_id": "CAND_0000049", "score": 0.0, "rationale": "Entire career at Wayne Enterprises (fictional disqualifier) in mechanical engineering and sales roles with no AI/ML skills."},
{"candidate_id": "CAND_0000050", "score": 0.2, "rationale": "Majority career at Infosys and TCS (disqualifying IT services firms) in non-technical marketing/HR/BA roles; advanced feature engineering skill noted but career profile is fundamentally misaligned."},
]
if __name__ == "__main__":
import csv
# Save hypothetical_resumes.json
pathlib.Path("artifacts").mkdir(exist_ok=True)
doc = docx.Document("dataset/job_description.docx")
jd_text = "\n".join(p.text for p in doc.paragraphs if p.text.strip())
data = {"resumes": RESUMES, "jd_text": jd_text}
with open("artifacts/hypothetical_resumes.json", "w", encoding="utf-8") as f:
json.dump(data, f, ensure_ascii=False, indent=2)
n_pos = sum(r["is_positive"] for r in RESUMES)
print(f"Saved artifacts/hypothetical_resumes.json ({n_pos} ideal, {len(RESUMES)-n_pos} anti)")
# Save teacher_labels_sample.csv
pathlib.Path("data").mkdir(exist_ok=True)
for row in LABELS_RAW:
row.setdefault("stratum", "sample")
with open("data/teacher_labels_sample.csv", "w", newline="", encoding="utf-8") as f:
writer = csv.DictWriter(f, fieldnames=["candidate_id", "score", "rationale", "stratum"])
writer.writeheader()
writer.writerows(LABELS_RAW)
print(f"Saved data/teacher_labels_sample.csv ({len(LABELS_RAW)} labels)")
# Quick stats
import collections
score_dist = collections.Counter(r["score"] for r in LABELS_RAW)
print("Score distribution:", dict(sorted(score_dist.items())))
high = [r for r in LABELS_RAW if r["score"] >= 0.8]
print(f"High-quality candidates (≥0.8): {[r['candidate_id'] for r in high]}")