rapidata 2.27.6__py3-none-any.whl → 2.28.0__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.
- rapidata/__init__.py +3 -1
- rapidata/rapidata_client/__init__.py +2 -0
- rapidata/rapidata_client/leaderboard/__init__.py +0 -0
- rapidata/rapidata_client/leaderboard/rapidata_leaderboard.py +127 -0
- rapidata/rapidata_client/leaderboard/rapidata_leaderboard_manager.py +80 -0
- rapidata/rapidata_client/order/rapidata_order.py +0 -1
- rapidata/rapidata_client/order/rapidata_order_manager.py +5 -5
- rapidata/rapidata_client/order/rapidata_results.py +17 -9
- rapidata/rapidata_client/rapidata_client.py +4 -0
- rapidata/rapidata_client/selection/__init__.py +1 -0
- rapidata/rapidata_client/selection/effort_selection.py +19 -0
- rapidata/rapidata_client/settings/__init__.py +1 -0
- rapidata/rapidata_client/settings/allow_neither_both.py +15 -0
- rapidata/rapidata_client/settings/rapidata_settings.py +3 -1
- rapidata/service/openapi_service.py +5 -0
- {rapidata-2.27.6.dist-info → rapidata-2.28.0.dist-info}/METADATA +1 -1
- {rapidata-2.27.6.dist-info → rapidata-2.28.0.dist-info}/RECORD +19 -14
- {rapidata-2.27.6.dist-info → rapidata-2.28.0.dist-info}/LICENSE +0 -0
- {rapidata-2.27.6.dist-info → rapidata-2.28.0.dist-info}/WHEEL +0 -0
rapidata/__init__.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
__version__ = "2.
|
|
1
|
+
__version__ = "2.28.0"
|
|
2
2
|
|
|
3
3
|
from .rapidata_client import (
|
|
4
4
|
RapidataClient,
|
|
5
5
|
DemographicSelection,
|
|
6
6
|
LabelingSelection,
|
|
7
|
+
EffortEstimationSelection,
|
|
7
8
|
RetrievalMode,
|
|
8
9
|
ValidationSelection,
|
|
9
10
|
ConditionalValidationSelection,
|
|
@@ -17,6 +18,7 @@ from .rapidata_client import (
|
|
|
17
18
|
NoShuffle,
|
|
18
19
|
PlayVideoUntilTheEnd,
|
|
19
20
|
CustomSetting,
|
|
21
|
+
AllowNeitherBoth,
|
|
20
22
|
CountryFilter,
|
|
21
23
|
LanguageFilter,
|
|
22
24
|
UserScoreFilter,
|
|
@@ -7,6 +7,7 @@ from .selection import (
|
|
|
7
7
|
CappedSelection,
|
|
8
8
|
ShufflingSelection,
|
|
9
9
|
RetrievalMode,
|
|
10
|
+
EffortEstimationSelection,
|
|
10
11
|
)
|
|
11
12
|
from .metadata import (
|
|
12
13
|
PrivateTextMetadata,
|
|
@@ -23,6 +24,7 @@ from .settings import (
|
|
|
23
24
|
NoShuffle,
|
|
24
25
|
PlayVideoUntilTheEnd,
|
|
25
26
|
CustomSetting,
|
|
27
|
+
AllowNeitherBoth,
|
|
26
28
|
)
|
|
27
29
|
from .country_codes import CountryCodes
|
|
28
30
|
from .assets import (
|
|
File without changes
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
from rapidata.api_client.models.create_leaderboard_participant_model import CreateLeaderboardParticipantModel
|
|
2
|
+
from rapidata.api_client.models.page_info import PageInfo
|
|
3
|
+
from rapidata.api_client.models.query_model import QueryModel
|
|
4
|
+
|
|
5
|
+
from rapidata.rapidata_client.order._rapidata_dataset import RapidataDataset
|
|
6
|
+
from rapidata.rapidata_client.assets import MediaAsset
|
|
7
|
+
from rapidata.rapidata_client.metadata import PromptMetadata
|
|
8
|
+
from rapidata.service.openapi_service import OpenAPIService
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class RapidataLeaderboard:
|
|
12
|
+
"""
|
|
13
|
+
An instance of a Rapidata leaderboard.
|
|
14
|
+
|
|
15
|
+
Used to interact with a specific leaderboard in the Rapidata system, such as retrieving prompts and evaluating models.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
name: The name that will be used to identify the leaderboard on the overview.
|
|
19
|
+
instruction: The instruction that will determine what how the models will be evaluated.
|
|
20
|
+
show_prompt: Whether to show the prompt to the users.
|
|
21
|
+
id: The ID of the leaderboard.
|
|
22
|
+
openapi_service: The OpenAPIService instance for API interaction.
|
|
23
|
+
"""
|
|
24
|
+
def __init__(self, name: str, instruction: str, show_prompt: bool, id: str, openapi_service: OpenAPIService):
|
|
25
|
+
self.__openapi_service = openapi_service
|
|
26
|
+
self.name = name
|
|
27
|
+
self.instruction = instruction
|
|
28
|
+
self.show_prompt = show_prompt
|
|
29
|
+
self._prompts: list[str] = []
|
|
30
|
+
self.id = id
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def prompts(self) -> list[str]:
|
|
34
|
+
"""
|
|
35
|
+
Returns the prompts that are registered for the leaderboard.
|
|
36
|
+
"""
|
|
37
|
+
if not self._prompts:
|
|
38
|
+
current_page = 1
|
|
39
|
+
total_pages = None
|
|
40
|
+
|
|
41
|
+
while True:
|
|
42
|
+
prompts_result = self.__openapi_service.leaderboard_api.leaderboard_leaderboard_id_prompts_get(
|
|
43
|
+
leaderboard_id=self.id,
|
|
44
|
+
request=QueryModel(
|
|
45
|
+
page=PageInfo(
|
|
46
|
+
index=current_page,
|
|
47
|
+
size=100
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
if prompts_result.total_pages is None:
|
|
53
|
+
raise ValueError("An error occurred while fetching prompts: total_pages is None")
|
|
54
|
+
|
|
55
|
+
total_pages = prompts_result.total_pages
|
|
56
|
+
|
|
57
|
+
self._prompts.extend([prompt.prompt for prompt in prompts_result.items])
|
|
58
|
+
|
|
59
|
+
if current_page >= total_pages:
|
|
60
|
+
break
|
|
61
|
+
|
|
62
|
+
current_page += 1
|
|
63
|
+
|
|
64
|
+
return self._prompts
|
|
65
|
+
|
|
66
|
+
def _register_prompts(self, prompts: list[str]):
|
|
67
|
+
"""
|
|
68
|
+
Registers the prompts for the leaderboard.
|
|
69
|
+
"""
|
|
70
|
+
for prompt in prompts:
|
|
71
|
+
self.__openapi_service.leaderboard_api.leaderboard_leaderboard_id_prompts_post(
|
|
72
|
+
leaderboard_id=self.id,
|
|
73
|
+
body=prompt
|
|
74
|
+
)
|
|
75
|
+
self._prompts = prompts
|
|
76
|
+
|
|
77
|
+
def evaluate_model(self, name: str, media: list[str], prompts: list[str]) -> None:
|
|
78
|
+
"""
|
|
79
|
+
Evaluates a model on the leaderboard.
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
name: The name of the model.
|
|
83
|
+
media: The generated images/videos that will be used to evaluate the model.
|
|
84
|
+
prompts: The prompts that correspond to the media. The order of the prompts must match the order of the media.
|
|
85
|
+
The prompts that are used must be registered for the leaderboard. To see the registered prompts, use the prompts property.
|
|
86
|
+
"""
|
|
87
|
+
if not media:
|
|
88
|
+
raise ValueError("Media must be a non-empty list of strings")
|
|
89
|
+
|
|
90
|
+
if len(media) != len(prompts):
|
|
91
|
+
raise ValueError("Media and prompts must have the same length")
|
|
92
|
+
|
|
93
|
+
if not all(prompt in self.prompts for prompt in prompts):
|
|
94
|
+
raise ValueError("All prompts must be in the registered prompts list. To see the registered prompts, use the prompts property.")
|
|
95
|
+
|
|
96
|
+
# happens before the creation of the participant to ensure all media paths are valid
|
|
97
|
+
assets = []
|
|
98
|
+
prompts_metadata: list[list[PromptMetadata]] = []
|
|
99
|
+
for media_path, prompt in zip(media, prompts):
|
|
100
|
+
assets.append(MediaAsset(media_path))
|
|
101
|
+
prompts_metadata.append([PromptMetadata(prompt)])
|
|
102
|
+
|
|
103
|
+
participant_result = self.__openapi_service.leaderboard_api.leaderboard_leaderboard_id_participants_post(
|
|
104
|
+
leaderboard_id=self.id,
|
|
105
|
+
create_leaderboard_participant_model=CreateLeaderboardParticipantModel(
|
|
106
|
+
name=name,
|
|
107
|
+
)
|
|
108
|
+
)
|
|
109
|
+
dataset = RapidataDataset(participant_result.dataset_id, self.__openapi_service)
|
|
110
|
+
|
|
111
|
+
dataset._add_datapoints(assets, prompts_metadata)
|
|
112
|
+
|
|
113
|
+
self.__openapi_service.leaderboard_api.leaderboard_leaderboard_id_participants_participant_id_submit_post(
|
|
114
|
+
leaderboard_id=self.id,
|
|
115
|
+
participant_id=participant_result.participant_id
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
def __str__(self) -> str:
|
|
119
|
+
return f"RapidataLeaderboard(name={self.name}, instruction={self.instruction}, show_prompt={self.show_prompt}, leaderboard_id={self.id})"
|
|
120
|
+
|
|
121
|
+
def __repr__(self) -> str:
|
|
122
|
+
return self.__str__()
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
from rapidata.service.openapi_service import OpenAPIService
|
|
2
|
+
from rapidata.rapidata_client.leaderboard.rapidata_leaderboard import RapidataLeaderboard
|
|
3
|
+
from rapidata.api_client.models.query_model import QueryModel
|
|
4
|
+
from rapidata.api_client.models.page_info import PageInfo
|
|
5
|
+
from rapidata.api_client.models.root_filter import RootFilter
|
|
6
|
+
from rapidata.api_client.models.filter import Filter
|
|
7
|
+
from rapidata.api_client.models.sort_criterion import SortCriterion
|
|
8
|
+
from rapidata.api_client.models.create_leaderboard_model import CreateLeaderboardModel
|
|
9
|
+
|
|
10
|
+
class RapidataLeaderboardManager:
|
|
11
|
+
"""
|
|
12
|
+
A manager for leaderboards.
|
|
13
|
+
|
|
14
|
+
Used to create and retrieve leaderboards.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
openapi_service: The OpenAPIService instance for API interaction.
|
|
18
|
+
"""
|
|
19
|
+
def __init__(self, openapi_service: OpenAPIService):
|
|
20
|
+
self.__openapi_service = openapi_service
|
|
21
|
+
|
|
22
|
+
def create_new_leaderboard(self, name: str, instruction: str, prompts: list[str], show_prompt: bool = False) -> RapidataLeaderboard:
|
|
23
|
+
"""
|
|
24
|
+
Creates a new leaderboard with the given name, instruction, and prompts.
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
leaderboard_name: The name of the leaderboard. Will be used to identify the leaderboard on the overview.
|
|
28
|
+
instruction: The instruction for the leaderboard. Will determine how the models will be evaluated.
|
|
29
|
+
prompts: The prompts for the leaderboard. Will be registered for the leaderboard and able to be retrieved again later.
|
|
30
|
+
show_prompt: Whether to show the prompt to the users when they are evaluating the models.
|
|
31
|
+
"""
|
|
32
|
+
leaderboard_id = self.__register_new_leaderboard(name, instruction, show_prompt)
|
|
33
|
+
leaderboard = RapidataLeaderboard(name, instruction, show_prompt, leaderboard_id, self.__openapi_service)
|
|
34
|
+
leaderboard._register_prompts(prompts)
|
|
35
|
+
return leaderboard
|
|
36
|
+
|
|
37
|
+
def get_leaderboard_by_id(self, leaderboard_id: str) -> RapidataLeaderboard:
|
|
38
|
+
"""
|
|
39
|
+
Retrieves a leaderboard by its ID.
|
|
40
|
+
|
|
41
|
+
Args:
|
|
42
|
+
leaderboard_id: The ID of the leaderboard.
|
|
43
|
+
"""
|
|
44
|
+
leaderboard_result = self.__openapi_service.leaderboard_api.leaderboard_leaderboard_id_get(
|
|
45
|
+
leaderboard_id=leaderboard_id
|
|
46
|
+
)
|
|
47
|
+
return RapidataLeaderboard(leaderboard_result.name, leaderboard_result.instruction, leaderboard_result.show_prompt, leaderboard_id, self.__openapi_service)
|
|
48
|
+
|
|
49
|
+
def find_leaderboards(self, name: str = "", amount: int = 10) -> list[RapidataLeaderboard]:
|
|
50
|
+
"""
|
|
51
|
+
Find your recent leaderboards given criteria. If nothing is provided, it will return the most recent leaderboard.
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
name (str, optional): The name of the leaderboard - matching leaderboard will contain the name. Defaults to "" for any leaderboard.
|
|
55
|
+
amount (int, optional): The amount of leaderboards to return. Defaults to 10.
|
|
56
|
+
"""
|
|
57
|
+
leaderboard_result = self.__openapi_service.leaderboard_api.leaderboards_get(
|
|
58
|
+
request=QueryModel(
|
|
59
|
+
page=PageInfo(
|
|
60
|
+
index=1,
|
|
61
|
+
size=amount
|
|
62
|
+
),
|
|
63
|
+
filter=RootFilter(filters=[Filter(field="Name", operator="Contains", value=name)]),
|
|
64
|
+
sortCriteria=[SortCriterion(direction="Desc", propertyName="CreatedAt")]
|
|
65
|
+
)
|
|
66
|
+
)
|
|
67
|
+
leaderboards = []
|
|
68
|
+
for leaderboard in leaderboard_result.items:
|
|
69
|
+
leaderboards.append(RapidataLeaderboard(leaderboard.name, leaderboard.instruction, leaderboard.show_prompt, leaderboard.id, self.__openapi_service))
|
|
70
|
+
return leaderboards
|
|
71
|
+
|
|
72
|
+
def __register_new_leaderboard(self, name: str, instruction: str, show_prompt: bool) -> str:
|
|
73
|
+
leaderboard_id = self.__openapi_service.leaderboard_api.leaderboard_post(
|
|
74
|
+
CreateLeaderboardModel(
|
|
75
|
+
name=name,
|
|
76
|
+
instruction=instruction,
|
|
77
|
+
showPrompt=show_prompt
|
|
78
|
+
)
|
|
79
|
+
).id
|
|
80
|
+
return leaderboard_id
|
|
@@ -169,7 +169,6 @@ class RapidataOrder:
|
|
|
169
169
|
Args:
|
|
170
170
|
preliminary_results: If True, returns the preliminary results of the order. Defaults to False.
|
|
171
171
|
Note that preliminary results are not final and may not contain all the datapoints & responses. Only the onese that are already available.
|
|
172
|
-
This will throw an exception if there are no responses available yet.
|
|
173
172
|
"""
|
|
174
173
|
logger.info(f"Getting results for order '{self}'...")
|
|
175
174
|
if preliminary_results and self.get_status() not in [OrderState.COMPLETED]:
|
|
@@ -49,7 +49,7 @@ class RapidataOrderManager:
|
|
|
49
49
|
selections (RapidataSelections): The RapidataSelections instance."""
|
|
50
50
|
|
|
51
51
|
def __init__(self, openapi_service: OpenAPIService):
|
|
52
|
-
self.
|
|
52
|
+
self.__openapi_service = openapi_service
|
|
53
53
|
self.filters = RapidataFilters
|
|
54
54
|
self.settings = RapidataSettings
|
|
55
55
|
self.selections = RapidataSelections
|
|
@@ -104,7 +104,7 @@ class RapidataOrderManager:
|
|
|
104
104
|
max_vote_count=responses_per_datapoint,
|
|
105
105
|
)
|
|
106
106
|
|
|
107
|
-
order_builder = RapidataOrderBuilder(name=name, openapi_service=self.
|
|
107
|
+
order_builder = RapidataOrderBuilder(name=name, openapi_service=self.__openapi_service)
|
|
108
108
|
|
|
109
109
|
if selections and validation_set_id:
|
|
110
110
|
logger.warning("Warning: Both selections and validation_set_id provided. Ignoring validation_set_id.")
|
|
@@ -637,12 +637,12 @@ class RapidataOrderManager:
|
|
|
637
637
|
RapidataOrder: The Order instance.
|
|
638
638
|
"""
|
|
639
639
|
|
|
640
|
-
order = self.
|
|
640
|
+
order = self.__openapi_service.order_api.order_order_id_get(order_id)
|
|
641
641
|
|
|
642
642
|
return RapidataOrder(
|
|
643
643
|
order_id=order_id,
|
|
644
644
|
name=order.order_name,
|
|
645
|
-
openapi_service=self.
|
|
645
|
+
openapi_service=self.__openapi_service)
|
|
646
646
|
|
|
647
647
|
def find_orders(self, name: str = "", amount: int = 10) -> list[RapidataOrder]:
|
|
648
648
|
"""Find your recent orders given criteria. If nothing is provided, it will return the most recent order.
|
|
@@ -654,7 +654,7 @@ class RapidataOrderManager:
|
|
|
654
654
|
Returns:
|
|
655
655
|
list[RapidataOrder]: A list of RapidataOrder instances.
|
|
656
656
|
"""
|
|
657
|
-
order_page_result = self.
|
|
657
|
+
order_page_result = self.__openapi_service.order_api.orders_get(QueryModel(
|
|
658
658
|
page=PageInfo(index=1, size=amount),
|
|
659
659
|
filter=RootFilter(filters=[Filter(field="OrderName", operator="Contains", value=name)]),
|
|
660
660
|
sortCriteria=[SortCriterion(direction="Desc", propertyName="OrderDate")]
|
|
@@ -180,31 +180,39 @@ class RapidataResults(dict):
|
|
|
180
180
|
|
|
181
181
|
rows = []
|
|
182
182
|
for result in self["results"]:
|
|
183
|
-
# Get
|
|
183
|
+
# Get all asset names from the first metric we find
|
|
184
|
+
assets = []
|
|
184
185
|
for key in result:
|
|
185
|
-
if isinstance(result[key], dict) and len(result[key])
|
|
186
|
+
if isinstance(result[key], dict) and len(result[key]) >= 2:
|
|
186
187
|
assets = list(result[key].keys())
|
|
187
188
|
break
|
|
188
189
|
else:
|
|
189
190
|
continue
|
|
190
191
|
|
|
191
|
-
|
|
192
|
+
assets = [asset for asset in assets if asset not in ["Both", "Neither"]]
|
|
192
193
|
|
|
193
194
|
# Initialize row with non-comparative fields
|
|
194
195
|
row = {
|
|
195
196
|
key: value for key, value in result.items()
|
|
196
197
|
if not isinstance(value, dict)
|
|
197
198
|
}
|
|
198
|
-
|
|
199
|
-
row["
|
|
200
|
-
row["assetB"] = asset_b
|
|
199
|
+
row["assetA"] = assets[0]
|
|
200
|
+
row["assetB"] = assets[1]
|
|
201
201
|
|
|
202
202
|
# Handle comparative metrics
|
|
203
203
|
for key, values in result.items():
|
|
204
|
-
if isinstance(values, dict) and len(values)
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
if isinstance(values, dict) and len(values) >= 2:
|
|
205
|
+
# Add main asset columns
|
|
206
|
+
for i, asset in enumerate(assets[:2]): # Limit to first 2 main assets
|
|
207
|
+
column_prefix = "A_" if i == 0 else "B_"
|
|
208
|
+
row[f'{column_prefix}{key}'] = values.get(asset, 0)
|
|
207
209
|
|
|
210
|
+
# Add special option columns if they exist
|
|
211
|
+
if "Both" in values:
|
|
212
|
+
row[f'Both_{key}'] = values.get("Both", 0)
|
|
213
|
+
if "Neither" in values:
|
|
214
|
+
row[f'Neither_{key}'] = values.get("Neither", 0)
|
|
215
|
+
|
|
208
216
|
rows.append(row)
|
|
209
217
|
|
|
210
218
|
return pd.DataFrame(rows)
|
|
@@ -5,6 +5,7 @@ from rapidata import __version__
|
|
|
5
5
|
from rapidata.service.openapi_service import OpenAPIService
|
|
6
6
|
|
|
7
7
|
from rapidata.rapidata_client.order.rapidata_order_manager import RapidataOrderManager
|
|
8
|
+
from rapidata.rapidata_client.leaderboard.rapidata_leaderboard_manager import RapidataLeaderboardManager
|
|
8
9
|
|
|
9
10
|
from rapidata.rapidata_client.validation.validation_set_manager import (
|
|
10
11
|
ValidationSetManager,
|
|
@@ -65,6 +66,9 @@ class RapidataClient:
|
|
|
65
66
|
|
|
66
67
|
logger.debug("Initializing DemographicManager")
|
|
67
68
|
self._demographic = DemographicManager(openapi_service=self._openapi_service)
|
|
69
|
+
|
|
70
|
+
logger.debug("Initializing RapidataLeaderboardManager")
|
|
71
|
+
self.mri = RapidataLeaderboardManager(openapi_service=self._openapi_service)
|
|
68
72
|
|
|
69
73
|
def reset_credentials(self):
|
|
70
74
|
"""Reset the credentials saved in the configuration file for the current environment."""
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from rapidata.rapidata_client.selection._base_selection import RapidataSelection
|
|
2
|
+
from rapidata.api_client.models.effort_capped_selection import EffortCappedSelection as EffortCappedSelectionModel
|
|
3
|
+
from rapidata.rapidata_client.selection.retrieval_modes import RetrievalMode
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class EffortEstimationSelection(RapidataSelection):
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def __init__(self, effort_budget: int, retrieval_mode: RetrievalMode = RetrievalMode.Shuffled, max_iterations: int | None = None):
|
|
10
|
+
self.effort_budget = effort_budget
|
|
11
|
+
self.retrieval_mode = retrieval_mode
|
|
12
|
+
self.max_iterations = max_iterations
|
|
13
|
+
|
|
14
|
+
def _to_model(self):
|
|
15
|
+
return EffortCappedSelectionModel(
|
|
16
|
+
_t="EffortCappedSelection",
|
|
17
|
+
effortBudget=self.effort_budget,
|
|
18
|
+
retrievalMode=self.retrieval_mode.value,
|
|
19
|
+
maxIterations=self.max_iterations)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from rapidata.rapidata_client.settings._rapidata_setting import RapidataSetting
|
|
2
|
+
from rapidata.rapidata_client.logging import managed_print, logger
|
|
3
|
+
|
|
4
|
+
class AllowNeitherBoth(RapidataSetting):
|
|
5
|
+
"""
|
|
6
|
+
Set whether to allow neither or both options.
|
|
7
|
+
This setting only works for compare orders.
|
|
8
|
+
|
|
9
|
+
Args:
|
|
10
|
+
value (bool): Whether to allow neither or both options. Defaults to True.
|
|
11
|
+
If this setting is not added to an order, the users won't be able to select neither or both.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, value: bool = True):
|
|
15
|
+
super().__init__(key="compare_unsure", value=value)
|
|
@@ -4,6 +4,7 @@ from rapidata.rapidata_client.settings import (
|
|
|
4
4
|
FreeTextMinimumCharacters,
|
|
5
5
|
NoShuffle,
|
|
6
6
|
PlayVideoUntilTheEnd,
|
|
7
|
+
AllowNeitherBoth,
|
|
7
8
|
)
|
|
8
9
|
|
|
9
10
|
class RapidataSettings:
|
|
@@ -18,6 +19,7 @@ class RapidataSettings:
|
|
|
18
19
|
free_text_minimum_characters (FreeTextMinimumCharacters): Only for free text tasks. Set the minimum number of characters a user has to type.
|
|
19
20
|
no_shuffle (NoShuffle): Only for classification and compare tasks. If true, the order of the categories / images will not be shuffled and presented in the same order as specified.
|
|
20
21
|
play_video_until_the_end (PlayVideoUntilTheEnd): Allows users to only answer once the video has finished playing.
|
|
22
|
+
allow_neither_both (AllowNeitherBoth): Only for compare tasks. If true, the users will be able to select neither or both instead of exclusively one of the options.
|
|
21
23
|
|
|
22
24
|
Example:
|
|
23
25
|
```python
|
|
@@ -33,4 +35,4 @@ class RapidataSettings:
|
|
|
33
35
|
free_text_minimum_characters = FreeTextMinimumCharacters
|
|
34
36
|
no_shuffle = NoShuffle
|
|
35
37
|
play_video_until_the_end = PlayVideoUntilTheEnd
|
|
36
|
-
|
|
38
|
+
allow_neither_both = AllowNeitherBoth
|
|
@@ -6,6 +6,7 @@ from rapidata.api_client.api.dataset_api import DatasetApi
|
|
|
6
6
|
from rapidata.api_client.api.order_api import OrderApi
|
|
7
7
|
from rapidata.api_client.api.pipeline_api import PipelineApi
|
|
8
8
|
from rapidata.api_client.api.rapid_api import RapidApi
|
|
9
|
+
from rapidata.api_client.api.leaderboard_api import LeaderboardApi
|
|
9
10
|
from rapidata.api_client.api.validation_set_api import ValidationSetApi
|
|
10
11
|
from rapidata.api_client.api.workflow_api import WorkflowApi
|
|
11
12
|
from rapidata.api_client.configuration import Configuration
|
|
@@ -107,6 +108,10 @@ class OpenAPIService:
|
|
|
107
108
|
@property
|
|
108
109
|
def workflow_api(self) -> WorkflowApi:
|
|
109
110
|
return WorkflowApi(self.api_client)
|
|
111
|
+
|
|
112
|
+
@property
|
|
113
|
+
def leaderboard_api(self) -> LeaderboardApi:
|
|
114
|
+
return LeaderboardApi(self.api_client)
|
|
110
115
|
|
|
111
116
|
def _get_rapidata_package_version(self):
|
|
112
117
|
"""
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
rapidata/__init__.py,sha256=
|
|
1
|
+
rapidata/__init__.py,sha256=U0Jnzk7Duyre8xS9I1pgxHtLblb_2zvnYOh7I_sWO3A,865
|
|
2
2
|
rapidata/api_client/__init__.py,sha256=hJ8b6i_S5KZCpmLupQJRh839MRweXxX85ti0Px7vI78,30530
|
|
3
3
|
rapidata/api_client/api/__init__.py,sha256=K67VMR3zWtv824onw87pEm-K2xrDphRIY04TtKg_k2U,1359
|
|
4
4
|
rapidata/api_client/api/campaign_api.py,sha256=ZEYXEp8_mzsElbklLXBLGnKEfPB1mx8-G5CXfSnibq0,80791
|
|
@@ -466,7 +466,7 @@ rapidata/api_client/models/workflow_split_model_filter_configs_inner.py,sha256=1
|
|
|
466
466
|
rapidata/api_client/models/workflow_state.py,sha256=5LAK1se76RCoozeVB6oxMPb8p_5bhLZJqn7q5fFQWis,850
|
|
467
467
|
rapidata/api_client/rest.py,sha256=rtIMcgINZOUaDFaJIinJkXRSddNJmXvMRMfgO2Ezk2o,10835
|
|
468
468
|
rapidata/api_client_README.md,sha256=81eV2jPGLgFdtvjLD_SSn2jixfyHOO5MPvj3hvF65qk,60685
|
|
469
|
-
rapidata/rapidata_client/__init__.py,sha256=
|
|
469
|
+
rapidata/rapidata_client/__init__.py,sha256=MLl41ZPDYezE9ookAjHS75wFqfCTOKq-U01GJbHFjrA,1133
|
|
470
470
|
rapidata/rapidata_client/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
471
471
|
rapidata/rapidata_client/api/rapidata_exception.py,sha256=BIdmHRrJUGW-Mqhp1H_suemZaR6w9TgjWq-ZW5iUPdQ,3878
|
|
472
472
|
rapidata/rapidata_client/assets/__init__.py,sha256=eQkqUrYFME1FCxPY2Xh2bbonKVPnsFElJ6aPFcsWGxI,361
|
|
@@ -497,6 +497,9 @@ rapidata/rapidata_client/filter/or_filter.py,sha256=u6vkXMTG_j15SbY3bkbnXbxJMDgE
|
|
|
497
497
|
rapidata/rapidata_client/filter/rapidata_filters.py,sha256=aHl8bjvL0wJLhzm6BCHy7mPGYYYKTLZhY0WZVeHx0ZA,2014
|
|
498
498
|
rapidata/rapidata_client/filter/response_count_filter.py,sha256=sDv9Dvy0FbnIQRSAxFGrUf9SIMISTNxnlAQcrFKBjXE,1989
|
|
499
499
|
rapidata/rapidata_client/filter/user_score_filter.py,sha256=2C78zkWm5TnfkxGbV1ER2xB7s9ynpacaibzyRZKG8Cc,1566
|
|
500
|
+
rapidata/rapidata_client/leaderboard/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
501
|
+
rapidata/rapidata_client/leaderboard/rapidata_leaderboard.py,sha256=sBYRlWxT2TeZnvwU3uuhVJl-o_iv5aM7f80dKOPc_Bk,5222
|
|
502
|
+
rapidata/rapidata_client/leaderboard/rapidata_leaderboard_manager.py,sha256=OjTpHucHh02uMWvKxSu37Hv8re41x1DbmgXLSN_I62w,3982
|
|
500
503
|
rapidata/rapidata_client/logging/__init__.py,sha256=4gLxePW8TvgYDZmPWMcf6fA8bEyu35vMKOmlPj5oXNE,110
|
|
501
504
|
rapidata/rapidata_client/logging/logger.py,sha256=9vULXUizGObQeqMY-CryiAQsq8xDZw0ChLhvV8oa99s,3907
|
|
502
505
|
rapidata/rapidata_client/logging/output_manager.py,sha256=AmSVZ2emVW5UWgOiNqkXNVRItsvd5Ox0hsIoZQhYYYo,653
|
|
@@ -510,36 +513,38 @@ rapidata/rapidata_client/metadata/_select_words_metadata.py,sha256=-MK5yQDi_G3BK
|
|
|
510
513
|
rapidata/rapidata_client/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
511
514
|
rapidata/rapidata_client/order/_rapidata_dataset.py,sha256=v5b86EDF0ITIOV4k4QU8gQ4eFPz2ow-4HV_mmC9tb4c,21264
|
|
512
515
|
rapidata/rapidata_client/order/_rapidata_order_builder.py,sha256=ioNGmWQF4KMdzvm-GIfAeflK8AgKaczZ1FfKkrZ1xXY,12649
|
|
513
|
-
rapidata/rapidata_client/order/rapidata_order.py,sha256=
|
|
514
|
-
rapidata/rapidata_client/order/rapidata_order_manager.py,sha256=
|
|
515
|
-
rapidata/rapidata_client/order/rapidata_results.py,sha256=
|
|
516
|
-
rapidata/rapidata_client/rapidata_client.py,sha256=
|
|
516
|
+
rapidata/rapidata_client/order/rapidata_order.py,sha256=CmZr0wAtogjhunhXACA9DvWCYf0Q5dXNthDCAUqjT00,12666
|
|
517
|
+
rapidata/rapidata_client/order/rapidata_order_manager.py,sha256=trEbTLe6-SsuWn5Q_DISxURxxlVjVSdBgjCjTVLZ3Mw,38311
|
|
518
|
+
rapidata/rapidata_client/order/rapidata_results.py,sha256=ZY0JyHMBZlR6-t6SqKt2OLEO6keR_KvKg9Wk6_I29x4,8653
|
|
519
|
+
rapidata/rapidata_client/rapidata_client.py,sha256=EMli04-y8WJ8BQpuh7VLDKHYudvoKz5rv5L-QKIYcsg,4284
|
|
517
520
|
rapidata/rapidata_client/referee/__init__.py,sha256=q0Hv9nmfEpyChejtyMLT8hWKL0vTTf_UgUXPYNJ-H6M,153
|
|
518
521
|
rapidata/rapidata_client/referee/_base_referee.py,sha256=MdFOhdxt3sRnWXLDKLJZKFdVpjBGn9jypPnWWQ6msQA,496
|
|
519
522
|
rapidata/rapidata_client/referee/_early_stopping_referee.py,sha256=ULbokQZ91wc9D_20qHUhe55D28D9eTY1J1cMp_-oIDc,2088
|
|
520
523
|
rapidata/rapidata_client/referee/_naive_referee.py,sha256=PVR8uy8hfRjr2DBzdOFyvou6S3swNc-4UvgjhO-09TU,1209
|
|
521
|
-
rapidata/rapidata_client/selection/__init__.py,sha256=
|
|
524
|
+
rapidata/rapidata_client/selection/__init__.py,sha256=vC2XbykShj_VW1uz5IZfQQXjgeIzzdYqC3n0K2c8cIs,574
|
|
522
525
|
rapidata/rapidata_client/selection/_base_selection.py,sha256=tInbWOgxT_4CHkr5QHoG55ZcUi1ZmfcEGIwLKKCnN20,147
|
|
523
526
|
rapidata/rapidata_client/selection/ab_test_selection.py,sha256=fymubkVMawqJmYp9FKzWXTki9tgBgoj3cOP8rG9oOd0,1284
|
|
524
527
|
rapidata/rapidata_client/selection/capped_selection.py,sha256=iWhbM1LcayhgFm7oKADXCaKHGdiQIupI0jbYuuEVM2A,1184
|
|
525
528
|
rapidata/rapidata_client/selection/conditional_validation_selection.py,sha256=OcNYSBi19vIcy2bLDmj9cv-gg5LFSvdjc3tooV0Z7Oc,2842
|
|
526
529
|
rapidata/rapidata_client/selection/demographic_selection.py,sha256=l4vnNbzlf9ED6BKqN4k5cZXShkXu9L1C5DtO78Vwr5M,1454
|
|
530
|
+
rapidata/rapidata_client/selection/effort_selection.py,sha256=uS8ctK2o-40Blu02jB5w7i8WtRSw21LhXszkkq30pM8,858
|
|
527
531
|
rapidata/rapidata_client/selection/labeling_selection.py,sha256=0X8DJHgwvgwekEbzVxWPyzZ1QAPcULZNDjfLQYUlcLM,1348
|
|
528
532
|
rapidata/rapidata_client/selection/rapidata_selections.py,sha256=lgwRivdzSnCri3K-Z-ngqR5RXwTl7iYuKTRpuyl5UMY,1853
|
|
529
533
|
rapidata/rapidata_client/selection/retrieval_modes.py,sha256=J2jzPEJ4wdllm_RnU_FYPh3eO3xeZS7QUk-NXgTB2u4,668
|
|
530
534
|
rapidata/rapidata_client/selection/shuffling_selection.py,sha256=FzOp7mnBLxNzM5at_-935wd77IHyWnFR1f8uqokiMOg,1201
|
|
531
535
|
rapidata/rapidata_client/selection/static_selection.py,sha256=-RWD3ChPe7-J31Shmah9JBNCgc5a16C5NOUl1f8tZCM,680
|
|
532
536
|
rapidata/rapidata_client/selection/validation_selection.py,sha256=sedeIa8lpXVXKtFJA9IDeRvo9A1Ne4ZGcepaWDUGhCU,851
|
|
533
|
-
rapidata/rapidata_client/settings/__init__.py,sha256=
|
|
537
|
+
rapidata/rapidata_client/settings/__init__.py,sha256=V5KW-_ffp4oZhwAMweRV0f2jSpXOb7oYYFiAwpsrkg4,507
|
|
534
538
|
rapidata/rapidata_client/settings/_rapidata_setting.py,sha256=MD5JhhogSLLrjFKjvL3JhMszOMCygyqLF-st0EwMSkw,352
|
|
535
539
|
rapidata/rapidata_client/settings/alert_on_fast_response.py,sha256=qW9Kv3mfl_V5NkPvKzg1Wz6QCRU-CmcAn1yaWCYI16U,989
|
|
540
|
+
rapidata/rapidata_client/settings/allow_neither_both.py,sha256=PMt1_n_kfERMoeENarx0uZqyGD2OmGONWognTmdvAgw,606
|
|
536
541
|
rapidata/rapidata_client/settings/custom_setting.py,sha256=TIbbedz98bfoIxQyiSMRYnQAaRFI1J7dYoTY89uNIoA,579
|
|
537
542
|
rapidata/rapidata_client/settings/free_text_minimum_characters.py,sha256=-kKO36Z7SsK9hGNEaVeHd1MLMqY6lkAuVAm3ST0y_gs,729
|
|
538
543
|
rapidata/rapidata_client/settings/models/__init__.py,sha256=IW7OuWg7xWIwFYrMAOX5N0HGGcqE6fFpgYin3vWRkOU,71
|
|
539
544
|
rapidata/rapidata_client/settings/models/translation_behaviour_options.py,sha256=7eR_Tk_WouW2g466dXdwuDuYdSxSAeaVP4KR3mW9q7A,479
|
|
540
545
|
rapidata/rapidata_client/settings/no_shuffle.py,sha256=9LNx4LptHZsQxamNYeY6lz9uakefyzVWM09tr76yx18,684
|
|
541
546
|
rapidata/rapidata_client/settings/play_video_until_the_end.py,sha256=LLHx2_72k5ZqqG4opdlOS0HpiVmqbq0Inuxb5iVvrW8,747
|
|
542
|
-
rapidata/rapidata_client/settings/rapidata_settings.py,sha256=
|
|
547
|
+
rapidata/rapidata_client/settings/rapidata_settings.py,sha256=qxwktsrrmGHqd6rKPMEZj0CK9k1SUtNjM2kedPaHTVs,1829
|
|
543
548
|
rapidata/rapidata_client/settings/translation_behaviour.py,sha256=i9n_H0eKJyKW6m3MKH_Cm1XEKWVEWsAV_79xGmGIC-4,742
|
|
544
549
|
rapidata/rapidata_client/validation/__init__.py,sha256=s5wHVtcJkncXSFuL9I0zNwccNOKpWAqxqUjkeohzi2E,24
|
|
545
550
|
rapidata/rapidata_client/validation/rapidata_validation_set.py,sha256=PgsutRTpzJ_e_H-xJxibSKHTskcM43aNwnm9dFhpMpw,1812
|
|
@@ -562,8 +567,8 @@ rapidata/rapidata_client/workflow/_timestamp_workflow.py,sha256=tPi2zu1-SlE_ppbG
|
|
|
562
567
|
rapidata/service/__init__.py,sha256=s9bS1AJZaWIhLtJX_ZA40_CK39rAAkwdAmymTMbeWl4,68
|
|
563
568
|
rapidata/service/credential_manager.py,sha256=pUEEtp6VrFWYhfUUtyqmS0AlRqe2Y0kFkY6o22IT4KM,8682
|
|
564
569
|
rapidata/service/local_file_service.py,sha256=pgorvlWcx52Uh3cEG6VrdMK_t__7dacQ_5AnfY14BW8,877
|
|
565
|
-
rapidata/service/openapi_service.py,sha256=
|
|
566
|
-
rapidata-2.
|
|
567
|
-
rapidata-2.
|
|
568
|
-
rapidata-2.
|
|
569
|
-
rapidata-2.
|
|
570
|
+
rapidata/service/openapi_service.py,sha256=yW8F6UcGs5VCzB4k3-FSBToojjpgJ4Y_LiEgZZ7uprw,5049
|
|
571
|
+
rapidata-2.28.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
572
|
+
rapidata-2.28.0.dist-info/METADATA,sha256=w2LFXQjfXsycagrDvCzvpFuezxfIKlOCO7-MK1oBZgk,1264
|
|
573
|
+
rapidata-2.28.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
574
|
+
rapidata-2.28.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|