Quickstart

For this example will be used simple ExecutionSchema with TokenSearcherNER task. This program will extract entities with provided labels and threshold.

To create program follow this steps:

1. Install package

pip install -U utca

2. Import modules that will be used

from utca.core import (
    AddData,
    RenameAttribute,
    Flush
)
from utca.implementation.predictors import (
    TokenSearcherPredictor, TokenSearcherPredictorConfig
)
from utca.implementation.tasks import (
    TokenSearcherNER,
    TokenSearcherNERPostprocessor,
)

3. Initialize components with desired configurations

Predictor that will be used by NER task

NER task

Here, we set up a task using the created predictor and define a postprocess chain with a predefined threshold.

Alternatively, we can create an NER task without describing the configuration or predictor by simply:

It will create a default task, which differs from the one described above only by the threshold value, which defaults to 0.

To learn more about default parameters, refer to:

TokenSearcherNER

4. Create ExecutionSchema

Here we described pipeline that will:

  1. Add labels to input data with values ["scientist", "university", "city"]

  2. Execute NER task

  3. Remove labels from results

  4. Rename output to entities

5. Run created pipeline

Here, we run pupline with input text.

Note that text and labels keys are expected by TokenSearcherNER task described above. Refer to class description in Used components section.

Result should look similar to:

Used components

TokenSearcherPredictorTokenSearcherNERAddDataFlushRenameAttributeExecutionSchema

What next

Explore more about components and concepts on the following pages, or jump to class descriptions and more advanced examples.

ConceptsExamples

Last updated