chali12's picture
Create new file
2213857
raw
history blame
1.46 kB
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")