-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
83 lines (73 loc) · 2.74 KB
/
Copy pathapp.py
File metadata and controls
83 lines (73 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import streamlit as st
from page_statistics import statistics_page
from about import about_page
from cover_letter import cover_letter_page
from job_recommender import job_recommender_run, load_dataframe
from home import home_page
import re
# Configuration de la page
st.set_page_config(
page_title="AI-Powered Job Matching",
page_icon="💼",
layout="wide"
)
# Inject custom CSS to left-align all text and content
st.markdown("""
<style>
/* Force text and block elements to align left */
.main, .block-container {
text-align: left !important;
align-items: flex-start !important;
}
/* Override Streamlit's default centering for markdown and widgets */
.stMarkdown, .stTextInput, .stButton, .stFileUploader, .stSuccess {
text-align: left !important;
width: 100% !important;
}
</style>
""", unsafe_allow_html=True)
# Fonction principale pour gérer la navigation
def main():
# Ajouter une barre latérale pour la navigation
with st.sidebar:
st.title("Navigation")
page = st.radio(
"Choose a page",
["Home", "Job Recommendation", "Cover Letter", "Statistics", "About"],
index=0 # Par défaut, sélectionnez la première option
)
# Afficher la page correspondante
if page == "Home":
home_page()
elif page == "Job Recommendation":
# Choisir la langue
language = st.sidebar.selectbox("Language", ["English", "German", "Both"])
df_job, df_job_en, df_job_de, df_skill_data = load_dataframe()
if language == 'English':
df = df_job_en.copy()
elif language == 'German':
df = df_job_de.copy()
else:
df = df_job.copy()
# Choisir la ville
lst_city = list(df['location'].unique())
lst_city.insert(0, 'All cities')
city = st.sidebar.selectbox("City", lst_city)
if city != 'All cities':
df = df[df['location'].str.contains(city, na=False, case=False)]
# Filtrer par niveau d'expérience
level = st.sidebar.selectbox('Type of level', ['Junior', 'Senior', 'Both'])
senior_pattern = r'(Senior|Lead|Experienced|Principal|Head|Director)'
if level == 'Senior':
df = df[df['position'].str.contains(senior_pattern, flags=re.IGNORECASE, regex=True, na=False)]
elif level == 'Junior':
df = df[~df['position'].str.contains(senior_pattern, flags=re.IGNORECASE, regex=True, na=False)]
job_recommender_run(df)
elif page == "Statistics":
statistics_page()
elif page == "Cover Letter":
cover_letter_page()
elif page == "About":
about_page()
if __name__ == "__main__":
main()