sancharikadebnath commited on
Commit
1744fe5
·
1 Parent(s): b0c98d8
app.py CHANGED
@@ -17,8 +17,10 @@ from dotenv import load_dotenv
17
  import google.generativeai as genai
18
  from langchain_google_genai import ChatGoogleGenerativeAI
19
 
 
20
  load_dotenv()
21
 
 
22
  class CareerEnchanter(object):
23
  def __init__(self, title="CareerEnchanter"):
24
  self.title = title
@@ -27,46 +29,52 @@ class CareerEnchanter(object):
27
  def model():
28
  genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
29
  return ChatGoogleGenerativeAI(model="gemini-pro")
30
-
 
31
  enchanter = CareerEnchanter()
32
- st.set_page_config(page_title=enchanter.title, page_icon='🤖', layout='centered')
33
 
34
- st.title("Enchant your Career")
 
 
 
 
35
 
 
36
  text = docLoader.load_doc()
37
  st.session_state['doc_text'] = text
38
- jd=st.text_area("Job Description: ",key="input")
 
 
 
 
39
  with st.sidebar:
40
- st.title(' :blue[_Career Enchanter_] 🤖')
41
- option = st.radio("Select an option: ", (
42
- "ATS Score",
43
- "Resume Review",
44
- "Resume Enhancements",
45
- "Resume Improvements",
46
- "Recommendation",
47
- "Keywords",
48
- "Generate Cover Letter",
49
- "Resume Generator",
50
- "Linkedin Profile Update",
51
- "Posssible Interview Questions",
52
- "Company Recommendations"
53
- ))
54
 
55
-
56
- if option == "ATS Score":
 
 
57
  calculation_method = st.radio("Choose how you want to calculate ATS Score: ", ("Using AI", "Manually (Cosine Similarity)"), horizontal=True)
58
 
59
- elif option == "Recommendation":
60
  recommendation_type = st.radio("Select the type of recommendation you want: ", ("Entire Resume", "Section Wise"), horizontal=True)
61
 
62
- elif option == "Keywords":
63
  analyz_type = st.radio("Select the type of Keywords Fucntion you want: ", ("Analyse Keywords", "Keyword Synonyms"), horizontal=True)
