AndreiTolmachev commited on
Commit
79761d1
·
verified ·
1 Parent(s): 75077f6

v2: update model card — add BA class, new metrics, usage example

Browse files
Files changed (1) hide show
  1. README.md +60 -30
README.md CHANGED
@@ -14,9 +14,10 @@ tags:
14
  - jobs
15
  - developer-classification
16
  - data-analyst-classification
17
- - dev-plus-da
 
18
  - r95
19
- - v1
20
  base_model: cointegrated/rubert-tiny2
21
  metrics:
22
  - precision
@@ -27,22 +28,24 @@ model-index:
27
  results:
28
  - task:
29
  type: text-classification
30
- name: Developer/Data Analyst vs Other Binary Classification
31
  metrics:
32
  - type: roc_auc
33
- value: 0.9790
34
  - type: precision
35
- value: 0.8797
36
  - type: recall
37
- value: 0.9509
38
  ---
39
 
40
- # dev_da_roles_1 - Developer + Data Analyst Classifier
41
 
42
- Binary job-vacancy classifier: detects **developer or Data Analyst** roles (`tech`) versus **other** roles (`other`).
43
 
44
  Built on top of [`cointegrated/rubert-tiny2`](https://huggingface.co/cointegrated/rubert-tiny2), a compact BERT model for Russian and English text.
45
 
 
 
46
  ## Task Definition
47
 
48
  The positive class (`tech`) is defined as:
@@ -59,6 +62,7 @@ The positive class (`tech`) is defined as:
59
  - ML / AI / Data Scientist
60
  - Mobile
61
  - Data Analyst
 
62
 
63
  Team leads and management roles are intentionally excluded from the positive class.
64
 
@@ -73,19 +77,29 @@ Team leads and management roles are intentionally excluded from the positive cla
73
 
74
  | Metric | Value |
75
  |---|---:|
76
- | ROC AUC | 0.9790 |
77
- | Precision @ threshold | 0.8797 |
78
- | Recall @ threshold | 0.9509 |
79
- | Best threshold | 0.3765 |
80
  | Target recall | 0.95 |
 
 
 
81
 
82
- Best epoch: **8**. Training `pos_weight`: **2.4813**.
 
 
 
 
 
 
 
83
 
84
  ## Inference Parameters
85
 
86
- - `max_length`: **256** tokens
87
- - Vacancy text is formed as `title + description`, with description truncated to **1200 characters**
88
- - Decision threshold for class `tech`: **0.3765**
89
 
90
  ## Usage
91
 
@@ -94,23 +108,30 @@ import torch
94
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
95
 
96
  MODEL_ID = "AndreiTolmachev/dev_da_roles_1"
97
- THRESHOLD = 0.3765
98
 
99
  tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
100
  model = AutoModelForSequenceClassification.from_pretrained(MODEL_ID).eval()
101
 
102
- def is_developer_or_data_analyst(title: str, description: str = "") -> bool:
103
- text = (title + " " + description[:1200]).strip()
104
- enc = tokenizer(text, truncation=True, max_length=256, return_tensors="pt")
105
  with torch.no_grad():
106
  logits = model(**enc).logits
107
  prob_tech = torch.softmax(logits, dim=-1)[0, 1].item()
108
  return prob_tech >= THRESHOLD
109
 
110
- print(is_developer_or_data_analyst(
111
- "Data Analyst",
112
- "SQL, Python, dashboards, product metrics, A/B tests..."
113
- ))
 
 
 
 
 
 
 
114
  ```
115
 
116
  ## Architecture
@@ -125,20 +146,29 @@ print(is_developer_or_data_analyst(
125
  ## Training
126
 
127
  - Dataset: internal job-vacancy dataset (`vacancies_labeled.csv`), labeled by an LLM pipeline
128
- - Loss: weighted cross-entropy
129
- - Threshold selected for target recall = **0.95**
130
- - Positive class includes developer roles and Data Analyst, excluding team leads
 
 
131
 
132
  ## Limitations
133
 
134
  - Trained primarily on Russian-language IT job vacancies; quality on other domains/languages is not guaranteed.
135
  - Team lead and management roles are treated as `other` by design.
136
- - Description is truncated to 1200 characters before tokenization.
137
- - The model intentionally groups developers and Data Analysts into one positive class; it does not distinguish between them.
 
138
 
139
  ## Version
140
 
141
- Hub tag: `v1.0-dev-da-r95`
 
 
 
 
 
 
142
 
143
  ## License
144
 
 
14
  - jobs
15
  - developer-classification
16
  - data-analyst-classification
17
+ - business-analyst-classification
18
+ - dev-plus-da-plus-ba
19
  - r95
20
+ - v2
21
  base_model: cointegrated/rubert-tiny2
22
  metrics:
23
  - precision
 
28
  results:
29
  - task:
30
  type: text-classification
31
+ name: Developer / Data Analyst / Business Analyst vs Other Binary Classification
32
  metrics:
33
  - type: roc_auc
34
+ value: 0.9815
35
  - type: precision
36
+ value: 0.9219
37
  - type: recall
38
+ value: 0.9506
39
  ---
40
 
41
+ # dev_da_roles_1 Developer + Data Analyst + Business Analyst Classifier
42
 
43
+ Binary job-vacancy classifier: detects **developer, Data Analyst, or Business Analyst** roles (`tech`) versus **other** roles (`other`).
44
 
45
  Built on top of [`cointegrated/rubert-tiny2`](https://huggingface.co/cointegrated/rubert-tiny2), a compact BERT model for Russian and English text.
46
 
47
+ > **v2** — extends v1 by adding Business Analyst to the positive class and using a longer input context (384 tokens / 2000 chars). Precision improved from 0.880 → 0.922.
48
+
49
  ## Task Definition
50
 
51
  The positive class (`tech`) is defined as:
 
62
  - ML / AI / Data Scientist
63
  - Mobile
64
  - Data Analyst
65
+ - Бизнес аналитик (Business Analyst)
66
 
67
  Team leads and management roles are intentionally excluded from the positive class.
68
 
 
77
 
78
  | Metric | Value |
79
  |---|---:|
80
+ | ROC AUC | 0.9815 |
81
+ | Precision @ threshold | 0.9219 |
82
+ | Recall @ threshold | 0.9506 |
83
+ | Best threshold | 0.8791 |
84
  | Target recall | 0.95 |
85
+ | Best epoch | 7 |
86
+
87
+ **Recall by key category (held-out test set):**
88
 
89
+ | Category | Recall |
90
+ |---|---:|
91
+ | Backend | 0.984 |
92
+ | Frontend | 1.000 |
93
+ | Mobile | 1.000 |
94
+ | ML / AI / Data Scientist | 0.976 |
95
+ | Data Analyst | 0.916 |
96
+ | Business Analyst | 0.895 |
97
 
98
  ## Inference Parameters
99
 
100
+ - `max_length`: **384** tokens
101
+ - Vacancy text: `title + " . " + description`, description truncated to **2000 characters**
102
+ - Decision threshold for class `tech`: **0.8791**
103
 
104
  ## Usage
105
 
 
108
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
109
 
110
  MODEL_ID = "AndreiTolmachev/dev_da_roles_1"
111
+ THRESHOLD = 0.8791
112
 
113
  tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
114
  model = AutoModelForSequenceClassification.from_pretrained(MODEL_ID).eval()
115
 
116
+ def is_tech_role(title: str, description: str = "") -> bool:
117
+ text = f"{title.strip()} . {description[:2000].strip()}"
118
+ enc = tokenizer(text, truncation=True, max_length=384, return_tensors="pt")
119
  with torch.no_grad():
120
  logits = model(**enc).logits
121
  prob_tech = torch.softmax(logits, dim=-1)[0, 1].item()
122
  return prob_tech >= THRESHOLD
123
 
124
+ # Developer
125
+ print(is_tech_role("Backend Python Developer", "FastAPI, PostgreSQL, Docker, Kubernetes..."))
126
+
127
+ # Data Analyst
128
+ print(is_tech_role("Data Analyst", "SQL, Python, dashboards, product metrics, A/B tests..."))
129
+
130
+ # Business Analyst
131
+ print(is_tech_role("Бизнес аналитик", "Сбор требований, UML, BPMN, работа с командой разработки..."))
132
+
133
+ # Manager — should return False
134
+ print(is_tech_role("Project Manager", "Agile, управление командой, планирование спринтов..."))
135
  ```
136
 
137
  ## Architecture
 
146
  ## Training
147
 
148
  - Dataset: internal job-vacancy dataset (`vacancies_labeled.csv`), labeled by an LLM pipeline
149
+ - Train/test split: 85% / 15%, stratified by role and team_lead flag
150
+ - Loss: weighted cross-entropy (`pos_weight` = 2.115)
151
+ - Optimizer: AdamW, `lr=2e-5`, linear warmup 10%, grad clip 1.0
152
+ - Early stopping: patience=3 on F1 at target recall ≥ 0.95
153
+ - Threshold selected to achieve target recall = **0.95**
154
 
155
  ## Limitations
156
 
157
  - Trained primarily on Russian-language IT job vacancies; quality on other domains/languages is not guaranteed.
158
  - Team lead and management roles are treated as `other` by design.
159
+ - Description is truncated to 2000 characters before tokenization.
160
+ - The model groups developers, Data Analysts, and Business Analysts into one positive class; it does not distinguish between them.
161
+ - Data Analyst recall is ~0.92: vacancies with heavy business/finance framing may be missed.
162
 
163
  ## Version
164
 
165
+ Hub tag: `v2.0-dev-da-ba-r95`
166
+
167
+ **Changelog vs v1:**
168
+ - Added Business Analyst (`Бизнес аналитик`) to positive class
169
+ - Input context extended: `max_length` 256→384, description 1200→2000 chars
170
+ - Precision improved: 0.880 → 0.922
171
+ - `lr` lowered to 2e-5, batch size 32→24 to accommodate longer sequences
172
 
173
  ## License
174