rapidata 0.1.22__py3-none-any.whl → 0.1.23__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.
@@ -36,7 +36,7 @@ from rapidata.service.openapi_service import OpenAPIService
36
36
  class RapidataValidationSet:
37
37
  """A class for interacting with a Rapidata validation set.
38
38
 
39
- Get a `ValidatioinSet` either by using [`rapi.get_validation_set(<id>)`](../rapidata_client.md#rapidata_client.rapidata_client.RapidataClient.get_validation_set) to get an exisitng validation set or by using [`rapi.new_validation_set(<name>)`](../rapidata_client.md#rapidata_clientrapidata_client.RapidataClient.new_validation_set) to create a new validation set.
39
+ Get a `ValidationSet` either by using `rapi.get_validation_set(id)` to get an exisitng validation set or by using `rapi.new_validation_set(name)` to create a new validation set.
40
40
  """
41
41
 
42
42
  def __init__(self, validation_set_id, openapi_service: OpenAPIService):
@@ -2,32 +2,97 @@ from rapidata.api_client.models.feature_flag_model import FeatureFlagModel
2
2
 
3
3
 
4
4
  class FeatureFlags:
5
+ """A class to manage feature flags.
6
+
7
+ This class provides methods to set and manage various feature flags
8
+ used in the application.
9
+
10
+ Attributes:
11
+ _flags (dict[str, str]): A dictionary to store feature flags.
12
+ """
13
+
5
14
  def __init__(self):
15
+ """Initialize the FeatureFlags object with an empty flags dictionary."""
6
16
  self._flags: dict[str, str] = {}
7
17
 
8
18
  def to_list(self) -> list[FeatureFlagModel]:
19
+ """Convert the feature flags to a list of FeatureFlagModel objects.
20
+
21
+ Returns:
22
+ list[FeatureFlagModel]: A list of FeatureFlagModel objects
23
+ representing the current feature flags.
24
+ """
9
25
  return [FeatureFlagModel(key=name, value=value) for name, value in self._flags.items()]
10
26
 
11
27
  def alert_on_fast_response(self, value: int):
28
+ """Gives an alert as a pop up on the UI when the response time is less than the threshold.
29
+
30
+ Args:
31
+ value (int): The threshold value for fast response alerts.
32
+
33
+ Returns:
34
+ FeatureFlags: The current FeatureFlags instance for method chaining.
35
+ """
12
36
  self._flags["alert_on_fast_response"] = str(value)
13
37
  return self
14
38
 
15
39
  def disable_translation(self, value: bool = True):
40
+ """Disable automatic translation of all texts in the UI.
41
+
42
+ Args:
43
+ value (bool, optional): Whether to disable translation. Defaults to True.
44
+
45
+ Returns:
46
+ FeatureFlags: The current FeatureFlags instance for method chaining.
47
+ """
16
48
  self._flags["disable_translation"] = str(value)
17
49
  return self
18
50
 
19
51
  def free_text_minimum_characters(self, value: int):
52
+ """Set the minimum number of characters a user has to type before the task can be successfully submitted.
53
+
54
+ Args:
55
+ value (int): The minimum number of characters for free text.
56
+
57
+ Returns:
58
+ FeatureFlags: The current FeatureFlags instance for method chaining.
59
+ """
20
60
  self._flags["free_text_minimum_characters"] = str(value)
21
61
  return self
22
62
 
23
63
  def no_shuffle(self, value: bool = True):
64
+ """Only for classify tasks. If true, the order of the categories will be the same as the one in the workflow.
65
+
66
+ Args:
67
+ value (bool, optional): Whether to disable shuffling. Defaults to True.
68
+
69
+ Returns:
70
+ FeatureFlags: The current FeatureFlags instance for method chaining.
71
+ """
24
72
  self._flags["no_shuffle"] = str(value)
25
73
  return self
26
-
27
- def claire_design(self, value: bool = True):
74
+
75
+ def compare_with_prompt_design(self, value: bool = True):
76
+ """A special design to compare two texts/images based on a criteria and a given prompt.
77
+
78
+ Args:
79
+ value (bool, optional): Whether to enable compare with prompt design. Defaults to True.
80
+
81
+ Returns:
82
+ FeatureFlags: The current FeatureFlags instance for method chaining.
83
+ """
28
84
  self._flags["claire"] = str(value)
29
85
  return self
30
-
86
+
31
87
  def key_value(self, key: str, value: str):
88
+ """Set a custom feature flag with the given key and value. Use this to enable features that do not have a dedicated method (yet).
89
+
90
+ Args:
91
+ key (str): The key for the custom feature flag.
92
+ value (str): The value for the custom feature flag.
93
+
94
+ Returns:
95
+ FeatureFlags: The current FeatureFlags instance for method chaining.
96
+ """
32
97
  self._flags[key] = value
