Update README.md
Browse files
README.md
CHANGED
|
@@ -29,7 +29,7 @@ Not designed for parsing **candidate resumes**.
|
|
| 29 |
### Training Data
|
| 30 |
|
| 31 |
* **Synthetic internship and job description dataset** generated with **mostly.ai**
|
| 32 |
-
* \~
|
| 33 |
* Labels: `SKILL`, `DISCIPLINE`, `COURSE`, `ROLE`
|
| 34 |
|
| 35 |
---
|
|
@@ -40,27 +40,35 @@ Not designed for parsing **candidate resumes**.
|
|
| 40 |
import torch
|
| 41 |
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
|
| 42 |
|
| 43 |
-
# Load
|
| 44 |
model_name = "gmay29/ner_model_final"
|
| 45 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 46 |
model = AutoModelForTokenClassification.from_pretrained(model_name)
|
| 47 |
|
| 48 |
-
device = 0 if torch.cuda.is_available() else -1
|
| 49 |
|
| 50 |
-
# Create NER pipeline
|
| 51 |
-
ner_pipeline = pipeline(
|
| 52 |
-
"ner",
|
| 53 |
-
model=model,
|
| 54 |
-
tokenizer=tokenizer,
|
| 55 |
-
device=device,
|
| 56 |
-
aggregation_strategy="simple"
|
| 57 |
-
)
|
| 58 |
|
| 59 |
-
# Example
|
| 60 |
text = """
|
|
|
|
| 61 |
Responsibilities of the Intern:
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
"""
|
| 65 |
|
| 66 |
# Run inference
|
|
@@ -74,15 +82,16 @@ for ent in entities:
|
|
| 74 |
**Example Output:**
|
| 75 |
|
| 76 |
```
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
SKILL |
|
| 80 |
-
SKILL |
|
| 81 |
-
SKILL |
|
| 82 |
-
SKILL |
|
| 83 |
-
SKILL |
|
| 84 |
-
SKILL |
|
| 85 |
-
|
|
|
|
| 86 |
```
|
| 87 |
|
| 88 |
---
|
|
|
|
| 29 |
### Training Data
|
| 30 |
|
| 31 |
* **Synthetic internship and job description dataset** generated with **mostly.ai**
|
| 32 |
+
* \~20,000 labeled samples (replace with actual dataset size if you know it)
|
| 33 |
* Labels: `SKILL`, `DISCIPLINE`, `COURSE`, `ROLE`
|
| 34 |
|
| 35 |
---
|
|
|
|
| 40 |
import torch
|
| 41 |
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
|
| 42 |
|
| 43 |
+
# Load from Hugging Face Hub
|
| 44 |
model_name = "gmay29/ner_model_final"
|
| 45 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 46 |
model = AutoModelForTokenClassification.from_pretrained(model_name)
|
| 47 |
|
| 48 |
+
device = 0 if torch.cuda.is_available() else -1 # pipeline expects 0 for GPU, -1 for CPU
|
| 49 |
|
| 50 |
+
# Create NER pipeline (handles context automatically)
|
| 51 |
+
ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer, device=device, aggregation_strategy="simple")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
+
# Example job description text
|
| 54 |
text = """
|
| 55 |
+
Details
|
| 56 |
Responsibilities of the Intern:
|
| 57 |
+
|
| 58 |
+
Accurately enter and update data into the company's databases and systems.
|
| 59 |
+
Maintain and organize digital and physical records.
|
| 60 |
+
Assist in generating and compiling reports using data from various sources.
|
| 61 |
+
Perform data quality checks to ensure accuracy and completeness.
|
| 62 |
+
Support the team with other administrative tasks as needed.
|
| 63 |
+
Requirements:
|
| 64 |
+
|
| 65 |
+
Strong data entry skills with high accuracy and attention to detail.
|
| 66 |
+
Proficiency in Microsoft Excel and other data management tools.
|
| 67 |
+
Basic understanding of data analysis and reporting.
|
| 68 |
+
Excellent organizational and time-management skills.
|
| 69 |
+
Good communication skills, both written and verbal.
|
| 70 |
+
Ability to work independently and manage time effectively.
|
| 71 |
+
A proactive approach to problem-solving.
|
| 72 |
"""
|
| 73 |
|
| 74 |
# Run inference
|
|
|
|
| 82 |
**Example Output:**
|
| 83 |
|
| 84 |
```
|
| 85 |
+
Device set to use cpu
|
| 86 |
+
Asking to truncate to max_length but no maximum length is provided and the model has no predefined maximum length. Default to no truncation.
|
| 87 |
+
SKILL | detail | score=1.000
|
| 88 |
+
SKILL | Excel | score=1.000
|
| 89 |
+
SKILL | management | score=1.000
|
| 90 |
+
SKILL | data analysis | score=1.000
|
| 91 |
+
SKILL | reporting | score=1.000
|
| 92 |
+
SKILL | time | score=0.993
|
| 93 |
+
SKILL | management | score=1.000
|
| 94 |
+
SKILL | communication skills | score=1.000
|
| 95 |
```
|
| 96 |
|
| 97 |
---
|