Spaces:
Sleeping
Sleeping
from typing import List, Dict | |
from pydantic import BaseModel | |
from langchain.prompts import PromptTemplate | |
from langchain.chains import LLMChain | |
from langchain.llms import OpenAI | |
class AspectsStructure(BaseModel): | |
checkpoints: List[str] | |
prompt_template = PromptTemplate( | |
input_variables=["job_description"], | |
template=""" | |
You are an expert recruiter specialized in analyzing resumes against job descriptions (JDs). Your task is to formulate checkpoints that focus on verifying criteria that are explicitly mentioned as must-have in the JD. These checkpoints will help generate insightful responses in the next step, ensuring the resume is analyzed against the critical, non-negotiable requirements, if any, outlined in the JD. | |
**Input**: The input for this task will be the job description (JD). | |
**Output**: Formulate 2 to 3 evaluation checkpoints/criteria focused solely on the must-have requirements. These checkpoints/criteria will serve as evaluation criteria for the next stage, where the candidate's resume will be checked for evidence and reasoning. | |
### Steps: | |
1) Understand the JD and determine the number of checkpoints (between 2-3) required depending on the specifications from the JD and the context of the role. For freshers/career beginners, the number of checkpoints could be less in number. | |
2) With a holistic and pragmatic approach, formulate the checkpoints that cover the verifiable aspects usually available from resumes. Note that the cultural aspects or thinking process or future plans of the candidate should not be part of this exercise. | |
**Guidelines**: | |
1. Identify parameters explicitly marked as must-have in the JD. | |
a. Consider the context and include aspects labeled as “required,” “mandatory,” “essential,” “prerequisite,” or similar if appropriate to be considered as must-have. | |
b. Focus only on very critical criteria that, if missing, should lead to disqualification of the candidate. | |
2. Clearly differentiate between must-haves and good-to-haves/preferences. | |
a. Exclude any parameters described as “preferred,” “nice-to-have,” or optional. | |
3. If specific education, certification, or experience is not explicitly mentioned as a must-have, do not include it in this section. | |
**Output Format:** | |
Checkpoint 1: [Description of checkpoint] | |
Checkpoint 2: [Description of checkpoint] | |
""" | |
) | |
class MhAspectsSignature: | |
def __init__(self, llm: OpenAI): | |
self.chain = LLMChain(llm=llm, prompt=prompt_template) | |
def generate_checkpoints(self, job_description: str) -> str: | |
return self.chain.run(job_description=job_description) | |