rapidata 2.28.2__py3-none-any.whl → 2.44.3__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.
- rapidata/__init__.py +11 -10
- rapidata/api_client/__init__.py +83 -355
- rapidata/api_client/api/__init__.py +8 -2
- rapidata/api_client/api/asset_api.py +853 -0
- rapidata/api_client/api/audience_api.py +1133 -0
- rapidata/api_client/api/benchmark_api.py +3966 -0
- rapidata/api_client/api/campaign_api.py +222 -444
- rapidata/api_client/api/client_api.py +38 -33
- rapidata/api_client/api/coco_api.py +0 -571
- rapidata/api_client/api/compare_workflow_api.py +11 -10
- rapidata/api_client/api/customer_rapid_api.py +644 -72
- rapidata/api_client/api/datapoint_api.py +8 -530
- rapidata/api_client/api/dataset_api.py +228 -3469
- rapidata/api_client/api/evaluation_workflow_api.py +29 -82
- rapidata/api_client/api/feedback_api.py +11 -281
- rapidata/api_client/api/grouped_ranking_workflow_api.py +319 -0
- rapidata/api_client/api/identity_api.py +83 -1171
- rapidata/api_client/api/leaderboard_api.py +356 -312
- rapidata/api_client/api/newsletter_api.py +20 -19
- rapidata/api_client/api/order_api.py +758 -5487
- rapidata/api_client/api/participant_api.py +2181 -0
- rapidata/api_client/api/pipeline_api.py +24 -1783
- rapidata/api_client/api/prompt_api.py +320 -0
- rapidata/api_client/api/rapidata_identity_api_api.py +5 -4
- rapidata/api_client/api/sample_api.py +300 -0
- rapidata/api_client/api/simple_workflow_api.py +11 -10
- rapidata/api_client/api/survey_api.py +304 -0
- rapidata/api_client/api/user_rapid_api.py +35 -31
- rapidata/api_client/api/validation_set_api.py +510 -3659
- rapidata/api_client/api/workflow_api.py +32 -825
- rapidata/api_client/api_client.py +2 -2
- rapidata/api_client/configuration.py +16 -29
- rapidata/api_client/exceptions.py +2 -2
- rapidata/api_client/models/__init__.py +65 -332
- rapidata/api_client/models/ab_test_selection_a_inner.py +1 -1
- rapidata/api_client/models/add_campaign_model.py +3 -3
- rapidata/api_client/models/add_user_response_result.py +10 -5
- rapidata/api_client/models/add_validation_rapid_model.py +55 -24
- rapidata/api_client/models/add_validation_rapid_model_asset.py +154 -0
- rapidata/api_client/models/add_validation_rapid_model_context_asset.py +160 -0
- rapidata/api_client/models/add_validation_rapid_model_metadata_inner.py +140 -0
- rapidata/api_client/models/add_validation_rapid_model_truth.py +7 -1
- rapidata/api_client/models/add_validation_rapid_new_model.py +137 -0
- rapidata/api_client/models/add_validation_rapid_new_model_asset.py +182 -0
- rapidata/api_client/models/add_validation_rapid_new_model_truth.py +286 -0
- rapidata/api_client/models/add_validation_text_rapid_model.py +1 -3
- rapidata/api_client/models/age_user_filter_model.py +2 -2
- rapidata/api_client/models/age_user_filter_model_age_group.py +41 -0
- rapidata/api_client/models/aggregated_orders_model.py +98 -0
- rapidata/api_client/models/aggregator_type.py +4 -2
- rapidata/api_client/models/and_filter.py +121 -0
- rapidata/api_client/models/and_filter_filters_inner.py +282 -0
- rapidata/api_client/models/and_user_filter_model.py +106 -0
- rapidata/api_client/models/and_user_filter_model_filters_inner.py +282 -0
- rapidata/api_client/models/are_rapids_active_result.py +2 -2
- rapidata/api_client/models/asset_metadata.py +11 -9
- rapidata/api_client/models/asset_type.py +40 -0
- rapidata/api_client/models/attach_category_rapid_blueprint.py +13 -3
- rapidata/api_client/models/attach_category_rapid_blueprint_category.py +89 -0
- rapidata/api_client/models/audience_status.py +38 -0
- rapidata/api_client/models/benchmark_query_result.py +98 -0
- rapidata/api_client/models/benchmark_query_result_paged_result.py +105 -0
- rapidata/api_client/models/boost_leaderboard_model.py +89 -0
- rapidata/api_client/models/boost_mode.py +37 -0
- rapidata/api_client/models/boost_query_result.py +7 -10
- rapidata/api_client/models/boost_query_result_boost_mode.py +37 -0
- rapidata/api_client/models/boost_query_result_boost_status.py +39 -0
- rapidata/api_client/models/boosting_profile.py +89 -0
- rapidata/api_client/models/box_shape.py +4 -33
- rapidata/api_client/models/campaign_filter.py +98 -0
- rapidata/api_client/models/campaign_query_result.py +15 -13
- rapidata/api_client/models/campaign_status.py +2 -2
- rapidata/api_client/models/change_boost_model.py +89 -0
- rapidata/api_client/models/classification_metadata.py +12 -1
- rapidata/api_client/models/classify_payload.py +14 -15
- rapidata/api_client/models/classify_payload_category.py +89 -0
- rapidata/api_client/models/client_model.py +25 -35
- rapidata/api_client/models/clients_query_result.py +5 -5
- rapidata/api_client/models/clone_order_model.py +6 -8
- rapidata/api_client/models/clone_order_result.py +9 -4
- rapidata/api_client/models/compare_rapid_blueprint.py +5 -3
- rapidata/api_client/models/compare_rapid_blueprint1.py +96 -0
- rapidata/api_client/models/compare_workflow_config.py +34 -23
- rapidata/api_client/models/compare_workflow_config_context_asset.py +174 -0
- rapidata/api_client/models/compare_workflow_config_metadata_value.py +31 -17
- rapidata/api_client/models/compare_workflow_config_model.py +15 -5
- rapidata/api_client/models/compare_workflow_model.py +34 -6
- rapidata/api_client/models/compare_workflow_model1.py +20 -9
- rapidata/api_client/models/compare_workflow_model_context_asset.py +160 -0
- rapidata/api_client/models/compare_workflow_model_metadata_inner.py +154 -0
- rapidata/api_client/models/compare_workflow_model_pair_maker_config.py +1 -1
- rapidata/api_client/models/comparison_operator.py +2 -2
- rapidata/api_client/models/conditional_validation_selection.py +8 -11
- rapidata/api_client/models/conditional_validation_selection_validation_chance.py +103 -0
- rapidata/api_client/models/confidence_interval.py +89 -0
- rapidata/api_client/models/count_metadata.py +12 -1
- rapidata/api_client/models/country_filter.py +98 -0
- rapidata/api_client/models/create_audience_request.py +99 -0
- rapidata/api_client/models/create_audience_result.py +87 -0
- rapidata/api_client/models/create_benchmark_model.py +87 -0
- rapidata/api_client/models/create_benchmark_participant_model.py +87 -0
- rapidata/api_client/models/create_benchmark_participant_result.py +89 -0
- rapidata/api_client/models/create_benchmark_prompt_result.py +87 -0
- rapidata/api_client/models/create_benchmark_result.py +87 -0
- rapidata/api_client/models/create_bridge_token_result.py +2 -2
- rapidata/api_client/models/create_client_model.py +6 -13
- rapidata/api_client/models/create_complex_order_model.py +9 -9
- rapidata/api_client/models/create_complex_order_result.py +6 -4
- rapidata/api_client/models/create_customer_client_result.py +2 -2
- rapidata/api_client/models/create_datapoint_from_files_model.py +3 -3
- rapidata/api_client/models/create_datapoint_from_text_sources_model.py +3 -3
- rapidata/api_client/models/create_datapoint_from_urls_model.py +3 -3
- rapidata/api_client/models/create_datapoint_model.py +134 -0
- rapidata/api_client/models/create_datapoint_model_asset.py +154 -0
- rapidata/api_client/models/create_datapoint_model_context_asset.py +160 -0
- rapidata/api_client/models/create_datapoint_model_metadata_inner.py +154 -0
- rapidata/api_client/models/create_datapoint_result.py +6 -18
- rapidata/api_client/models/create_demographic_rapid_model.py +45 -7
- rapidata/api_client/models/create_demographic_rapid_model_asset.py +160 -0
- rapidata/api_client/models/create_demographic_rapid_model_context_asset.py +160 -0
- rapidata/api_client/models/create_demographic_rapid_model_new.py +119 -0
- rapidata/api_client/models/create_empty_validation_set_result.py +2 -2
- rapidata/api_client/models/create_leaderboard_model.py +59 -10
- rapidata/api_client/models/create_leaderboard_result.py +17 -5
- rapidata/api_client/models/create_order_model.py +30 -101
- rapidata/api_client/models/create_order_model_referee.py +12 -12
- rapidata/api_client/models/create_order_model_workflow.py +35 -21
- rapidata/api_client/models/create_order_result.py +6 -4
- rapidata/api_client/models/create_rapid_result.py +2 -2
- rapidata/api_client/models/create_sample_model.py +93 -0
- rapidata/api_client/models/create_sample_model_asset.py +154 -0
- rapidata/api_client/models/create_sample_model_obsolete.py +87 -0
- rapidata/api_client/models/create_simple_pipeline_model_pipeline_steps_inner.py +8 -22
- rapidata/api_client/models/create_unsupported_order_model.py +6 -6
- rapidata/api_client/models/create_validation_set_model.py +5 -5
- rapidata/api_client/models/datapoint_model.py +3 -3
- rapidata/api_client/models/datapoint_state.py +2 -2
- rapidata/api_client/models/demographic_filter.py +100 -0
- rapidata/api_client/models/dynamic_client_registration_request.py +21 -36
- rapidata/api_client/models/early_stopping_referee_model.py +3 -3
- rapidata/api_client/models/effort_capped_selection.py +2 -11
- rapidata/api_client/models/elo_config.py +2 -2
- rapidata/api_client/models/elo_config_model.py +6 -6
- rapidata/api_client/models/entity_tag_header_value.py +93 -0
- rapidata/api_client/models/evaluation_workflow_config.py +13 -3
- rapidata/api_client/models/evaluation_workflow_model.py +16 -6
- rapidata/api_client/models/existing_asset_input.py +120 -0
- rapidata/api_client/models/existing_asset_input_metadata_value.py +126 -0
- rapidata/api_client/models/feature_flag.py +2 -2
- rapidata/api_client/models/feature_flag_model.py +6 -6
- rapidata/api_client/models/feedback_model.py +7 -7
- rapidata/api_client/models/file_asset.py +3 -5
- rapidata/api_client/models/file_asset_input.py +104 -0
- rapidata/api_client/models/file_asset_input1.py +104 -0
- rapidata/api_client/models/file_asset_input1_file.py +168 -0
- rapidata/api_client/models/file_asset_input2.py +104 -0
- rapidata/api_client/models/file_asset_input3.py +104 -0
- rapidata/api_client/models/file_asset_input_file.py +168 -0
- rapidata/api_client/models/file_asset_metadata_value.py +252 -0
- rapidata/api_client/models/file_asset_model_metadata_value.py +25 -81
- rapidata/api_client/models/file_stream_result.py +122 -0
- rapidata/api_client/models/file_type.py +39 -0
- rapidata/api_client/models/file_type_metadata.py +110 -0
- rapidata/api_client/models/file_type_metadata_model.py +97 -0
- rapidata/api_client/models/filter.py +7 -25
- rapidata/api_client/models/filter_operator.py +3 -2
- rapidata/api_client/models/fork_benchmark_result.py +87 -0
- rapidata/api_client/models/form_file_wrapper.py +135 -0
- rapidata/api_client/models/free_text_payload.py +10 -3
- rapidata/api_client/models/free_text_rapid_blueprint.py +10 -3
- rapidata/api_client/models/gender_user_filter_model.py +2 -2
- rapidata/api_client/models/gender_user_filter_model_gender.py +38 -0
- rapidata/api_client/models/get_asset_metadata_result.py +100 -0
- rapidata/api_client/models/get_audience_by_id_result.py +111 -0
- rapidata/api_client/models/get_available_validation_sets_result.py +2 -2
- rapidata/api_client/models/get_benchmark_by_id_query.py +96 -0
- rapidata/api_client/models/get_benchmark_by_id_query_result.py +94 -0
- rapidata/api_client/models/get_benchmark_by_id_query_result_paged_result.py +105 -0
- rapidata/api_client/models/get_benchmark_by_id_result.py +96 -0
- rapidata/api_client/models/get_boost_result.py +97 -0
- rapidata/api_client/models/get_boost_result_boost_mode.py +37 -0
- rapidata/api_client/models/get_boost_result_boost_status.py +39 -0
- rapidata/api_client/models/get_compare_ab_summary_result.py +5 -5
- rapidata/api_client/models/get_compare_workflow_results_model.py +7 -7
- rapidata/api_client/models/get_compare_workflow_results_result.py +5 -5
- rapidata/api_client/models/get_datapoint_by_id_result.py +10 -21
- rapidata/api_client/models/get_datapoint_by_id_result_asset.py +170 -0
- rapidata/api_client/models/get_dataset_by_id_result.py +2 -2
- rapidata/api_client/models/get_dataset_progress_result.py +2 -2
- rapidata/api_client/models/get_evaluation_workflow_results_model.py +119 -0
- rapidata/api_client/models/get_failed_datapoints_result.py +5 -5
- rapidata/api_client/models/get_failed_datapoints_result_datapoint.py +100 -0
- rapidata/api_client/models/get_file_metadata_result.py +100 -0
- rapidata/api_client/models/get_grouped_ranking_workflow_results_model.py +106 -0
- rapidata/api_client/models/get_grouped_ranking_workflow_results_result.py +97 -0
- rapidata/api_client/models/get_grouped_ranking_workflow_results_result_paged_result.py +105 -0
- rapidata/api_client/models/get_leaderboard_by_id_result.py +50 -6
- rapidata/api_client/models/get_order_by_id_result.py +12 -5
- rapidata/api_client/models/get_participant_by_id_result.py +9 -20
- rapidata/api_client/models/get_pipeline_by_id_result.py +5 -5
- rapidata/api_client/models/get_public_orders_result.py +2 -2
- rapidata/api_client/models/get_public_responses_result.py +95 -0
- rapidata/api_client/models/get_public_responses_result_response.py +112 -0
- rapidata/api_client/models/get_rapid_responses_result.py +6 -12
- rapidata/api_client/models/get_recommended_validation_set_result.py +95 -0
- rapidata/api_client/models/get_responses_for_rapid_result.py +106 -0
- rapidata/api_client/models/get_responses_for_rapid_result_response.py +103 -0
- rapidata/api_client/models/get_responses_for_rapid_result_response_result.py +266 -0
- rapidata/api_client/models/get_responses_result.py +5 -5
- rapidata/api_client/models/get_responses_result_response.py +103 -0
- rapidata/api_client/models/get_sample_by_id_result.py +125 -0
- rapidata/api_client/models/get_simple_workflow_results_model.py +20 -15
- rapidata/api_client/models/get_standing_by_id_result.py +96 -0
- rapidata/api_client/models/get_validation_rapids_result.py +32 -41
- rapidata/api_client/models/get_validation_set_by_id_result.py +10 -4
- rapidata/api_client/models/get_workflow_by_id_result.py +5 -5
- rapidata/api_client/models/get_workflow_by_id_result_workflow.py +23 -9
- rapidata/api_client/models/get_workflow_progress_result.py +5 -11
- rapidata/api_client/models/get_workflow_results_result.py +34 -23
- rapidata/api_client/models/get_workflow_results_result_response.py +103 -0
- rapidata/api_client/models/google_one_tap_login_model.py +4 -4
- rapidata/api_client/models/grouped_ranking_workflow_config.py +155 -0
- rapidata/api_client/models/grouped_ranking_workflow_config_context_assets_value.py +170 -0
- rapidata/api_client/models/grouped_ranking_workflow_model.py +147 -0
- rapidata/api_client/models/grouped_ranking_workflow_model1.py +121 -0
- rapidata/api_client/models/i_artifact_model.py +182 -0
- rapidata/api_client/models/i_artifact_model_campaign_artifact_model.py +98 -0
- rapidata/api_client/models/i_artifact_model_dataset_artifact_model.py +98 -0
- rapidata/api_client/models/i_artifact_model_file_artifact_model.py +98 -0
- rapidata/api_client/models/i_artifact_model_workflow_artifact_model.py +98 -0
- rapidata/api_client/models/i_artifact_model_workflow_config_artifact_model.py +102 -0
- rapidata/api_client/models/i_asset.py +170 -0
- rapidata/api_client/models/i_asset_file_asset.py +111 -0
- rapidata/api_client/models/i_asset_input.py +156 -0
- rapidata/api_client/models/i_asset_input_existing_asset_input.py +118 -0
- rapidata/api_client/models/i_asset_input_multi_asset_input.py +128 -0
- rapidata/api_client/models/i_asset_input_text_asset_input.py +118 -0
- rapidata/api_client/models/i_asset_model.py +170 -0
- rapidata/api_client/models/i_asset_model_file_asset_model.py +113 -0
- rapidata/api_client/models/i_asset_model_multi_asset_model.py +123 -0
- rapidata/api_client/models/i_asset_model_null_asset_model.py +111 -0
- rapidata/api_client/models/i_asset_model_text_asset_model.py +113 -0
- rapidata/api_client/models/i_asset_multi_asset.py +121 -0
- rapidata/api_client/models/i_asset_null_asset.py +109 -0
- rapidata/api_client/models/i_asset_text_asset.py +111 -0
- rapidata/api_client/models/i_campaign_filter.py +282 -0
- rapidata/api_client/models/i_campaign_filter_and_filter.py +117 -0
- rapidata/api_client/models/i_campaign_filter_campaign_filter.py +98 -0
- rapidata/api_client/models/i_campaign_filter_country_filter.py +98 -0
- rapidata/api_client/models/i_campaign_filter_demographic_filter.py +100 -0
- rapidata/api_client/models/i_campaign_filter_language_filter.py +98 -0
- rapidata/api_client/models/i_campaign_filter_new_user_filter.py +96 -0
- rapidata/api_client/models/i_campaign_filter_not_filter.py +113 -0
- rapidata/api_client/models/i_campaign_filter_or_filter.py +117 -0
- rapidata/api_client/models/i_campaign_filter_response_count_filter.py +103 -0
- rapidata/api_client/models/i_campaign_filter_user_action_restriction_filter.py +106 -0
- rapidata/api_client/models/i_campaign_filter_user_score_filter.py +102 -0
- rapidata/api_client/models/i_campaign_filter_user_state_filter.py +106 -0
- rapidata/api_client/models/i_dataset_metadata_input.py +154 -0
- rapidata/api_client/models/i_dataset_metadata_input_prompt_asset_metadata_input.py +100 -0
- rapidata/api_client/models/i_dataset_metadata_input_prompt_metadata_input.py +96 -0
- rapidata/api_client/models/i_dataset_metadata_input_transcription_metadata_input.py +96 -0
- rapidata/api_client/models/i_dataset_model.py +126 -0
- rapidata/api_client/models/i_dataset_model_clone_dataset_model.py +98 -0
- rapidata/api_client/models/i_metadata.py +252 -0
- rapidata/api_client/models/i_metadata_classification_metadata.py +109 -0
- rapidata/api_client/models/i_metadata_count_metadata.py +109 -0
- rapidata/api_client/models/i_metadata_file_type_metadata.py +110 -0
- rapidata/api_client/models/i_metadata_image_dimension_metadata.py +111 -0
- rapidata/api_client/models/i_metadata_input.py +126 -0
- rapidata/api_client/models/i_metadata_input_text_metadata_input.py +111 -0
- rapidata/api_client/models/i_metadata_location_metadata.py +111 -0
- rapidata/api_client/models/i_metadata_model.py +252 -0
- rapidata/api_client/models/i_metadata_model_classification_metadata_model.py +96 -0
- rapidata/api_client/models/i_metadata_model_count_metadata_model.py +96 -0
- rapidata/api_client/models/i_metadata_model_file_type_metadata_model.py +97 -0
- rapidata/api_client/models/i_metadata_model_image_dimension_metadata_model.py +98 -0
- rapidata/api_client/models/i_metadata_model_location_metadata_model.py +98 -0
- rapidata/api_client/models/i_metadata_model_original_filename_metadata_model.py +96 -0
- rapidata/api_client/models/i_metadata_model_source_url_metadata_model.py +96 -0
- rapidata/api_client/models/i_metadata_model_streams_metadata_model.py +100 -0
- rapidata/api_client/models/i_metadata_model_text_metadata_model.py +101 -0
- rapidata/api_client/models/i_metadata_model_video_duration_metadata_model.py +97 -0
- rapidata/api_client/models/i_metadata_original_filename_metadata.py +109 -0
- rapidata/api_client/models/i_metadata_source_url_metadata.py +109 -0
- rapidata/api_client/models/i_metadata_streams_metadata.py +113 -0
- rapidata/api_client/models/i_metadata_text_metadata.py +114 -0
- rapidata/api_client/models/i_metadata_video_duration_metadata.py +110 -0
- rapidata/api_client/models/i_order_workflow_model.py +168 -0
- rapidata/api_client/models/i_order_workflow_model_compare_workflow_model.py +146 -0
- rapidata/api_client/models/i_order_workflow_model_evaluation_workflow_model.py +108 -0
- rapidata/api_client/models/i_order_workflow_model_grouped_ranking_workflow_model.py +147 -0
- rapidata/api_client/models/i_order_workflow_model_simple_workflow_model.py +110 -0
- rapidata/api_client/models/i_pair_maker_config.py +126 -0
- rapidata/api_client/models/i_pair_maker_config_model.py +126 -0
- rapidata/api_client/models/i_pair_maker_config_model_online_pair_maker_config_model.py +98 -0
- rapidata/api_client/models/i_pair_maker_config_online_pair_maker_config.py +98 -0
- rapidata/api_client/models/i_pair_maker_information.py +126 -0
- rapidata/api_client/models/i_pair_maker_information_online_pair_maker_information.py +100 -0
- rapidata/api_client/models/i_pipeline_artifact_model.py +126 -0
- rapidata/api_client/models/i_pipeline_artifact_model_create_dataset_artifact_model.py +102 -0
- rapidata/api_client/models/i_pipeline_model.py +126 -0
- rapidata/api_client/models/i_pipeline_model_create_simple_pipeline_model.py +116 -0
- rapidata/api_client/models/i_pipeline_step_model.py +168 -0
- rapidata/api_client/models/i_pipeline_step_model_dataset_evaluation_step_model.py +102 -0
- rapidata/api_client/models/i_pipeline_step_model_send_completion_mail_step_model.py +98 -0
- rapidata/api_client/models/i_pipeline_step_model_workflow_aggregation_step_model.py +103 -0
- rapidata/api_client/models/i_pipeline_step_model_workflow_labeling_step_model.py +96 -0
- rapidata/api_client/models/i_rapid_blueprint.py +252 -0
- rapidata/api_client/models/i_rapid_blueprint_attach_category_rapid_blueprint.py +108 -0
- rapidata/api_client/models/i_rapid_blueprint_bounding_box_rapid_blueprint.py +96 -0
- rapidata/api_client/models/i_rapid_blueprint_compare_rapid_blueprint.py +98 -0
- rapidata/api_client/models/i_rapid_blueprint_free_text_rapid_blueprint.py +103 -0
- rapidata/api_client/models/i_rapid_blueprint_line_rapid_blueprint.py +96 -0
- rapidata/api_client/models/i_rapid_blueprint_locate_rapid_blueprint.py +96 -0
- rapidata/api_client/models/i_rapid_blueprint_named_entity_rapid_blueprint.py +98 -0
- rapidata/api_client/models/i_rapid_blueprint_polygon_rapid_blueprint.py +96 -0
- rapidata/api_client/models/i_rapid_blueprint_scrub_rapid_blueprint.py +96 -0
- rapidata/api_client/models/i_rapid_blueprint_transcription_rapid_blueprint.py +96 -0
- rapidata/api_client/models/i_rapid_payload.py +252 -0
- rapidata/api_client/models/i_rapid_payload_bounding_box_payload.py +96 -0
- rapidata/api_client/models/i_rapid_payload_classify_payload.py +106 -0
- rapidata/api_client/models/i_rapid_payload_compare_payload.py +96 -0
- rapidata/api_client/models/i_rapid_payload_free_text_payload.py +103 -0
- rapidata/api_client/models/i_rapid_payload_line_payload.py +96 -0
- rapidata/api_client/models/i_rapid_payload_locate_payload.py +96 -0
- rapidata/api_client/models/i_rapid_payload_named_entity_payload.py +98 -0
- rapidata/api_client/models/i_rapid_payload_polygon_payload.py +96 -0
- rapidata/api_client/models/i_rapid_payload_scrub_payload.py +96 -0
- rapidata/api_client/models/i_rapid_payload_transcription_payload.py +106 -0
- rapidata/api_client/models/i_rapid_result.py +266 -0
- rapidata/api_client/models/i_rapid_result_attach_category_result.py +98 -0
- rapidata/api_client/models/i_rapid_result_bounding_box_result.py +106 -0
- rapidata/api_client/models/i_rapid_result_compare_result.py +98 -0
- rapidata/api_client/models/i_rapid_result_free_text_result.py +98 -0
- rapidata/api_client/models/i_rapid_result_line_result.py +106 -0
- rapidata/api_client/models/i_rapid_result_locate_result.py +106 -0
- rapidata/api_client/models/i_rapid_result_named_entity_result.py +106 -0
- rapidata/api_client/models/i_rapid_result_polygon_result.py +106 -0
- rapidata/api_client/models/i_rapid_result_scrub_result.py +98 -0
- rapidata/api_client/models/i_rapid_result_skip_result.py +96 -0
- rapidata/api_client/models/i_rapid_result_transcription_result.py +106 -0
- rapidata/api_client/models/i_referee_config.py +154 -0
- rapidata/api_client/models/i_referee_config_naive_referee_config.py +96 -0
- rapidata/api_client/models/i_referee_config_never_ending_referee_config.py +94 -0
- rapidata/api_client/models/i_referee_config_probabilistic_attach_category_referee_config.py +98 -0
- rapidata/api_client/models/i_referee_info.py +154 -0
- rapidata/api_client/models/i_referee_info_naive_referee_info.py +96 -0
- rapidata/api_client/models/i_referee_info_never_ending_referee_info.py +94 -0
- rapidata/api_client/models/i_referee_info_probabilistic_attach_category_referee_info.py +98 -0
- rapidata/api_client/models/i_referee_model.py +140 -0
- rapidata/api_client/models/i_referee_model_early_stopping_referee_model.py +98 -0
- rapidata/api_client/models/i_referee_model_naive_referee_model.py +96 -0
- rapidata/api_client/models/i_selection.py +240 -0
- rapidata/api_client/models/i_selection_ab_test_selection.py +122 -0
- rapidata/api_client/models/i_selection_capped_selection.py +108 -0
- rapidata/api_client/models/i_selection_conditional_validation_selection.py +110 -0
- rapidata/api_client/models/i_selection_demographic_selection.py +98 -0
- rapidata/api_client/models/i_selection_effort_capped_selection.py +101 -0
- rapidata/api_client/models/i_selection_labeling_selection.py +103 -0
- rapidata/api_client/models/i_selection_shuffling_selection.py +106 -0
- rapidata/api_client/models/i_selection_static_selection.py +96 -0
- rapidata/api_client/models/i_selection_validation_selection.py +98 -0
- rapidata/api_client/models/i_user_filter_model.py +282 -0
- rapidata/api_client/models/i_user_filter_model_age_user_filter_model.py +104 -0
- rapidata/api_client/models/i_user_filter_model_and_user_filter_model.py +106 -0
- rapidata/api_client/models/i_user_filter_model_campaign_user_filter_model.py +96 -0
- rapidata/api_client/models/i_user_filter_model_country_user_filter_model.py +96 -0
- rapidata/api_client/models/i_user_filter_model_custom_user_filter_model.py +98 -0
- rapidata/api_client/models/i_user_filter_model_gender_user_filter_model.py +104 -0
- rapidata/api_client/models/i_user_filter_model_language_user_filter_model.py +96 -0
- rapidata/api_client/models/i_user_filter_model_new_user_filter_model.py +94 -0
- rapidata/api_client/models/i_user_filter_model_not_user_filter_model.py +102 -0
- rapidata/api_client/models/i_user_filter_model_or_user_filter_model.py +106 -0
- rapidata/api_client/models/i_user_filter_model_response_count_user_filter_model.py +101 -0
- rapidata/api_client/models/i_user_filter_model_user_score_user_filter_model.py +105 -0
- rapidata/api_client/models/i_validation_metadata_input.py +140 -0
- rapidata/api_client/models/i_validation_metadata_input_prompt_asset_metadata_input.py +100 -0
- rapidata/api_client/models/i_validation_metadata_input_prompt_metadata_input.py +96 -0
- rapidata/api_client/models/i_validation_truth.py +280 -0
- rapidata/api_client/models/i_validation_truth_attach_category_truth.py +96 -0
- rapidata/api_client/models/i_validation_truth_bounding_box_truth.py +102 -0
- rapidata/api_client/models/i_validation_truth_compare_truth.py +96 -0
- rapidata/api_client/models/i_validation_truth_empty_validation_truth.py +94 -0
- rapidata/api_client/models/i_validation_truth_line_truth.py +94 -0
- rapidata/api_client/models/i_validation_truth_locate_box_truth.py +104 -0
- rapidata/api_client/models/i_validation_truth_multi_compare_truth.py +96 -0
- rapidata/api_client/models/i_validation_truth_named_entity_truth.py +104 -0
- rapidata/api_client/models/i_validation_truth_polygon_truth.py +94 -0
- rapidata/api_client/models/i_validation_truth_scrub_truth.py +104 -0
- rapidata/api_client/models/i_validation_truth_skip_truth.py +94 -0
- rapidata/api_client/models/i_validation_truth_transcription_truth.py +115 -0
- rapidata/api_client/models/i_workflow_config.py +168 -0
- rapidata/api_client/models/i_workflow_config_compare_workflow_config.py +142 -0
- rapidata/api_client/models/i_workflow_config_evaluation_workflow_config.py +114 -0
- rapidata/api_client/models/i_workflow_config_grouped_ranking_workflow_config.py +155 -0
- rapidata/api_client/models/i_workflow_config_simple_workflow_config.py +116 -0
- rapidata/api_client/models/i_workflow_model.py +168 -0
- rapidata/api_client/models/i_workflow_model_compare_workflow_model.py +145 -0
- rapidata/api_client/models/i_workflow_model_evaluation_workflow_model.py +115 -0
- rapidata/api_client/models/i_workflow_model_grouped_ranking_workflow_model.py +121 -0
- rapidata/api_client/models/i_workflow_model_simple_workflow_model.py +119 -0
- rapidata/api_client/models/image_dimension_metadata.py +12 -1
- rapidata/api_client/models/inquire_file_metadata_result.py +100 -0
- rapidata/api_client/models/inspect_report_result.py +2 -2
- rapidata/api_client/models/json_web_key.py +2 -36
- rapidata/api_client/models/json_web_key_set.py +2 -22
- rapidata/api_client/models/labeling_selection.py +11 -13
- rapidata/api_client/models/language_filter.py +98 -0
- rapidata/api_client/models/leaderboard_query_result.py +46 -4
- rapidata/api_client/models/leaderboards_query_result.py +135 -0
- rapidata/api_client/models/line_result.py +3 -3
- rapidata/api_client/models/line_result_line.py +97 -0
- rapidata/api_client/models/line_result_line_point.py +89 -0
- rapidata/api_client/models/local_file_wrapper.py +120 -0
- rapidata/api_client/models/locate_coordinate.py +4 -13
- rapidata/api_client/models/location_metadata.py +12 -1
- rapidata/api_client/models/logic_operator.py +2 -2
- rapidata/api_client/models/metadata_i_order_metadata_input.py +154 -0
- rapidata/api_client/models/metadata_i_order_metadata_input_metadata_prompt_asset_metadata_input.py +100 -0
- rapidata/api_client/models/metadata_i_order_metadata_input_metadata_prompt_metadata_input.py +96 -0
- rapidata/api_client/models/metadata_i_order_metadata_input_metadata_transcription_metadata_input.py +96 -0
- rapidata/api_client/models/metadata_prompt_asset_metadata_input.py +100 -0
- rapidata/api_client/models/metadata_prompt_metadata_input.py +96 -0
- rapidata/api_client/models/metadata_transcription_metadata_input.py +96 -0
- rapidata/api_client/models/multi_asset.py +6 -6
- rapidata/api_client/models/multi_asset_assets_inner.py +170 -0
- rapidata/api_client/models/multi_asset_input.py +130 -0
- rapidata/api_client/models/multi_asset_input1.py +110 -0
- rapidata/api_client/models/multi_asset_input1_assets_inner.py +198 -0
- rapidata/api_client/models/multi_asset_input2.py +110 -0
- rapidata/api_client/models/multi_asset_input3.py +110 -0
- rapidata/api_client/models/multi_asset_input3_assets_inner.py +198 -0
- rapidata/api_client/models/multi_asset_input_assets_inner.py +156 -0
- rapidata/api_client/models/multi_asset_model.py +3 -3
- rapidata/api_client/models/naive_referee_model.py +2 -2
- rapidata/api_client/models/named_classification.py +4 -13
- rapidata/api_client/models/new_user_filter.py +96 -0
- rapidata/api_client/models/newsletter_model.py +6 -6
- rapidata/api_client/models/not_available_yet_result.py +4 -13
- rapidata/api_client/models/not_filter.py +117 -0
- rapidata/api_client/models/not_user_filter_model.py +3 -3
- rapidata/api_client/models/null_asset.py +3 -5
- rapidata/api_client/models/online_pair_maker_config_model.py +3 -3
- rapidata/api_client/models/or_filter.py +121 -0
- rapidata/api_client/models/or_user_filter_model.py +3 -3
- rapidata/api_client/models/order_model.py +15 -14
- rapidata/api_client/models/order_state.py +2 -2
- rapidata/api_client/models/original_filename_metadata.py +12 -1
- rapidata/api_client/models/page_info.py +2 -7
- rapidata/api_client/models/paged_result_aggregated_orders_model.py +105 -0
- rapidata/api_client/models/paged_result_benchmark_query_result.py +105 -0
- rapidata/api_client/models/paged_result_campaign_query_result.py +105 -0
- rapidata/api_client/models/paged_result_clients_query_result.py +105 -0
- rapidata/api_client/models/paged_result_datapoint_model.py +105 -0
- rapidata/api_client/models/paged_result_get_compare_workflow_results_result.py +105 -0
- rapidata/api_client/models/paged_result_get_grouped_ranking_workflow_results_result.py +105 -0
- rapidata/api_client/models/paged_result_get_validation_rapids_result.py +105 -0
- rapidata/api_client/models/paged_result_get_workflow_results_result.py +105 -0
- rapidata/api_client/models/paged_result_i_workflow_model.py +105 -0
- rapidata/api_client/models/paged_result_leaderboard_query_result.py +105 -0
- rapidata/api_client/models/paged_result_leaderboards_query_result.py +105 -0
- rapidata/api_client/models/paged_result_of_aggregated_orders_model.py +103 -0
- rapidata/api_client/models/paged_result_of_benchmark_query_result.py +103 -0
- rapidata/api_client/models/paged_result_of_campaign_query_result.py +103 -0
- rapidata/api_client/models/paged_result_of_clients_query_result.py +103 -0
- rapidata/api_client/models/paged_result_of_get_compare_workflow_results_result.py +103 -0
- rapidata/api_client/models/paged_result_of_get_grouped_ranking_workflow_results_result.py +103 -0
- rapidata/api_client/models/paged_result_of_get_validation_rapids_result.py +103 -0
- rapidata/api_client/models/paged_result_of_get_workflow_results_result.py +103 -0
- rapidata/api_client/models/paged_result_of_i_workflow_model.py +103 -0
- rapidata/api_client/models/paged_result_of_leaderboards_query_result.py +103 -0
- rapidata/api_client/models/paged_result_of_order_model.py +103 -0
- rapidata/api_client/models/paged_result_of_participant_by_benchmark.py +103 -0
- rapidata/api_client/models/paged_result_of_prompt_by_benchmark_result.py +103 -0
- rapidata/api_client/models/paged_result_of_query_audiences_result.py +103 -0
- rapidata/api_client/models/paged_result_of_query_datapoints_by_dataset_id_result.py +103 -0
- rapidata/api_client/models/paged_result_of_query_validation_rapid_eligibility_result.py +103 -0
- rapidata/api_client/models/paged_result_of_rapid_model.py +103 -0
- rapidata/api_client/models/paged_result_of_runs_by_leaderboard_result.py +103 -0
- rapidata/api_client/models/paged_result_of_sample_by_identifier.py +103 -0
- rapidata/api_client/models/paged_result_of_sample_by_participant.py +103 -0
- rapidata/api_client/models/paged_result_of_standing_by_leaderboard.py +103 -0
- rapidata/api_client/models/paged_result_of_validation_set_model.py +103 -0
- rapidata/api_client/models/paged_result_order_model.py +105 -0
- rapidata/api_client/models/paged_result_participant_by_benchmark.py +105 -0
- rapidata/api_client/models/paged_result_potential_validation_rapid.py +105 -0
- rapidata/api_client/models/paged_result_prompt_by_benchmark_result.py +105 -0
- rapidata/api_client/models/paged_result_query_audiences_result.py +105 -0
- rapidata/api_client/models/paged_result_query_datapoints_by_dataset_id_result.py +105 -0
- rapidata/api_client/models/paged_result_query_validation_rapid_eligibility_result.py +105 -0
- rapidata/api_client/models/paged_result_rapid_model.py +105 -0
- rapidata/api_client/models/paged_result_runs_by_leaderboard_result.py +105 -0
- rapidata/api_client/models/paged_result_sample_by_identifier.py +105 -0
- rapidata/api_client/models/paged_result_sample_by_participant.py +105 -0
- rapidata/api_client/models/paged_result_standing_by_leaderboard.py +105 -0
- rapidata/api_client/models/paged_result_validation_set_model.py +105 -0
- rapidata/api_client/models/participant_by_benchmark.py +94 -0
- rapidata/api_client/models/participant_by_benchmark_paged_result.py +105 -0
- rapidata/api_client/models/participant_by_leaderboard.py +19 -8
- rapidata/api_client/models/participant_status.py +4 -5
- rapidata/api_client/models/pipeline_id_workflow_config_put_request.py +140 -0
- rapidata/api_client/models/polygon_result.py +3 -3
- rapidata/api_client/models/polygon_result_coordinate.py +89 -0
- rapidata/api_client/models/polygon_result_shape.py +95 -0
- rapidata/api_client/models/potential_validation_rapid.py +103 -0
- rapidata/api_client/models/potential_validation_rapid_paged_result.py +105 -0
- rapidata/api_client/models/potential_validation_rapid_truth.py +280 -0
- rapidata/api_client/models/preliminary_download_model.py +5 -5
- rapidata/api_client/models/preview_order_model.py +87 -0
- rapidata/api_client/models/problem_details.py +2 -20
- rapidata/api_client/models/prompt_asset_metadata_input.py +6 -8
- rapidata/api_client/models/prompt_asset_metadata_input_asset.py +154 -0
- rapidata/api_client/models/prompt_by_benchmark_result.py +112 -0
- rapidata/api_client/models/prompt_by_benchmark_result_paged_result.py +105 -0
- rapidata/api_client/models/prompt_metadata.py +12 -1
- rapidata/api_client/models/prompt_metadata_input.py +2 -2
- rapidata/api_client/models/prompt_type.py +38 -0
- rapidata/api_client/models/proxy_file_wrapper.py +129 -0
- rapidata/api_client/models/public_order_model.py +2 -2
- rapidata/api_client/models/public_rapid_response.py +112 -0
- rapidata/api_client/models/query_audiences_result.py +111 -0
- rapidata/api_client/models/query_datapoints_by_dataset_id_result.py +95 -0
- rapidata/api_client/models/query_model.py +10 -5
- rapidata/api_client/models/query_validation_model.py +97 -0
- rapidata/api_client/models/query_validation_rapid_eligibility_model_query_validation_model.py +107 -0
- rapidata/api_client/models/query_validation_rapid_eligibility_result.py +103 -0
- rapidata/api_client/models/query_validation_rapid_eligibility_result_truth.py +280 -0
- rapidata/api_client/models/rapid_issue.py +2 -2
- rapidata/api_client/models/rapid_modality.py +46 -0
- rapidata/api_client/models/rapid_model.py +33 -49
- rapidata/api_client/models/rapid_result_model.py +7 -7
- rapidata/api_client/models/rapid_skipped_model.py +5 -5
- rapidata/api_client/models/rapid_state.py +2 -2
- rapidata/api_client/models/read_bridge_token_keys_result.py +10 -24
- rapidata/api_client/models/reference_asset_input.py +100 -0
- rapidata/api_client/models/report_model.py +9 -15
- rapidata/api_client/models/response_count_filter.py +103 -0
- rapidata/api_client/models/response_count_user_filter_model.py +2 -8
- rapidata/api_client/models/retrieval_mode.py +2 -2
- rapidata/api_client/models/root_filter.py +5 -14
- rapidata/api_client/models/run_status.py +39 -0
- rapidata/api_client/models/runs_by_leaderboard_result.py +104 -0
- rapidata/api_client/models/runs_by_leaderboard_result_paged_result.py +105 -0
- rapidata/api_client/models/sample_by_identifier.py +125 -0
- rapidata/api_client/models/sample_by_identifier_paged_result.py +105 -0
- rapidata/api_client/models/sample_by_participant.py +121 -0
- rapidata/api_client/models/sample_by_participant_paged_result.py +105 -0
- rapidata/api_client/models/scrub_range.py +2 -2
- rapidata/api_client/models/send_survey_model.py +87 -0
- rapidata/api_client/models/simple_workflow_config.py +15 -7
- rapidata/api_client/models/simple_workflow_config_blueprint.py +37 -23
- rapidata/api_client/models/simple_workflow_config_model.py +11 -3
- rapidata/api_client/models/simple_workflow_model.py +14 -4
- rapidata/api_client/models/simple_workflow_model1.py +4 -11
- rapidata/api_client/models/simple_workflow_model_blueprint.py +1 -1
- rapidata/api_client/models/sort_criterion.py +5 -11
- rapidata/api_client/models/sort_direction.py +2 -2
- rapidata/api_client/models/source_url_metadata.py +12 -1
- rapidata/api_client/models/standing_by_benchmark.py +113 -0
- rapidata/api_client/models/standing_by_leaderboard.py +113 -0
- rapidata/api_client/models/standing_by_leaderboard_paged_result.py +105 -0
- rapidata/api_client/models/standing_status.py +38 -0
- rapidata/api_client/models/standings_by_benchmark_result.py +95 -0
- rapidata/api_client/models/standings_by_leaderboard_result.py +95 -0
- rapidata/api_client/models/start_preliminary_download_result.py +87 -0
- rapidata/api_client/models/sticky_state.py +3 -2
- rapidata/api_client/models/stream_file_wrapper.py +138 -0
- rapidata/api_client/models/streams_metadata.py +12 -1
- rapidata/api_client/models/string_segment.py +105 -0
- rapidata/api_client/models/submit_coco_model.py +1 -3
- rapidata/api_client/models/submit_order_model.py +87 -0
- rapidata/api_client/models/submit_participant_result.py +89 -0
- rapidata/api_client/models/submit_prompt_model.py +107 -0
- rapidata/api_client/models/submit_prompt_model_prompt_asset.py +202 -0
- rapidata/api_client/models/tags_by_benchmark_result.py +87 -0
- rapidata/api_client/models/text_asset.py +3 -5
- rapidata/api_client/models/text_asset_input.py +120 -0
- rapidata/api_client/models/text_metadata.py +18 -2
- rapidata/api_client/models/text_metadata_input.py +111 -0
- rapidata/api_client/models/text_metadata_model.py +7 -2
- rapidata/api_client/models/transcription_metadata.py +9 -1
- rapidata/api_client/models/transcription_metadata_input.py +2 -2
- rapidata/api_client/models/transcription_word.py +2 -2
- rapidata/api_client/models/translated_string.py +2 -2
- rapidata/api_client/models/unlock_order_result.py +2 -2
- rapidata/api_client/models/update_audience_request.py +102 -0
- rapidata/api_client/models/update_benchmark_model.py +99 -0
- rapidata/api_client/models/update_benchmark_name_model.py +87 -0
- rapidata/api_client/models/update_campaign_model.py +11 -11
- rapidata/api_client/models/update_dataset_name_model.py +5 -5
- rapidata/api_client/models/update_dimensions_model.py +3 -3
- rapidata/api_client/models/update_leaderboard_model.py +106 -0
- rapidata/api_client/models/update_leaderboard_name_model.py +87 -0
- rapidata/api_client/models/update_leaderboard_response_config_model.py +89 -0
- rapidata/api_client/models/update_order_name_model.py +5 -5
- rapidata/api_client/models/update_participant_model.py +92 -0
- rapidata/api_client/models/update_participant_name_model.py +87 -0
- rapidata/api_client/models/update_priority_model.py +87 -0
- rapidata/api_client/models/update_prompt_tags_model.py +87 -0
- rapidata/api_client/models/update_should_alert_model.py +87 -0
- rapidata/api_client/models/update_validation_rapid_model.py +28 -10
- rapidata/api_client/models/update_validation_rapid_model_context_asset.py +160 -0
- rapidata/api_client/models/update_validation_set_model.py +120 -0
- rapidata/api_client/models/upload_asset_result.py +102 -0
- rapidata/api_client/models/upload_file_from_url_result.py +87 -0
- rapidata/api_client/models/upload_file_result.py +87 -0
- rapidata/api_client/models/user_action_restriction.py +37 -0
- rapidata/api_client/models/user_action_restriction_filter.py +101 -0
- rapidata/api_client/models/user_score_filter.py +102 -0
- rapidata/api_client/models/user_state.py +38 -0
- rapidata/api_client/models/user_state_filter.py +101 -0
- rapidata/api_client/models/validation_chance.py +20 -3
- rapidata/api_client/models/validation_set_model.py +39 -5
- rapidata/api_client/models/validation_set_overview_model.py +2 -2
- rapidata/api_client/models/validation_set_zip_post_request_blueprint.py +252 -0
- rapidata/api_client/models/video_duration_metadata.py +12 -1
- rapidata/api_client/models/workflow_aggregation_step_model.py +3 -12
- rapidata/api_client/models/workflow_config_artifact_model_workflow_config.py +23 -9
- rapidata/api_client/models/workflow_state.py +2 -2
- rapidata/api_client/models/zip_entry_file_wrapper.py +151 -0
- rapidata/api_client/rest.py +16 -9
- rapidata/api_client_README.md +373 -336
- rapidata/rapidata_client/__init__.py +9 -18
- rapidata/rapidata_client/api/rapidata_api_client.py +253 -0
- rapidata/rapidata_client/benchmark/_detail_mapper.py +32 -0
- rapidata/rapidata_client/benchmark/leaderboard/__init__.py +0 -0
- rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py +221 -0
- rapidata/rapidata_client/benchmark/participant/__init__.py +0 -0
- rapidata/rapidata_client/benchmark/participant/_participant.py +147 -0
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py +546 -0
- rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py +219 -0
- rapidata/rapidata_client/config/__init__.py +4 -0
- rapidata/rapidata_client/config/logger.py +135 -0
- rapidata/rapidata_client/config/logging_config.py +55 -0
- rapidata/rapidata_client/config/managed_print.py +6 -0
- rapidata/rapidata_client/config/order_config.py +14 -0
- rapidata/rapidata_client/config/rapidata_config.py +36 -0
- rapidata/rapidata_client/config/tracer.py +184 -0
- rapidata/rapidata_client/config/upload_config.py +64 -0
- rapidata/rapidata_client/datapoints/__init__.py +10 -0
- rapidata/rapidata_client/datapoints/_asset_uploader.py +169 -0
- rapidata/rapidata_client/datapoints/_datapoint.py +92 -0
- rapidata/rapidata_client/datapoints/_datapoint_uploader.py +47 -0
- rapidata/rapidata_client/datapoints/_datapoints_validator.py +70 -0
- rapidata/rapidata_client/datapoints/assets/__init__.py +0 -0
- rapidata/rapidata_client/datapoints/assets/constants.py +7 -0
- rapidata/rapidata_client/{metadata → datapoints/metadata}/__init__.py +1 -0
- rapidata/rapidata_client/datapoints/metadata/_media_asset_metadata.py +26 -0
- rapidata/rapidata_client/datapoints/metadata/_private_text_metadata.py +16 -0
- rapidata/rapidata_client/datapoints/metadata/_prompt_identifier_metadata.py +14 -0
- rapidata/rapidata_client/datapoints/metadata/_prompt_metadata.py +12 -0
- rapidata/rapidata_client/datapoints/metadata/_public_text_metadata.py +16 -0
- rapidata/rapidata_client/{metadata → datapoints/metadata}/_select_words_metadata.py +4 -5
- rapidata/rapidata_client/demographic/demographic_manager.py +44 -19
- rapidata/rapidata_client/exceptions/__init__.py +1 -0
- rapidata/rapidata_client/exceptions/failed_upload_exception.py +20 -0
- rapidata/rapidata_client/filter/__init__.py +1 -0
- rapidata/rapidata_client/filter/_base_filter.py +27 -6
- rapidata/rapidata_client/filter/age_filter.py +21 -10
- rapidata/rapidata_client/filter/and_filter.py +42 -0
- rapidata/rapidata_client/filter/campaign_filter.py +18 -10
- rapidata/rapidata_client/filter/country_filter.py +34 -12
- rapidata/rapidata_client/filter/custom_filter.py +22 -12
- rapidata/rapidata_client/filter/gender_filter.py +22 -10
- rapidata/rapidata_client/filter/language_filter.py +39 -21
- rapidata/rapidata_client/filter/models/age_group.py +14 -12
- rapidata/rapidata_client/filter/models/gender.py +12 -8
- rapidata/rapidata_client/filter/new_user_filter.py +11 -4
- rapidata/rapidata_client/filter/not_filter.py +23 -11
- rapidata/rapidata_client/filter/or_filter.py +23 -11
- rapidata/rapidata_client/filter/rapidata_filters.py +19 -13
- rapidata/rapidata_client/filter/response_count_filter.py +36 -20
- rapidata/rapidata_client/filter/user_score_filter.py +47 -24
- rapidata/rapidata_client/order/_rapidata_order_builder.py +289 -154
- rapidata/rapidata_client/order/dataset/_rapidata_dataset.py +153 -0
- rapidata/rapidata_client/order/rapidata_order.py +316 -163
- rapidata/rapidata_client/order/rapidata_order_manager.py +688 -430
- rapidata/rapidata_client/order/rapidata_results.py +86 -63
- rapidata/rapidata_client/rapidata_client.py +98 -36
- rapidata/rapidata_client/referee/__init__.py +1 -1
- rapidata/rapidata_client/referee/_base_referee.py +7 -3
- rapidata/rapidata_client/referee/_early_stopping_referee.py +20 -11
- rapidata/rapidata_client/referee/_naive_referee.py +18 -3
- rapidata/rapidata_client/selection/__init__.py +2 -2
- rapidata/rapidata_client/selection/_base_selection.py +9 -2
- rapidata/rapidata_client/selection/ab_test_selection.py +28 -20
- rapidata/rapidata_client/selection/capped_selection.py +23 -16
- rapidata/rapidata_client/selection/conditional_validation_selection.py +43 -24
- rapidata/rapidata_client/selection/demographic_selection.py +21 -6
- rapidata/rapidata_client/selection/effort_selection.py +40 -10
- rapidata/rapidata_client/selection/labeling_selection.py +34 -11
- rapidata/rapidata_client/selection/{retrieval_modes.py → rapidata_retrieval_modes.py} +7 -4
- rapidata/rapidata_client/selection/rapidata_selections.py +17 -8
- rapidata/rapidata_client/selection/shuffling_selection.py +21 -13
- rapidata/rapidata_client/selection/static_selection.py +19 -8
- rapidata/rapidata_client/selection/validation_selection.py +20 -4
- rapidata/rapidata_client/settings/__init__.py +2 -0
- rapidata/rapidata_client/settings/_rapidata_setting.py +15 -2
- rapidata/rapidata_client/settings/alert_on_fast_response.py +8 -5
- rapidata/rapidata_client/settings/allow_neither_both.py +3 -0
- rapidata/rapidata_client/settings/custom_setting.py +3 -2
- rapidata/rapidata_client/settings/free_text_minimum_characters.py +9 -4
- rapidata/rapidata_client/settings/models/translation_behaviour_options.py +3 -2
- rapidata/rapidata_client/settings/mute_video.py +15 -0
- rapidata/rapidata_client/settings/no_shuffle.py +4 -2
- rapidata/rapidata_client/settings/play_video_until_the_end.py +7 -4
- rapidata/rapidata_client/settings/rapidata_settings.py +16 -3
- rapidata/rapidata_client/settings/swap_context_instruction.py +20 -0
- rapidata/rapidata_client/settings/translation_behaviour.py +7 -5
- rapidata/rapidata_client/validation/rapidata_validation_set.py +106 -12
- rapidata/rapidata_client/validation/rapids/_validation_rapid_uploader.py +62 -0
- rapidata/rapidata_client/validation/rapids/box.py +37 -12
- rapidata/rapidata_client/validation/rapids/rapids.py +28 -103
- rapidata/rapidata_client/validation/rapids/rapids_manager.py +315 -208
- rapidata/rapidata_client/validation/validation_set_manager.py +511 -274
- rapidata/rapidata_client/workflow/__init__.py +2 -1
- rapidata/rapidata_client/workflow/_base_workflow.py +25 -7
- rapidata/rapidata_client/workflow/_classify_workflow.py +58 -15
- rapidata/rapidata_client/workflow/_compare_workflow.py +44 -9
- rapidata/rapidata_client/workflow/_draw_workflow.py +40 -10
- rapidata/rapidata_client/workflow/_evaluation_workflow.py +28 -7
- rapidata/rapidata_client/workflow/_free_text_workflow.py +46 -9
- rapidata/rapidata_client/workflow/_locate_workflow.py +40 -10
- rapidata/rapidata_client/workflow/_multi_ranking_workflow.py +87 -0
- rapidata/rapidata_client/workflow/_ranking_workflow.py +109 -25
- rapidata/rapidata_client/workflow/_select_words_workflow.py +51 -11
- rapidata/rapidata_client/workflow/_timestamp_workflow.py +42 -11
- rapidata/service/__init__.py +0 -1
- rapidata/service/credential_manager.py +14 -14
- rapidata/service/openapi_service.py +79 -24
- rapidata/types/__init__.py +166 -0
- rapidata-2.44.3.dist-info/METADATA +32 -0
- rapidata-2.44.3.dist-info/RECORD +1014 -0
- {rapidata-2.28.2.dist-info → rapidata-2.44.3.dist-info}/WHEEL +1 -1
- rapidata/rapidata_client/api/rapidata_exception.py +0 -107
- rapidata/rapidata_client/assets/__init__.py +0 -10
- rapidata/rapidata_client/assets/_base_asset.py +0 -11
- rapidata/rapidata_client/assets/_media_asset.py +0 -306
- rapidata/rapidata_client/assets/_multi_asset.py +0 -61
- rapidata/rapidata_client/assets/_sessions.py +0 -35
- rapidata/rapidata_client/assets/_text_asset.py +0 -34
- rapidata/rapidata_client/assets/data_type_enum.py +0 -7
- rapidata/rapidata_client/country_codes/__init__.py +0 -1
- rapidata/rapidata_client/country_codes/country_codes.py +0 -19
- rapidata/rapidata_client/leaderboard/rapidata_leaderboard.py +0 -127
- rapidata/rapidata_client/leaderboard/rapidata_leaderboard_manager.py +0 -92
- rapidata/rapidata_client/logging/__init__.py +0 -2
- rapidata/rapidata_client/logging/logger.py +0 -122
- rapidata/rapidata_client/logging/output_manager.py +0 -20
- rapidata/rapidata_client/metadata/_media_asset_metadata.py +0 -15
- rapidata/rapidata_client/metadata/_private_text_metadata.py +0 -17
- rapidata/rapidata_client/metadata/_prompt_metadata.py +0 -18
- rapidata/rapidata_client/metadata/_public_text_metadata.py +0 -17
- rapidata/rapidata_client/order/_rapidata_dataset.py +0 -461
- rapidata/service/local_file_service.py +0 -25
- rapidata-2.28.2.dist-info/METADATA +0 -35
- rapidata-2.28.2.dist-info/RECORD +0 -574
- /rapidata/rapidata_client/{leaderboard → benchmark}/__init__.py +0 -0
- /rapidata/rapidata_client/{metadata → datapoints/metadata}/_base_metadata.py +0 -0
- {rapidata-2.28.2.dist-info → rapidata-2.44.3.dist-info/licenses}/LICENSE +0 -0
|
@@ -1,48 +1,35 @@
|
|
|
1
|
-
from
|
|
2
|
-
from urllib3._collections import HTTPHeaderDict # type: ignore[import]
|
|
3
|
-
from itertools import zip_longest
|
|
1
|
+
from __future__ import annotations
|
|
4
2
|
|
|
5
|
-
from
|
|
6
|
-
|
|
7
|
-
from rapidata.rapidata_client.
|
|
8
|
-
from rapidata.rapidata_client.
|
|
9
|
-
from rapidata.rapidata_client.
|
|
10
|
-
from rapidata.rapidata_client.
|
|
11
|
-
from rapidata.rapidata_client.
|
|
12
|
-
|
|
13
|
-
from rapidata.rapidata_client.workflow import (
|
|
14
|
-
Workflow,
|
|
15
|
-
ClassifyWorkflow,
|
|
16
|
-
CompareWorkflow,
|
|
17
|
-
FreeTextWorkflow,
|
|
18
|
-
SelectWordsWorkflow,
|
|
19
|
-
LocateWorkflow,
|
|
20
|
-
DrawWorkflow,
|
|
21
|
-
TimestampWorkflow,
|
|
22
|
-
RankingWorkflow
|
|
3
|
+
from typing import Literal, Optional, Sequence, get_args, TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from rapidata.rapidata_client.config import logger
|
|
6
|
+
from rapidata.rapidata_client.config.tracer import tracer
|
|
7
|
+
from rapidata.rapidata_client.datapoints._asset_uploader import AssetUploader
|
|
8
|
+
from rapidata.rapidata_client.datapoints._datapoint import Datapoint
|
|
9
|
+
from rapidata.rapidata_client.datapoints._datapoints_validator import (
|
|
10
|
+
DatapointsValidator,
|
|
23
11
|
)
|
|
24
|
-
from rapidata.rapidata_client.selection.validation_selection import ValidationSelection
|
|
25
|
-
from rapidata.rapidata_client.selection.labeling_selection import LabelingSelection
|
|
26
|
-
from rapidata.rapidata_client.assets import MediaAsset, TextAsset, MultiAsset
|
|
27
12
|
from rapidata.rapidata_client.filter import RapidataFilter
|
|
28
13
|
from rapidata.rapidata_client.filter.rapidata_filters import RapidataFilters
|
|
29
|
-
from rapidata.rapidata_client.settings import
|
|
14
|
+
from rapidata.rapidata_client.settings import RapidataSetting, RapidataSettings
|
|
30
15
|
from rapidata.rapidata_client.selection.rapidata_selections import RapidataSelections
|
|
31
|
-
from rapidata.
|
|
32
|
-
|
|
33
|
-
from rapidata.api_client.models.query_model import QueryModel
|
|
34
|
-
from rapidata.api_client.models.page_info import PageInfo
|
|
35
|
-
from rapidata.api_client.models.root_filter import RootFilter
|
|
36
|
-
from rapidata.api_client.models.filter import Filter
|
|
37
|
-
from rapidata.api_client.models.sort_criterion import SortCriterion
|
|
16
|
+
from rapidata.service.openapi_service import OpenAPIService
|
|
38
17
|
|
|
39
|
-
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from rapidata.rapidata_client.order._rapidata_order_builder import (
|
|
20
|
+
StickyStateLiteral,
|
|
21
|
+
)
|
|
22
|
+
from rapidata.rapidata_client.order.rapidata_order import RapidataOrder
|
|
23
|
+
from rapidata.rapidata_client.selection._base_selection import RapidataSelection
|
|
24
|
+
from rapidata.rapidata_client.workflow import (
|
|
25
|
+
Workflow,
|
|
26
|
+
)
|
|
40
27
|
|
|
41
28
|
|
|
42
29
|
class RapidataOrderManager:
|
|
43
30
|
"""
|
|
44
31
|
Handels everything regarding the orders from creation to retrieval.
|
|
45
|
-
|
|
32
|
+
|
|
46
33
|
Attributes:
|
|
47
34
|
filters (RapidataFilters): The RapidataFilters instance.
|
|
48
35
|
settings (RapidataSettings): The RapidataSettings instance.
|
|
@@ -53,112 +40,129 @@ class RapidataOrderManager:
|
|
|
53
40
|
self.filters = RapidataFilters
|
|
54
41
|
self.settings = RapidataSettings
|
|
55
42
|
self.selections = RapidataSelections
|
|
56
|
-
|
|
43
|
+
from rapidata.rapidata_client.order._rapidata_order_builder import (
|
|
44
|
+
StickyStateLiteral,
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
self.__priority: int | None = None
|
|
48
|
+
self.__sticky_state: StickyStateLiteral | None = None
|
|
49
|
+
self._asset_uploader = AssetUploader(openapi_service)
|
|
57
50
|
logger.debug("RapidataOrderManager initialized")
|
|
58
51
|
|
|
59
|
-
def
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
settings
|
|
75
|
-
|
|
76
|
-
selections
|
|
77
|
-
private_notes: list[str] | None = None,
|
|
78
|
-
default_labeling_amount: int = 3
|
|
79
|
-
) -> RapidataOrder:
|
|
80
|
-
|
|
81
|
-
if not assets:
|
|
82
|
-
raise ValueError("No datapoints provided")
|
|
83
|
-
|
|
84
|
-
if contexts and len(contexts) != len(assets):
|
|
85
|
-
raise ValueError("Number of contexts must match number of datapoints")
|
|
86
|
-
|
|
87
|
-
if media_contexts and len(media_contexts) != len(assets):
|
|
88
|
-
raise ValueError("Number of media contexts must match number of datapoints")
|
|
89
|
-
|
|
90
|
-
if sentences and len(sentences) != len(assets):
|
|
91
|
-
raise ValueError("Number of sentences must match number of datapoints")
|
|
92
|
-
|
|
93
|
-
if private_notes and len(private_notes) != len(assets):
|
|
94
|
-
raise ValueError("Number of private notes must match number of datapoints")
|
|
95
|
-
|
|
96
|
-
if sentences and contexts:
|
|
97
|
-
raise ValueError("You can only use contexts or sentences, not both")
|
|
52
|
+
def _create_general_order(
|
|
53
|
+
self,
|
|
54
|
+
name: str,
|
|
55
|
+
workflow: Workflow,
|
|
56
|
+
datapoints: list[Datapoint],
|
|
57
|
+
responses_per_datapoint: int = 10,
|
|
58
|
+
validation_set_id: str | None = None,
|
|
59
|
+
confidence_threshold: float | None = None,
|
|
60
|
+
filters: Sequence[RapidataFilter] | None = None,
|
|
61
|
+
settings: Sequence[RapidataSetting] | None = None,
|
|
62
|
+
selections: Sequence[RapidataSelection] | None = None,
|
|
63
|
+
) -> RapidataOrder:
|
|
64
|
+
if filters is None:
|
|
65
|
+
filters = []
|
|
66
|
+
if settings is None:
|
|
67
|
+
settings = []
|
|
68
|
+
if selections is None:
|
|
69
|
+
selections = []
|
|
98
70
|
|
|
99
71
|
if not confidence_threshold:
|
|
72
|
+
from rapidata.rapidata_client.referee._naive_referee import NaiveReferee
|
|
73
|
+
|
|
100
74
|
referee = NaiveReferee(responses=responses_per_datapoint)
|
|
101
75
|
else:
|
|
76
|
+
from rapidata.rapidata_client.referee._early_stopping_referee import (
|
|
77
|
+
EarlyStoppingReferee,
|
|
78
|
+
)
|
|
79
|
+
|
|
102
80
|
referee = EarlyStoppingReferee(
|
|
103
81
|
threshold=confidence_threshold,
|
|
104
82
|
max_vote_count=responses_per_datapoint,
|
|
105
83
|
)
|
|
106
84
|
|
|
107
|
-
|
|
85
|
+
logger.debug(
|
|
86
|
+
"Creating order with parameters: name %s, workflow %s, datapoints %s, responses_per_datapoint %s, validation_set_id %s, confidence_threshold %s, filters %s, settings %s, selections %s",
|
|
87
|
+
name,
|
|
88
|
+
workflow,
|
|
89
|
+
datapoints,
|
|
90
|
+
responses_per_datapoint,
|
|
91
|
+
validation_set_id,
|
|
92
|
+
confidence_threshold,
|
|
93
|
+
filters,
|
|
94
|
+
settings,
|
|
95
|
+
selections,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
from rapidata.rapidata_client.order._rapidata_order_builder import (
|
|
99
|
+
RapidataOrderBuilder,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
order_builder = RapidataOrderBuilder(
|
|
103
|
+
name=name, openapi_service=self.__openapi_service
|
|
104
|
+
)
|
|
108
105
|
|
|
109
106
|
if selections and validation_set_id:
|
|
110
|
-
logger.warning(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
order = (order_builder
|
|
129
|
-
._workflow(workflow)
|
|
130
|
-
._media(
|
|
131
|
-
assets=assets,
|
|
132
|
-
multi_metadata=multi_metadata
|
|
133
|
-
)
|
|
134
|
-
._referee(referee)
|
|
135
|
-
._filters(filters)
|
|
136
|
-
._selections(selections)
|
|
137
|
-
._settings(settings)
|
|
138
|
-
._priority(self.__priority)
|
|
139
|
-
._create()
|
|
140
|
-
)
|
|
107
|
+
logger.warning(
|
|
108
|
+
"Warning: Both selections and validation_set_id provided. Ignoring validation_set_id."
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
order = (
|
|
112
|
+
order_builder._set_workflow(workflow)
|
|
113
|
+
._set_datapoints(datapoints=datapoints)
|
|
114
|
+
._set_referee(referee)
|
|
115
|
+
._set_filters(filters)
|
|
116
|
+
._set_selections(selections)
|
|
117
|
+
._set_settings(settings)
|
|
118
|
+
._set_validation_set_id(validation_set_id if not selections else None)
|
|
119
|
+
._set_priority(self.__priority)
|
|
120
|
+
._set_sticky_state(self.__sticky_state)
|
|
121
|
+
._create()
|
|
122
|
+
)
|
|
123
|
+
logger.debug("Order created: %s", order)
|
|
141
124
|
return order
|
|
142
|
-
|
|
143
|
-
def _set_priority(self, priority: int):
|
|
125
|
+
|
|
126
|
+
def _set_priority(self, priority: int | None):
|
|
127
|
+
if priority is not None and not isinstance(priority, int):
|
|
128
|
+
raise TypeError("Priority must be an integer or None")
|
|
129
|
+
|
|
130
|
+
if priority is not None and priority < 0:
|
|
131
|
+
raise ValueError("Priority must be greater than 0 or None")
|
|
132
|
+
|
|
144
133
|
self.__priority = priority
|
|
145
|
-
|
|
146
|
-
def
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
134
|
+
|
|
135
|
+
def _set_sticky_state(self, sticky_state: StickyStateLiteral | None):
|
|
136
|
+
from rapidata.rapidata_client.order._rapidata_order_builder import (
|
|
137
|
+
StickyStateLiteral,
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
sticky_state_valid_values = get_args(StickyStateLiteral)
|
|
141
|
+
|
|
142
|
+
if sticky_state is not None and sticky_state not in sticky_state_valid_values:
|
|
143
|
+
raise ValueError(
|
|
144
|
+
f"Sticky state must be one of {sticky_state_valid_values} or None"
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
self.__sticky_state = sticky_state
|
|
148
|
+
|
|
149
|
+
def create_classification_order(
|
|
150
|
+
self,
|
|
151
|
+
name: str,
|
|
152
|
+
instruction: str,
|
|
153
|
+
answer_options: list[str],
|
|
154
|
+
datapoints: list[str],
|
|
155
|
+
data_type: Literal["media", "text"] = "media",
|
|
156
|
+
responses_per_datapoint: int = 10,
|
|
157
|
+
contexts: list[str] | None = None,
|
|
158
|
+
media_contexts: list[str] | None = None,
|
|
159
|
+
validation_set_id: str | None = None,
|
|
160
|
+
confidence_threshold: float | None = None,
|
|
161
|
+
filters: Sequence[RapidataFilter] | None = None,
|
|
162
|
+
settings: Sequence[RapidataSetting] | None = None,
|
|
163
|
+
selections: Sequence[RapidataSelection] | None = None,
|
|
164
|
+
private_notes: list[str] | None = None,
|
|
165
|
+
) -> RapidataOrder:
|
|
162
166
|
"""Create a classification order.
|
|
163
167
|
|
|
164
168
|
With this order you can have a datapoint (image, text, video, audio) be classified into one of the answer options.
|
|
@@ -169,8 +173,8 @@ class RapidataOrderManager:
|
|
|
169
173
|
instruction (str): The instruction for how the data should be classified.
|
|
170
174
|
answer_options (list[str]): The list of options for the classification.
|
|
171
175
|
datapoints (list[str]): The list of datapoints for the classification - each datapoint will be labeled.
|
|
172
|
-
data_type (str, optional): The data type of the datapoints. Defaults to
|
|
173
|
-
Other option:
|
|
176
|
+
data_type (str, optional): The data type of the datapoints. Defaults to "media" (any form of image, video or audio). \n
|
|
177
|
+
Other option: "text".
|
|
174
178
|
responses_per_datapoint (int, optional): The number of responses that will be collected per datapoint. Defaults to 10.
|
|
175
179
|
contexts (list[str], optional): The list of contexts for the classification. Defaults to None.\n
|
|
176
180
|
If provided has to be the same length as datapoints and will be shown in addition to the instruction and options. (Therefore will be different for each datapoint)
|
|
@@ -185,50 +189,74 @@ class RapidataOrderManager:
|
|
|
185
189
|
settings (Sequence[RapidataSetting], optional): The list of settings for the classification. Defaults to []. Decides how the tasks should be shown.
|
|
186
190
|
selections (Sequence[RapidataSelection], optional): The list of selections for the classification. Defaults to []. Decides in what order the tasks should be shown.
|
|
187
191
|
private_notes (list[str], optional): The list of private notes for the classification. Defaults to None.
|
|
188
|
-
If provided has to be the same length as datapoints.\n
|
|
192
|
+
If provided has to be the same length as datapoints.\n
|
|
189
193
|
This will NOT be shown to the labelers but will be included in the result purely for your own reference.
|
|
194
|
+
|
|
195
|
+
Example:
|
|
196
|
+
```python
|
|
197
|
+
from rapidata import RapidataClient, NoShuffle
|
|
198
|
+
|
|
199
|
+
rapi = RapidataClient()
|
|
200
|
+
order = rapi.order.create_classification_order(
|
|
201
|
+
name="Image Quality Rating",
|
|
202
|
+
instruction="How would you rate the quality of this image?",
|
|
203
|
+
answer_options=["1: Poor", "2: Fair", "3: Good", "4: Excellent"],
|
|
204
|
+
datapoints=["https://example.com/image1.jpg", "https://example.com/image2.jpg"],
|
|
205
|
+
responses_per_datapoint=15,
|
|
206
|
+
settings=[NoShuffle()], # Keep options in order for Likert scale
|
|
207
|
+
).run()
|
|
208
|
+
|
|
209
|
+
results = order.get_results()
|
|
210
|
+
```
|
|
190
211
|
"""
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
212
|
+
with tracer.start_as_current_span(
|
|
213
|
+
"RapidataOrderManager.create_classification_order"
|
|
214
|
+
):
|
|
215
|
+
if not isinstance(datapoints, list) or not all(
|
|
216
|
+
isinstance(datapoint, str) for datapoint in datapoints
|
|
217
|
+
):
|
|
218
|
+
raise ValueError("Datapoints must be a list of strings")
|
|
219
|
+
|
|
220
|
+
from rapidata.rapidata_client.workflow import ClassifyWorkflow
|
|
221
|
+
|
|
222
|
+
datapoints_instances = DatapointsValidator.map_datapoints(
|
|
223
|
+
datapoints=datapoints,
|
|
224
|
+
contexts=contexts,
|
|
225
|
+
media_contexts=media_contexts,
|
|
226
|
+
private_notes=private_notes,
|
|
227
|
+
data_type=data_type,
|
|
228
|
+
)
|
|
229
|
+
return self._create_general_order(
|
|
230
|
+
name=name,
|
|
231
|
+
workflow=ClassifyWorkflow(
|
|
232
|
+
instruction=instruction, answer_options=answer_options
|
|
233
|
+
),
|
|
234
|
+
datapoints=datapoints_instances,
|
|
235
|
+
responses_per_datapoint=responses_per_datapoint,
|
|
236
|
+
validation_set_id=validation_set_id,
|
|
237
|
+
confidence_threshold=confidence_threshold,
|
|
238
|
+
filters=filters,
|
|
239
|
+
selections=selections,
|
|
240
|
+
settings=settings,
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
def create_compare_order(
|
|
244
|
+
self,
|
|
245
|
+
name: str,
|
|
246
|
+
instruction: str,
|
|
247
|
+
datapoints: list[list[str]],
|
|
248
|
+
data_type: Literal["media", "text"] = "media",
|
|
249
|
+
responses_per_datapoint: int = 10,
|
|
250
|
+
contexts: list[str] | None = None,
|
|
251
|
+
media_contexts: list[str] | None = None,
|
|
252
|
+
a_b_names: list[str] | None = None,
|
|
253
|
+
validation_set_id: str | None = None,
|
|
254
|
+
confidence_threshold: float | None = None,
|
|
255
|
+
filters: Sequence[RapidataFilter] | None = None,
|
|
256
|
+
settings: Sequence[RapidataSetting] | None = None,
|
|
257
|
+
selections: Sequence[RapidataSelection] | None = None,
|
|
258
|
+
private_notes: list[str] | None = None,
|
|
259
|
+
) -> RapidataOrder:
|
|
232
260
|
"""Create a compare order.
|
|
233
261
|
|
|
234
262
|
With this order you compare two datapoints (image, text, video, audio) and the annotators will choose one of the two based on the instruction.
|
|
@@ -237,8 +265,8 @@ class RapidataOrderManager:
|
|
|
237
265
|
name (str): The name of the order. (Will not be shown to the labeler)
|
|
238
266
|
instruction (str): The instruction for the comparison. Will be shown along side each datapoint.
|
|
239
267
|
datapoints (list[list[str]]): Outher list is the datapoints, inner list is the options for the comparison - each datapoint will be labeled.
|
|
240
|
-
data_type (str, optional): The data type of the datapoints. Defaults to
|
|
241
|
-
Other option:
|
|
268
|
+
data_type (str, optional): The data type of the datapoints. Defaults to "media" (any form of image, video or audio). \n
|
|
269
|
+
Other option: "text".
|
|
242
270
|
responses_per_datapoint (int, optional): The number of responses that will be collected per datapoint. Defaults to 10.
|
|
243
271
|
contexts (list[str], optional): The list of contexts for the comparison. Defaults to None.\n
|
|
244
272
|
If provided has to be the same length as datapoints and will be shown in addition to the instruction. (Therefore will be different for each datapoint)
|
|
@@ -246,6 +274,15 @@ class RapidataOrderManager:
|
|
|
246
274
|
media_contexts (list[str], optional): The list of media contexts i.e. links to the images / videos for the comparison. Defaults to None.\n
|
|
247
275
|
If provided has to be the same length as datapoints and will be shown in addition to the instruction. (Therefore will be different for each datapoint)
|
|
248
276
|
Will be matched up with the datapoints using the list index.
|
|
277
|
+
a_b_names (list[str], optional): Custom naming for the two opposing models defined by the index in the datapoints list. Defaults to None.\n
|
|
278
|
+
If provided has to be a list of exactly two strings.
|
|
279
|
+
example:
|
|
280
|
+
```python
|
|
281
|
+
datapoints = [["path_to_image_A", "path_to_image_B"], ["path_to_text_A", "path_to_text_B"]]
|
|
282
|
+
a_b_naming = ["Model A", "Model B"]
|
|
283
|
+
```
|
|
284
|
+
The results will then correctly show "Model A" and "Model B".
|
|
285
|
+
If not provided, the results will be shown as "A" and "B".
|
|
249
286
|
validation_set_id (str, optional): The ID of the validation set. Defaults to None.\n
|
|
250
287
|
If provided, one validation task will be shown infront of the datapoints that will be labeled.
|
|
251
288
|
confidence_threshold (float, optional): The probability threshold for the comparison. Defaults to None.\n
|
|
@@ -254,113 +291,219 @@ class RapidataOrderManager:
|
|
|
254
291
|
settings (Sequence[RapidataSetting], optional): The list of settings for the comparison. Defaults to []. Decides how the tasks should be shown.
|
|
255
292
|
selections (Sequence[RapidataSelection], optional): The list of selections for the comparison. Defaults to []. Decides in what order the tasks should be shown.
|
|
256
293
|
private_notes (list[str], optional): The list of private notes for the comparison. Defaults to None.\n
|
|
257
|
-
If provided has to be the same length as datapoints.\n
|
|
294
|
+
If provided has to be the same length as datapoints.\n
|
|
258
295
|
This will NOT be shown to the labelers but will be included in the result purely for your own reference.
|
|
259
|
-
"""
|
|
260
|
-
|
|
261
|
-
if any(type(datapoint) != list for datapoint in datapoints):
|
|
262
|
-
raise ValueError("Each datapoint must be a list of 2 paths/texts")
|
|
263
|
-
|
|
264
|
-
if any(len(datapoint) != 2 for datapoint in datapoints):
|
|
265
|
-
raise ValueError("Each datapoint must contain exactly two options")
|
|
266
296
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
297
|
+
Example:
|
|
298
|
+
```python
|
|
299
|
+
from rapidata import RapidataClient
|
|
300
|
+
|
|
301
|
+
rapi = RapidataClient()
|
|
302
|
+
order = rapi.order.create_compare_order(
|
|
303
|
+
name="Image Prompt Alignment",
|
|
304
|
+
instruction="Which image follows the prompt more accurately?",
|
|
305
|
+
datapoints=[
|
|
306
|
+
["https://example.com/model_a_img1.jpg", "https://example.com/model_b_img1.jpg"],
|
|
307
|
+
["https://example.com/model_a_img2.jpg", "https://example.com/model_b_img2.jpg"],
|
|
308
|
+
],
|
|
309
|
+
contexts=["A cat sitting on a red couch", "A blue car in the rain"],
|
|
310
|
+
responses_per_datapoint=25,
|
|
311
|
+
a_b_names=["Flux", "Midjourney"], # Optional: label the models in results
|
|
312
|
+
).run()
|
|
313
|
+
|
|
314
|
+
results = order.get_results()
|
|
315
|
+
```
|
|
316
|
+
"""
|
|
317
|
+
with tracer.start_as_current_span("RapidataOrderManager.create_compare_order"):
|
|
318
|
+
if any(not isinstance(datapoint, list) for datapoint in datapoints):
|
|
319
|
+
raise ValueError("Each datapoint must be a list of 2 paths/texts")
|
|
320
|
+
|
|
321
|
+
if any(len(set(datapoint)) != 2 for datapoint in datapoints):
|
|
322
|
+
raise ValueError(
|
|
323
|
+
"Each datapoint must contain exactly two unique options"
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
if a_b_names is not None and len(a_b_names) != 2:
|
|
327
|
+
raise ValueError(
|
|
328
|
+
"A_B_naming must be a list of exactly two strings or None"
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
from rapidata.rapidata_client.workflow import CompareWorkflow
|
|
332
|
+
|
|
333
|
+
datapoints_instances = DatapointsValidator.map_datapoints(
|
|
334
|
+
datapoints=datapoints,
|
|
335
|
+
contexts=contexts,
|
|
336
|
+
media_contexts=media_contexts,
|
|
337
|
+
private_notes=private_notes,
|
|
338
|
+
data_type=data_type,
|
|
339
|
+
)
|
|
340
|
+
return self._create_general_order(
|
|
341
|
+
name=name,
|
|
342
|
+
workflow=CompareWorkflow(instruction=instruction, a_b_names=a_b_names),
|
|
343
|
+
datapoints=datapoints_instances,
|
|
344
|
+
responses_per_datapoint=responses_per_datapoint,
|
|
345
|
+
validation_set_id=validation_set_id,
|
|
346
|
+
confidence_threshold=confidence_threshold,
|
|
347
|
+
filters=filters,
|
|
348
|
+
selections=selections,
|
|
349
|
+
settings=settings,
|
|
350
|
+
)
|
|
290
351
|
|
|
291
|
-
def create_ranking_order(
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
352
|
+
def create_ranking_order(
|
|
353
|
+
self,
|
|
354
|
+
name: str,
|
|
355
|
+
instruction: str,
|
|
356
|
+
datapoints: list[list[str]],
|
|
357
|
+
comparison_budget_per_ranking: int,
|
|
358
|
+
responses_per_comparison: int = 1,
|
|
359
|
+
data_type: Literal["media", "text"] = "media",
|
|
360
|
+
random_comparisons_ratio: float = 0.5,
|
|
361
|
+
contexts: Optional[list[str]] = None,
|
|
362
|
+
media_contexts: Optional[list[str]] = None,
|
|
363
|
+
validation_set_id: Optional[str] = None,
|
|
364
|
+
filters: Sequence[RapidataFilter] | None = None,
|
|
365
|
+
settings: Sequence[RapidataSetting] | None = None,
|
|
366
|
+
selections: Sequence[RapidataSelection] | None = None,
|
|
367
|
+
) -> RapidataOrder:
|
|
305
368
|
"""
|
|
306
369
|
Create a ranking order.
|
|
307
370
|
|
|
308
|
-
With this order you can
|
|
309
|
-
|
|
371
|
+
With this order you can have a multiple lists of datapoints (image, text, video, audio) be ranked based on the instruction.
|
|
372
|
+
Each list will be ranked independently, based on comparison matchups.
|
|
310
373
|
|
|
311
374
|
Args:
|
|
312
375
|
name (str): The name of the order.
|
|
313
|
-
instruction (str): The
|
|
314
|
-
datapoints (list[str]):
|
|
315
|
-
|
|
316
|
-
responses_per_comparison (int, optional): The number of responses collected per comparison. Defaults to 1.
|
|
317
|
-
data_type (str, optional): The data type of the datapoints. Defaults to
|
|
318
|
-
Other option:
|
|
319
|
-
random_comparisons_ratio (float, optional): The
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
376
|
+
instruction (str): The instruction for the ranking. Will be shown with each matchup.
|
|
377
|
+
datapoints (list[list[str]]): The outer list is determines the independent rankings, the inner list is the datapoints for each ranking.
|
|
378
|
+
comparison_budget_per_ranking (int): The number of comparisons that will be collected per ranking (outer list of datapoints).
|
|
379
|
+
responses_per_comparison (int, optional): The number of responses that will be collected per comparison. Defaults to 1.
|
|
380
|
+
data_type (str, optional): The data type of the datapoints. Defaults to "media" (any form of image, video or audio). \n
|
|
381
|
+
Other option: "text".
|
|
382
|
+
random_comparisons_ratio (float, optional): The ratio of random comparisons to the total number of comparisons. Defaults to 0.5.
|
|
383
|
+
contexts (list[str], optional): The list of contexts for the ranking. Defaults to None.\n
|
|
384
|
+
If provided has to be the same length as the outer list of datapoints and will be shown in addition to the instruction. (Therefore will be different for each ranking)
|
|
385
|
+
Will be matched up with the datapoints using the list index.
|
|
386
|
+
media_contexts (list[str], optional): The list of media contexts for the ranking i.e links to the images / videos. Defaults to None.\n
|
|
387
|
+
If provided has to be the same length as the outer list of datapoints and will be shown in addition to the instruction. (Therefore will be different for each ranking)
|
|
388
|
+
Will be matched up with the datapoints using the list index.
|
|
323
389
|
validation_set_id (str, optional): The ID of the validation set. Defaults to None.\n
|
|
324
390
|
If provided, one validation task will be shown infront of the datapoints that will be labeled.
|
|
325
|
-
filters (Sequence[RapidataFilter], optional): The list of filters for the
|
|
326
|
-
settings (Sequence[RapidataSetting], optional): The list of settings for the
|
|
327
|
-
selections (Sequence[RapidataSelection], optional): The list of selections for the
|
|
391
|
+
filters (Sequence[RapidataFilter], optional): The list of filters for the ranking. Defaults to []. Decides who the tasks should be shown to.
|
|
392
|
+
settings (Sequence[RapidataSetting], optional): The list of settings for the ranking. Defaults to []. Decides how the tasks should be shown.
|
|
393
|
+
selections (Sequence[RapidataSelection], optional): The list of selections for the ranking. Defaults to []. Decides in what order the tasks should be shown.
|
|
394
|
+
|
|
395
|
+
Example:
|
|
396
|
+
```python
|
|
397
|
+
from rapidata import RapidataClient
|
|
398
|
+
|
|
399
|
+
rapi = RapidataClient()
|
|
400
|
+
# Rank 12 images by preference using 50 pairwise comparisons
|
|
401
|
+
order = rapi.order.create_ranking_order(
|
|
402
|
+
name="Image Quality Ranking",
|
|
403
|
+
instruction="Which image looks better?",
|
|
404
|
+
datapoints=[["img1.jpg", "img2.jpg", "img3.jpg", "img4.jpg", "img5.jpg",
|
|
405
|
+
"img6.jpg", "img7.jpg", "img8.jpg", "img9.jpg", "img10.jpg",
|
|
406
|
+
"img11.jpg", "img12.jpg"]],
|
|
407
|
+
comparison_budget_per_ranking=50,
|
|
408
|
+
random_comparisons_ratio=0.5, # 50% random, 50% close matchups
|
|
409
|
+
).run()
|
|
410
|
+
|
|
411
|
+
results = order.get_results() # Returns ranked list with scores
|
|
412
|
+
```
|
|
328
413
|
"""
|
|
414
|
+
with tracer.start_as_current_span("RapidataOrderManager.create_ranking_order"):
|
|
415
|
+
if contexts and len(contexts) != len(datapoints):
|
|
416
|
+
raise ValueError(
|
|
417
|
+
"Number of contexts must match the number of sets that will be ranked"
|
|
418
|
+
)
|
|
419
|
+
if media_contexts and len(media_contexts) != len(datapoints):
|
|
420
|
+
raise ValueError(
|
|
421
|
+
"Number of media contexts must match the number of sets that will be ranked"
|
|
422
|
+
)
|
|
423
|
+
if not isinstance(datapoints, list) or not all(
|
|
424
|
+
isinstance(dp, list) for dp in datapoints
|
|
425
|
+
):
|
|
426
|
+
raise ValueError(
|
|
427
|
+
"Datapoints must be a list of lists. Outer list is the independent rankings, inner list is the datapoints for each ranking."
|
|
428
|
+
)
|
|
429
|
+
if not all(len(set(dp)) == len(dp) for dp in datapoints):
|
|
430
|
+
raise ValueError("Each inner list must contain unique datapoints.")
|
|
431
|
+
|
|
432
|
+
if not all(len(inner_list) >= 2 for inner_list in datapoints):
|
|
433
|
+
raise ValueError(
|
|
434
|
+
"Each ranking must contain at least two unique datapoints."
|
|
435
|
+
)
|
|
436
|
+
|
|
437
|
+
from rapidata.rapidata_client.workflow import MultiRankingWorkflow
|
|
438
|
+
from rapidata.api_client.models.i_asset_input import IAssetInput
|
|
439
|
+
from rapidata.api_client.models.i_asset_input_existing_asset_input import (
|
|
440
|
+
IAssetInputExistingAssetInput,
|
|
441
|
+
)
|
|
329
442
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
filters=filters,
|
|
349
|
-
selections=selections,
|
|
350
|
-
settings=settings,
|
|
351
|
-
)
|
|
443
|
+
datapoints_instances = []
|
|
444
|
+
for i, datapoint in enumerate(datapoints):
|
|
445
|
+
for d in datapoint:
|
|
446
|
+
datapoints_instances.append(
|
|
447
|
+
Datapoint(
|
|
448
|
+
asset=d,
|
|
449
|
+
data_type=data_type,
|
|
450
|
+
context=contexts[i] if contexts else None,
|
|
451
|
+
media_context=media_contexts[i] if media_contexts else None,
|
|
452
|
+
group=str(i),
|
|
453
|
+
)
|
|
454
|
+
)
|
|
455
|
+
|
|
456
|
+
contexts_dict = (
|
|
457
|
+
{str(i): context for i, context in enumerate(contexts)}
|
|
458
|
+
if contexts
|
|
459
|
+
else None
|
|
460
|
+
)
|
|
352
461
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
462
|
+
media_contexts_dict = (
|
|
463
|
+
{
|
|
464
|
+
str(i): IAssetInput(
|
|
465
|
+
actual_instance=IAssetInputExistingAssetInput(
|
|
466
|
+
_t="ExistingAssetInput",
|
|
467
|
+
name=self._asset_uploader.upload_asset(media_context),
|
|
468
|
+
)
|
|
469
|
+
)
|
|
470
|
+
for i, media_context in enumerate(media_contexts)
|
|
471
|
+
}
|
|
472
|
+
if media_contexts
|
|
473
|
+
else None
|
|
474
|
+
)
|
|
475
|
+
|
|
476
|
+
return self._create_general_order(
|
|
477
|
+
name=name,
|
|
478
|
+
workflow=MultiRankingWorkflow(
|
|
479
|
+
instruction=instruction,
|
|
480
|
+
comparison_budget_per_ranking=comparison_budget_per_ranking,
|
|
481
|
+
random_comparisons_ratio=random_comparisons_ratio,
|
|
482
|
+
contexts=contexts_dict,
|
|
483
|
+
media_contexts=media_contexts_dict,
|
|
484
|
+
),
|
|
485
|
+
datapoints=datapoints_instances,
|
|
486
|
+
responses_per_datapoint=responses_per_comparison,
|
|
487
|
+
validation_set_id=validation_set_id,
|
|
488
|
+
filters=filters,
|
|
489
|
+
selections=selections,
|
|
490
|
+
settings=settings,
|
|
491
|
+
)
|
|
492
|
+
|
|
493
|
+
def create_free_text_order(
|
|
494
|
+
self,
|
|
495
|
+
name: str,
|
|
496
|
+
instruction: str,
|
|
497
|
+
datapoints: list[str],
|
|
498
|
+
data_type: Literal["media", "text"] = "media",
|
|
499
|
+
responses_per_datapoint: int = 10,
|
|
500
|
+
contexts: list[str] | None = None,
|
|
501
|
+
media_contexts: list[str] | None = None,
|
|
502
|
+
filters: Sequence[RapidataFilter] | None = None,
|
|
503
|
+
settings: Sequence[RapidataSetting] | None = None,
|
|
504
|
+
selections: Sequence[RapidataSelection] | None = None,
|
|
505
|
+
private_notes: list[str] | None = None,
|
|
506
|
+
) -> RapidataOrder:
|
|
364
507
|
"""Create a free text order.
|
|
365
508
|
|
|
366
509
|
With this order you can have a datapoint (image, text, video, audio) be labeled with free text.
|
|
@@ -370,50 +513,73 @@ class RapidataOrderManager:
|
|
|
370
513
|
name (str): The name of the order.
|
|
371
514
|
instruction (str): The instruction to answer with free text. Will be shown along side each datapoint.
|
|
372
515
|
datapoints (list[str]): The list of datapoints for the free text - each datapoint will be labeled.
|
|
373
|
-
data_type (str, optional): The data type of the datapoints. Defaults to
|
|
374
|
-
Other option:
|
|
516
|
+
data_type (str, optional): The data type of the datapoints. Defaults to "media" (any form of image, video or audio). \n
|
|
517
|
+
Other option: "text".
|
|
375
518
|
responses_per_datapoint (int, optional): The number of responses that will be collected per datapoint. Defaults to 10.
|
|
519
|
+
contexts (list[str], optional): The list of contexts for the free text. Defaults to None.\n
|
|
520
|
+
If provided has to be the same length as datapoints and will be shown in addition to the instruction. (Therefore will be different for each datapoint)
|
|
521
|
+
Will be matched up with the datapoints using the list index.
|
|
522
|
+
media_contexts (list[str], optional): The list of media contexts for the free text i.e links to the images / videos. Defaults to None.\n
|
|
523
|
+
If provided has to be the same length as datapoints and will be shown in addition to the instruction. (Therefore will be different for each datapoint)
|
|
524
|
+
Will be matched up with the datapoints using the list index.
|
|
376
525
|
filters (Sequence[RapidataFilter], optional): The list of filters for the free text. Defaults to []. Decides who the tasks should be shown to.
|
|
377
526
|
settings (Sequence[RapidataSetting], optional): The list of settings for the free text. Defaults to []. Decides how the tasks should be shown.
|
|
378
527
|
selections (Sequence[RapidataSelection], optional): The list of selections for the free text. Defaults to []. Decides in what order the tasks should be shown.
|
|
379
528
|
private_notes (list[str], optional): The list of private notes for the free text. Defaults to None.\n
|
|
380
|
-
If provided has to be the same length as datapoints.\n
|
|
529
|
+
If provided has to be the same length as datapoints.\n
|
|
381
530
|
This will NOT be shown to the labelers but will be included in the result purely for your own reference.
|
|
531
|
+
|
|
532
|
+
Example:
|
|
533
|
+
```python
|
|
534
|
+
from rapidata import RapidataClient, FreeTextMinimumCharacters
|
|
535
|
+
|
|
536
|
+
rapi = RapidataClient()
|
|
537
|
+
order = rapi.order.create_free_text_order(
|
|
538
|
+
name="Image Captioning",
|
|
539
|
+
instruction="Describe what you see in this image in detail",
|
|
540
|
+
datapoints=["https://example.com/image1.jpg", "https://example.com/image2.jpg"],
|
|
541
|
+
responses_per_datapoint=5,
|
|
542
|
+
settings=[FreeTextMinimumCharacters(20)], # Require at least 20 characters
|
|
543
|
+
).run()
|
|
544
|
+
|
|
545
|
+
results = order.get_results()
|
|
546
|
+
```
|
|
382
547
|
"""
|
|
548
|
+
with tracer.start_as_current_span(
|
|
549
|
+
"RapidataOrderManager.create_free_text_order"
|
|
550
|
+
):
|
|
551
|
+
from rapidata.rapidata_client.workflow import FreeTextWorkflow
|
|
552
|
+
|
|
553
|
+
datapoints_instances = DatapointsValidator.map_datapoints(
|
|
554
|
+
datapoints=datapoints,
|
|
555
|
+
contexts=contexts,
|
|
556
|
+
media_contexts=media_contexts,
|
|
557
|
+
private_notes=private_notes,
|
|
558
|
+
data_type=data_type,
|
|
559
|
+
)
|
|
560
|
+
return self._create_general_order(
|
|
561
|
+
name=name,
|
|
562
|
+
workflow=FreeTextWorkflow(instruction=instruction),
|
|
563
|
+
datapoints=datapoints_instances,
|
|
564
|
+
responses_per_datapoint=responses_per_datapoint,
|
|
565
|
+
filters=filters,
|
|
566
|
+
selections=selections,
|
|
567
|
+
settings=settings,
|
|
568
|
+
)
|
|
383
569
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
responses_per_datapoint=responses_per_datapoint,
|
|
398
|
-
filters=filters,
|
|
399
|
-
selections=selections,
|
|
400
|
-
settings=settings,
|
|
401
|
-
default_labeling_amount=1,
|
|
402
|
-
private_notes=private_notes
|
|
403
|
-
)
|
|
404
|
-
|
|
405
|
-
def create_select_words_order(self,
|
|
406
|
-
name: str,
|
|
407
|
-
instruction: str,
|
|
408
|
-
datapoints: list[str],
|
|
409
|
-
sentences: list[str],
|
|
410
|
-
responses_per_datapoint: int = 10,
|
|
411
|
-
validation_set_id: str | None = None,
|
|
412
|
-
filters: Sequence[RapidataFilter] = [],
|
|
413
|
-
settings: Sequence[RapidataSetting] = [],
|
|
414
|
-
selections: Sequence[RapidataSelection] = [],
|
|
415
|
-
private_notes: list[str] | None = None,
|
|
416
|
-
) -> RapidataOrder:
|
|
570
|
+
def create_select_words_order(
|
|
571
|
+
self,
|
|
572
|
+
name: str,
|
|
573
|
+
instruction: str,
|
|
574
|
+
datapoints: list[str],
|
|
575
|
+
sentences: list[str],
|
|
576
|
+
responses_per_datapoint: int = 10,
|
|
577
|
+
validation_set_id: str | None = None,
|
|
578
|
+
filters: Sequence[RapidataFilter] | None = None,
|
|
579
|
+
settings: Sequence[RapidataSetting] | None = None,
|
|
580
|
+
selections: Sequence[RapidataSelection] | None = None,
|
|
581
|
+
private_notes: list[str] | None = None,
|
|
582
|
+
) -> RapidataOrder:
|
|
417
583
|
"""Create a select words order.
|
|
418
584
|
|
|
419
585
|
With this order you can have a datapoint (image, text, video, audio) be labeled with a list of words.
|
|
@@ -433,41 +599,62 @@ class RapidataOrderManager:
|
|
|
433
599
|
settings (Sequence[RapidataSetting], optional): The list of settings for the select words. Defaults to []. Decides how the tasks should be shown.
|
|
434
600
|
selections (Sequence[RapidataSelection], optional): The list of selections for the select words. Defaults to []. Decides in what order the tasks should be shown.
|
|
435
601
|
private_notes (list[str], optional): The list of private notes for the select words. Defaults to None.\n
|
|
436
|
-
If provided has to be the same length as datapoints.\n
|
|
602
|
+
If provided has to be the same length as datapoints.\n
|
|
437
603
|
This will NOT be shown to the labelers but will be included in the result purely for your own reference.
|
|
604
|
+
|
|
605
|
+
Example:
|
|
606
|
+
```python
|
|
607
|
+
from rapidata import RapidataClient
|
|
608
|
+
|
|
609
|
+
rapi = RapidataClient()
|
|
610
|
+
order = rapi.order.create_select_words_order(
|
|
611
|
+
name="Find Text-Image Mismatches",
|
|
612
|
+
instruction="Select words that don't match what's shown in the image",
|
|
613
|
+
datapoints=["https://example.com/image1.jpg", "https://example.com/image2.jpg"],
|
|
614
|
+
sentences=["A red car on a blue road", "Two cats playing with yarn"],
|
|
615
|
+
responses_per_datapoint=15,
|
|
616
|
+
).run()
|
|
617
|
+
|
|
618
|
+
results = order.get_results()
|
|
619
|
+
```
|
|
438
620
|
"""
|
|
621
|
+
with tracer.start_as_current_span(
|
|
622
|
+
"RapidataOrderManager.create_select_words_order"
|
|
623
|
+
):
|
|
624
|
+
from rapidata.rapidata_client.workflow import SelectWordsWorkflow
|
|
625
|
+
|
|
626
|
+
datapoints_instances = DatapointsValidator.map_datapoints(
|
|
627
|
+
datapoints=datapoints,
|
|
628
|
+
sentences=sentences,
|
|
629
|
+
private_notes=private_notes,
|
|
630
|
+
)
|
|
631
|
+
return self._create_general_order(
|
|
632
|
+
name=name,
|
|
633
|
+
workflow=SelectWordsWorkflow(
|
|
634
|
+
instruction=instruction,
|
|
635
|
+
),
|
|
636
|
+
datapoints=datapoints_instances,
|
|
637
|
+
responses_per_datapoint=responses_per_datapoint,
|
|
638
|
+
validation_set_id=validation_set_id,
|
|
639
|
+
filters=filters,
|
|
640
|
+
selections=selections,
|
|
641
|
+
settings=settings,
|
|
642
|
+
)
|
|
439
643
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
default_labeling_amount=2,
|
|
455
|
-
private_notes=private_notes
|
|
456
|
-
)
|
|
457
|
-
|
|
458
|
-
def create_locate_order(self,
|
|
459
|
-
name: str,
|
|
460
|
-
instruction: str,
|
|
461
|
-
datapoints: list[str],
|
|
462
|
-
responses_per_datapoint: int = 10,
|
|
463
|
-
contexts: list[str] | None = None,
|
|
464
|
-
media_contexts: list[str] | None = None,
|
|
465
|
-
validation_set_id: str | None = None,
|
|
466
|
-
filters: Sequence[RapidataFilter] = [],
|
|
467
|
-
settings: Sequence[RapidataSetting] = [],
|
|
468
|
-
selections: Sequence[RapidataSelection] = [],
|
|
469
|
-
private_notes: list[str] | None = None,
|
|
470
|
-
) -> RapidataOrder:
|
|
644
|
+
def create_locate_order(
|
|
645
|
+
self,
|
|
646
|
+
name: str,
|
|
647
|
+
instruction: str,
|
|
648
|
+
datapoints: list[str],
|
|
649
|
+
responses_per_datapoint: int = 10,
|
|
650
|
+
contexts: list[str] | None = None,
|
|
651
|
+
media_contexts: list[str] | None = None,
|
|
652
|
+
validation_set_id: str | None = None,
|
|
653
|
+
filters: Sequence[RapidataFilter] | None = None,
|
|
654
|
+
settings: Sequence[RapidataSetting] | None = None,
|
|
655
|
+
selections: Sequence[RapidataSelection] | None = None,
|
|
656
|
+
private_notes: list[str] | None = None,
|
|
657
|
+
) -> RapidataOrder:
|
|
471
658
|
"""Create a locate order.
|
|
472
659
|
|
|
473
660
|
With this order you can have people locate specific objects in a datapoint (image, text, video, audio).
|
|
@@ -489,39 +676,58 @@ class RapidataOrderManager:
|
|
|
489
676
|
settings (Sequence[RapidataSetting], optional): The list of settings for the locate. Defaults to []. Decides how the tasks should be shown.
|
|
490
677
|
selections (Sequence[RapidataSelection], optional): The list of selections for the locate. Defaults to []. Decides in what order the tasks should be shown.
|
|
491
678
|
private_notes (list[str], optional): The list of private notes for the locate. Defaults to None.\n
|
|
492
|
-
If provided has to be the same length as datapoints.\n
|
|
679
|
+
If provided has to be the same length as datapoints.\n
|
|
493
680
|
This will NOT be shown to the labelers but will be included in the result purely for your own reference.
|
|
494
|
-
"""
|
|
495
681
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
name=name,
|
|
500
|
-
workflow=LocateWorkflow(target=instruction),
|
|
501
|
-
assets=assets,
|
|
502
|
-
responses_per_datapoint=responses_per_datapoint,
|
|
503
|
-
contexts=contexts,
|
|
504
|
-
media_contexts=media_contexts,
|
|
505
|
-
validation_set_id=validation_set_id,
|
|
506
|
-
filters=filters,
|
|
507
|
-
selections=selections,
|
|
508
|
-
settings=settings,
|
|
509
|
-
private_notes=private_notes
|
|
510
|
-
)
|
|
682
|
+
Example:
|
|
683
|
+
```python
|
|
684
|
+
from rapidata import RapidataClient
|
|
511
685
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
686
|
+
rapi = RapidataClient()
|
|
687
|
+
order = rapi.order.create_locate_order(
|
|
688
|
+
name="Find Artifacts",
|
|
689
|
+
instruction="Tap on any visual glitches or errors in the image",
|
|
690
|
+
datapoints=["https://example.com/ai_generated1.jpg", "https://example.com/ai_generated2.jpg"],
|
|
691
|
+
responses_per_datapoint=35,
|
|
692
|
+
).run()
|
|
693
|
+
|
|
694
|
+
results = order.get_results()
|
|
695
|
+
```
|
|
696
|
+
"""
|
|
697
|
+
with tracer.start_as_current_span("RapidataOrderManager.create_locate_order"):
|
|
698
|
+
from rapidata.rapidata_client.workflow import LocateWorkflow
|
|
699
|
+
|
|
700
|
+
datapoints_instances = DatapointsValidator.map_datapoints(
|
|
701
|
+
datapoints=datapoints,
|
|
702
|
+
contexts=contexts,
|
|
703
|
+
media_contexts=media_contexts,
|
|
704
|
+
private_notes=private_notes,
|
|
705
|
+
)
|
|
706
|
+
return self._create_general_order(
|
|
707
|
+
name=name,
|
|
708
|
+
workflow=LocateWorkflow(target=instruction),
|
|
709
|
+
datapoints=datapoints_instances,
|
|
710
|
+
responses_per_datapoint=responses_per_datapoint,
|
|
711
|
+
validation_set_id=validation_set_id,
|
|
712
|
+
filters=filters,
|
|
713
|
+
selections=selections,
|
|
714
|
+
settings=settings,
|
|
715
|
+
)
|
|
716
|
+
|
|
717
|
+
def create_draw_order(
|
|
718
|
+
self,
|
|
719
|
+
name: str,
|
|
720
|
+
instruction: str,
|
|
721
|
+
datapoints: list[str],
|
|
722
|
+
responses_per_datapoint: int = 10,
|
|
723
|
+
contexts: list[str] | None = None,
|
|
724
|
+
media_contexts: list[str] | None = None,
|
|
725
|
+
validation_set_id: str | None = None,
|
|
726
|
+
filters: Sequence[RapidataFilter] = [],
|
|
727
|
+
settings: Sequence[RapidataSetting] = [],
|
|
728
|
+
selections: Sequence[RapidataSelection] = [],
|
|
729
|
+
private_notes: list[str] | None = None,
|
|
730
|
+
) -> RapidataOrder:
|
|
525
731
|
"""Create a draw order.
|
|
526
732
|
|
|
527
733
|
With this order you can have people draw lines on a datapoint (image, text, video, audio).
|
|
@@ -543,42 +749,61 @@ class RapidataOrderManager:
|
|
|
543
749
|
settings (Sequence[RapidataSetting], optional): The list of settings for the draw lines. Defaults to []. Decides how the tasks should be shown.
|
|
544
750
|
selections (Sequence[RapidataSelection], optional): The list of selections for the draw lines. Defaults to []. Decides in what order the tasks should be shown.
|
|
545
751
|
private_notes (list[str], optional): The list of private notes for the draw lines. Defaults to None.\n
|
|
546
|
-
If provided has to be the same length as datapoints.\n
|
|
752
|
+
If provided has to be the same length as datapoints.\n
|
|
547
753
|
This will NOT be shown to the labelers but will be included in the result purely for your own reference.
|
|
754
|
+
|
|
755
|
+
Example:
|
|
756
|
+
```python
|
|
757
|
+
from rapidata import RapidataClient
|
|
758
|
+
|
|
759
|
+
rapi = RapidataClient()
|
|
760
|
+
order = rapi.order.create_draw_order(
|
|
761
|
+
name="Segment Objects",
|
|
762
|
+
instruction="Color in all the cars in the image",
|
|
763
|
+
datapoints=["https://example.com/street1.jpg", "https://example.com/street2.jpg"],
|
|
764
|
+
responses_per_datapoint=35,
|
|
765
|
+
).run()
|
|
766
|
+
|
|
767
|
+
results = order.get_results()
|
|
768
|
+
```
|
|
548
769
|
"""
|
|
770
|
+
with tracer.start_as_current_span("RapidataOrderManager.create_draw_order"):
|
|
771
|
+
from rapidata.rapidata_client.workflow import DrawWorkflow
|
|
772
|
+
|
|
773
|
+
datapoints_instances = DatapointsValidator.map_datapoints(
|
|
774
|
+
datapoints=datapoints,
|
|
775
|
+
contexts=contexts,
|
|
776
|
+
media_contexts=media_contexts,
|
|
777
|
+
private_notes=private_notes,
|
|
778
|
+
)
|
|
779
|
+
return self._create_general_order(
|
|
780
|
+
name=name,
|
|
781
|
+
workflow=DrawWorkflow(target=instruction),
|
|
782
|
+
datapoints=datapoints_instances,
|
|
783
|
+
responses_per_datapoint=responses_per_datapoint,
|
|
784
|
+
validation_set_id=validation_set_id,
|
|
785
|
+
filters=filters,
|
|
786
|
+
selections=selections,
|
|
787
|
+
settings=settings,
|
|
788
|
+
)
|
|
549
789
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
)
|
|
565
|
-
|
|
566
|
-
def create_timestamp_order(self,
|
|
567
|
-
name: str,
|
|
568
|
-
instruction: str,
|
|
569
|
-
datapoints: list[str],
|
|
570
|
-
responses_per_datapoint: int = 10,
|
|
571
|
-
contexts: list[str] | None = None,
|
|
572
|
-
media_contexts: list[str] | None = None,
|
|
573
|
-
validation_set_id: str | None = None,
|
|
574
|
-
filters: Sequence[RapidataFilter] = [],
|
|
575
|
-
settings: Sequence[RapidataSetting] = [],
|
|
576
|
-
selections: Sequence[RapidataSelection] = [],
|
|
577
|
-
private_notes: list[str] | None = None,
|
|
578
|
-
) -> RapidataOrder:
|
|
790
|
+
def create_timestamp_order(
|
|
791
|
+
self,
|
|
792
|
+
name: str,
|
|
793
|
+
instruction: str,
|
|
794
|
+
datapoints: list[str],
|
|
795
|
+
responses_per_datapoint: int = 10,
|
|
796
|
+
contexts: list[str] | None = None,
|
|
797
|
+
media_contexts: list[str] | None = None,
|
|
798
|
+
validation_set_id: str | None = None,
|
|
799
|
+
filters: Sequence[RapidataFilter] | None = None,
|
|
800
|
+
settings: Sequence[RapidataSetting] | None = None,
|
|
801
|
+
selections: Sequence[RapidataSelection] | None = None,
|
|
802
|
+
private_notes: list[str] | None = None,
|
|
803
|
+
) -> RapidataOrder:
|
|
579
804
|
"""Create a timestamp order.
|
|
580
805
|
|
|
581
|
-
Warning:
|
|
806
|
+
Warning:
|
|
582
807
|
This order is currently not fully supported and may give unexpected results.
|
|
583
808
|
|
|
584
809
|
With this order you can have people mark specific timestamps in a datapoint (video, audio).
|
|
@@ -600,32 +825,31 @@ class RapidataOrderManager:
|
|
|
600
825
|
settings (Sequence[RapidataSetting], optional): The list of settings for the timestamp. Defaults to []. Decides how the tasks should be shown.
|
|
601
826
|
selections (Sequence[RapidataSelection], optional): The list of selections for the timestamp. Defaults to []. Decides in what order the tasks should be shown.
|
|
602
827
|
private_notes (list[str], optional): The list of private notes for the timestamp. Defaults to None.\n
|
|
603
|
-
If provided has to be the same length as datapoints.\n
|
|
828
|
+
If provided has to be the same length as datapoints.\n
|
|
604
829
|
This will NOT be shown to the labelers but will be included in the result purely for your own reference.
|
|
605
830
|
"""
|
|
606
831
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
)
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
)
|
|
832
|
+
with tracer.start_as_current_span(
|
|
833
|
+
"RapidataOrderManager.create_timestamp_order"
|
|
834
|
+
):
|
|
835
|
+
from rapidata.rapidata_client.workflow import TimestampWorkflow
|
|
836
|
+
|
|
837
|
+
datapoints_instances = DatapointsValidator.map_datapoints(
|
|
838
|
+
datapoints=datapoints,
|
|
839
|
+
contexts=contexts,
|
|
840
|
+
media_contexts=media_contexts,
|
|
841
|
+
private_notes=private_notes,
|
|
842
|
+
)
|
|
843
|
+
return self._create_general_order(
|
|
844
|
+
name=name,
|
|
845
|
+
workflow=TimestampWorkflow(instruction=instruction),
|
|
846
|
+
datapoints=datapoints_instances,
|
|
847
|
+
responses_per_datapoint=responses_per_datapoint,
|
|
848
|
+
validation_set_id=validation_set_id,
|
|
849
|
+
filters=filters,
|
|
850
|
+
selections=selections,
|
|
851
|
+
settings=settings,
|
|
852
|
+
)
|
|
629
853
|
|
|
630
854
|
def get_order_by_id(self, order_id: str) -> RapidataOrder:
|
|
631
855
|
"""Get an order by ID.
|
|
@@ -636,13 +860,16 @@ class RapidataOrderManager:
|
|
|
636
860
|
Returns:
|
|
637
861
|
RapidataOrder: The Order instance.
|
|
638
862
|
"""
|
|
639
|
-
|
|
640
|
-
|
|
863
|
+
with tracer.start_as_current_span("RapidataOrderManager.get_order_by_id"):
|
|
864
|
+
from rapidata.rapidata_client.order.rapidata_order import RapidataOrder
|
|
865
|
+
|
|
866
|
+
order = self.__openapi_service.order_api.order_order_id_get(order_id)
|
|
641
867
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
868
|
+
return RapidataOrder(
|
|
869
|
+
order_id=order_id,
|
|
870
|
+
name=order.order_name,
|
|
871
|
+
openapi_service=self.__openapi_service,
|
|
872
|
+
)
|
|
646
873
|
|
|
647
874
|
def find_orders(self, name: str = "", amount: int = 10) -> list[RapidataOrder]:
|
|
648
875
|
"""Find your recent orders given criteria. If nothing is provided, it will return the most recent order.
|
|
@@ -654,11 +881,42 @@ class RapidataOrderManager:
|
|
|
654
881
|
Returns:
|
|
655
882
|
list[RapidataOrder]: A list of RapidataOrder instances.
|
|
656
883
|
"""
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
884
|
+
with tracer.start_as_current_span("RapidataOrderManager.find_orders"):
|
|
885
|
+
from rapidata.api_client.models.page_info import PageInfo
|
|
886
|
+
from rapidata.api_client.models.query_model import QueryModel
|
|
887
|
+
from rapidata.api_client.models.root_filter import RootFilter
|
|
888
|
+
from rapidata.api_client.models.filter import Filter
|
|
889
|
+
from rapidata.api_client.models.filter_operator import FilterOperator
|
|
890
|
+
from rapidata.api_client.models.sort_criterion import SortCriterion
|
|
891
|
+
from rapidata.api_client.models.sort_direction import SortDirection
|
|
892
|
+
|
|
893
|
+
order_page_result = self.__openapi_service.order_api.orders_get(
|
|
894
|
+
QueryModel(
|
|
895
|
+
page=PageInfo(index=1, size=amount),
|
|
896
|
+
filter=RootFilter(
|
|
897
|
+
filters=[
|
|
898
|
+
Filter(
|
|
899
|
+
field="OrderName",
|
|
900
|
+
operator=FilterOperator.CONTAINS,
|
|
901
|
+
value=name,
|
|
902
|
+
)
|
|
903
|
+
]
|
|
904
|
+
),
|
|
905
|
+
sortCriteria=[
|
|
906
|
+
SortCriterion(
|
|
907
|
+
direction=SortDirection.DESC, propertyName="OrderDate"
|
|
908
|
+
)
|
|
909
|
+
],
|
|
910
|
+
)
|
|
911
|
+
)
|
|
912
|
+
|
|
913
|
+
orders = [
|
|
914
|
+
self.get_order_by_id(order.id) for order in order_page_result.items
|
|
915
|
+
]
|
|
916
|
+
return orders
|
|
917
|
+
|
|
918
|
+
def __str__(self) -> str:
|
|
919
|
+
return "RapidataOrderManager"
|
|
920
|
+
|
|
921
|
+
def __repr__(self) -> str:
|
|
922
|
+
return self.__str__()
|