lwolfrum2's picture
Create README.md
4ca6ea0 verified
|
Raw
History Blame
1.8 kB
---
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