<!-- Source: https://docs.squirro.com/en/latest/api/squirro.lib.nlp.steps.analyzers.ProximityValidation.html -->
# ProximityValidation

**`class ProximityValidation(config)`**

Bases: [`Analyzer`](squirro.lib.nlp.steps.analyzers.Analyzer.md#squirro.lib.nlp.steps.analyzers.Analyzer)

The proximity validation [`Analyzer`](squirro.lib.nlp.steps.analyzers.Analyzer.md#squirro.lib.nlp.steps.analyzers.Analyzer) creates the necessary files for the metrics and confusion matrix in the AI Studio Validation screens.

**Intput** - the content of the label_field and the tag_field field needs to be of type [`list`](https://docs.python.org/3.11/library/stdtypes.html#list) [ [`list`](https://docs.python.org/3.11/library/stdtypes.html#list) [ [`str`](https://docs.python.org/3.11/library/stdtypes.html#str) ] ]. Only the 1st element of the 2nd level list is incorporated. In addition, the 1st level lists of both fields needs to be of same length.

**Output** - there is no output field, the validation info is stored in the kfold_validation.json file.

Parameters

- `type` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – proximity_validation
- `input_field` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``None`) – 

  Field to use as original text

  Deprecated since version 3.6.3.
- `input_fields` ([`list`](https://docs.python.org/3.11/library/stdtypes.html#list)`, ``None`) – 

  List of fields to use as original text

  Deprecated since version 3.6.3.
- `not_class` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``None`) – This class includes all neg/opposite elements,
  which do not belong to any other class

**Example**

```json
{
    "step": "analyzer",
    "type": "proximity_validation",
    "label_field": "label",
    "tag_field": "prediction"
}
```

Methods SummaryMethods Documentation

**`process(docs)`**

Process a set of documents

Parameters

`docs` (`generator``(`[`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)`)`) – Generator of documents

Returns

Analysis

Return type

[dict](https://docs.python.org/3.11/library/stdtypes.html#dict)

**`train(docs)`**

Train on a step of a set of documents

Parameters

`docs` (`generator``(`[`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)`)`) – Generator of documents

Returns

Generator of processed documents

Return type

generator([Document](../technical/libnlp/base.md#squirro.lib.nlp.document.Document))
