Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,19 +1,27 @@
|
|
| 1 |
-
|
| 2 |
-
import pickle
|
| 3 |
-
import re
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
st.write(f"### Predicted Job Role: `{prediction[0]}`")
|
|
|
|
| 1 |
+
|
| 2 |
+
import pickle
|
| 3 |
+
import re
|
| 4 |
+
|
| 5 |
+
import os
|
| 6 |
+
os.environ.setdefault("STREAMLIT_CONFIG_DIR", ".streamlit")
|
| 7 |
+
os.makedirs(os.environ["STREAMLIT_CONFIG_DIR"], exist_ok=True)
|
| 8 |
+
os.environ["STREAMLIT_BROWSER_GATHER_USAGE_STATS"] = "false"
|
| 9 |
+
|
| 10 |
+
import streamlit as st
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
st.title("Resume Classifer")
|
| 14 |
+
|
| 15 |
+
uploaded_file = st.file_uploader("Upload your resume (.txt)", type=['txt'])
|
| 16 |
+
|
| 17 |
+
if uploaded_file:
|
| 18 |
+
resume_text = uploaded_file.read().decode('utf-8')
|
| 19 |
+
|
| 20 |
+
with open("model.pkl","rb") as f:
|
| 21 |
+
vectorizer, model = pickle.load(f)
|
| 22 |
+
|
| 23 |
+
text = re.sub(r'[^a-zA-Z ]', '', resume_text).lower()
|
| 24 |
+
features = vectorizer.transform([text])
|
| 25 |
+
prediction = model.predict(features)
|
| 26 |
+
|
| 27 |
st.write(f"### Predicted Job Role: `{prediction[0]}`")
|