Skip to content

Commit

Permalink
Merge pull request #38 from AnasAito/issue-visualize
Browse files Browse the repository at this point in the history
Issue visualize and setups for new release
  • Loading branch information
Badr-MOUFAD authored Nov 7, 2021
2 parents e4c6540 + 4a30198 commit 3a8e510
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ venv
dist
skillNer.egg-info

draft
/skill_db_relax_20.json
/token_dist.json
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center"><img width="50%" src="https://user-images.githubusercontent.com/56308112/128958594-79813e72-b688-4a9a-9267-324f098d4b0c.png" /></p>

[![Downloads](https://static.pepy.tech/personalized-badge/skillner?period=total&units=international_system&left_color=blue&right_color=orange&left_text=PyPi%20downloads)](https://pepy.tech/project/skillner)
[![Number of SkillNer downloads](https://static.pepy.tech/personalized-badge/skillner?period=total&units=international_system&left_color=blue&right_color=orange&left_text=PyPi%20downloads)](https://pepy.tech/project/skillner)

**Just looking to test out SkillNer? Check out our [demo](https://share.streamlit.io/anasaito/skillner_demo/index.py)**.

Expand Down Expand Up @@ -38,9 +38,11 @@ which is one of the main plugins of SkillNer. Thanks its modular nature, you can
customize SkillNer behavior just by adjusting | plugin | unplugin modules. Don't worry about these details, we will discuss them in details in the an **upcomming Tutorial section**.

```bash
python -m spacy download en_core_web_sm
python -m spacy download en_core_web_lg
```

**Note:** The later installation will take few seconds before it get done since ``spacy en_core_web_lg `` is a bit too large (800 MB). Yet, you need to wait only one time.


## Example of usage

Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@

setuptools.setup(
name="skillNer",
version="1.0.2",
version="1.0.3",
author="Anas Ait AOMAR & Badr MOUFAD",
author_email="[email protected]",
description="An NLP module to automatically Extract skills and certifications from unstructured job postings, texts, and applicant's resumes",
url="https://github.com/AnasAito/SkillNER",
keywords=['python', 'NLP', "NER", "skills-extraction", "job-description"],
download_url='https://github.com/AnasAito/SkillNER/archive/refs/tags/v1.0.2.tar.gz',
keywords=["skillNer", 'python', 'NLP', "NER",
"skills-extraction", "job-description"],
download_url='https://github.com/AnasAito/SkillNER/archive/refs/tags/v1.0.3.tar.gz',
packages=setuptools.find_packages(),
install_requires=dependencies,
classifiers=[
Expand Down
23 changes: 23 additions & 0 deletions skillNer/visualizer/phrase_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@


class Phrase:
"""Data structure to build html visualization of the annotated text.
The input text is split into skill phrase and non skill phrase
"""

def __init__(
self,
text: str
Expand Down Expand Up @@ -38,7 +42,20 @@ def split_text_to_phare(
annotation: dict, # result of skill extractor
SKILL_DB: dict
) -> List:
"""Main function to distinguish skill and non skill phrases
Parameters
----------
annotation : dict
The output of the ``SkillExtractor.annotate``
SKILL_DB: dict
Data base of skills
Returns
-------
List
returns a list of phrases
"""
# params
list_words = annotation["text"].split(" ")

Expand Down Expand Up @@ -68,6 +85,12 @@ def split_text_to_phare(
# append phrase
arr_skill_phrases.append(phrase)

# handle case where no skill was annotated in text
if not len(arr_skill_phrases):
phrase = Phrase(text=annotation["text"])

return [phrase]

# order phrases
arr_skill_phrases.sort(key=lambda item: item.start)

Expand Down

0 comments on commit 3a8e510

Please sign in to comment.