Nassira commited on
Commit
b774862
·
verified ·
1 Parent(s): 3a3ef00

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -0
app.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from cv_analyzer import analyze_cv
3
+
4
+ st.title('CV Analyzer')
5
+
6
+ uploaded_file = st.file_uploader("Choose a CV file", type=['pdf', 'docx', 'txt'])
7
+
8
+ if uploaded_file is not None:
9
+ file_content = uploaded_file.read()
10
+ result = analyze_cv(file_content)
11
+
12
+ if "error" in result:
13
+ st.error(result["error"])
14
+ else:
15
+ st.header("Extracted Text")
16
+ st.text(result["extracted_text"])
17
+
18
+ st.header("Detected Sections")
19
+ st.json(result["detected_sections"])
20
+
21
+ st.header("Verified Sections")
22
+ st.json(result["verified_sections"])
23
+
24
+ st.header("Verified Elements")
25
+ for section, subsections in result["verified_elements"].items():
26
+ st.subheader(section)
27
+ for subsection in subsections:
28
+ st.write(f"Subsection {subsection['subsection_number']}:")
29
+ for element in subsection['elements']:
30
+ st.write(f"- {element['name']}: {'Present' if element['present'] else 'Not present'}")
31
+ if element['present'] and 'content' in element:
32
+ st.write(f" Content: {element['content']}")
33
+ st.write("---")