rapidata 1.4.4__py3-none-any.whl → 1.4.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of rapidata might be problematic. Click here for more details.

@@ -74,7 +74,6 @@ from rapidata.api_client.models.create_dataset_artifact_model import CreateDatas
74
74
  from rapidata.api_client.models.create_dataset_artifact_model_dataset import CreateDatasetArtifactModelDataset
75
75
  from rapidata.api_client.models.create_demographic_rapid_model import CreateDemographicRapidModel
76
76
  from rapidata.api_client.models.create_empty_validation_set_result import CreateEmptyValidationSetResult
77
- from rapidata.api_client.models.create_legacy_client_model import CreateLegacyClientModel
78
77
  from rapidata.api_client.models.create_order_model import CreateOrderModel
79
78
  from rapidata.api_client.models.create_order_model_referee import CreateOrderModelReferee
80
79
  from rapidata.api_client.models.create_order_model_user_filters_inner import CreateOrderModelUserFiltersInner
@@ -140,12 +139,8 @@ from rapidata.api_client.models.image_dimension_metadata_model import ImageDimen
140
139
  from rapidata.api_client.models.import_from_file_result import ImportFromFileResult
141
140
  from rapidata.api_client.models.import_validation_set_from_file_result import ImportValidationSetFromFileResult
142
141
  from rapidata.api_client.models.in_progress_rapid_model import InProgressRapidModel
143
- from rapidata.api_client.models.issue_auth_token_result import IssueAuthTokenResult
144
142
  from rapidata.api_client.models.labeling_selection import LabelingSelection
145
143
  from rapidata.api_client.models.language_user_filter_model import LanguageUserFilterModel
146
- from rapidata.api_client.models.legacy_issue_client_auth_token_result import LegacyIssueClientAuthTokenResult
147
- from rapidata.api_client.models.legacy_request_password_reset_command import LegacyRequestPasswordResetCommand
148
- from rapidata.api_client.models.legacy_submit_password_reset_command import LegacySubmitPasswordResetCommand
149
144
  from rapidata.api_client.models.line import Line
150
145
  from rapidata.api_client.models.line_payload import LinePayload
151
146
  from rapidata.api_client.models.line_point import LinePoint
@@ -161,7 +156,6 @@ from rapidata.api_client.models.location_metadata import LocationMetadata
161
156
  from rapidata.api_client.models.location_metadata_exists_filter_config import LocationMetadataExistsFilterConfig
162
157
  from rapidata.api_client.models.location_metadata_model import LocationMetadataModel
163
158
  from rapidata.api_client.models.logic_operator import LogicOperator
164
- from rapidata.api_client.models.login_model import LoginModel
165
159
  from rapidata.api_client.models.metadata_visibilities import MetadataVisibilities
166
160
  from rapidata.api_client.models.multi_asset import MultiAsset
167
161
  from rapidata.api_client.models.multi_asset_model import MultiAssetModel
@@ -213,11 +207,10 @@ from rapidata.api_client.models.rapid_answer_result import RapidAnswerResult
213
207
  from rapidata.api_client.models.rapid_result_model import RapidResultModel
214
208
  from rapidata.api_client.models.rapid_result_model_result import RapidResultModelResult
215
209
  from rapidata.api_client.models.rapid_skipped_model import RapidSkippedModel
210
+ from rapidata.api_client.models.register_temporary_customer_model import RegisterTemporaryCustomerModel
216
211
  from rapidata.api_client.models.root_filter import RootFilter
217
212
  from rapidata.api_client.models.send_completion_mail_step_model import SendCompletionMailStepModel
218
213
  from rapidata.api_client.models.shape import Shape
219
- from rapidata.api_client.models.signup_customer_model import SignupCustomerModel
220
- from rapidata.api_client.models.signup_shadow_customer_model import SignupShadowCustomerModel
221
214
  from rapidata.api_client.models.simple_workflow_config import SimpleWorkflowConfig
222
215
  from rapidata.api_client.models.simple_workflow_config_model import SimpleWorkflowConfigModel
