# Retain metadata in output

**URL:** <https://support.prodi.gy/t/retain-metadata-in-output/7148>\
**Category:** Uncategorized\
**Tags:** usage\
**Created:** [March 11, 2024, 6:37pm UTC](https://support.prodi.gy/t/retain-metadata-in-output/7148 "2024-03-11T18:37:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cheyanneb](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/cheyanneb/32/2409_2.png) [@cheyanneb](https://support.prodi.gy/u/cheyanneb)\
**Post date:** [March 11, 2024, 6:37pm UTC](https://support.prodi.gy/t/retain-metadata-in-output/7148/1 "2024-03-11T18:37:54Z")

</div>

I often have additional metadata in my `.jsonl` files when I upload them to Prodigy. When I run `db-out`, the metadata is often missing. Examples: `unique_id`, etc. Is there a way to ensure that all metadata in the input file is retained in the output file?

---

<div class="post-metadata">

**Author:** ![india-kerle](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/india-kerle/32/4324_2.png) [@india-kerle](https://support.prodi.gy/u/india-kerle)\
**Post date:** [March 12, 2024, 11:24am UTC](https://support.prodi.gy/t/retain-metadata-in-output/7148/2 "2024-03-12T11:24:20Z")

</div>

Hey @cheyanneb !

I just played around with a dummy dataset that included metadata and was unable to replicate your error.

I used the following input data to label:

```python
{"text": "stroopwafels are great", "meta": {"unique_id": 1, "date": "12-03"}}
{"text": "apples are healthy", "meta": {"unique_id": 2, "date": "12-03"}}
{"text": "I love medialunas", "meta": {"unique_id": 3, "date": "12-03"}}

```

quickly labelled it with:

```python
prodigy textcat.manual test_db ./data/raw/examples.jsonl --label POS,NEG

```

and gave it a save:

```python
prodigy db-out test_db > ./data/labelled/labelled_examples.jsonl

```

when I inspected the output, the metadata associated to each task was indeed present in the `.jsonl` file:

```python
{"text":"stroopwafels are great","meta":{"unique_id":1,"date":"12-03"},"_input_hash":506862616,"_task_hash":-871522844,"options":[{"id":"POS","text":"POS"},{"id":"NEG","text":"NEG"}],"_view_id":"choice","config":{"choice_style":"multiple"},"accept":["POS"],"answer":"accept","_timestamp":1710242248,"_annotator_id":"2024-03-12_08-17-20","_session_id":"2024-03-12_08-17-20"}
{"text":"apples are healthy","meta":{"unique_id":2,"date":"12-03"},"_input_hash":111541500,"_task_hash":1919756499,"options":[{"id":"POS","text":"POS"},{"id":"NEG","text":"NEG"}],"_view_id":"choice","accept":["POS"],"config":{"choice_style":"multiple"},"answer":"accept","_timestamp":1710242251,"_annotator_id":"2024-03-12_08-17-20","_session_id":"2024-03-12_08-17-20"}
{"text":"I love medialunas","meta":{"unique_id":3,"date":"12-03"},"_input_hash":1251118931,"_task_hash":599886080,"options":[{"id":"POS","text":"POS"},{"id":"NEG","text":"NEG"}],"_view_id":"choice","accept":["POS"],"config":{"choice_style":"multiple"},"answer":"accept","_timestamp":1710242254,"_annotator_id":"2024-03-12_08-17-20","_session_id":"2024-03-12_08-17-20"}

```

Are you labelling pipelines highly custom? i.e. do you have any custom post-processing steps of the labelled data that might be dropping the metadata?

Hopefully we can get to the bottom of this!
