# GLiNERPredictor

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

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

Subclass of [**Predictor**](https://utca.knowledgator.com/predictors/predictor)**.**

## Module: [implementation](https://utca.knowledgator.com/framework-structure#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**](https://utca.knowledgator.com/core/schemas#input)**], optional):** Class for input validation. Defaults to [**GLiNERPredictorInput**](#glinerpredictorinput).
* <mark style="color:orange;">**output\_class**</mark>**&#x20;(Type\[**[**Output**](https://utca.knowledgator.com/core/schemas#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**](https://utca.knowledgator.com/core/schemas#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**](https://utca.knowledgator.com/core/schemas#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**](https://utca.knowledgator.com/core/schemas#iomodel).

***

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

#### Arguments:

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

***

***
