File size: 1,801 Bytes
4ca6ea0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
language:
- de
base_model:
- agne/jobGBERT
pipeline_tag: text-classification
---
# CareerBERT Classifier

A text classification model fine-tuned for career-related text analysis.

## Installation

Install the required dependencies:

```bash
pip install transformers torch
```

## Quick Start

Load and use the model in a few lines:

```python
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from transformers import pipeline

modelpath = "lwolfrum2/careerbert-classifier"
model = AutoModelForSequenceClassification.from_pretrained(modelpath)
tokenizer = AutoTokenizer.from_pretrained(modelpath)
pipe = pipeline("text-classification", model, tokenizer=tokenizer)

# Classify text
result = pipe("Your text here")
print(result)
```

## Usage

### Simple Classification

```python
# Single example
text = "I am looking for a job in software development."
result = pipe(text)
print(result)
# Output: [{'label': 'career_query', 'score': 0.98}]
```

### Batch Processing

```python
texts = [
    "Software engineer with 5 years experience",
    "Just looking for a new job",
    "Tell me about this coffee",
]

results = pipe(texts)
for text, result in zip(texts, results):
    print(f"{text} → {result['label']} ({result['score']:.2f})")
```

## Output Format

Each prediction returns a dictionary with:
- `label`: The predicted class (0 = not relevant, 1 = relevant)
- `score`: Confidence score (0–1)

## Notes

- The model runs on CPU by default. For faster inference on large batches, use GPU:
  ```python
  pipe = pipeline("text-classification", model, tokenizer=tokenizer, device=0)
  ```
- Texts longer than the model's max token length will be truncated.

## Model Details

**Model**: lwolfrum2/careerbert-classifier  
**Base**: BERT  
**Task**: Text classification