subhaganesh commited on
Commit
06b1ad6
·
verified ·
1 Parent(s): dac48ba

Upload 4 files

Browse files
Files changed (5) hide show
  1. .gitattributes +1 -0
  2. app.py +63 -0
  3. image.jpg +3 -0
  4. requirements.txt +8 -0
  5. tfidf.pkl +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ image.jpg filter=lfs diff=lfs merge=lfs -text
app.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pickle
3
+ import re
4
+ import nltk
5
+
6
+ nltk.download('punkt')
7
+ nltk.download('stopwords')
8
+
9
+ #loading models
10
+ clf = pickle.load(open('clf.sav','rb'))
11
+ tfidf = pickle.load(open('tfidf.sav','rb'))
12
+
13
+ def clean_resume(resume_text):
14
+ clean_text = re.sub('http\S+\s*', ' ', resume_text)
15
+ clean_text = re.sub('RT|cc', ' ', clean_text)
16
+ clean_text = re.sub('#\S+', '', clean_text)
17
+ clean_text = re.sub('@\S+', ' ', clean_text)
18
+ clean_text = re.sub('[%s]' % re.escape("""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""), ' ', clean_text)
19
+ clean_text = re.sub(r'[^\x00-\x7f]', r' ', clean_text)
20
+ clean_text = re.sub('\s+', ' ', clean_text)
21
+ return clean_text
22
+
23
+ # web app
24
+ def main():
25
+ st.markdown(
26
+ """
27
+ <style>
28
+ .reportview-container {
29
+ background: url("image.jpg");
30
+ background-size: cover;
31
+ }
32
+ </style>
33
+ """,
34
+ unsafe_allow_html=True
35
+ )
36
+
37
+ st.title("Resume Screening App")
38
+ uploaded_file = st.file_uploader('Upload Resume', type=['txt','pdf'])
39
+
40
+ if uploaded_file is not None:
41
+ try:
42
+ resume_bytes = uploaded_file.read()
43
+ resume_text = resume_bytes.decode('utf-8')
44
+ except UnicodeDecodeError:
45
+ # If UTF-8 decoding fails, try decoding with 'latin-1'
46
+ resume_text = resume_bytes.decode('latin-1')
47
+
48
+ cleaned_resume = clean_resume(resume_text)
49
+ input_features = tfidf.transform([cleaned_resume])
50
+ prediction_id = clf.predict(input_features)[0]
51
+ box_color = "black"
52
+ styled_prediction = f'<div style="background-color: {box_color}; padding: 10px; border-radius: 5px;">{prediction_id}</div>'
53
+ st.markdown(styled_prediction, unsafe_allow_html=True)
54
+
55
+ # python main
56
+ if __name__ == "__main__":
57
+ main()
58
+
59
+
60
+
61
+
62
+
63
+
image.jpg ADDED

Git LFS Details

  • SHA256: da83f08a4b863aa596118d11ee200303bcf33309bc096fc28448f36a04cd9d46
  • Pointer size: 132 Bytes
  • Size of remote file: 2 MB
requirements.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ pandas
2
+ matplotlib
3
+ seaborn
4
+ numpy
5
+ scikit-learn
6
+ nltk
7
+ streamlit
8
+ altair==4.1.0
tfidf.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8360c57986c7133f7994d8329d26c74cf1a0218092746fadddc7ead6d4a41d27
3
+ size 213499