33
98
  return self
@@ -8,7 +8,7 @@ from rapidata.service.openapi_service import OpenAPIService
8
8
 
9
9
 
10
10
  class RapidataClient:
11
- """The Rapidata client is the main entry point for interacting with the Rapidata API. It allows you to create orders and validation sets. For creating a new order, check out [`new_order()`][rapidata.rapidata_client.rapidata_client.RapidataClient.new_order]. For creating a new validation set, check out [`new_validation_set()`][rapidata.rapidata_client.rapidata_client.RapidataClient.new_validation_set]."""
11
+ """The Rapidata client is the main entry point for interacting with the Rapidata API. It allows you to create orders and validation sets. For creating a new order, check out `new_order()`. For creating a new validation set, check out `new_validation_set()`."""
12
12
 
13
13
  def __init__(
14
14
  self,
@@ -1,16 +1,34 @@
1
1
  from typing import Any
2
2
  from rapidata.rapidata_client.referee.base_referee import Referee
3
- from rapidata.api_client.models.early_stopping_referee_model import EarlyStoppingRefereeModel
3
+ from rapidata.api_client.models.early_stopping_referee_model import (
4
+ EarlyStoppingRefereeModel,
5
+ )
4
6
 
5
7
 
6
8
  class ClassifyEarlyStoppingReferee(Referee):
7
- """
8
- The referee defines when a task is considered complete.
9
- The EarlyStoppingReferee stops the task when the confidence in the winning category is above a threshold.
10
- The threshold behaves logarithmically, i.e. if 0.99 stops too early, try 0.999 or 0.9999.
9
+ """A referee that stops the task when confidence in the winning category exceeds a threshold.
10
+
11
+ This referee implements an early stopping mechanism for classification tasks.
12
+ It terminates the task when the confidence in the leading category surpasses
13
+ a specified threshold or when the maximum number of votes is reached.
14
+
15
+ The threshold behaves logarithmically, meaning small increments (e.g., from 0.99
16
+ to 0.999) can significantly impact the stopping criteria.
17
+
18
+ Attributes:
19
+ threshold (float): The confidence threshold for early stopping.
20
+ max_vote_count (int): The maximum number of votes allowed before stopping.
11
21
  """
12
22
 
13
23
  def __init__(self, threshold: float = 0.999, max_vote_count: int = 100):
24
+ """Initialize the ClassifyEarlyStoppingReferee.
25
+
26
+ Args:
27
+ threshold (float, optional): The confidence threshold for early stopping.
28
+ Defaults to 0.999.
29
+ max_vote_count (int, optional): The maximum number of votes allowed
30
+ before stopping. Defaults to 100.
31
+ """
14
32
  self.threshold = threshold
15
33
  self.max_vote_count = max_vote_count
16
34
 
@@ -25,5 +43,5 @@ class ClassifyEarlyStoppingReferee(Referee):
25
43
  return EarlyStoppingRefereeModel(
26
44
  _t="EarlyStoppingReferee",
27
45
  threshold=self.threshold,
28
- max_votes=self.max_vote_count,
46
+ maxVotes=self.max_vote_count,
29
47
  )
@@ -3,12 +3,23 @@ from rapidata.rapidata_client.referee.base_referee import Referee
3
3
 
4
4
 
5
5
  class NaiveReferee(Referee):
6
- """
7
- The referee defines when a task is considered complete.
8
- The SimpleReferee is the simplest referee, requiring a fixed number of guesses.
6
+ """A simple referee that completes a task after a fixed number of guesses.
7
+
8
+ This referee implements a straightforward approach to task completion,
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.
11
+
12
+ Attributes:
13
+ required_guesses (int): The number of guesses required to complete the task.
9
14
  """
10
15
 
11
16
  def __init__(self, required_guesses: int = 10):
17
+ """Initialize the NaiveReferee.
18
+
19
+ Args:
20
+ required_guesses (int, optional): The number of guesses required
21
+ to complete the task. Defaults to 10.
22
+ """
12
23
  super().__init__()
13
24
  self.required_guesses = required_guesses
14
25
 
@@ -4,7 +4,6 @@ from typing import Any
4
4
  from rapidata.api_client.models.simple_workflow_model import SimpleWorkflowModel
5
5
  from rapidata.rapidata_client.feature_flags import FeatureFlags
6
6
  from rapidata.rapidata_client.referee.base_referee import Referee
7
- from rapidata.rapidata_client.referee.naive_referee import NaiveReferee
8
7
 
9
8
 
10
9
  class Workflow(ABC):
@@ -36,4 +35,4 @@ class Workflow(ABC):
36
35
 
37
36
  def feature_flags(self, feature_flags: FeatureFlags):
38
37
  self._feature_flags = feature_flags
39
- return self
38
+ return self
@@ -6,6 +6,21 @@ from rapidata.rapidata_client.workflow import Workflow
6
6
 
7
7
 
8
8
  class ClassifyWorkflow(Workflow):
9
+ """
10
+ A workflow for classification tasks.
11
+
12
+ This class represents a classification workflow where a question is presented
13
+ along with a list of possible options for classification.
14
+
15
+ Args:
16
+ question (str): The classification question to be presented.
17
+ options (list[str]): A list of possible classification options.
18
+
19
+ Attributes:
20
+ _question (str): The classification question.
21
+ _options (list[str]): The list of classification options.
22
+ """
23
+
9
24
  def __init__(self, question: str, options: list[str]):
10
25
  super().__init__(type="SimpleWorkflowConfig")
11
26
  self._question = question
@@ -6,7 +6,26 @@ from rapidata.api_client.models.simple_workflow_model import SimpleWorkflowModel
6
6
 
7
7
 
8
8
  class CompareWorkflow(Workflow):
9
+ """
10
+ A workflow for comparison tasks.
11
+
12
+ This class represents a comparison workflow where items are compared based on
13
+ specified criteria.
14
+
15
+ Attributes:
16
+ _criteria (str): The criteria used for comparison.
17
+
18
+ Args:
19
+ criteria (str): The criteria to be used for comparison.
20
+ """
21
+
9
22
  def __init__(self, criteria: str):
23
+ """
24
+ Initialize a CompareWorkflow instance.
25
+
26
+ Args:
27
+ criteria (str): The criteria to be used for comparison.
28
+ """
10
29
  super().__init__(type="CompareWorkflowConfig")
11
30
  self._criteria = criteria
12
31
 
@@ -15,7 +34,7 @@ class CompareWorkflow(Workflow):
15
34
  **super().to_dict(),
16
35
  "criteria": self._criteria,
17
36
  }
