File size: 1,461 Bytes
2213857
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import streamlit as st
from datasets import load_dataset
from spacy_streamlit import visualize_textcat, visualize_ner
import spacy_streamlit


import pandas as pd
from io import StringIO
from transformers import pipeline
import spacy
from PIL import Image

# we write text
st.title('Skills Extraction Project')

# we write markdown
st.markdown('This NLP project helps you extract skills from job description. You just need to paste a job description and directly access the required skills for a specific vacancy. Save time!', unsafe_allow_html=False)

@st.cache(allow_output_mutation=True)
def get_model():
    return spacy.load("en_core_web_sm")

nlp = get_model()

raw_text = st.text_area(label="Insert your job description")

#if raw_text != "":
docx = nlp(raw_text)
spacy_streamlit.visualize_ner(docx, labels = nlp.get_pipe('ner').labels)
#spacy_streamlit.visualize_ner(docx,labels=nlp.get_pipe('ner').labels)
    

#download the skills & job description in a csv from a df
#@st.cache
#def convert_df(df):
  # IMPORTANT: Cache the conversion to prevent computation on every rerun
  #return df.to_csv().encode('utf-8')

#csv = convert_df(my_large_df)

#st.download_button(
     #label="Download as as CSV",
     #data=csv,
     #file_name='skills.csv',
     #mime='text/csv',
 #)





@st.cache  # 👈 This function will be cached
def load_large_dataset():
    # Do something really slow in here!
    return load_dataset("glue", "sst2", split="validation")