Update app.py
Browse files
app.py
CHANGED
@@ -1,46 +1,28 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
import
|
3 |
-
import
|
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 |
-
elif ent.label_ == "DATE":
|
30 |
-
extracted_info["experience"].append(ent.text)
|
31 |
-
|
32 |
-
match_score = sum(1 for token in nlp(job_desc) if token.text in text) / len(job_desc.split()) * 100
|
33 |
-
return extracted_info, match_score
|
34 |
-
|
35 |
-
# Streamlit interface
|
36 |
-
st.title("Resume Scanner with NLP")
|
37 |
-
uploaded_file = st.file_uploader("Upload a resume (PDF or DOCX)", type=["pdf", "docx"])
|
38 |
-
job_description = st.text_area("Paste the job description here")
|
39 |
-
|
40 |
-
if uploaded_file and job_description:
|
41 |
-
resume_text = extract_text(uploaded_file)
|
42 |
-
extracted_info, match_score = analyze_resume(resume_text, job_description)
|
43 |
-
|
44 |
-
st.subheader("Extracted Information:")
|
45 |
-
st.write(extracted_info)
|
46 |
-
st.subheader(f"Match Score: {match_score:.2f}%")
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import easyocr
|
3 |
+
from PIL import Image
|
4 |
+
|
5 |
+
# Initialize the EasyOCR Reader
|
6 |
+
reader = easyocr.Reader(['en'])
|
7 |
+
|
8 |
+
# Streamlit interface
|
9 |
+
st.title("OCR with EasyOCR")
|
10 |
+
|
11 |
+
# Upload image
|
12 |
+
uploaded_file = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png"])
|
13 |
+
|
14 |
+
if uploaded_file:
|
15 |
+
# Open image file
|
16 |
+
image = Image.open(uploaded_file)
|
17 |
+
st.image(image, caption='Uploaded Image', use_column_width=True)
|
18 |
+
|
19 |
+
# Run OCR
|
20 |
+
result = reader.readtext(image)
|
21 |
+
|
22 |
+
# Display OCR results
|
23 |
+
st.subheader("OCR Results:")
|
24 |
+
for detection in result:
|
25 |
+
text = detection[1]
|
26 |
+
bbox = detection[0]
|
27 |
+
st.write(f"Text: {text}")
|
28 |
+
st.write(f"Bounding Box: {bbox}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|