Downloads · 30 days
19
11% of all-time downloads
chayuto/thai-job-ner-phayathaibert
thai-job-ner-phayathaibert is a token classification model from chayuto. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as mit.
Named Entity Recognition model for extracting structured HR data from informal Thai job postings (e.g., Facebook groups, Line chats). Fine-tuned from PhayaThaiBERT (~122M params).
Downloads · 30 days
19
11% of all-time downloads
All-time downloads
178
Public
Parameters
277M
2.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 98%
From the Hugging Face model README
Named Entity Recognition model for extracting structured HR data from informal Thai job postings (e.g., Facebook groups, Line chats). Fine-tuned from PhayaThaiBERT (~122M params).
v2 update: Trained on style-matched synthetic + real-world data with upsampling. Real-world F1 improved from 0.143 → 0.975.
This model extracts 7 entity types from Thai job-related text:
| Entity | Description | Example |
|---|---|---|
HARD_SKILL | Skills or procedures | ดูแลผู้สูงอายุ, CPR, Python |
PERSON | Names | คุณสมชาย, พี่แจน |
LOCATION | Places | สีลม, ลาดพร้าว, บางนา |
COMPENSATION | Pay amounts | 18,000 บาท/เดือน |
EMPLOYMENT_TERMS | Job structure | part-time, กะกลางวัน |
CONTACT | Phone, Line, email | 081-234-5678, @care123 |
DEMOGRAPHIC | Age, gender | อายุ 25-40, หญิง |
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
model_name = "chayuto/thai-job-ner-phayathaibert"
ner = pipeline("ner", model=model_name, aggregation_strategy="simple")
text = "รับสมัครคนดูแลผู้สูงอายุ ย่านสีลม เงินเดือน 18,000 บาท โทร 081-234-5678"
results = ner(text)
for entity in results:
print(f"{entity['entity_group']}: {entity['word']} ({entity['score']:.2%})")
clicknext/phayathaibert (CamemBERT architecture, ~122M params, XLM-R-derived vocabulary)Raw Thai text + GPT-4o entity extractions → fuzzy alignment with rapidfuzz + pythainlp TCC boundary snapping → subword token mapping via offset_mapping → IOB2-formatted HuggingFace Dataset.
Style-matched synthetic data (v3) was generated to mimic real-world post characteristics: varied formatting, code-switching, informal language. Real-world posts were upsampled 5x to achieve a 20-35% real data proportion — the sweet spot identified through systematic experiments (see below).
| Metric | Score |
|---|---|
| F1 | 0.975 |
| Precision | 0.960 |
| Recall | 0.990 |
| Entity | F1 | Precision | Recall | Support |
|---|---|---|---|---|
| COMPENSATION | 1.000 | 1.000 | 1.000 | 15 |
| CONTACT | 1.000 | 1.000 | 1.000 | 10 |
| DEMOGRAPHIC | 1.000 | 1.000 | 1.000 | 14 |
| LOCATION | 1.000 | 1.000 | 1.000 | 8 |
| PERSON | 1.000 | 1.000 | 1.000 | 3 |
| HARD_SKILL | 0.973 | 0.947 | 1.000 | 36 |
| EMPLOYMENT_TERMS | 0.880 | 0.846 | 0.917 | 12 |
5 of 7 entity types achieve perfect F1 on real-world data.
| Metric | Score |
|---|---|
| F1 | 0.929 |
| Precision | 0.915 |
| Recall | 0.944 |
| Version | Training Data | Real-World F1 | Key Insight |
|---|---|---|---|
| v1 (synthetic-only) | 1,253 synthetic | 0.143 | Synthetic alone fails on real data |
| v1 (real-only) | 37 real posts | 0.558 | Small but 4x more effective per sample |
| v1 (mixed, 4.1% real) | 1,057 mixed | 0.935 | Even a few real posts help dramatically |
| v2 (v3+real5x, 34.6% real) | 619 mixed | 0.975 | Style-matched synthetic + upsampling |
Key finding: real data proportion is the #1 factor. Style-matched synthetic data is 3x more efficient than generic synthetic data.
offset_mapping for tokenizer-agnostic subword-to-character alignmentMIT