Annotators
Initialization of the ZenML annotator stack component.
BaseAnnotator
Bases: StackComponent
, ABC
Base class for all ZenML annotators.
Source code in src/zenml/annotators/base_annotator.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
config
property
Returns the BaseAnnotatorConfig
config.
Returns:
Type | Description |
---|---|
BaseAnnotatorConfig
|
The configuration. |
add_dataset(**kwargs)
abstractmethod
Registers a dataset for annotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
Any
|
The dataset or confirmation object on adding the dataset. |
Source code in src/zenml/annotators/base_annotator.py
102 103 104 105 106 107 108 109 110 111 |
|
delete_dataset(**kwargs)
abstractmethod
Deletes a dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
keyword arguments. |
{}
|
Source code in src/zenml/annotators/base_annotator.py
124 125 126 127 128 129 130 |
|
get_dataset(**kwargs)
abstractmethod
Gets the dataset with the given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
Any
|
The dataset with the given name. |
Source code in src/zenml/annotators/base_annotator.py
113 114 115 116 117 118 119 120 121 122 |
|
get_dataset_names()
abstractmethod
Gets the names of the datasets currently available for annotation.
Returns:
Type | Description |
---|---|
List[str]
|
The names of the datasets currently available for annotation. |
Source code in src/zenml/annotators/base_annotator.py
73 74 75 76 77 78 79 |
|
get_dataset_stats(dataset_name)
abstractmethod
Gets the statistics of a dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_name
|
str
|
name of the dataset. |
required |
Returns:
Type | Description |
---|---|
Tuple[int, int]
|
A tuple containing (labeled_task_count, unlabeled_task_count) for the dataset. |
Source code in src/zenml/annotators/base_annotator.py
81 82 83 84 85 86 87 88 89 90 91 |
|
get_datasets()
abstractmethod
Gets the datasets currently available for annotation.
Returns:
Type | Description |
---|---|
List[Any]
|
The datasets currently available for annotation. |
Source code in src/zenml/annotators/base_annotator.py
65 66 67 68 69 70 71 |
|
get_labeled_data(**kwargs)
abstractmethod
Gets the labeled data for the given dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
Any
|
The labeled data for the given dataset. |
Source code in src/zenml/annotators/base_annotator.py
132 133 134 135 136 137 138 139 140 141 |
|
get_unlabeled_data(**kwargs)
abstractmethod
Gets the unlabeled data for the given dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
str
|
Additional keyword arguments to pass to the Label Studio client. |
{}
|
Returns:
Type | Description |
---|---|
Any
|
The unlabeled data for the given dataset. |
Source code in src/zenml/annotators/base_annotator.py
143 144 145 146 147 148 149 150 151 152 |
|
get_url()
abstractmethod
Gets the URL of the annotation interface.
Returns:
Type | Description |
---|---|
str
|
The URL of the annotation interface. |
Source code in src/zenml/annotators/base_annotator.py
46 47 48 49 50 51 52 |
|
get_url_for_dataset(dataset_name)
abstractmethod
Gets the URL of the annotation interface for a specific dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_name
|
str
|
name of the dataset. |
required |
Returns:
Type | Description |
---|---|
str
|
The URL of the dataset annotation interface. |
Source code in src/zenml/annotators/base_annotator.py
54 55 56 57 58 59 60 61 62 63 |
|
launch(**kwargs)
abstractmethod
Launches the annotation interface.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments to pass to the annotation client. |
{}
|
Source code in src/zenml/annotators/base_annotator.py
93 94 95 96 97 98 99 100 |
|