> For the complete documentation index, see [llms.txt](https://docs.tabiya.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tabiya.org/tabiya-documentation/deutsch/unser-tech-stack/livelihoods-classifier/training.md).

# Schulung

Trainieren Sie Ihr Modell zur Entitätsextraktion mit PyTorch.

Aktivieren Sie zuerst die virtuelle Umgebung wie erklärt [hier](/tabiya-documentation/deutsch/unser-tech-stack/livelihoods-classifier/getting-started.md#dep).

### Trainieren eines Modells zur Entitätsextraktion

Konfigurieren Sie die notwendigen Hyperparameter in der config.json-Datei. Die Standardwerte sind:

```json
{
    "model_name": "bert-base-cased",
    "crf": false,
    "dataset_path": "tabiya/job_ner_dataset",   
    "label_list": ["O", "B-Skill", "B-Qualification", "I-Domain", "I-Experience", "I-Qualification", "B-Occupation", "B-Domain", "I-Occupation", "I-Skill", "B-Experience"],
    "model_max_length": 128,
    "batch_size": 32,
    "learning_rate": 1e-4,
    "epochs": 4,
    "weight_decay": 0.01,
    "save": false,
    "output_path": "bert_job_ner"
}
```

Um das Modell zu trainieren, führen Sie das folgende Script im `train` Verzeichnis aus:

```sh
python train.py
```

Das Trainingsskript basiert auf dem [official HuggingFace token classification tutorial](https://huggingface.co/docs/transformers/en/tasks/token_classification).

### Trainieren eines Modells zur Entitätsähnlichkeit

Konfigurieren Sie die notwendigen Hyperparameter in der `sbert_train` Funktion in der Datei sbert\_train.py:

```python
sbert_train(model_id='all-MiniLM-L6-v2', dataset_path='your/dataset/path', output_path='your/output/path')
```

Um das Ähnlichkeitsmodell zu trainieren, führen Sie das folgende Script im `train` Verzeichnis aus:

```sh
python sbert_train.py
```

Der Datensatz sollte als CSV-Datei mit zwei Spalten formatiert sein, wie z. B. 'title' und 'esco\_label', wobei jede Zeile ein Paar zusammenhängender Textdaten enthält, die während des Trainings verwendet werden sollen. Stellen Sie sicher, dass in Ihrem Datensatz keine fehlenden Werte vorhanden sind, um ein erfolgreiches Training des Modells zu gewährleisten. Hier ein Beispiel, wie Ihre CSV-Datei aussehen könnte:

| Titel                   | esco\_label                           |
| ----------------------- | ------------------------------------- |
| Senior Conflict Manager | Leiter einer öffentlichen Einrichtung |
| usw                     | usw                                   |

Weitere Informationen finden Sie [hier](/tabiya-documentation/deutsch/unser-tech-stack/livelihoods-classifier/datasets.md#entity-similarity).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tabiya.org/tabiya-documentation/deutsch/unser-tech-stack/livelihoods-classifier/training.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
