> For the complete documentation index, see [llms.txt](https://utca.knowledgator.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://utca.knowledgator.com/predictors/glinerpredictor.md).

# GLiNERPredictor

GLiNER predictor

This predictor is specifically build to use GLiNER approach. See more:&#x20;

{% embed url="<https://github.com/urchade/GLiNER>" %}

Subclass of [**Predictor**](/predictors/predictor.md)**.**

## Module: [implementation](/framework-structure.md#implementation).predictors

## Methods and properties

Main methods and properties

***

### <mark style="color:blue;">\_\_init\_\_</mark>

#### Arguments:

* <mark style="color:orange;">**cfg**</mark>**&#x20;(**[**GLiNERPredictorConfig**](#glinerpredictorconfig)**, optional):** Configuration for predictor. If value equals to None, default **GLiNERPredictorConfig** configuration will be used. Defaults to None.
* <mark style="color:orange;">**input\_class**</mark>**&#x20;(Type\[**[**Input**](/core/schemas.md#input)**], optional):** Class for input validation. Defaults to [**GLiNERPredictorInput**](#glinerpredictorinput).
* <mark style="color:orange;">**output\_class**</mark>**&#x20;(Type\[**[**Output**](/core/schemas.md#output)**], optional):** Class for output validation. Defaults to [**GLiNERPredictorOutput**](#glinerpredictoroutput)**.**
* <mark style="color:orange;">**name**</mark>**&#x20;(Optional\[str], optional):** Name for identification. If equals to None, class name will be used. Defaults to None.

***

***

***

## <mark style="color:green;">GLiNERPredictorConfig</mark>

Prebuild configuration that describes default parameters for GLiNER models pipeline. Subclass of [**Config**](/core/schemas.md#config).

***

### <mark style="color:blue;">\_\_init\_\_</mark>

#### Arguments:

* <mark style="color:orange;">**model\_name**</mark> **(str, optional):** Model to use. Defaults to **"urchade/gliner\_small-v2.1"**.
* <mark style="color:orange;">**device**</mark>**&#x20;(str):** Defaults to **"cpu"**.

***

***

***

## <mark style="color:green;">GLiNERPredictorInput</mark>

Subclass of[ **IOModel**](/core/schemas.md#iomodel).

***

### <mark style="color:blue;">\_\_init\_\_</mark>

#### Arguments:

* <mark style="color:orange;">**texts**</mark>**&#x20;(List\[str])**
* <mark style="color:orange;">**labels**</mark>**&#x20;(List\[str])**
* <mark style="color:orange;">**threshold**</mark>**&#x20;(float, optional):** Defaults to 0.5. &#x20;

***

***

***

## <mark style="color:green;">GLiNERPredictorOutput</mark>

Subclass of[ **IOModel**](/core/schemas.md#iomodel).

***

### <mark style="color:blue;">\_\_init\_\_</mark>

#### Arguments:

* <mark style="color:orange;">**output**</mark>**&#x20;(List\[List\[Dict\[str, Any]]]):** Entities of corresponding inputs.

***

***
