Text Classification
Transformers
Safetensors
Russian
English
bert
tiny-bert
rubert-tiny2
binary-classification
jobs
developer-classification
data-analyst-classification
business-analyst-classification
dev-plus-da-plus-ba
r95
v2
Eval Results (legacy)
text-embeddings-inference
Instructions to use AndreiTolmachev/dev_da_roles_1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AndreiTolmachev/dev_da_roles_1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="AndreiTolmachev/dev_da_roles_1")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("AndreiTolmachev/dev_da_roles_1") model = AutoModelForSequenceClassification.from_pretrained("AndreiTolmachev/dev_da_roles_1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload dev+data-analyst r95 tiny BERT model
Browse files- README.md +145 -0
- config.json +39 -0
- meta.json +29 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +24 -0
README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- ru
|
| 4 |
+
- en
|
| 5 |
+
license: mit
|
| 6 |
+
library_name: transformers
|
| 7 |
+
pipeline_tag: text-classification
|
| 8 |
+
tags:
|
| 9 |
+
- text-classification
|
| 10 |
+
- bert
|
| 11 |
+
- tiny-bert
|
| 12 |
+
- rubert-tiny2
|
| 13 |
+
- binary-classification
|
| 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
|
| 23 |
+
- recall
|
| 24 |
+
- roc_auc
|
| 25 |
+
model-index:
|
| 26 |
+
- name: dev_da_roles_1
|
| 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:
|
| 49 |
+
|
| 50 |
+
> `role_category in TECH_CLASSES AND team_lead == 0`
|
| 51 |
+
|
| 52 |
+
`TECH_CLASSES`:
|
| 53 |
+
|
| 54 |
+
- Backend
|
| 55 |
+
- Desktop / Systems
|
| 56 |
+
- Embedded
|
| 57 |
+
- Frontend
|
| 58 |
+
- Fullstack
|
| 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 |
+
|
| 65 |
+
## Labels
|
| 66 |
+
|
| 67 |
+
| id | label |
|
| 68 |
+
|----|-------|
|
| 69 |
+
| 0 | other |
|
| 70 |
+
| 1 | tech |
|
| 71 |
+
|
| 72 |
+
## Validation Metrics
|
| 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 |
+
|
| 92 |
+
```python
|
| 93 |
+
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
|
| 117 |
+
|
| 118 |
+
- Model: `BertForSequenceClassification`
|
| 119 |
+
- Base model: `cointegrated/rubert-tiny2`
|
| 120 |
+
- Layers: 3, hidden size: 312, attention heads: 12
|
| 121 |
+
- Vocab size: 83,828
|
| 122 |
+
- Parameters: ~29M
|
| 123 |
+
- `max_position_embeddings`: 2048
|
| 124 |
+
|
| 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 |
+
|
| 145 |
+
MIT.
|
config.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_cross_attention": false,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"BertForSequenceClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": null,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"emb_size": 312,
|
| 11 |
+
"eos_token_id": null,
|
| 12 |
+
"gradient_checkpointing": false,
|
| 13 |
+
"hidden_act": "gelu",
|
| 14 |
+
"hidden_dropout_prob": 0.1,
|
| 15 |
+
"hidden_size": 312,
|
| 16 |
+
"id2label": {
|
| 17 |
+
"0": "other",
|
| 18 |
+
"1": "tech"
|
| 19 |
+
},
|
| 20 |
+
"initializer_range": 0.02,
|
| 21 |
+
"intermediate_size": 600,
|
| 22 |
+
"is_decoder": false,
|
| 23 |
+
"label2id": {
|
| 24 |
+
"other": 0,
|
| 25 |
+
"tech": 1
|
| 26 |
+
},
|
| 27 |
+
"layer_norm_eps": 1e-12,
|
| 28 |
+
"max_position_embeddings": 2048,
|
| 29 |
+
"model_type": "bert",
|
| 30 |
+
"num_attention_heads": 12,
|
| 31 |
+
"num_hidden_layers": 3,
|
| 32 |
+
"pad_token_id": 0,
|
| 33 |
+
"position_embedding_type": "absolute",
|
| 34 |
+
"tie_word_embeddings": true,
|
| 35 |
+
"transformers_version": "5.7.0",
|
| 36 |
+
"type_vocab_size": 2,
|
| 37 |
+
"use_cache": true,
|
| 38 |
+
"vocab_size": 83828
|
| 39 |
+
}
|
meta.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"task": "dev_da_vs_other_binary",
|
| 3 |
+
"positive_definition": "role_category in TECH_CLASSES AND team_lead==0",
|
| 4 |
+
"tech_classes": [
|
| 5 |
+
"Backend",
|
| 6 |
+
"Data Analyst",
|
| 7 |
+
"Desktop / Systems",
|
| 8 |
+
"Embedded",
|
| 9 |
+
"Frontend",
|
| 10 |
+
"Fullstack",
|
| 11 |
+
"ML / AI / Data Scientist",
|
| 12 |
+
"Mobile"
|
| 13 |
+
],
|
| 14 |
+
"labels": [
|
| 15 |
+
"other",
|
| 16 |
+
"tech"
|
| 17 |
+
],
|
| 18 |
+
"max_len": 256,
|
| 19 |
+
"description_chars": 1200,
|
| 20 |
+
"base_model": "cointegrated/rubert-tiny2",
|
| 21 |
+
"trained_on": "vacancies_labeled.csv",
|
| 22 |
+
"best_epoch": 8,
|
| 23 |
+
"best_threshold": 0.37654510140419006,
|
| 24 |
+
"best_precision_at_threshold": 0.8796791443850267,
|
| 25 |
+
"best_recall_at_threshold": 0.9508670520231214,
|
| 26 |
+
"best_roc_auc": 0.9790331422674761,
|
| 27 |
+
"target_recall": 0.95,
|
| 28 |
+
"pos_weight": 2.481304126337239
|
| 29 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9d3eff74a0776fad17bbff6f6ac030ca9f884bb5e795fc7f1387f76bc2e815eb
|
| 3 |
+
size 116784136
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"cls_token": "[CLS]",
|
| 4 |
+
"do_basic_tokenize": true,
|
| 5 |
+
"do_lower_case": false,
|
| 6 |
+
"is_local": false,
|
| 7 |
+
"local_files_only": false,
|
| 8 |
+
"mask_token": "[MASK]",
|
| 9 |
+
"max_length": 512,
|
| 10 |
+
"model_max_length": 2048,
|
| 11 |
+
"never_split": null,
|
| 12 |
+
"pad_to_multiple_of": null,
|
| 13 |
+
"pad_token": "[PAD]",
|
| 14 |
+
"pad_token_type_id": 0,
|
| 15 |
+
"padding_side": "right",
|
| 16 |
+
"sep_token": "[SEP]",
|
| 17 |
+
"stride": 0,
|
| 18 |
+
"strip_accents": null,
|
| 19 |
+
"tokenize_chinese_chars": true,
|
| 20 |
+
"tokenizer_class": "BertTokenizer",
|
| 21 |
+
"truncation_side": "right",
|
| 22 |
+
"truncation_strategy": "longest_first",
|
| 23 |
+
"unk_token": "[UNK]"
|
| 24 |
+
}
|