AIEcosystem commited on
Commit
0b5f772
·
verified ·
1 Parent(s): 002ac5e

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +10 -10
src/streamlit_app.py CHANGED
@@ -82,10 +82,10 @@ expander.write("""
82
 
83
  -Type or paste your text into the text area, then press Ctrl + Enter. Click the 'Results' button to extract and tag entities in your text data.
84
  -Results are presented in easy-to-read tables, visualized in an interactive tree map, pie chart and bar chart, and are available for download along with a Glossary of tags.
85
- -This HR.ai web app predicts thirty-seven (37) labels: "Job_with_Date", "Email", "Phone_number", "Street_address", "City", "Country", "Date_of_birth", "Marital_status", "Person", "Full_time", "Part_time", "Contract", "Terminated", "Retired", "Job_title", "Date", "Organization", "Role", "Performance_score", "Leave_of_absence", "Retirement_plan", "Bonus", "Stock_options", "Health_insurance", "Pay_rate", "Annual_salary", "Tax", "Deductions", "Interview_type", "Applicant", "Referral", "Job_board", "Recruiter", "Offer_letter", "Agreement", "Certification", "Skill"
86
 
87
 
88
- **How to Use the InfoFinder web app:**
89
  1. Type or paste your text into the text area, then press Ctrl + Enter.
90
  2. Click the 'Add Question' button to add your question to the Record of Questions. You can manage your questions by deleting them one by one.
91
  3. Click the 'Extract Answers' button to extract the answer to your question.
@@ -141,13 +141,13 @@ def load_gliner_model(model_name):
141
  st.stop()
142
 
143
  # --- HR_AI Model Labels and Mappings ---
144
- labels = ["Job_with_Date", "Email", "Phone_number", "Street_address", "City", "Country", "Date_of_birth", "Marital_status", "Person", "Full_time", "Part_time", "Contract", "Terminated", "Retired", "Job_title", "Date", "Organization", "Role", "Performance_score", "Leave_of_absence", "Retirement_plan", "Bonus", "Stock_options", "Health_insurance", "Pay_rate", "Annual_salary", "Tax", "Deductions", "Interview_type", "Applicant", "Referral", "Job_board", "Recruiter", "Offer_letter", "Agreement", "Certification", "Skill"]
145
 
146
  category_mapping = {
147
  "Contact Information": ["Email", "Phone_number", "Street_address", "City", "Country"],
148
  "Personal Details": ["Date_of_birth", "Marital_status", "Person"],
149
  "Employment Status": ["Full_time", "Part_time", "Contract", "Terminated", "Retired"],
150
- "Employment Information": ["Job_with_Date", "Job_title", "Date", "Organization", "Role"],
151
  "Performance": ["Performance_score"],
152
  "Attendance": ["Leave_of_absence"],
153
  "Benefits": ["Retirement_plan", "Bonus", "Stock_options", "Health_insurance"],
@@ -169,10 +169,10 @@ def get_stable_color(label):
169
  return '#' + hex_dig[:6]
170
 
171
  # --- Main App with Tabs ---
172
- tab1, tab2 = st.tabs(["HR.ai", "InfoFinder"])
173
 
174
  with tab1:
175
- st.subheader("HR.ai")
176
 
177
  # Load model for this tab
178
  model_hr = load_gliner_model("HR_AI")
@@ -266,7 +266,7 @@ with tab1:
266
  st.download_button(
267
  label="Download results and glossary (zip)",
268
  data=buf.getvalue(),
269
- file_name="nlpblogs_hr_results.zip",
270
  mime="application/zip",
271
  )
272
 
@@ -283,7 +283,7 @@ with tab1:
283
  st.info(f"Results processed in **{elapsed_time:.2f} seconds**.")
284
 
285
  with tab2:
286
- st.subheader("InfoFinder")
287
 
288
  # Load model for this tab
289
  model_qa = load_gliner_model("InfoFinder")
@@ -295,7 +295,7 @@ with tab2:
295
 
296
  st.button("Clear text", on_click=clear_text_qa, key="clear_qa")
297
 
298
- st.subheader("Question-Answering", divider="violet")
299
  question_input = st.text_input("Ask wh-questions. **Wh-questions begin with what, when, where, who, whom, which, whose, why and how. We use them to ask for specific information.**")
300
 
301
  if st.button("Add Question"):
@@ -363,7 +363,7 @@ with tab2:
363
  st.download_button(
364
  label="Download CSV",
365
  data=csv_data,
366
- file_name="nlpblogs_infofinder_results.csv",
367
  mime="text/csv",
368
  )
369
 
 
82
 
83
  -Type or paste your text into the text area, then press Ctrl + Enter. Click the 'Results' button to extract and tag entities in your text data.
84
  -Results are presented in easy-to-read tables, visualized in an interactive tree map, pie chart and bar chart, and are available for download along with a Glossary of tags.
85
+ -This HR.ai web app predicts thirty-seven (36) labels: "Email", "Phone_number", "Street_address", "City", "Country", "Date_of_birth", "Marital_status", "Person", "Full_time", "Part_time", "Contract", "Terminated", "Retired", "Job_title", "Date", "Organization", "Role", "Performance_score", "Leave_of_absence", "Retirement_plan", "Bonus", "Stock_options", "Health_insurance", "Pay_rate", "Annual_salary", "Tax", "Deductions", "Interview_type", "Applicant", "Referral", "Job_board", "Recruiter", "Offer_letter", "Agreement", "Certification", "Skill"
86
 
87
 
88
+ **How to Use the Question-Answering feature:**
89
  1. Type or paste your text into the text area, then press Ctrl + Enter.
90
  2. Click the 'Add Question' button to add your question to the Record of Questions. You can manage your questions by deleting them one by one.
91
  3. Click the 'Extract Answers' button to extract the answer to your question.
 
141
  st.stop()
142
 
143
  # --- HR_AI Model Labels and Mappings ---
144
+ labels = ["Email", "Phone_number", "Street_address", "City", "Country", "Date_of_birth", "Marital_status", "Person", "Full_time", "Part_time", "Contract", "Terminated", "Retired", "Job_title", "Date", "Organization", "Role", "Performance_score", "Leave_of_absence", "Retirement_plan", "Bonus", "Stock_options", "Health_insurance", "Pay_rate", "Annual_salary", "Tax", "Deductions", "Interview_type", "Applicant", "Referral", "Job_board", "Recruiter", "Offer_letter", "Agreement", "Certification", "Skill"]
145
 
146
  category_mapping = {
147
  "Contact Information": ["Email", "Phone_number", "Street_address", "City", "Country"],
148
  "Personal Details": ["Date_of_birth", "Marital_status", "Person"],
149
  "Employment Status": ["Full_time", "Part_time", "Contract", "Terminated", "Retired"],
150
+ "Employment Information": ["Job_title", "Date", "Organization", "Role"],
151
  "Performance": ["Performance_score"],
152
  "Attendance": ["Leave_of_absence"],
153
  "Benefits": ["Retirement_plan", "Bonus", "Stock_options", "Health_insurance"],
 
169
  return '#' + hex_dig[:6]
170
 
171
  # --- Main App with Tabs ---
172
+ tab1, tab2 = st.tabs(["HR.ai", "Question-Answering"])
173
 
174
  with tab1:
175
+
176
 
177
  # Load model for this tab
178
  model_hr = load_gliner_model("HR_AI")
 
266
  st.download_button(
267
  label="Download results and glossary (zip)",
268
  data=buf.getvalue(),
269
+ file_name="nlpblogs_results.zip",
270
  mime="application/zip",
271
  )
272
 
 
283
  st.info(f"Results processed in **{elapsed_time:.2f} seconds**.")
284
 
285
  with tab2:
286
+
287
 
288
  # Load model for this tab
289
  model_qa = load_gliner_model("InfoFinder")
 
295
 
296
  st.button("Clear text", on_click=clear_text_qa, key="clear_qa")
297
 
298
+ st.subheader("Question-Answering", divider="green")
299
  question_input = st.text_input("Ask wh-questions. **Wh-questions begin with what, when, where, who, whom, which, whose, why and how. We use them to ask for specific information.**")
300
 
301
  if st.button("Add Question"):
 
363
  st.download_button(
364
  label="Download CSV",
365
  data=csv_data,
366
+ file_name="nlpblogs_questions_answers.csv",
367
  mime="text/csv",
368
  )
369