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 utca2. 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:
TokenSearcherNER4. Create ExecutionSchema
Here we described pipeline that will:
Add labels to input data with values ["scientist", "university", "city"]
Execute NER task
Remove labels from results
Rename output to entities
5. Run created pipeline
Here, we run pupline with input text.
Result should look similar to:
Used components
TokenSearcherPredictorTokenSearcherNERAddDataFlushRenameAttributeExecutionSchemaWhat next
Explore more about components and concepts on the following pages, or jump to class descriptions and more advanced examples.
ConceptsExamplesLast updated