# Training on part of the custom annotations

**URL:** <https://support.prodi.gy/t/training-on-part-of-the-custom-annotations/4822>\
**Category:** Uncategorized\
**Tags:** usage, ner, database\
**Created:** [October 19, 2021, 8:09am UTC](https://support.prodi.gy/t/training-on-part-of-the-custom-annotations/4822 "2021-10-19T08:09:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [October 20, 2021, 8:08am UTC](https://support.prodi.gy/t/training-on-part-of-the-custom-annotations/4822/2 "2021-10-20T08:08:04Z")

</div>

Hi! If you've annotated all labels in one dataset, one option would be to separate them into multiple sets (e.g. one per label, or one for the label you're most interested in) by connecting to the database [in Python](https://prodi.gy/docs/api-database#database):

```python
from prodigy.components.db import connect

db = connect()
examples = db.get_dataset("your_dataset_with_all_labels")
new_examples = []
for eg in examples:
    spans = [span for span in eg.get("spans", []) if span["label"] == "EDUCATION"]
    eg["spans"] = spans
    new_examples.append(eg)

db.add_dataset("your_dataset_education")
db.add_examples(new_examples, ["your_dataset_education"])

```

You now have one dataset with only the spans you labelled as `EDUCATION` and you'll be able to run experiments with it separately.

---

_[View the full topic](https://support.prodi.gy/t/training-on-part-of-the-custom-annotations/4822)._
