File size: 623 Bytes
13b4b59
 
 
ce78163
 
13b4b59
 
 
 
 
 
 
 
dd48f0e
13b4b59
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import spacy
import streamlit as st
from spacy_streamlit import visualize_ner
import en_core_web_sm
nlp = en_core_web_sm.load()


st.write("""
# Finding tech trends on Data Science jobs using NER. (DEMO)
""")

nlp = spacy.load("en_core_web_sm")
ruler = nlp.add_pipe("entity_ruler", before="ner")
ruler.from_disk("patterns.jsonl")

txt = st.text_area(label='Enter the job description')
doc = nlp(txt)
visualize_ner(doc, labels=nlp.get_pipe("ner").labels)

st.json(
    [{'label': entity.label_, 'text': entity.text, 'start': entity.start, 'end': entity.end} \
        for entity in doc.ents if entity.ent_id_ == 'SKILLS']
)