Redrob-hackathon / lib /jd_requirements.py
Mohit0708's picture
Initial commit
7b833a7
Raw
History Blame Contribute Delete
7.28 kB
"""
lib/jd_requirements.py
Hand-decomposed JD requirements. Every category is traceable to a specific
paragraph in job_description.docx. A generic keyword-IDF extractor would
never recover "title-chaser" or "5+ years closed-source with no external
validation" as a signal; hand-encoding is the only way.
Matching runs over lib.schema.unified_text_blob() (in-context career text,
NOT the raw skills[] list) so a phrase only counts when the candidate
describes actual work they did with it.
"""
# --- "Things you absolutely need" (JD: "The skills inventory") ---
MUST_HAVE = {
"embeddings_retrieval": [
"embedding", "sentence-transformers", "sentence transformers",
"openai embedding", "bge", "e5 embedding", "dense retrieval",
"semantic search", "retrieval-augmented", "rag pipeline", "rag system",
],
"vector_db_hybrid_search": [
"pinecone", "weaviate", "qdrant", "milvus", "opensearch",
"elasticsearch", "faiss", "vector database", "vector db",
"hybrid search", "hybrid retrieval", "bm25",
],
"python_production": [
"python",
],
"eval_frameworks": [
"ndcg", "mrr", "map@", "mean average precision", "precision@",
"offline evaluation", "online evaluation", "a/b test",
"offline-to-online", "evaluation framework", "evaluation pipeline",
],
}
# --- "Nice to have but won't reject for" ---
NICE_TO_HAVE = {
"llm_finetuning": ["lora", "qlora", "peft", "fine-tun", "finetun"],
"learning_to_rank": [
"learning to rank", "learning-to-rank", "ltr model", "xgboost",
"lambdamart", "neural ranking", "ranking model",
],
"hr_tech_marketplace": [
"recruiting", "hr tech", "hrtech", "talent platform", "marketplace",
"job search", "candidate matching", "hiring platform",
],
"distributed_inference": [
"distributed system", "large-scale inference", "low latency",
"high throughput", "horizontal scaling", "inference optimization",
"model serving",
],
"external_validation": [
"open source", "open-source", "published a paper", "conference talk",
"blog post", "github.com", "oss contribut",
],
}
# Production / shipping evidence vocabulary (JD: "Production strength")
# M5 fix: removed near-synonym duplicates that caused double-counting
# ("ab test" == "a/b test", "real-world users" == "real users", "scaled to" == "at scale").
# Keeping only one variant per concept; the /5-hit threshold in production_strength()
# is calibrated to this deduplicated list.
PRODUCTION_EVIDENCE = [
"production", "deployed", "shipped", "live traffic",
"real users", "at scale", "latency", "throughput",
"a/b test", "recall improvement", "ranking quality",
"rollout", "launched", "owned the", "on-call",
]
# Pre-LLM IR vocabulary. Credit only applies when a role *started* before
# PRE_LLM_CUTOFF_YEAR and its description doesn't contain post-2022 LLM terms
# (M3 fix: a role that started in 2020 but ran through 2024 with "langchain"
# throughout shouldn't earn pre-LLM credit).
PRE_LLM_IR_KEYWORDS = [
"search ranking", "information retrieval", "recommendation system",
"recommender system", "learning to rank", "click-through", "ctr model",
"collaborative filtering", "search relevance", "query understanding",
"ranking algorithm", "elasticsearch", "solr", "bm25",
]
PRE_LLM_CUTOFF_YEAR = 2022
# Post-2022 LLM-era markers. A role description containing these is treated as
# post-LLM-inflection work even if the role's start_date is before 2022 (M3 fix).
POST_LLM_MARKERS = [
"langchain", "llamaindex", "rag pipeline", "chatgpt", "gpt-4", "llama 2",
"claude", "gemini", "openai api", "anthropic",
]
# JD: "We're not going to move forward with pure research" -- no production
RESEARCH_ONLY_TITLE_HINTS = [
"research scientist", "research engineer", "research fellow",
"postdoctoral", "phd researcher", "academic researcher",
]
# JD: "consulting firms ... in their entire career" -- expanded beyond the JD's
# original 7 to include other common Indian IT-services names seen in the real pool.
CONSULTING_FIRMS = [
"tcs", "tata consultancy services", "infosys", "wipro", "accenture",
"cognizant", "capgemini", "hcl", "tech mahindra", "mindtree",
"l&t infotech", "lti", "mphasis", "hexaware", "persistent systems",
"zensar", "birlasoft", "niit", "cyient", "mastek", "sonata software",
"genpact", "wns", "firstsource",
]
CONSULTING_INDUSTRIES = ["it services", "consulting", "staffing", "bpo"]
# JD: "CV / speech / robotics without significant NLP/IR exposure"
NON_NLP_DOMAINS = ["computer vision", "speech recognition", "robotics", "cv engineer"]
NLP_IR_RESCUE_KEYWORDS = [
"nlp", "natural language", "retrieval", "search", "ranking",
"recommendation", "embeddings", "text classification",
]
# JD: "Architecture / tech lead without writing code in 18 months"
ARCHITECT_TITLE_HINTS = ["architect", "tech lead", "engineering manager", "head of"]
# JD: "ideal candidate ... located in or willing to relocate to Noida or Pune"
PREFERRED_LOCATIONS = ["pune", "noida"]
WELCOME_LOCATIONS = ["hyderabad", "mumbai", "delhi", "ncr", "gurgaon", "gurugram",
"bangalore", "bengaluru", "chennai", "kolkata"]
# C2 fix: explicitly non-engineering titles that score high due to keyword pollution
# in career description text. Penalty applied unless they have strong ML skill evidence
# (which would indicate they're mis-titled, not a false positive).
BAD_TITLE_PATTERNS = [
"customer support", "customer success", "marketing manager", "marketing director",
"content writer", "hr manager", "human resources", "graphic designer",
"ui designer", "ux designer", "sales manager", "account manager",
"civil engineer", "mechanical engineer", "electrical engineer",
"accountant", "recruiter", "talent acquisition", "operations manager",
"android developer", "ios developer", "mobile developer",
"seo specialist", "social media manager", "business analyst",
"project manager", "product manager",
]
IDEAL_YOE_LOW, IDEAL_YOE_HIGH = 5, 9
IDEAL_YOE_SOFT_LOW, IDEAL_YOE_SOFT_HIGH = 4, 11
JD_IDEAL_CANDIDATE_TEXT = """
Senior AI engineer owning the intelligence layer: ranking, retrieval and
matching systems that decide what recruiters and candidates see. Six to
eight years total experience, four to five years in applied ML or AI roles
at product companies, not pure services. Shipped at least one end to end
ranking, search, or recommendation system to real users at meaningful
scale. Production experience with embeddings based retrieval, vector
databases or hybrid search infrastructure, handling embedding drift, index
refresh, retrieval quality regression in production. Hands on experience
designing evaluation frameworks for ranking systems, NDCG, MRR, MAP,
offline to online correlation, A/B test interpretation. Strong opinions
about hybrid versus dense retrieval, offline versus online evaluation, when
to fine tune versus prompt, defended with reference to systems actually
built. Comfortable shipping a working ranker in a week while also owning
long term architecture. Mentors engineers, works async first, writes a lot,
disagrees openly, decides quickly.
"""