223
216
  from rapidata.api_client.models.simple_workflow_config_model_blueprint import SimpleWorkflowConfigModelBlueprint
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class RegisterTemporaryCustomerModel(BaseModel):
26
+ """
27
+ The model for signing up a new temporary user.
28
+ """ # noqa: E501
29
+ token: StrictStr = Field(description="A recaptcha token to verify the user is not a bot.")
30
+ __properties: ClassVar[List[str]] = ["token"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of RegisterTemporaryCustomerModel from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of RegisterTemporaryCustomerModel from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "token": obj.get("token")
84
+ })
85
+ return _obj
86
+
87
+
@@ -89,20 +89,8 @@ Class | Method | HTTP request | Description
89
89
  *DatasetApi* | [**dataset_upload_datapoint_post**](rapidata/api_client/docs/DatasetApi.md#dataset_upload_datapoint_post) | **POST** /Dataset/UploadDatapoint | Creates a new multi asset datapoint.
90
90
  *DatasetApi* | [**dataset_upload_files_from_s3_post**](rapidata/api_client/docs/DatasetApi.md#dataset_upload_files_from_s3_post) | **POST** /Dataset/UploadFilesFromS3 | Uploads files from an S3 bucket to a dataset.
91
91
  *DatasetApi* | [**dataset_upload_images_to_dataset_post**](rapidata/api_client/docs/DatasetApi.md#dataset_upload_images_to_dataset_post) | **POST** /Dataset/UploadImagesToDataset | Uploads images to a dataset.
92
- *IdentityApi* | [**identity_confirm_get**](rapidata/api_client/docs/IdentityApi.md#identity_confirm_get) | **GET** /Identity/Confirm | Confirms a user's signup by a token.
93
92
  *IdentityApi* | [**identity_create_client_post**](rapidata/api_client/docs/IdentityApi.md#identity_create_client_post) | **POST** /Identity/CreateClient | Creates a new client for the current customer.
94
- *IdentityApi* | [**identity_create_legacy_client_post**](rapidata/api_client/docs/IdentityApi.md#identity_create_legacy_client_post) | **POST** /Identity/CreateLegacyClient | Creates a new client for a customer.
95
- *IdentityApi* | [**identity_external_login_callback_get**](rapidata/api_client/docs/IdentityApi.md#identity_external_login_callback_get) | **GET** /Identity/ExternalLoginCallback | Logs in a user using after receiving a grant from an external provider.
96
- *IdentityApi* | [**identity_external_login_post**](rapidata/api_client/docs/IdentityApi.md#identity_external_login_post) | **POST** /Identity/ExternalLogin | Logs in a user using an external provider.
97
- *IdentityApi* | [**identity_get_auth_token_get**](rapidata/api_client/docs/IdentityApi.md#identity_get_auth_token_get) | **GET** /Identity/GetAuthToken | Issues a new auth token using the refresh token.
98
- *IdentityApi* | [**identity_get_client_auth_token_post**](rapidata/api_client/docs/IdentityApi.md#identity_get_client_auth_token_post) | **POST** /Identity/GetClientAuthToken | Issues a new auth token using the client credentials.
99
- *IdentityApi* | [**identity_index_post**](rapidata/api_client/docs/IdentityApi.md#identity_index_post) | **POST** /Identity/Index | Logs in a user by username or email and password.
100
- *IdentityApi* | [**identity_logout_post**](rapidata/api_client/docs/IdentityApi.md#identity_logout_post) | **POST** /Identity/Logout | Logs out the current user by deleting the refresh token cookie.
101
93
  *IdentityApi* | [**identity_register_temporary_post**](rapidata/api_client/docs/IdentityApi.md#identity_register_temporary_post) | **POST** /Identity/RegisterTemporary | Registers and logs in a temporary customer.
102
- *IdentityApi* | [**identity_request_reset_post**](rapidata/api_client/docs/IdentityApi.md#identity_request_reset_post) | **POST** /Identity/RequestReset | Request a password reset for a user.
103
- *IdentityApi* | [**identity_signup_post**](rapidata/api_client/docs/IdentityApi.md#identity_signup_post) | **POST** /Identity/Signup | Signs up a new user.
104
- *IdentityApi* | [**identity_submit_reset_post**](rapidata/api_client/docs/IdentityApi.md#identity_submit_reset_post) | **POST** /Identity/SubmitReset | Updates the password of a user after a password reset request.
105
- *IdentityApi* | [**identity_temporary_post**](rapidata/api_client/docs/IdentityApi.md#identity_temporary_post) | **POST** /Identity/Temporary | Creates a new temporary user.
106
94
  *NewsletterApi* | [**newsletter_post**](rapidata/api_client/docs/NewsletterApi.md#newsletter_post) | **POST** /Newsletter | Signs a user up to the newsletter.
107
95
  *NewsletterApi* | [**newsletter_unsubscribe_post**](rapidata/api_client/docs/NewsletterApi.md#newsletter_unsubscribe_post) | **POST** /Newsletter/Unsubscribe | Unsubscribes a user from the newsletter.
108
96
  *OrderApi* | [**order_approve_post**](rapidata/api_client/docs/OrderApi.md#order_approve_post) | **POST** /Order/Approve | Approves an order that has been submitted for manual approval.
@@ -212,7 +200,6 @@ Class | Method | HTTP request | Description
212
200
  - [CreateDatasetArtifactModelDataset](rapidata/api_client/docs/CreateDatasetArtifactModelDataset.md)
213
201
  - [CreateDemographicRapidModel](rapidata/api_client/docs/CreateDemographicRapidModel.md)
214
202
  - [CreateEmptyValidationSetResult](rapidata/api_client/docs/CreateEmptyValidationSetResult.md)
215
- - [CreateLegacyClientModel](rapidata/api_client/docs/CreateLegacyClientModel.md)
216
203
  - [CreateOrderModel](rapidata/api_client/docs/CreateOrderModel.md)
217
204
  - [CreateOrderModelReferee](rapidata/api_client/docs/CreateOrderModelReferee.md)
218
205
  - [CreateOrderModelUserFiltersInner](rapidata/api_client/docs/CreateOrderModelUserFiltersInner.md)
@@ -278,12 +265,8 @@ Class | Method | HTTP request | Description
278
265
  - [ImportFromFileResult](rapidata/api_client/docs/ImportFromFileResult.md)
279
266
  - [ImportValidationSetFromFileResult](rapidata/api_client/docs/ImportValidationSetFromFileResult.md)
280
267
  - [InProgressRapidModel](rapidata/api_client/docs/InProgressRapidModel.md)
281
- - [IssueAuthTokenResult](rapidata/api_client/docs/IssueAuthTokenResult.md)
282
268
  - [LabelingSelection](rapidata/api_client/docs/LabelingSelection.md)
283
269
  - [LanguageUserFilterModel](rapidata/api_client/docs/LanguageUserFilterModel.md)
284
- - [LegacyIssueClientAuthTokenResult](rapidata/api_client/docs/LegacyIssueClientAuthTokenResult.md)
285
- - [LegacyRequestPasswordResetCommand](rapidata/api_client/docs/LegacyRequestPasswordResetCommand.md)
286
- - [LegacySubmitPasswordResetCommand](rapidata/api_client/docs/LegacySubmitPasswordResetCommand.md)
287
270
  - [Line](rapidata/api_client/docs/Line.md)
288
271
  - [LinePayload](rapidata/api_client/docs/LinePayload.md)
289
272
  - [LinePoint](rapidata/api_client/docs/LinePoint.md)
@@ -299,7 +282,6 @@ Class | Method | HTTP request | Description
299
282
  - [LocationMetadataExistsFilterConfig](rapidata/api_client/docs/LocationMetadataExistsFilterConfig.md)
300
283
  - [LocationMetadataModel](rapidata/api_client/docs/LocationMetadataModel.md)
301
284
  - [LogicOperator](rapidata/api_client/docs/LogicOperator.md)
302
- - [LoginModel](rapidata/api_client/docs/LoginModel.md)
303
285
  - [MetadataVisibilities](rapidata/api_client/docs/MetadataVisibilities.md)
304
286
  - [MultiAsset](rapidata/api_client/docs/MultiAsset.md)
305
287
  - [MultiAssetModel](rapidata/api_client/docs/MultiAssetModel.md)
@@ -351,11 +333,10 @@ Class | Method | HTTP request | Description
351
333
  - [RapidResultModel](rapidata/api_client/docs/RapidResultModel.md)
352
334
  - [RapidResultModelResult](rapidata/api_client/docs/RapidResultModelResult.md)
353
335
  - [RapidSkippedModel](rapidata/api_client/docs/RapidSkippedModel.md)
336
+ - [RegisterTemporaryCustomerModel](rapidata/api_client/docs/RegisterTemporaryCustomerModel.md)
354
337
  - [RootFilter](rapidata/api_client/docs/RootFilter.md)
355
338
  - [SendCompletionMailStepModel](rapidata/api_client/docs/SendCompletionMailStepModel.md)
356
339
  - [Shape](rapidata/api_client/docs/Shape.md)
357
- - [SignupCustomerModel](rapidata/api_client/docs/SignupCustomerModel.md)
358
- - [SignupShadowCustomerModel](rapidata/api_client/docs/SignupShadowCustomerModel.md)
359
340
  - [SimpleWorkflowConfig](rapidata/api_client/docs/SimpleWorkflowConfig.md)
360
341
  - [SimpleWorkflowConfigModel](rapidata/api_client/docs/SimpleWorkflowConfigModel.md)
361
342
  - [SimpleWorkflowConfigModelBlueprint](rapidata/api_client/docs/SimpleWorkflowConfigModelBlueprint.md)
@@ -12,7 +12,7 @@ from .selection import (
12
12
  ConditionalValidationSelection,
13
13
  CappedSelection,
14
14
  )
15
- from .referee import NaiveReferee, ClassifyEarlyStoppingReferee
15
+ from .referee import NaiveReferee, EarlyStoppingReferee
16
16
  from .metadata import (
17
17
  PrivateTextMetadata,
18
18
  PublicTextMetadata,
@@ -1,7 +1,7 @@
1
1
  from rapidata.api_client.models.feature_flag_model import FeatureFlagModel
2
- from enum import StrEnum
2
+ from enum import Enum
3
3
 
4
- class TranslationBehaviour(StrEnum):
4
+ class TranslationBehaviour(Enum):
5
5
  BOTH = "both"
6
6
  ONLY_ORIGINAL = "only original"
7
7
  ONLY_TRANSLATED = "only translated"
@@ -70,7 +70,7 @@ class FeatureFlags:
70
70
  Returns:
71
71
  FeatureFlags: The current FeatureFlags instance for method chaining.
72
72
  """
73
- self._flags["translation_behaviour"] = behaviour
73
+ self._flags["translation_behaviour"] = behaviour.value
74
74
  return self
75
75
 
76
76
  def free_text_minimum_characters(self, value: int):
@@ -120,4 +120,4 @@ class FeatureFlags:
120
120
  FeatureFlags: The current FeatureFlags instance for method chaining.
121
121
  """
122
122
  self._flags[key] = value
123
- return self
123
+ return self
@@ -28,8 +28,8 @@ class RapidataClient:
28
28
  self,
29
29
  client_id: str,
30
30
  client_secret: str,
31
- endpoint: str = "https://api.app.rapidata.ai",
32
- token_url: str = "https://api.app.rapidata.ai/connect/token",
31
+ endpoint: str = "https://api.rapidata.ai",
32
+ token_url: str = "https://auth.rapidata.ai/connect/token",
33
33
  oauth_scope: str = "openid",
34
34
  cert_path: str | None = None,
35
35
  ):
@@ -106,7 +106,7 @@ class RapidataClient:
106
106
  order_id=order_id,
107
107
  name=order.order_name,
108
108
  openapi_service=self.openapi_service)
109
-
109
+
110
110
  def find_orders(self, name: str = "", amount: int = 1) -> list[RapidataOrder]:
111
111
  """Find your recent orders given criteria. If nothing is provided, it will return the most recent order.
112
112
 
@@ -123,16 +123,16 @@ class RapidataClient:
123
123
  filter=RootFilter(filters=[Filter(field="OrderName", operator="Contains", value=name)]),
124
124
  sortCriteria=[SortCriterion(direction="Desc", propertyName="OrderDate")]
125
125
  ))
126
-
126
+
127
127
  except BadRequestException as e:
128
128
  raise ValueError(f"Error occured during request. \nError: {e.body} \nTraceid: {e.headers.get('X-Trace-Id') if isinstance(e.headers, HTTPHeaderDict) else 'Unknown'}")
129
129
 
130
130
  except Exception as e:
131
131
  raise ValueError(f"Unknown error occured: {e}")
132
-
132
+
133
133
  orders = [self.get_order(order.id) for order in order_page_result.items]
134
134
  return orders
135
-
135
+
136
136
  def create_classify_order(self, name: str) -> ClassificationQuestionBuilder:
137
137
  """Create a new classification order where people are asked to classify an image.
138
138
 
@@ -143,7 +143,7 @@ class RapidataClient:
143
143
  ClassificationQuestionBuilder: A ClassificationQuestionBuilder instance.
144
144
  """
145
145
  return ClassificationQuestionBuilder(name=name, openapi_service=self.openapi_service)
146
-
146
+
147
147
  def create_compare_order(self, name: str) -> CompareCriteriaBuilder:
148
148
  """Create a new comparison order where people are asked to compare two images.
149
149
 
@@ -1,3 +1,3 @@
1
1
  from .base_referee import Referee
2
2
  from .naive_referee import NaiveReferee #as MaxVoteReferee
3
- from .classify_early_stopping_referee import ClassifyEarlyStoppingReferee
3
+ from .early_stopping_referee import EarlyStoppingReferee
@@ -5,7 +5,7 @@ from rapidata.api_client.models.early_stopping_referee_model import (
5
5
  )
6
6
 
7
7
 
8
- class ClassifyEarlyStoppingReferee(Referee):
8
+ class EarlyStoppingReferee(Referee):
9
9
  """A referee that stops the task when confidence in the winning category exceeds a threshold.
10
10
 
11
11
  This referee implements an early stopping mechanism for classification tasks.
@@ -15,6 +15,8 @@ class ClassifyEarlyStoppingReferee(Referee):
15
15
  The threshold behaves logarithmically, meaning small increments (e.g., from 0.99
16
16
  to 0.999) can significantly impact the stopping criteria.
17
17
 
18
+ This referee is supported for the classification and compare tasks.
19
+
18
20
  Attributes:
19
21
  threshold (float): The confidence threshold for early stopping.
20
22
  max_vote_count (int): The maximum number of votes allowed before stopping.
@@ -3,31 +3,31 @@ from rapidata.rapidata_client.referee.base_referee import Referee
3
3
 
4
4
 
5
5
  class NaiveReferee(Referee):
6
- """A simple referee that completes a task after a fixed number of guesses.
6
+ """A simple referee that completes a task after a fixed number of responses.
7
7
 
8
8
  This referee implements a straightforward approach to task completion,
9
9
  where the task is considered finished after a predetermined number of
10
- guesses have been made, regardless of the content or quality of those guesses.
10
+ responses have been made, regardless of the content or quality of those responses.
11
11
 
12
12
  Attributes:
13
- required_guesses (int): The number of guesses required to complete the task.
13
+ responses (int): The number of responses required to complete the task.
14
14
  """
15
15
 
16
- def __init__(self, required_guesses: int = 10):
16
+ def __init__(self, responses: int = 10):
17
17
  """Initialize the NaiveReferee.
18
18
 
19
19
  Args:
20
- required_guesses (int, optional): The number of guesses required
21
- to complete the task. Defaults to 10.
20
+ responses (int, optional): The number of responses required
21
+ to complete the task. Defaults to 10. This is per media item.
22
22
  """
23
23
  super().__init__()
24
- self.required_guesses = required_guesses
24
+ self.responses = responses
25
25
 
26
26
  def to_dict(self):
27
27
  return {
28
28
  "_t": "NaiveRefereeConfig",
29
- "guessesRequired": self.required_guesses,
29
+ "guessesRequired": self.responses,
30
30
  }
31
31
 
32
32
  def to_model(self):
33
- return NaiveRefereeModel(_t="NaiveReferee", totalVotes=self.required_guesses)
33
+ return NaiveRefereeModel(_t="NaiveReferee", totalVotes=self.responses)
@@ -1,7 +1,7 @@
1
1
  from rapidata.rapidata_client.order.rapidata_order_builder import RapidataOrderBuilder
2
2
  from rapidata.rapidata_client.metadata.base_metadata import Metadata
3
3
  from rapidata.rapidata_client.referee.naive_referee import NaiveReferee
4
- from rapidata.rapidata_client.referee.classify_early_stopping_referee import ClassifyEarlyStoppingReferee
4
+ from rapidata.rapidata_client.referee.early_stopping_referee import EarlyStoppingReferee
5
5
  from rapidata.rapidata_client.selection.base_selection import Selection
6
6
  from rapidata.rapidata_client.workflow.classify_workflow import ClassifyWorkflow
7
7
  from rapidata.rapidata_client.selection.validation_selection import ValidationSelection
@@ -43,13 +43,13 @@ class ClassificationOrderBuilder:
43
43
 
44
44
  def create(self, submit: bool = True, max_upload_workers: int = 10):
45
45
  if self._probability_threshold and self._responses_required:
46
- referee = ClassifyEarlyStoppingReferee(
46
+ referee = EarlyStoppingReferee(
47
47
  max_vote_count=self._responses_required,
48
48
  threshold=self._probability_threshold
49
49
  )
50
50
 
51
51
  else:
52
- referee = NaiveReferee(required_guesses=self._responses_required)
52
+ referee = NaiveReferee(responses=self._responses_required)
53
53
 
54
54
  assets = [MediaAsset(path=media_path) for media_path in self._media_paths]
55
55
 
@@ -2,7 +2,7 @@ from rapidata.service.openapi_service import OpenAPIService
2
2
  from rapidata.rapidata_client.metadata import Metadata
3
3
  from rapidata.rapidata_client.order.rapidata_order_builder import RapidataOrderBuilder
4
4
  from rapidata.rapidata_client.workflow.compare_workflow import CompareWorkflow
5
- from rapidata.rapidata_client.referee.naive_referee import NaiveReferee
5
+ from rapidata.rapidata_client.referee import NaiveReferee, EarlyStoppingReferee
6
6
  from rapidata.rapidata_client.selection.validation_selection import ValidationSelection
7
7
  from rapidata.rapidata_client.selection.labeling_selection import LabelingSelection
8
8
  from rapidata.rapidata_client.selection.base_selection import Selection
@@ -18,6 +18,7 @@ class CompareOrderBuilder:
18
18
  self._responses_required = 10
19
19
  self._metadata = None
20
20
  self._validation_set_id = None
21
+ self._probability_threshold = None
21
22
 
22
23
  def responses(self, responses_required: int) -> 'CompareOrderBuilder':
23
24
  """Set the number of resoonses required per matchup/pairing for the comparison order."""
@@ -34,7 +35,20 @@ class CompareOrderBuilder:
34
35
  self._validation_set_id = validation_set_id
35
36
  return self
36
37
 
38
+ def probability_threshold(self, probability_threshold: float) -> 'CompareOrderBuilder':
39
+ """Set the probability threshold for early stopping."""
40
+ self._probability_threshold = probability_threshold
41
+ return self
42
+
37
43
  def create(self, submit: bool = True, max_upload_workers: int = 10):
44
+ if self._probability_threshold and self._responses_required:
45
+ referee = EarlyStoppingReferee(
46
+ max_vote_count=self._responses_required,
47
+ threshold=self._probability_threshold
48
+ )
49
+
50
+ else:
51
+ referee = NaiveReferee(responses=self._responses_required)
38
52
  selection: list[Selection] = ([ValidationSelection(amount=1, validation_set_id=self._validation_set_id), LabelingSelection(amount=2)]
39
53
  if self._validation_set_id
40
54
  else [LabelingSelection(amount=3)])
@@ -46,7 +60,7 @@ class CompareOrderBuilder:
46
60
  criteria=self._criteria
47
61
  )
48
62
  )
49
- .referee(NaiveReferee(required_guesses=self._responses_required))
63
+ .referee(referee)
50
64
  .media(media_paths, metadata=self._metadata) # type: ignore
51
65
  .selections(selection)
52
66
  .create(submit=submit, max_workers=max_upload_workers))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rapidata
3
- Version: 1.4.4
3
+ Version: 1.4.6
4
4
  Summary: Rapidata package containing the Rapidata Python Client to interact with the Rapidata Web API in an easy way.
5
5
  License: Apache-2.0
6
6
  Author: Rapidata AG
@@ -1,12 +1,12 @@
1
- rapidata/__init__.py,sha256=vjmq4p45annpd9K5QbD_0RdcLIkDnNFkNb55ZVws56A,587
2
- rapidata/api_client/__init__.py,sha256=kVvFCI9LJojctHrtdas3VH3EPpbuT8S2OrERxSew5v4,23913
1
+ rapidata/__init__.py,sha256=xkV2cgV_RBZCW8CNxWFMlf4EFJUWXcJnqfzQtJsG6NA,579
2
+ rapidata/api_client/__init__.py,sha256=JmHmClUXDsPZxpAoI7L3s4fvVSNrfxNHXXmFo8Q9k14,23276
3
3
  rapidata/api_client/api/__init__.py,sha256=S0oVoAVMys10M-Z1SqirMdnHMYSHH3Lz6iph1CfILc0,1004
4
4
  rapidata/api_client/api/campaign_api.py,sha256=DxPFqt9F6c9OpXu_Uxhsrib2NVwnbcZFa3Vkrj7cIuA,40474
5
5
  rapidata/api_client/api/coco_api.py,sha256=4QYkW7c0SZvs-HOYmj585yL0KNr6Xc16ajS7b72yI6w,24972
6
6
  rapidata/api_client/api/compare_workflow_api.py,sha256=2P5Z1zvlEc6zmrmeSN67l1LONpchz6g0v0olfD8M_o8,12652
7
7
  rapidata/api_client/api/datapoint_api.py,sha256=CdLFVMrVylj2_D6Ll58_4ME604-7mgWCyXF5SpKmyfI,31668
8
8
  rapidata/api_client/api/dataset_api.py,sha256=9v2bBPYnRDKWvAvB7cJoew-O_bkmuocjpcg75hjkAkQ,92297
9
- rapidata/api_client/api/identity_api.py,sha256=cj_eFzaxjZz4CjPsRWmWmsi0jlfSLA8R2bbPH7AXqpA,150412
9
+ rapidata/api_client/api/identity_api.py,sha256=RtAhKQPJeDi4LaSDTEb5S219wancNyNqFKfKDeiPFco,23579
10
10
  rapidata/api_client/api/newsletter_api.py,sha256=9ZqGDB4_AEQZfRA61RRYkyQ06WjXH-aCwJUe60c2H4w,22575
11
11
  rapidata/api_client/api/order_api.py,sha256=llSmHHwivLmcJJ5XCNwZw6KBySIOJmLtr5d27hoCApU,209409
12
12
  rapidata/api_client/api/pipeline_api.py,sha256=-2KuB0C1P7veSMmOqXKSJpLN_5xdM_5JbUTSluEUpPA,33246
@@ -20,7 +20,7 @@ rapidata/api_client/api_client.py,sha256=EDhxAOUc5JFWvFsF1zc726Q7GoEFkuB8uor5SlG
20
20
  rapidata/api_client/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
21
21
  rapidata/api_client/configuration.py,sha256=g472vHVPLBotq8EkfSXP4sbp7xnn-3sb8O8BBlRWK1I,15931
22
22
  rapidata/api_client/exceptions.py,sha256=eLLd1fxM0Ygf3IIG6aNx9hdy79drst5Cem0UjI_NamM,5978
23
- rapidata/api_client/models/__init__.py,sha256=4-leSlFIAEAW-5v86ivs6zKMtmtoHnxNc1A3MKnGQ6o,22368
23
+ rapidata/api_client/models/__init__.py,sha256=DnXGkxLZZNnBDnjOB2YPyLCwbR3glSipc4Hg6aZQuPc,21731
24
24
  rapidata/api_client/models/add_campaign_artifact_result.py,sha256=4IvFVS-tLlL6eHsWp-IZ_ul5T30-h3YEwd2B5ioBbgY,2582
25
25
  rapidata/api_client/models/add_campaign_model.py,sha256=OJzkfvQlrp6j6ffwVShouUCW-MQZw60BGUJpqjbSGs8,6853
26
26
  rapidata/api_client/models/add_validation_rapid_model.py,sha256=-HRHMK-o6dgGjUqfsP_woZcFxfN7nuJ-L1CUaK9nihY,4918
@@ -242,6 +242,7 @@ rapidata/api_client/models/rapid_answer_result.py,sha256=oXYHKpjkXa_cxgJb8xUR_v8
242
242
  rapidata/api_client/models/rapid_result_model.py,sha256=JVUSCNErUbZimSIelKb7pgXjxdaHFX6ZjKahuRLbe7w,3048
243
243
  rapidata/api_client/models/rapid_result_model_result.py,sha256=RjA75vGoZW5fEHLxS3-z1TUesyax_qxPXW4aYhGFoPw,11681
244
244
  rapidata/api_client/models/rapid_skipped_model.py,sha256=3_YXlv4B8teo_xXWlXUMX2ybxgM29PWSw0JMha7qajY,2808
245
+ rapidata/api_client/models/register_temporary_customer_model.py,sha256=E4GPQtiA8FKa7aDUgQmQqOQuKm-CpWBfcRKhKWkMTSg,2643
245
246
  rapidata/api_client/models/request_password_reset_command.py,sha256=6bSYVzN3KNKd5u0Xl0vSjHRKI2uowIavU_wMbmLktvo,3174
246
247
  rapidata/api_client/models/root_filter.py,sha256=ee1rX_2CSUV7etI1sryrgZU1s85ifKVQ8PhpD6PMzRE,3363
247
248
  rapidata/api_client/models/send_completion_mail_step_model.py,sha256=iU90CqnaTiC5DmhLKKSJNV_xcKJtnbEJ0NpLtUUhvPM,3382
@@ -309,8 +310,8 @@ rapidata/api_client/models/workflow_split_model.py,sha256=zthOSaUl8dbLhLymLK_lrP
309
310
  rapidata/api_client/models/workflow_split_model_filter_configs_inner.py,sha256=1Fx9uZtztiiAdMXkj7YeCqt7o6VkG9lKf7D7UP_h088,7447
310
311
  rapidata/api_client/models/workflow_state.py,sha256=5LAK1se76RCoozeVB6oxMPb8p_5bhLZJqn7q5fFQWis,850
311
312
  rapidata/api_client/rest.py,sha256=zmCIFQC2l1t-KZcq-TgEm3vco3y_LK6vRm3Q07K-xRI,9423
312
- rapidata/api_client_README.md,sha256=58aoLkfxLpoYpBu7uOQkdfPB5wwrkW1cix_LZ1GLQQQ,37571
313
- rapidata/rapidata_client/__init__.py,sha256=mX25RNyeNqboIzCMz_Lm3SnMTXM8LJ_jpXuIRraafww,803
313
+ rapidata/api_client_README.md,sha256=ytnRUXykfU8I78TFE6DyO8xuFtyrK9hLztx5cejwfCM,34597
314
+ rapidata/rapidata_client/__init__.py,sha256=2SsfOqLpkTh6b0wTKwUaBboxwuU9_SvP4TK-eUoocGo,795
314
315
  rapidata/rapidata_client/assets/__init__.py,sha256=T-XKvMSkmyI8iYLUYDdZ3LrrSInHsGMUY_Tz77hhnlE,240
315
316
  rapidata/rapidata_client/assets/base_asset.py,sha256=B2YWH1NgaeYUYHDW3OPpHM_bqawHbH4EjnRCE2BYwiM,298
316
317
  rapidata/rapidata_client/assets/media_asset.py,sha256=4xU1k2abdHGwbkJAYNOZYyOPB__5VBRDvRjklegFufQ,887
@@ -325,7 +326,7 @@ rapidata/rapidata_client/dataset/rapidata_validation_set.py,sha256=rSRZQ67-8XjLa
325
326
  rapidata/rapidata_client/dataset/validation_rapid_parts.py,sha256=uzpOZFqQu8bG6vmjcWWUNJPZsRe28OmnyalRE6ry8tk,2317
326
327
  rapidata/rapidata_client/dataset/validation_set_builder.py,sha256=xPZBzNRPausIbYNRVinIhsVGnKSIIuxP5tjKkV4hOyo,7990
327
328
  rapidata/rapidata_client/feature_flags/__init__.py,sha256=IYkcK_bZCl5RfyQFiWjjUdz4y0jipiW9qfeopq4EjQQ,40
328
- rapidata/rapidata_client/feature_flags/feature_flags.py,sha256=r8imkH_e2NPGjqHMUjLF0qbYHajuu0gMv1z5Ep4Gm3c,4478
329
+ rapidata/rapidata_client/feature_flags/feature_flags.py,sha256=ESwPY0mHDCzY_rjYastl1rWZVbmt-3gc9lHQdwgGfGo,4479
329
330
  rapidata/rapidata_client/filter/__init__.py,sha256=F3JsMCbAZWH7SNdgaj98ydTqgCCKXKBhLyt9gQ4x6tQ,301
330
331
  rapidata/rapidata_client/filter/age_filter.py,sha256=hncr1zNM_HrO0fCta8h0LgTCB8Ufv_vI5_cGhMb-xr8,478
331
332
  rapidata/rapidata_client/filter/base_filter.py,sha256=nXraj72cumyQjjYoo4MMpnlE0aWjAIOmGakKf0MNqps,135
@@ -343,11 +344,11 @@ rapidata/rapidata_client/metadata/transcription_metadata.py,sha256=THtDEVCON4Ulc
343
344
  rapidata/rapidata_client/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
344
345
  rapidata/rapidata_client/order/rapidata_order.py,sha256=IMozRlrYK_yqGLk0GQbLNYL_RRb7gUcSgDe6NUjOEEE,4812
345
346
  rapidata/rapidata_client/order/rapidata_order_builder.py,sha256=QvICzduLAuAkf8qFKxHV3zAag838WnV9lEzWdD4dxI0,15926
346
- rapidata/rapidata_client/rapidata_client.py,sha256=UKFDbck3TOcSIRM31gHpl7vpSCHd3jPrjiTODfBPH44,6956
347
- rapidata/rapidata_client/referee/__init__.py,sha256=Ow9MQsONhF4sX2wFK9jbvSBrpcJgtq3OglIQMkBUdIY,167
347
+ rapidata/rapidata_client/rapidata_client.py,sha256=oSgBXBnszS7f2ITc0ljlOAaRlIpX8DSAE-RFOAKIDIM,6917
348
+ rapidata/rapidata_client/referee/__init__.py,sha256=E1VODxTjoQRnxzdgMh3aRlDLouxe1nWuvozEHXD2gq4,150
348
349
  rapidata/rapidata_client/referee/base_referee.py,sha256=bMy7cw0a-pGNbFu6u_1_Jplu0A483Ubj4oDQzh8vu8k,493
349
- rapidata/rapidata_client/referee/classify_early_stopping_referee.py,sha256=B5wsqKM3_Oc1TU_MFGiIyiXjwK1LcmaVjhzLdaL8Cgw,1797
350
- rapidata/rapidata_client/referee/naive_referee.py,sha256=KWMLSc73gOdM8YT_ciFhfN7J4eKgtOFphBG9tIra9g0,1179
350
+ rapidata/rapidata_client/referee/early_stopping_referee.py,sha256=Dg2Kk7OiLBtS3kknsLxyJIlS27xmPvsikFR6g4xlbTE,1862
351
+ rapidata/rapidata_client/referee/naive_referee.py,sha256=uOmrzCfpDopm6ww8u4Am5vz5qGNM7621HNJ-QIeH9wM,1164
351
352
  rapidata/rapidata_client/selection/__init__.py,sha256=RFdVUeo2bjCL1gPIL6HXzbpOBqY9kYedkNgb2_ANNLs,321
352
353
  rapidata/rapidata_client/selection/base_selection.py,sha256=Y3HkROPm4I4HLNiR0HuHKpvk236KkRlsoDxQATm_chY,138
353
354
  rapidata/rapidata_client/selection/capped_selection.py,sha256=ikEIT1sKbwWSK8zVqabT-se5LwsEbFs9dkMbO3u_ERk,807
@@ -356,8 +357,8 @@ rapidata/rapidata_client/selection/demographic_selection.py,sha256=DnMbLhzRItZ0t
356
357
  rapidata/rapidata_client/selection/labeling_selection.py,sha256=cqDMQEXfQGMmgIvPgGOYgIGaXflV_J7LZsGOsakLXqo,425
357
358
  rapidata/rapidata_client/selection/validation_selection.py,sha256=HswzD2SvZZWisNLoGj--0sT_TIK8crYp3xGGndo6aLY,523
358
359
  rapidata/rapidata_client/simple_builders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
359
- rapidata/rapidata_client/simple_builders/simple_classification_builders.py,sha256=kaa8DNQJ3WOd_LdXItNkENMCID5v5WThbAEQVBNoNyc,5552
360
- rapidata/rapidata_client/simple_builders/simple_compare_builders.py,sha256=MOb_QwwjaERRks82LemtG46ovoMLNQmNLN_A7JpZK0M,4240
360
+ rapidata/rapidata_client/simple_builders/simple_classification_builders.py,sha256=gTb1OzJZjNW48ltrp0v9tcDjLee9_ZiLw78zYziVu_g,5520
361
+ rapidata/rapidata_client/simple_builders/simple_compare_builders.py,sha256=GmNIUoAkoAHp0OnWLOgeI5-wnDiycuye0o1CUa9c3Q0,4808
361
362
  rapidata/rapidata_client/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
362
363
  rapidata/rapidata_client/utils/utils.py,sha256=Fl99gCnh_HnieIp099xEvEv4g2kEIKiFcUp0G2iz6x8,815
363
364
  rapidata/rapidata_client/workflow/__init__.py,sha256=xWuzAhBnbcUFfWcgYrzj8ZYLSOXyFtgfepgMrf0hNhU,290
@@ -372,7 +373,7 @@ rapidata/service/local_file_service.py,sha256=pgorvlWcx52Uh3cEG6VrdMK_t__7dacQ_5
372
373
  rapidata/service/openapi_service.py,sha256=pGcOCttKZW0PVCSM7Kfehe5loh7CxmmDDbu4UJbamnI,2770
373
374
  rapidata/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
374
375
  rapidata/utils/image_utils.py,sha256=TldO3eJWG8IhfJjm5MfNGO0mEDm1mQTsRoA0HLU1Uxs,404
375
- rapidata-1.4.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
376
- rapidata-1.4.4.dist-info/METADATA,sha256=7i3T_HJVJpDWZuwxdzjy7al08xAY_yZCxZjMhdllncc,1012
377
- rapidata-1.4.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
378
- rapidata-1.4.4.dist-info/RECORD,,
376
+ rapidata-1.4.6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
377
+ rapidata-1.4.6.dist-info/METADATA,sha256=SFcRi0ilN8gwUDdl1tSA8gt_OVADGVPyVG4_EeJWvfg,1012
378
+ rapidata-1.4.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
379
+ rapidata-1.4.6.dist-info/RECORD,,