64
-
65
- with st.spinner("Loading Model..."):
66
- llm = enchanter.model()
67
-
68
-
69
- # Create a dictionary mapping options to functions
70
  option_functions = {
71
  "ATS Score": ats.run_ats,
72
  "Resume Review": review.run_review,
@@ -77,7 +85,7 @@ option_functions = {
77
  "Generate Cover Letter": cover_letter.run_letter,
78
  "Resume Generator": newresume.run_newresume,
79
  "Linkedin Profile Update": linkedin.run_linkedin,
80
- "Posssible Interview Questions": interview.run_interview,
81
  "Company Recommendations": company_recommend.run_company
82
  }
83
 
@@ -100,4 +108,4 @@ if option in option_functions:
100
  else:
101
  func(llm, st.session_state['doc_text'], jd)
102
  else:
103
- func(llm, st.session_state['doc_text'], jd)
 
17
  import google.generativeai as genai
18
  from langchain_google_genai import ChatGoogleGenerativeAI
19
 
20
+ # Load environment variables
21
  load_dotenv()
22
 
23
+ # Initialize CareerEnchanter
24
  class CareerEnchanter(object):
25
  def __init__(self, title="CareerEnchanter"):
26
  self.title = title
 
29
  def model():
30
  genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
31
  return ChatGoogleGenerativeAI(model="gemini-pro")
32
+
33
+ # Initialize CareerEnchanter instance
34
  enchanter = CareerEnchanter()
 
35
 
36
+ # Set Streamlit page configuration
37
+ st.set_page_config(page_title=enchanter.title, page_icon='🤖', layout='wide')
38
+
39
+ # Main title
40
+ st.title("🚀 Career Enchanter 🚀")
41
 
42
+ # Load document
43
  text = docLoader.load_doc()
44
  st.session_state['doc_text'] = text
45
+
46
+ # Job Description input
47
+ jd = st.text_area("Job Description: ", key="input")
48
+
49
+ # Sidebar options
50
  with st.sidebar:
51
+ st.title('🔮 Career Enchanter Options 🔮')
52
+ option = st.radio("Select an option: ", (
53
+ "ATS Score",
54
+ "Resume Review",
55
+ "Resume Enhancements",
56
+ "Resume Improvements",
57
+ "Recommendation",
58
+ "Keywords",
59
+ "Generate Cover Letter",
60
+ "Resume Generator",
61
+ "Linkedin Profile Update",
62
+ "Possible Interview Questions",
63
+ "Company Recommendations"
64
+ ))
65
 
66
+ # Load model
67
+ with st.spinner("Loading Model..."):
68
+ llm = enchanter.model()
69
+ if option == "ATS Score":
70
  calculation_method = st.radio("Choose how you want to calculate ATS Score: ", ("Using AI", "Manually (Cosine Similarity)"), horizontal=True)
71
 
72
+ elif option == "Recommendation":
73
  recommendation_type = st.radio("Select the type of recommendation you want: ", ("Entire Resume", "Section Wise"), horizontal=True)
74
 
75
+ elif option == "Keywords":
76
  analyz_type = st.radio("Select the type of Keywords Fucntion you want: ", ("Analyse Keywords", "Keyword Synonyms"), horizontal=True)
77
+ # Dictionary mapping options to functions
 
 
 
 
 
78
  option_functions = {
79
  "ATS Score": ats.run_ats,
80
  "Resume Review": review.run_review,
 
85
  "Generate Cover Letter": cover_letter.run_letter,
86
  "Resume Generator": newresume.run_newresume,
87
  "Linkedin Profile Update": linkedin.run_linkedin,
88
+ "Possible Interview Questions": interview.run_interview,
89
  "Company Recommendations": company_recommend.run_company
90
  }
91
 
 
108
  else:
109
  func(llm, st.session_state['doc_text'], jd)
110
  else:
111
+ func(llm, st.session_state['doc_text'], jd)
components/__pycache__/functions.cpython-39.pyc CHANGED
Binary files a/components/__pycache__/functions.cpython-39.pyc and b/components/__pycache__/functions.cpython-39.pyc differ
 
components/__pycache__/prompts.cpython-39.pyc CHANGED
Binary files a/components/__pycache__/prompts.cpython-39.pyc and b/components/__pycache__/prompts.cpython-39.pyc differ
 
components/functions.py CHANGED
@@ -7,6 +7,7 @@ import re
7
  import numpy as np
8
  import numpy as np
9
  import torch
 
10
  from nltk.corpus import stopwords
11
  from nltk.tokenize import word_tokenize
12
  from transformers import BertTokenizer, BertModel
@@ -56,6 +57,12 @@ class Functions():
56
 
57
  @staticmethod
58
  def calculate_ats_score(resume_data, job_description):
 
 
 
 
 
 
59
  def preprocess_text(text):
60
  text = text.lower()
61
  stop_words = set(stopwords.words('english'))
 
7
  import numpy as np
8
  import numpy as np
9
  import torch
10
+ import nltk
11
  from nltk.corpus import stopwords
12
  from nltk.tokenize import word_tokenize
13
  from transformers import BertTokenizer, BertModel
 
57
 
58
  @staticmethod
59
  def calculate_ats_score(resume_data, job_description):
60
+ # Download NLTK stopwords if not already downloaded
61
+ try:
62
+ stopwords.words('english')
63
+ except LookupError:
64
+ nltk.download('stopwords')
65
+
66
  def preprocess_text(text):
67
  text = text.lower()
68
  stop_words = set(stopwords.words('english'))
components/prompts.py CHANGED
@@ -101,8 +101,8 @@ resume_improve = """
101
  """
102
 
103
  resume_enhance = """
104
- You are an experienced Technical Human Resource Manager,your task is to Provide specific suggestions in bullet points to tailor the resume to the job description from the provided paragraph.
105
- Please share your professional suggestions on what to write and how to write the given pargraph so that the candidate's profile aligns with the role.
106
  Highlight weaknesses of the applicant in relation to the specified job requirements and provide sugestions on how to enhance it and make it strength.
107
 
108
  Job Description: {input_text}
 
101
  """
102
 
103
  resume_enhance = """
104
+ You are an experienced Technical Human Resource Manager, your task is to Provide specific suggestions in bullet points to tailor the resume to the job description from the provided paragraph.
105
+ Please share your professional suggestions on what to write and how to write the given paragraph so that the candidate's profile aligns with the role.
106
  Highlight weaknesses of the applicant in relation to the specified job requirements and provide sugestions on how to enhance it and make it strength.
107
 
108
  Job Description: {input_text}