Spaces:
Runtime error
Runtime error
Commit
·
bec338a
1
Parent(s):
d81e3aa
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import spacy
|
2 |
import streamlit as st
|
3 |
from spacy_streamlit import visualize_ner
|
@@ -11,14 +12,18 @@ st.write("""
|
|
11 |
# Finding tech trends on Data Science jobs using NER. (DEMO)
|
12 |
""")
|
13 |
|
|
|
14 |
nlp = spacy.load("en_core_web_sm")
|
15 |
ruler = nlp.add_pipe("entity_ruler", before="ner")
|
16 |
-
ruler.from_disk("patterns.jsonl")
|
|
|
|
|
|
|
17 |
|
18 |
-
|
19 |
-
doc = nlp(txt)
|
20 |
visualize_ner(doc, labels=nlp.get_pipe("ner").labels)
|
21 |
|
|
|
22 |
st.json(
|
23 |
[{'label': entity.label_, 'text': entity.text, 'start': entity.start, 'end': entity.end} \
|
24 |
for entity in doc.ents if entity.ent_id_ == 'SKILLS']
|
|
|
1 |
+
from numpy import place
|
2 |
import spacy
|
3 |
import streamlit as st
|
4 |
from spacy_streamlit import visualize_ner
|
|
|
12 |
# Finding tech trends on Data Science jobs using NER. (DEMO)
|
13 |
""")
|
14 |
|
15 |
+
|
16 |
nlp = spacy.load("en_core_web_sm")
|
17 |
ruler = nlp.add_pipe("entity_ruler", before="ner")
|
18 |
+
ruler.from_disk("data/patterns.jsonl")
|
19 |
+
|
20 |
+
description = "Built with love 💙 Python, Spacy, Streamlit and Huggingface 🤗"
|
21 |
+
text = st.text_area(label='Job Description', value=description, placeholder='Please enter a job description')
|
22 |
|
23 |
+
doc = nlp(text)
|
|
|
24 |
visualize_ner(doc, labels=nlp.get_pipe("ner").labels)
|
25 |
|
26 |
+
st.subheader('Skill Requirements')
|
27 |
st.json(
|
28 |
[{'label': entity.label_, 'text': entity.text, 'start': entity.start, 'end': entity.end} \
|
29 |
for entity in doc.ents if entity.ent_id_ == 'SKILLS']
|