|
24 | 24 | NAME_KEY, |
25 | 25 | REFERENCE_IDS_KEY, |
26 | 26 | REQUEST_ID_KEY, |
| 27 | + AUTOTAG_SCORE_THRESHOLD, |
27 | 28 | UPDATE_KEY, |
28 | 29 | ) |
29 | 30 | from .dataset_item import ( |
@@ -86,21 +87,36 @@ def items(self) -> List[DatasetItem]: |
86 | 87 | return self._client.get_dataset_items(self.id) |
87 | 88 |
|
88 | 89 | @sanitize_string_args |
89 | | - def autotag_scores(self, autotag_name, for_scores_greater_than=0): |
90 | | - """Export the autotag scores above a threshold, largest scores first. |
| 90 | + def autotag_items(self, autotag_name, for_scores_greater_than=0): |
| 91 | + """For a given Autotag of this dataset, export its tagged items with scores above a threshold, largest scores first. |
91 | 92 |
|
92 | | - If you have pandas installed, you can create a pandas dataframe using |
| 93 | + :return: dictionary of the form |
| 94 | + { |
| 95 | + 'autotagItems': AutotagItem[], |
| 96 | + 'autotag': Autotag |
| 97 | + } |
| 98 | + See https://dashboard.nucleus.scale.com/nucleus/docs/api#export-autotag-items for more details on the return types. |
| 99 | + """ |
| 100 | + response = self._client.make_request( |
| 101 | + payload={AUTOTAG_SCORE_THRESHOLD: for_scores_greater_than}, |
| 102 | + route=f"autotag/dataset/{self.id}/autotag/{autotag_name}/taggedItems", |
| 103 | + requests_command=requests.get, |
| 104 | + ) |
| 105 | + return response |
93 | 106 |
|
94 | | - pandas.Dataframe(dataset.autotag_scores(autotag_name)) |
| 107 | + def autotag_training_items(self, autotag_name): |
| 108 | + """For a given Autotag of this dataset, export its training items. These are user selected positives during refinement. |
95 | 109 |
|
96 | 110 | :return: dictionary of the form |
97 | | - {'ref_ids': List[str], |
98 | | - 'datset_item_ids': List[str], |
99 | | - 'score': List[float]} |
| 111 | + { |
| 112 | + 'autotagTrainingItems': AutotagTrainingItem[], |
| 113 | + 'autotag': Autotag |
| 114 | + } |
| 115 | + See https://dashboard.nucleus.scale.com/nucleus/docs/api#export-autotag-training-items for more details on the return types. |
100 | 116 | """ |
101 | 117 | response = self._client.make_request( |
102 | 118 | payload={}, |
103 | | - route=f"autotag/{self.id}/{autotag_name}/{for_scores_greater_than}", |
| 119 | + route=f"autotag/dataset/{self.id}/autotag/{autotag_name}/trainingItems", |
104 | 120 | requests_command=requests.get, |
105 | 121 | ) |
106 | 122 | return response |
|
0 commit comments