Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
#
|
5 |
-
|
6 |
|
7 |
# Create Streamlit app
|
8 |
-
st.title("
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
# Run NER on user input
|
14 |
-
if text_input:
|
15 |
-
results = ner_model(text_input)
|
16 |
-
for result in results:
|
17 |
-
st.write(f"{result['word']}: {result['entity']}")
|
|
|
1 |
+
# import streamlit as st
|
2 |
+
# from transformers import pipeline
|
3 |
+
|
4 |
+
# # Load NER model
|
5 |
+
# ner_model = pipeline("ner", model="has-abi/distilBERT-finetuned-resumes-sections")
|
6 |
+
|
7 |
+
# # Create Streamlit app
|
8 |
+
# st.title("Named Entity Recognition with Hugging Face models")
|
9 |
+
|
10 |
+
# # Get user input
|
11 |
+
# text_input = st.text_input("Enter some text:")
|
12 |
+
|
13 |
+
# # Run NER on user input
|
14 |
+
# if text_input:
|
15 |
+
# results = ner_model(text_input)
|
16 |
+
# for result in results:
|
17 |
+
# st.write(f"{result['word']}: {result['entity']}")
|
18 |
import streamlit as st
|
19 |
from transformers import pipeline
|
20 |
|
21 |
+
# Set up Resuméner pipeline
|
22 |
+
summarizer = pipeline("summarization", model="sshleifer/distilbart-cnn-6-6")
|
23 |
|
24 |
# Create Streamlit app
|
25 |
+
st.title("Resuméner")
|
26 |
+
st.write("Upload your resume below to generate a summary.")
|
27 |
+
|
28 |
+
# Upload resume file
|
29 |
+
uploaded_file = st.file_uploader("Choose a file")
|
30 |
|
31 |
+
if uploaded_file is not None:
|
32 |
+
# Read resume file contents
|
33 |
+
resume_text = uploaded_file.read().decode("utf-8")
|
34 |
+
|
35 |
+
# Generate summary using Resuméner pipeline
|
36 |
+
summary = summarizer(resume_text, max_length=100, min_length=30, do_sample=False)[0]['summary_text']
|
37 |
+
|
38 |
+
# Display summary
|
39 |
+
st.write("Summary:")
|
40 |
+
st.write(summary)
|
41 |
|
|
|
|
|
|
|
|
|
|