robertselvam commited on
Commit
2bb69d1
·
verified ·
1 Parent(s): 7a213a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -36
app.py CHANGED
@@ -34,43 +34,43 @@ class ResumeAnalyser:
34
  result = ""
35
  job_description = self.extract_text_from_file(job_description_path.name)
36
  for resume_path in resume_list_path:
37
- resume = self.extract_text_from_file(resume_path.name)
38
- # Create a conversation for the OpenAI chat API
39
- conversation = [
40
- {"role": "system", "content": "You are a Mental Healthcare Chatbot."},
41
- {"role": "user", "content": f"""Given the job description and the resume, assess the matching percentage to 100 and if 100 percentage not matched mention the remaining percentage with reason. **Job Description:**{job_description}**Resume:**{resume}
42
- **Detailed Analysis:**
43
- Introduction to say we've assessment the resume
44
- the result should be in this format:
45
- Matched Percentage: Precisely [get matching percentage between job description and resume]%.\n
46
- Qualification Matching Percentage: [matching percentage between job description and resume qualifications].\n
47
- Skills Matching Percentage: [matching percentage between job description and resume skills].\n
48
- Experience Matching Percentage: [matching percentage between job description and resume experience].\n
49
- Reason : [Reasons for why this resume matched and not matched.].\n
50
- Skills To Improve : [Mention the skills to improve for the candidate according to the given job description. If there are no matches, simply say N/A.].\n
51
- Keywords : [Return the matched keywords from resume and job_description. If there are no matches, simply say N/A.]\n
52
- Company : [Extracted company name from job description].\n
53
- Irrevelant: [mention the irrevelant skills and expericence]\n
54
- Recommend Course: [mention specific course to recommend the candidate for job description needs].\n
55
- Experience: [mention specific experience to recommend the candidate for job description needs].\n
56
- Tailor Your Application: [Emphasize relevant areas].\n
57
- Certifications: [Pursue certifications in mention area].\n
58
- Feel free to contact us for further clarification.\n
59
- Best wishes,
60
- Your job is to write a proper E-Mail to the candidate from the organization with the job role, the candidate's name, organization name, and the body of this E-Mail should be in the above format."""}
61
- ]
62
-
63
- # Call OpenAI GPT-3.5-turbo
64
- chat_completion = client.chat.completions.create(
65
- model = "gpt-3.5-turbo",
66
- messages = conversation,
67
- max_tokens=300,
68
- temperature=0
69
- )
70
-
71
- response = chat_completion.choices[0].message.content
72
 
73
- result += response + "\n-------------------------------------------------------------------------------------\n"
74
 
75
  return result
76
 
 
34
  result = ""
35
  job_description = self.extract_text_from_file(job_description_path.name)
36
  for resume_path in resume_list_path:
37
+ resume = self.extract_text_from_file(resume_path.name)
38
+ # Create a conversation for the OpenAI chat API
39
+ conversation = [
40
+ {"role": "system", "content": "You are a Mental Healthcare Chatbot."},
41
+ {"role": "user", "content": f"""Given the job description and the resume, assess the matching percentage to 100 and if 100 percentage not matched mention the remaining percentage with reason. **Job Description:**{job_description}**Resume:**{resume}
42
+ **Detailed Analysis:**
43
+ Introduction to say we've assessment the resume
44
+ the result should be in this format:
45
+ Matched Percentage: Precisely [get matching percentage between job description and resume]%.\n
46
+ Qualification Matching Percentage: [matching percentage between job description and resume qualifications].\n
47
+ Skills Matching Percentage: [matching percentage between job description and resume skills].\n
48
+ Experience Matching Percentage: [matching percentage between job description and resume experience].\n
49
+ Reason : [Reasons for why this resume matched and not matched.].\n
50
+ Skills To Improve : [Mention the skills to improve for the candidate according to the given job description. If there are no matches, simply say N/A.].\n
51
+ Keywords : [Return the matched keywords from resume and job_description. If there are no matches, simply say N/A.]\n
52
+ Company : [Extracted company name from job description].\n
53
+ Irrevelant: [mention the irrevelant skills and expericence]\n
54
+ Recommend Course: [mention specific course to recommend the candidate for job description needs].\n
55
+ Experience: [mention specific experience to recommend the candidate for job description needs].\n
56
+ Tailor Your Application: [Emphasize relevant areas].\n
57
+ Certifications: [Pursue certifications in mention area].\n
58
+ Feel free to contact us for further clarification.\n
59
+ Best wishes,
60
+ Your job is to write a proper E-Mail to the candidate from the organization with the job role, the candidate's name, organization name, and the body of this E-Mail should be in the above format."""}
61
+ ]
62
+
63
+ # Call OpenAI GPT-3.5-turbo
64
+ chat_completion = client.chat.completions.create(
65
+ model = "gpt-3.5-turbo",
66
+ messages = conversation,
67
+ max_tokens=300,
68
+ temperature=0
69
+ )
70
+
71
+ response = chat_completion.choices[0].message.content
72
 
73
+ result += response + "\n-------------------------------------------------------------------------------------\n"
74
 
75
  return result
76