18
-
37
+
19
38
  def to_model(self) -> SimpleWorkflowModel:
20
39
  blueprint = CompareRapidBlueprint(
21
40
  _t="CompareBlueprint",
@@ -26,4 +45,3 @@ class CompareWorkflow(Workflow):
26
45
  _t="SimpleWorkflow",
27
46
  blueprint=SimpleWorkflowModelBlueprint(blueprint),
28
47
  )
29
-
@@ -6,7 +6,26 @@ from rapidata.api_client.models.free_text_rapid_blueprint import FreeTextRapidBl
6
6
 
7
7
 
8
8
  class FreeTextWorkflow(Workflow):
9
+ """
10
+ A workflow for free text input tasks.
11
+
12
+ This class represents a workflow where users can provide free-form text responses
13
+ to a given question.
14
+
15
+ Attributes:
16
+ _question (str): The question to be answered with free text.
17
+
18
+ Args:
19
+ question (str): The question to be presented for free text input.
20
+ """
21
+
9
22
  def __init__(self, question: str):
23
+ """
24
+ Initialize a FreeTextWorkflow instance.
25
+
26
+ Args:
27
+ question (str): The question to be presented for free text input.
28
+ """
10
29
  super().__init__(type="SimpleWorkflowConfig")
11
30
  self._question = question
12
31
 
@@ -5,11 +5,29 @@ from rapidata.rapidata_client.workflow.base_workflow import Workflow
5
5
 
6
6
 
7
7
  class TranscriptionWorkflow(Workflow):
8
+ """
9
+ A workflow for transcription tasks.
10
+
11
+ This class represents a transcription workflow where audio or video content
12
+ is transcribed based on given instructions.
13
+
14
+ Attributes:
15
+ _instruction (str): The instruction for the transcription task.
16
+
17
+ Args:
18
+ instruction (str): The instruction to be provided for the transcription task.
19
+ """
8
20
 
9
21
  def __init__(self, instruction: str):
22
+ """
23
+ Initialize a TranscriptionWorkflow instance.
24
+
25
+ Args:
26
+ instruction (str): The instruction to be provided for the transcription task.
27
+ """
10
28
  super().__init__(type="SimpleWorkflowConfig")
11
29
  self._instruction = instruction
12
-
30
+
13
31
  def to_model(self) -> SimpleWorkflowModel:
14
32
  blueprint = TranscriptionRapidBlueprint(
15
33
  _t="TranscriptionBlueprint",
@@ -19,4 +37,4 @@ class TranscriptionWorkflow(Workflow):
19
37
  return SimpleWorkflowModel(
20
38
  _t="SimpleWorkflow",
21
39
  blueprint=SimpleWorkflowModelBlueprint(blueprint)
22
- )
40
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rapidata
3
- Version: 0.1.22
3
+ Version: 0.1.23
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
@@ -223,11 +223,11 @@ rapidata/rapidata_client/country_codes/__init__.py,sha256=Y8qeG2IMjvMGvhaPydq0nh
223
223
  rapidata/rapidata_client/country_codes/country_codes.py,sha256=Q0HMX7uHJQDeLCFPP5bq4iYi6pgcDWEcl2ONGhjgoeU,286
224
224
  rapidata/rapidata_client/dataset/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
225
225
  rapidata/rapidata_client/dataset/rapidata_dataset.py,sha256=J5jlSIbdswhqXHOq8Qf9gtzVF70cImq9sioDG7S9Mxs,2457
226
- rapidata/rapidata_client/dataset/rapidata_validation_set.py,sha256=FR6h9-4WUne4h9PNF4Qz7dsfoqhdlm35YGN-3JGjiVE,4661
226
+ rapidata/rapidata_client/dataset/rapidata_validation_set.py,sha256=oQUtAF9ouLWg9AXkHXlnbEsPb8w9zxeKTw2YbSIk3ic,4475
227
227
  rapidata/rapidata_client/dataset/validation_rapid_parts.py,sha256=SIeQesEXPPOW5kclxYLNWaKllBXHm7DQKBdMU-GXnfc,2104
228
228
  rapidata/rapidata_client/dataset/validation_set_builder.py,sha256=_g7acP7lqYMI_5U9q1T6YHuUQ1ZDfZbLJ-QoqsGME4o,7463
229
229
  rapidata/rapidata_client/feature_flags/__init__.py,sha256=BNG_NQ4CrrC61fAWliImr8r581pIvegrkepVVbxcBw8,55
230
- rapidata/rapidata_client/feature_flags/feature_flags.py,sha256=uV4TPXc1oyqBRC9Ch3APprZwxBGnGMAl9DMFBUWmvnA,1048
230
+ rapidata/rapidata_client/feature_flags/feature_flags.py,sha256=uQrLuH8X5XqBHARMiw6HsIdZuCtSgBAgtTHrNxljkSs,3529
231
231
  rapidata/rapidata_client/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
232
232
  rapidata/rapidata_client/metadata/base_metadata.py,sha256=BJoZT4lRs94lu7PE3__LcsMINHNDVKRKRART-EKzSaw,217
233
233
  rapidata/rapidata_client/metadata/private_text_metadata.py,sha256=VJ_SJwp8OMFZLuUMRWvPeKOySXYJuGr-YgpwuLfTbmo,517
@@ -236,11 +236,11 @@ rapidata/rapidata_client/metadata/transcription_metadata.py,sha256=THtDEVCON4Ulc
236
236
  rapidata/rapidata_client/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
237
237
  rapidata/rapidata_client/order/rapidata_order.py,sha256=VRDLTPBf2k6UihF0DnWq3nfBLWExfWHzh3T-cJgFF1w,2437
238
238
  rapidata/rapidata_client/order/rapidata_order_builder.py,sha256=qGfdmO3wdQMDwlW5NTM8x5ll8YmC0UUuUkGtyzGMObU,8105
239
- rapidata/rapidata_client/rapidata_client.py,sha256=34xt1F8Jx94whQISMmoiE-MhzbxOl4m5lcQDRSE80BM,2923
239
+ rapidata/rapidata_client/rapidata_client.py,sha256=z3vz5_GNivnShj7kqii-eUff16rvwSy62zwi8WZqAWo,2776
240
240
  rapidata/rapidata_client/referee/__init__.py,sha256=x0AxGCsR6TlDjfqQ00lB9V7QVS9EZCJzweNEIzx42PI,207
241
241
  rapidata/rapidata_client/referee/base_referee.py,sha256=bMy7cw0a-pGNbFu6u_1_Jplu0A483Ubj4oDQzh8vu8k,493
242
- rapidata/rapidata_client/referee/classify_early_stopping_referee.py,sha256=r2ukb2gQzKXUVznGATT-pyWaAPbPyzohx_lATvQX3HY,1071
243
- rapidata/rapidata_client/referee/naive_referee.py,sha256=9CSoZou4YBFc9PiRvA2ELVQqyk-S1nug1SqhTwO9Tvw,719
242
+ rapidata/rapidata_client/referee/classify_early_stopping_referee.py,sha256=B5wsqKM3_Oc1TU_MFGiIyiXjwK1LcmaVjhzLdaL8Cgw,1797
243
+ rapidata/rapidata_client/referee/naive_referee.py,sha256=KWMLSc73gOdM8YT_ciFhfN7J4eKgtOFphBG9tIra9g0,1179
244
244
  rapidata/rapidata_client/selection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
245
245
  rapidata/rapidata_client/selection/base_selection.py,sha256=Y3HkROPm4I4HLNiR0HuHKpvk236KkRlsoDxQATm_chY,138
246
246
  rapidata/rapidata_client/selection/demographic_selection.py,sha256=DU8YvAj-WFALMAQJgjvBm1_ruIdPg2JVuKw07f7nDuA,453
@@ -249,17 +249,17 @@ rapidata/rapidata_client/selection/validation_selection.py,sha256=HswzD2SvZZWisN
249
249
  rapidata/rapidata_client/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
250
250
  rapidata/rapidata_client/utils/utils.py,sha256=Fl99gCnh_HnieIp099xEvEv4g2kEIKiFcUp0G2iz6x8,815
251
251
  rapidata/rapidata_client/workflow/__init__.py,sha256=CDG8bKOBhLV4A0uBlqOd__79fH9KW3-UlZsR1RANLf0,250
252
- rapidata/rapidata_client/workflow/base_workflow.py,sha256=335UyiNsIFix7ru_KZLeQHvfNg3GSId44ppPmWTXs_Y,1267
253
- rapidata/rapidata_client/workflow/classify_workflow.py,sha256=m_0z3y3BNnoOeJv27GpmKXfyjVhjeK-5gaVbtYLboVc,1221
254
- rapidata/rapidata_client/workflow/compare_workflow.py,sha256=sbL22-8z_P2vPxPjVp9iXqs6XLpNOoQIgx0tyh3jLbk,974
255
- rapidata/rapidata_client/workflow/free_text_workflow.py,sha256=X4FBFw00n3S8tqwjHgOOKAcykTkyCcC-Fb-JEJarGm0,1059
256
- rapidata/rapidata_client/workflow/transcription_workflow.py,sha256=BkbYaW-T1mr8PxzICx_JT3tFNastOA1KF6Og4qaM67A,854
252
+ rapidata/rapidata_client/workflow/base_workflow.py,sha256=VoZtNIFoylTrylMWC7CqzuSCLfG2yEGCmenf-HBzYOI,1196
253
+ rapidata/rapidata_client/workflow/classify_workflow.py,sha256=NkyyBrlCDqYVQaCARR9EHYuREEtXond69kD6jbzcN3M,1713
254
+ rapidata/rapidata_client/workflow/compare_workflow.py,sha256=nqrgtohlXBfgHh_cRPOFAlwdI8wVc7PUsH0FDM7wIjg,1431
255
+ rapidata/rapidata_client/workflow/free_text_workflow.py,sha256=VaypoG3yKgsbtVyqxta3W28eDwdnGebCy2xDWPCBMyo,1566
256
+ rapidata/rapidata_client/workflow/transcription_workflow.py,sha256=_KDtGCdRhauJm3jQHpwhY-Hq79CLg5I8q2RgOz5lo1g,1404
257
257
  rapidata/service/__init__.py,sha256=s9bS1AJZaWIhLtJX_ZA40_CK39rAAkwdAmymTMbeWl4,68
258
258
  rapidata/service/local_file_service.py,sha256=pgorvlWcx52Uh3cEG6VrdMK_t__7dacQ_5AnfY14BW8,877
259
259
  rapidata/service/openapi_service.py,sha256=-vrM2jEzQxr9KAerOYkVhpvMEeHwjzRwm9L_VFyzOT0,1537
260
260
  rapidata/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
261
261
  rapidata/utils/image_utils.py,sha256=TldO3eJWG8IhfJjm5MfNGO0mEDm1mQTsRoA0HLU1Uxs,404
262
- rapidata-0.1.22.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
263
- rapidata-0.1.22.dist-info/METADATA,sha256=FbqPH3fBfz-OqA1xkRUnKmh3QvAP7DLBIkkLmQoVySc,924
264
- rapidata-0.1.22.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
265
- rapidata-0.1.22.dist-info/RECORD,,
262
+ rapidata-0.1.23.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
263
+ rapidata-0.1.23.dist-info/METADATA,sha256=KwJViXo2Zd925MIu9HXnXhJr9aNfHXHiLzrUfZENBww,924
264
+ rapidata-0.1.23.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
265
+ rapidata-0.1.23.dist-info/RECORD,,