SumantBobade commited on
Commit
b4d88a5
·
verified ·
1 Parent(s): 229a97a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -18
app.py CHANGED
@@ -1,19 +1,27 @@
1
- import streamlit as st
2
- import pickle
3
- import re
4
-
5
- st.title("Resume Classifer")
6
-
7
- uploaded_file = st.file_uploader("Upload your resume (.txt)", type=['txt'])
8
-
9
- if uploaded_file:
10
- resume_text = uploaded_file.read().decode('utf-8')
11
-
12
- with open("model.pkl","rb") as f:
13
- vectorizer, model = pickle.load(f)
14
-
15
- text = re.sub(r'[^a-zA-Z ]', '', resume_text).lower()
16
- features = vectorizer.transform([text])
17
- prediction = model.predict(features)
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]}`")