MLNerMixin#

class MLNerMixin#

Bases: object

Mixin for interacting with NER groundtruths, categories, labels, and models.

Methods Summary

create_ner_category(project_id, ...)

Create a new category.

create_ner_fastpass(project_id, ...)

Create or overwrite (upsert) the FastPass settings.

create_ner_groundtruth(project_id, ...)

Create a new groundtruth.

create_ner_item_label(project_id, ...)

Create a new label for a groundtruth item.

create_ner_label(project_id, groundtruth_id, ...)

Create a new label.

create_ner_publish(project_id, ...)

Create and publish a new NER model.

create_ner_validation(project_id, ...)

Create a new NER validation.

delete_ner_category(project_id, ...)

Delete a category.

delete_ner_fastpass(project_id, groundtruth_id)

Soft-delete the FastPass (set active = False).

delete_ner_groundtruth(project_id, ...)

Delete a groundtruth.

delete_ner_item_label(project_id, ...)

Delete a specific label from a groundtruth item.

delete_ner_label(project_id, groundtruth_id, ...)

Delete a label.

delete_ner_publish(project_id, ...)

Delete a published NER model.

get_groundtruths_ner(project_id)

Return all ground truth for a project in a list.

get_ner_categories(project_id, groundtruth_id)

List all categories under a groundtruth.

get_ner_category(project_id, groundtruth_id, ...)

Retrieve a single category.

get_ner_fastpass(project_id, groundtruth_id)

Retrieve the active FastPass settings for this project/groundtruth.

get_ner_fastpass_labels(project_id, ...[, ...])

Run FastPass inference on a single item.

get_ner_fastpass_models(project_id, ...)

List all FastPass templates available for NER.

get_ner_groundtruth(project_id, groundtruth_id)

Retrieve a single groundtruth by ID.

get_ner_groundtruths(project_id)

List all groundtruths for a project.

get_ner_item_label(project_id, ...)

Get all labels for a specific item.

get_ner_item_labels(project_id, groundtruth_id)

List all item labels for a groundtruth, with optional filters.

get_ner_label(project_id, groundtruth_id, ...)

Retrieve a single label.

get_ner_labels(project_id, groundtruth_id, ...)

List all labels for a category.

get_ner_models(project_id)

List all available NER models.

get_ner_publishes(project_id, groundtruth_id)

List all published NER models for a groundtruth.

get_ner_validation(project_id, ...)

Retrieve a specific NER validation by ID.

get_ner_validation_set(project_id, ...[, params])

Get the validation set for a groundtruth.

get_ner_validations(project_id, groundtruth_id)

List all NER validations for a groundtruth.

update_ner_category(project_id, ...)

Update an existing category.

update_ner_fastpass(project_id, ...)

Toggle only the active flag on the FastPass.

update_ner_fastpass_suggestion(project_id, ...)

Process (update) a single FastPass suggestion by its ID.

update_ner_groundtruth(project_id, ...)

Update an existing groundtruth.

update_ner_item_label(project_id, ...)

Update a label on a groundtruth item.

update_ner_label(project_id, groundtruth_id, ...)

Update an existing label.

Methods Documentation

create_ner_category(project_id, groundtruth_id, category_data)#

Create a new category.

create_ner_fastpass(project_id, groundtruth_id, fastpass_data)#

Create or overwrite (upsert) the FastPass settings.

create_ner_groundtruth(project_id, groundtruth_data)#

Create a new groundtruth.

create_ner_item_label(project_id, groundtruth_id, item_id, label_data)#

Create a new label for a groundtruth item.

create_ner_label(project_id, groundtruth_id, category_id, label_data)#

Create a new label.

create_ner_publish(project_id, groundtruth_id, publish_data)#

Create and publish a new NER model.

create_ner_validation(project_id, groundtruth_id, validation_data)#

Create a new NER validation.

delete_ner_category(project_id, groundtruth_id, category_id)#

Delete a category.

delete_ner_fastpass(project_id, groundtruth_id)#

Soft-delete the FastPass (set active = False).

delete_ner_groundtruth(project_id, groundtruth_id)#

Delete a groundtruth.

delete_ner_item_label(project_id, groundtruth_id, item_id, item_label_id)#

Delete a specific label from a groundtruth item.

delete_ner_label(project_id, groundtruth_id, category_id, label_id)#

Delete a label.

delete_ner_publish(project_id, groundtruth_id, publish_id)#

Delete a published NER model.

get_groundtruths_ner(project_id)#

Return all ground truth for a project in a list.

Parameters:

project_id – Id of the Squirro project.

get_ner_categories(project_id, groundtruth_id)#

List all categories under a groundtruth.

get_ner_category(project_id, groundtruth_id, category_id)#

Retrieve a single category.

get_ner_fastpass(project_id, groundtruth_id)#

Retrieve the active FastPass settings for this project/groundtruth.

get_ner_fastpass_labels(project_id, groundtruth_id, item_id, label_mapping=None, config_model=None)#

Run FastPass inference on a single item. Optional query parameters (e.g. label_mapping, config_model) will be forwarded.

get_ner_fastpass_models(project_id, groundtruth_id)#

List all FastPass templates available for NER.

get_ner_groundtruth(project_id, groundtruth_id)#

Retrieve a single groundtruth by ID.

get_ner_groundtruths(project_id)#

List all groundtruths for a project.

get_ner_item_label(project_id, groundtruth_id, item_id)#

Get all labels for a specific item.

get_ner_item_labels(project_id, groundtruth_id, user_id=None, labelled_filter=None, label_id=None, query=None, count=None, start=None)#

List all item labels for a groundtruth, with optional filters.

get_ner_label(project_id, groundtruth_id, category_id, label_id)#

Retrieve a single label.

get_ner_labels(project_id, groundtruth_id, category_id)#

List all labels for a category.

get_ner_models(project_id)#

List all available NER models.

get_ner_publishes(project_id, groundtruth_id)#

List all published NER models for a groundtruth.

get_ner_validation(project_id, groundtruth_id, validation_id)#

Retrieve a specific NER validation by ID.

get_ner_validation_set(project_id, groundtruth_id, params=None)#

Get the validation set for a groundtruth.

Parameters:
  • project_id – ID of the Squirro project.

  • groundtruth_id – ID of the groundtruth.

  • params (Optional[dict]) – Optional parameters to filter the validation set. These are defined in the ML API documentation.

get_ner_validations(project_id, groundtruth_id)#

List all NER validations for a groundtruth.

update_ner_category(project_id, groundtruth_id, category_id, category_data)#

Update an existing category.

update_ner_fastpass(project_id, groundtruth_id, fastpass_update)#

Toggle only the active flag on the FastPass.

update_ner_fastpass_suggestion(project_id, groundtruth_id, suggestion_id, suggestion_data)#

Process (update) a single FastPass suggestion by its ID.

update_ner_groundtruth(project_id, groundtruth_id, groundtruth_data)#

Update an existing groundtruth.

update_ner_item_label(project_id, groundtruth_id, item_id, item_label_id, label_data)#

Update a label on a groundtruth item.

update_ner_label(project_id, groundtruth_id, category_id, label_id, label_data)#

Update an existing label.