# Combining two separate datasets into a single trained model

**URL:** <https://support.prodi.gy/t/combining-two-separate-datasets-into-a-single-trained-model/6965>\
**Category:** Uncategorized\
**Tags:** ner\
**Created:** [December 6, 2023, 6:39am UTC](https://support.prodi.gy/t/combining-two-separate-datasets-into-a-single-trained-model/6965 "2023-12-06T06:39:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mv3](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/mv3/32/4254_2.png) [@mv3](https://support.prodi.gy/u/mv3)\
**Post date:** [December 6, 2023, 6:39am UTC](https://support.prodi.gy/t/combining-two-separate-datasets-into-a-single-trained-model/6965/1 "2023-12-06T06:39:12Z")

</div>

Hi, I've been able to create two datasets, let's call these **a** (entity label: A) and **b** (entity label: B). Tried but I only get one label annotated:

```python
python -m prodigy train \
--ner a,b \
./output/c \
--label-stats

============================= Training pipeline =============================
Components: ner
Merging training and evaluation data for 1 components
  - [ner] Training: 1738 | Evaluation: 438 (20% split)
Training: 907 | Evaluation: 226
Labels: ner (2)
ℹ Pipeline: ['tok2vec', 'ner']
...
✔ Saved pipeline to output directory
output/c/model-last

=============================== NER (per type) ===============================

           P R F
A 94.56 95.36 94.96
B 0.0 0.0 0.0

```

I tried combining the two datasets first via `python -m prodigy db-merge a,b c` then training via

```python
python -m prodigy train \
--ner c \
./output/c \
--label-stats

```

But still only getting a single label. Inspecting the .jsonl file of the merged dataset `c` reveals annotations of both labels `a` and `b`.

Appreciate pointers towards the right direction. Thanks!

---

<div class="post-metadata">

**Author:** ![koaning](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/koaning/32/230_2.png) [@koaning](https://support.prodi.gy/u/koaning)\
**Post date:** [December 6, 2023, 9:39am UTC](https://support.prodi.gy/t/combining-two-separate-datasets-into-a-single-trained-model/6965/2 "2023-12-06T09:39:54Z")

</div>

Hi there!

I believe this is the same issue as described here:

> [@data-to-spacy losing annotations](https://support.prodi.gy/t/data-to-spacy-losing-annotations/6864/6):
>
> Let me try something else then. First, I'll try to recreate your situation by annotating this data. {"text": "hello my name is james"} {"text": "hello my name is john"} {"text": "hello my name is robert"} {"text": "hello my name is michael"} {"text": "hello my name is william"} {"text": "hello my name is mary"} {"text": "hello my name is david"} {"text": "hello my name is richard"} {"text": "hello my name is joseph"} I'm doing these two recipe calls to generate two datasets. One with names, th…

The thread also has a solution. Let me know if that doesn't apply to your situation though!

---

<div class="post-metadata">

**Author:** ![mv3](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/mv3/32/4254_2.png) [@mv3](https://support.prodi.gy/u/mv3)\
**Post date:** [December 6, 2023, 5:24pm UTC](https://support.prodi.gy/t/combining-two-separate-datasets-into-a-single-trained-model/6965/3 "2023-12-06T17:24:53Z")

</div>

Thanks for the quick revert. Yes, the (interim?) solution applies!
