Spaces:
Runtime error
Runtime error
Commit
·
13b4b59
1
Parent(s):
8a16b4d
Upload app.py
Browse files
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from nbformat import write
|
2 |
+
import pandas as pd
|
3 |
+
import spacy
|
4 |
+
import streamlit as st
|
5 |
+
from spacy_streamlit import visualize_ner
|
6 |
+
|
7 |
+
|
8 |
+
st.write("""
|
9 |
+
# Finding tech trends on Data Science jobs using NER. (DEMO)
|
10 |
+
""")
|
11 |
+
|
12 |
+
nlp = spacy.load("en_core_web_sm")
|
13 |
+
ruler = nlp.add_pipe("entity_ruler", before="ner")
|
14 |
+
ruler.from_disk("data/patterns.jsonl")
|
15 |
+
|
16 |
+
txt = st.text_area(label='Enter the job description')
|
17 |
+
doc = nlp(txt)
|
18 |
+
visualize_ner(doc, labels=nlp.get_pipe("ner").labels)
|
19 |
+
|
20 |
+
st.json(
|
21 |
+
[{'label': entity.label_, 'text': entity.text, 'start': entity.start, 'end': entity.end} \
|
22 |
+
for entity in doc.ents if entity.ent_id_ == 'SKILLS']
|
23 |
+
)
|