Rapidata audience manager
RapidataAudienceManager #
Handles everything regarding audiences from creation to retrieval.
A manager for creating, retrieving, and searching for audiences. Audiences are groups of annotators that can be recruited based on example tasks and assigned jobs.
Source code in src/rapidata/rapidata_client/audience/rapidata_audience_manager.py
create_audience #
create_audience(
name: str,
filters: list[RapidataFilter] | None = None,
target_accuracy: float | None = None,
min_tasks: int | None = None,
max_tasks: int | None = None,
) -> RapidataAudience
Create a new audience.
Creates a new audience with the specified name and optional filters.
Annotators join an audience by passing a short admission trial: they must answer validation tasks well enough to be trusted. The two intuitive knobs below describe that bar as "solve N tasks at X accuracy":
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the audience. |
required |
filters
|
list[RapidataFilter]
|
The list of filters to apply to the audience. Defaults to None (no filters). |
None
|
target_accuracy
|
float
|
X — the fraction of validation tasks (0..1) an annotator must get right to be admitted. Defaults to None, in which case the server default of 0.75 applies. |
None
|
min_tasks
|
int
|
N — the number of validation tasks an annotator must complete before the accuracy verdict is trusted. Defaults to None, in which case the server default of 10 applies. |
None
|
max_tasks
|
int
|
Upper bound on admission-trial tasks before a verdict is forced. Defaults to None (no cap). |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
RapidataAudience |
RapidataAudience
|
The created audience instance. |
Source code in src/rapidata/rapidata_client/audience/rapidata_audience_manager.py
get_audience_by_id #
get_audience_by_id(audience_id: str) -> RapidataAudience
Get an audience by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
audience_id
|
str
|
The unique identifier of the audience. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
RapidataAudience |
RapidataAudience
|
The audience instance. |
Source code in src/rapidata/rapidata_client/audience/rapidata_audience_manager.py
find_audiences #
find_audiences(
name: str = "", amount: int = 10, page: int = 1
) -> list[RapidataAudience]
Find your audiences by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Filter audiences by name (matching audiences will contain this string). Defaults to "" for any audience. |
''
|
amount
|
int
|
The maximum number of audiences to return. Defaults to 10. |
10
|
page
|
int
|
The page of audiences to return. Defaults to 1. |
1
|
Returns:
| Type | Description |
|---|---|
list[RapidataAudience]
|
list[RapidataAudience]: A list of RapidataAudience instances. |