Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +25 -14
src/streamlit_app.py
CHANGED
@@ -65,7 +65,7 @@ st.set_page_config(layout="wide", page_title="Named Entity Recognition App")
|
|
65 |
st.subheader("HR.ai", divider="green")
|
66 |
st.link_button("by nlpblogs", "https://nlpblogs.com", type="tertiary")
|
67 |
expander = st.expander("**Important notes**")
|
68 |
-
expander.write("""**Named Entities:** This HR.ai predicts
|
69 |
|
70 |
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.
|
71 |
|
@@ -106,24 +106,35 @@ if not comet_initialized:
|
|
106 |
st.warning("Comet ML not initialized. Check environment variables.")
|
107 |
|
108 |
# --- Label Definitions ---
|
109 |
-
|
|
|
|
|
|
|
110 |
|
111 |
# Create a mapping dictionary for labels to categories
|
|
|
112 |
category_mapping = {
|
113 |
-
"Contact Information": ["Email", "Phone_number", "Street_address", "City", "
|
114 |
-
"Personal Details": ["Date_of_birth", "
|
115 |
-
"Employment Status": ["Full_time", "Part_time", "Contract", "
|
116 |
-
"Employment Information" : ["Job_title", "
|
117 |
-
"Performance": ["
|
118 |
-
"Attendance": ["
|
119 |
-
"Benefits": ["
|
120 |
-
"Compensation": ["Pay_rate", "
|
121 |
-
"Deductions": ["Tax", "
|
122 |
-
"Recruitment & Sourcing": ["
|
123 |
-
"Legal & Compliance": ["
|
124 |
-
"Professional_Development": [
|
125 |
}
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
# --- Model Loading ---
|
128 |
@st.cache_resource
|
129 |
def load_ner_model():
|
|
|
65 |
st.subheader("HR.ai", divider="green")
|
66 |
st.link_button("by nlpblogs", "https://nlpblogs.com", type="tertiary")
|
67 |
expander = st.expander("**Important notes**")
|
68 |
+
expander.write("""**Named Entities:** This HR.ai predicts thirty-six (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"
|
69 |
|
70 |
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.
|
71 |
|
|
|
106 |
st.warning("Comet ML not initialized. Check environment variables.")
|
107 |
|
108 |
# --- Label Definitions ---
|
109 |
+
|
110 |
+
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"]
|
111 |
+
|
112 |
+
|
113 |
|
114 |
# Create a mapping dictionary for labels to categories
|
115 |
+
|
116 |
category_mapping = {
|
117 |
+
"Contact Information": ["Email", "Phone_number", "Street_address", "City", "Country"],
|
118 |
+
"Personal Details": ["Date_of_birth", "Marital_status", "Person"],
|
119 |
+
"Employment Status": ["Full_time", "Part_time", "Contract", "Terminated", "Retired"],
|
120 |
+
"Employment Information" : ["Job_title", "Date", "Organization", "Role"],
|
121 |
+
"Performance": ["Performance_score"],
|
122 |
+
"Attendance": ["Leave_of_absence"],
|
123 |
+
"Benefits": ["Retirement_plan", "Bonus", "Stock_options", "Health_insurance"],
|
124 |
+
"Compensation": ["Pay_rate", "Annual_salary"],
|
125 |
+
"Deductions": ["Tax", "Deductions"],
|
126 |
+
"Recruitment & Sourcing": ["Interview_type", "Applicant", "Referral", "Job_board", "Recruiter"],
|
127 |
+
"Legal & Compliance": ["Offer_letter", "Agreement"],
|
128 |
+
"Professional_Development": [ "Certification", "Skill"]
|
129 |
}
|
130 |
|
131 |
+
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
+
|
136 |
+
|
137 |
+
|
138 |
# --- Model Loading ---
|
139 |
@st.cache_resource
|
140 |
def load_ner_model():
|