> 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-technologie-stack/livelihoods-classifier/training.md).

# Schulung

Trainieren Sie Ihr Modell zur Entitätsextraktion mit PyTorch.

Aktivieren Sie zunächst die virtuelle Umgebung wie erläutert [hier](/tabiya-documentation/deutsch/unser-technologie-stack/livelihoods-classifier/getting-started.md#dep).

### Trainieren Sie ein Modell zur Entitätsextraktion

Konfigurieren Sie die erforderlichen Hyperparameter in der Datei config.json. 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 Skript im `train` Verzeichnis aus:

```sh
python train.py
```

Das Trainingsskript basiert auf dem [offiziellen HuggingFace-Tutorial zur Token-Klassifikation](https://huggingface.co/docs/transformers/en/tasks/token_classification).

### Trainieren Sie ein Modell zur Entitätsähnlichkeit

Konfigurieren Sie die erforderlichen 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 Skript im `train` Verzeichnis aus:

```sh
python sbert_train.py
```

Das Dataset sollte als CSV-Datei mit zwei Spalten formatiert sein, etwa 'title' und 'esco\_label', wobei jede Zeile ein Paar verwandter Textdatenpunkte enthält, die während des Trainingsprozesses verwendet werden. Stellen Sie sicher, dass in Ihrem Dataset keine fehlenden Werte vorhanden sind, um ein erfolgreiches Training des Modells zu gewährleisten. Hier ist ein Beispiel, wie Ihre CSV-Datei aussehen könnte:

| Titel                     | esco\_label                             |
| ------------------------- | --------------------------------------- |
| Leitender Konfliktmanager | Direktor einer öffentlichen Einrichtung |
| usw.                      | usw.                                    |

Weitere Informationen finden Sie [hier](/tabiya-documentation/deutsch/unser-technologie-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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
