# Multilabel text classification

**URL:** <https://support.prodi.gy/t/multilabel-text-classification/5247>\
**Category:** Uncategorized\
**Tags:** usage, textcat\
**Created:** [January 28, 2022, 6:48am UTC](https://support.prodi.gy/t/multilabel-text-classification/5247 "2022-01-28T06:48:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lingo](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/lingo/32/2753_2.png) [@Lingo](https://support.prodi.gy/u/Lingo)\
**Post date:** [January 28, 2022, 6:48am UTC](https://support.prodi.gy/t/multilabel-text-classification/5247/1 "2022-01-28T06:48:32Z")

</div>

Hi,  
I am new to Prodigy, and try to load in a dataset with multiple and exclusive labels. The json file with two data look like this:  
_[_  
_{"text": "This is about robot science", "label": "TECHNOLOGY"},_  
_{"text": "This is about money","label": "ECONOMY"}_  
_]_

The data is imported as follows:  
_prodigy db-in data\_minimal data.json_

Then I start Prodigy with the following command:  
_prodigy textcat.manual data\_minimal data.json --label TECHNOLOGY,ECONOMY_

But I only get one label that consist of both labels merged:

![image](https://us1.discourse-cdn.com/flex020/uploads/prodigy/original/2X/0/0c29ff1aec51dbd079b71bff04a5cec0233f9995.png)

What I really want to do is to train a bert model for email categorization and then use Prodigy to manually control emails that are wrongly classified.  
Is there a basic tutorial except for the support sites? I couldn't find anything really basic about how to get started on Youtube.  
Thanks  
Anders

---

<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:** [January 28, 2022, 10:09am UTC](https://support.prodi.gy/t/multilabel-text-classification/5247/2 "2022-01-28T10:09:08Z")

</div>

Hi! Are you using Windows PowerShell by any chance? It seems to have this quirk that needs you to add strings explicitly in quotes, so try `--label "TECHNOLOGY,ECONOMY"` instead.

> [@Lingo](#):
>
> The data is imported as follows:  
> _prodigy db-in data\_minimal data.json_

Btw, you shouldn't have to export anything into your dataset before you start annotating – the data will be read in automatically from the file when you start the server. The dataset is intended for the collected annotations, not the raw data. If you import raw data, you end up with unannotated examples in your dataset, which is typically not what you want.

---

<div class="post-metadata">

**Author:** ![Lingo](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/lingo/32/2753_2.png) [@Lingo](https://support.prodi.gy/u/Lingo)\
**Post date:** [January 28, 2022, 12:34pm UTC](https://support.prodi.gy/t/multilabel-text-classification/5247/3 "2022-01-28T12:34:03Z")

</div>

Thanks a lot for rapid and concise answer! Using quotes solved my first problem. If I understand you correctly, you recommend me to start the annotation session with the following command:

_prodigy textcat.manual **-** data.json --label "TECHNOLOGY,ECONOMY"_

Will Prodigy still save the annotated data in "data\_minimal" then? Or where else will it be stored?  
Anders

---

<div class="post-metadata">

**Author:** ![nix411](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/nix411/32/2982_2.png) [@nix411](https://support.prodi.gy/u/nix411)\
**Post date:** [January 28, 2022, 1:18pm UTC](https://support.prodi.gy/t/multilabel-text-classification/5247/4 "2022-01-28T13:18:04Z")

</div>

> [@Lingo](#):
>
> Will Prodigy still save the annotated data in "data\_minimal" then? Or where else will it be stored?

I can answer that. It'll save it to your database directly (into the dataset you expressed). See details [here](https://prodi.gy/docs/recipes#textcat-manual). So it would look something like this

```python
prodigy textcat.manual email-labels ./data.json --label "TECHNOLOGY,ECONOMY"

```

assuming you have `data.json` looking something like this

```json
[{"text": "some text"}, {"text": "some other text"}]

```

The above command would save your annotations into a dataset called `email-labels`

---

<div class="post-metadata">

**Author:** ![Lingo](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/lingo/32/2753_2.png) [@Lingo](https://support.prodi.gy/u/Lingo)\
**Post date:** [January 28, 2022, 2:04pm UTC](https://support.prodi.gy/t/multilabel-text-classification/5247/5 "2022-01-28T14:04:42Z")

</div>

Thanks a lot! It takes some time to get used to the syntax here, but this brought me a long way further.
