# Get all labels / entity groups available to a model

**URL:** <https://discuss.huggingface.co/t/get-all-labels-entity-groups-available-to-a-model/40144>\
**Category:** 🤗Transformers\
**Created:** [May 17, 2023, 8:39am UTC](https://discuss.huggingface.co/t/get-all-labels-entity-groups-available-to-a-model/40144 "2023-05-17T08:39:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeril](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jeril](https://discuss.huggingface.co/u/jeril)\
**Post date:** [May 17, 2023, 8:39am UTC](https://discuss.huggingface.co/t/get-all-labels-entity-groups-available-to-a-model/40144/1 "2023-05-17T08:39:33Z")

</div>

I have the following code to get the named entity values from a given text:

```auto
from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline

tokenizer = AutoTokenizer.from_pretrained("Davlan/distilbert-base-multilingual-cased-ner-hrl")
model = AutoModelForTokenClassification.from_pretrained("Davlan/distilbert-base-multilingual-cased-ner-hrl")
nlp = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="max")

example = "My name is Johnathan Smith and I work at Apple"
ner_results = nlp(example)
print(ner_results)

```

The following is the output:

```auto
[{'end': 26,
  'entity_group': 'PER',
  'score': 0.9994689,
  'start': 11,
  'word': 'Johnathan Smith'},
 {'end': 46,
  'entity_group': 'ORG',
  'score': 0.9983876,
  'start': 41,
  'word': 'Apple'}]

```

In the above example the labels / entitiy groups are `ORG` and `PER`. How to find all the labels / entitiy groups available?  
Kindly advise.

---

<div class="post-metadata">

**Author:** ![jmtk](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/jmtk/32/21722_2.png) [@jmtk](https://discuss.huggingface.co/u/jmtk)\
**Post date:** [November 30, 2023, 1:20pm UTC](https://discuss.huggingface.co/t/get-all-labels-entity-groups-available-to-a-model/40144/2 "2023-11-30T13:20:29Z")

</div>

I found this which was semi-helpful although there’s not really a great explanation for them. This was in the config.json in the root of the model files

> **[config.json · dslim/bert-base-NER-uncased at main](https://huggingface.co/dslim/bert-base-NER-uncased/blob/main/config.json)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.
