mdakhras commited on
Commit
0004adb
·
verified ·
1 Parent(s): 379de84

correct the targeted content from cv to PD

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +9 -9
src/streamlit_app.py CHANGED
@@ -27,7 +27,7 @@ client = AzureOpenAI(
27
  api_key=API_KEY,
28
  )
29
 
30
- # Function to extract information from CV using Azure OpenAI GPT-4 model
31
  def extract_PD_info_from_azure(text):
32
  prompt = f"""
33
  Act as an HR recruiter. Carefully evaluate the provided job description (PD) document and extract the following information into the specified structured format. Ensure that all fields are populated. If a field is not explicitly mentioned in the text, use ""N/A"" as the default value.
@@ -85,7 +85,7 @@ def extract_PD_info_from_azure(text):
85
  st.error(f"Error occurred while contacting Azure OpenAI: {e}")
86
  return None
87
 
88
- # Function to extract information from CV using Azure OpenAI GPT-4 model
89
  def extract_criterions_from_azure(text):
90
  prompt = f"""
91
  Act as an HR recruiter. Based on the main criteria categories defined below, extract bullet items from the provided PD text. For each bullet item, create a Criterion Object with the following fields:
@@ -229,16 +229,16 @@ def extract_weights_from_azure(text):
229
  st.title("AI Screening - Post Description Information Extraction")
230
  st.write("Enter the PD text below, and the agent will extract relevant information such as job title, location, skills, experience, and education, Criterions, Criterion Weights.")
231
 
232
- # Text area for entering CV content manually
233
- cv_text = st.text_area("Enter CV Text", height=300)
234
 
235
- if cv_text:
236
- # Display the entered CV text
237
- # st.subheader("Entered Text from CV")
238
- # st.text_area("CV Text", cv_text, height=300)
239
 
240
  # Extract relevant information using Azure OpenAI GPT-4
241
- extracted_info = extract_PD_info_from_azure(cv_text)
242
 
243
  # Display the extracted information
244
  if extracted_info:
 
27
  api_key=API_KEY,
28
  )
29
 
30
+ # Function to extract information from PD using Azure OpenAI GPT-4 model
31
  def extract_PD_info_from_azure(text):
32
  prompt = f"""
33
  Act as an HR recruiter. Carefully evaluate the provided job description (PD) document and extract the following information into the specified structured format. Ensure that all fields are populated. If a field is not explicitly mentioned in the text, use ""N/A"" as the default value.
 
85
  st.error(f"Error occurred while contacting Azure OpenAI: {e}")
86
  return None
87
 
88
+ # Function to extract information from PD using Azure OpenAI GPT-4 model
89
  def extract_criterions_from_azure(text):
90
  prompt = f"""
91
  Act as an HR recruiter. Based on the main criteria categories defined below, extract bullet items from the provided PD text. For each bullet item, create a Criterion Object with the following fields:
 
229
  st.title("AI Screening - Post Description Information Extraction")
230
  st.write("Enter the PD text below, and the agent will extract relevant information such as job title, location, skills, experience, and education, Criterions, Criterion Weights.")
231
 
232
+ # Text area for entering PD content manually
233
+ pd_text = st.text_area("Enter PD Text", height=300)
234
 
235
+ if pd_text:
236
+ # Display the entered PD text
237
+ # st.subheader("Entered Text from PD")
238
+ # st.text_area("PD Text", pd_text, height=300)
239
 
240
  # Extract relevant information using Azure OpenAI GPT-4
241
+ extracted_info = extract_PD_info_from_azure(pd_text)
242
 
243
  # Display the extracted information
244
  if extracted_info: