Views
No views yet
roberta-base model fine-tuned for Named Entity Recognition (NER) on Human Resources documents, specifically Résumés (CVs) and Job Descriptions (JDs).SKILL: Technical skills, software, tools, or soft skills.
EXPERIENCE_DURATION: Text spans that describe a duration of time.
token-classification (or ner) pipeline from the transformers library.1from transformers import pipeline
2
3# Load the model from the Hub
4model_id = "feliponi/hirly-ner-multi"
5
6# Initialize the pipeline
7# aggregation_strategy="simple" groups B- and I- tags (e.g., B-SKILL, I-SKILL -> SKILL)
8extractor = pipeline(
9 "ner",
10 model=model_id,
11 aggregation_strategy="simple"
12)
13
14# Example text
15text = """
16Data Scientist with 5+ years of experience in Python and machine learning.
17Also 6 months in Java.
18
19Soft skills:
20inclusive leadership
21paradigm thinking
22performance optimization
23personal initiative
24
25english language proficiency
26portuguese language proficiency
27
28AWS Certified Solutions Architect - Associate"""
29
30# Get entities
31entities = extractor(text)
32
33# Filter for high confidence
34min_confidence = 0.7
35confident_entities = [e for e in entities if e['score'] >= min_confidence]
36
37# Print the results
38for entity in confident_entities:
39 print(f"[{entity['entity_group']}] {entity['word']} (Confidence: {entity['score']:.2f})")[{'entity_group': 'SKILL', 'score': np.float32(0.9340167), 'word': 'Data Scientist', 'start': 1, 'end': 15},
{'entity_group': 'EXPERIENCE_DURATION', 'score': np.float32(0.9998663), 'word': ' 5+ years', 'start': 21, 'end': 29},
{'entity_group': 'SKILL', 'score': np.float32(0.99859816), 'word': ' Python', 'start': 47, 'end': 53},
{'entity_group': 'SKILL', 'score': np.float32(0.9998181), 'word': ' machine learning', 'start': 58, 'end': 74},
{'entity_group': 'EXPERIENCE_DURATION', 'score': np.float32(0.9998392), 'word': ' 6 months', 'start': 81, 'end': 89},
{'entity_group': 'SKILL', 'score': np.float32(0.9982002), 'word': ' Java', 'start': 93, 'end': 97},
{'entity_group': 'SOFT_SKILL', 'score': np.float32(0.995745), 'word': ' leadership', 'start': 124, 'end': 134},
{'entity_group': 'SOFT_SKILL', 'score': np.float32(0.9859735), 'word': 'performance optimization', 'start': 153, 'end': 177},
{'entity_group': 'SOFT_SKILL', 'score': np.float32(0.98516375), 'word': 'personal initiative', 'start': 178, 'end': 197},
{'entity_group': 'LANG', 'score': np.float32(0.96456385), 'word': 'english language proficiency', 'start': 199, 'end': 227},
{'entity_group': 'LANG', 'score': np.float32(0.9288162), 'word': 'portuguese language proficiency', 'start': 228, 'end': 259},
{'entity_group': 'SKILL', 'score': np.float32(0.926032), 'word': 'AWS', 'start': 261, 'end': 264},
{'entity_group': 'SOFT_SKILL', 'score': np.float32(0.9559879), 'word': ' Solutions', 'start': 275, 'end': 284},
{'entity_group': 'SKILL', 'score': np.float32(0.84499276), 'word': ' Architect', 'start': 285, 'end': 294}]| Entity | F1-Score |
|---|---|
SKILLS | 98.9% |
LANG | 99.0% |
CERT | 84.9% |
SOFT_SKILL | 98.6% |
EXPERIENCE_DURATION | 99.8% |
| Overall | 96.3% |
EXPERIENCE_DURATION (Pattern-Based): This entity was labeled using a robust set of regular expressions designed to find time-based patterns (e.g., "5+ years", "six months", "3-5 anos"). Its near-perfect F1 score reflects the high precision of this regex approach.SKILL, SOFT_SKILL, LANG, CERT (Vocabulary-Based): These four entities were labeled by performing high-speed, exact matching against four separate vocabulary files (skills.txt, softskills.txt, langskills.txt, certifications.txt).SKILL, SOFT_SKILL, LANG): The excellent F1 scores (98-99%) indicate that the vocabularies for these labels were comprehensive and matched the training texts frequently.CERT): The 84.9% F1 score is strong but shows room for improvement. This score suggests the certifications.txt vocabulary was less comprehensive. The model's performance for this label would be directly improved by adding more certification names (e.g., "AWS CSAA", "PMP", etc.) to the vocabulary file and retraining.SKILL with high confidence. Users of this model should filter the output to remove known false positives.
. with a 0.33 score, as seen in the sample output). It is highly recommended to filter results by a confidence score (e.g., score > 0.7) for clean outputs.