rg.Dataset
¶
Dataset
is a class that represents a collection of records. It is used to store and manage records in Argilla.
Usage Examples¶
Creating a Dataset¶
To create a new dataset you need to define its name and settings. Optional parameters are workspace
and client
, if you want to create the dataset in a specific workspace or on a specific Argilla instance.
dataset = rg.Dataset(
name="my_dataset",
settings=rg.Settings(
fields=[
rg.TextField(name="text"),
],
questions=[
rg.TextQuestion(name="response"),
],
),
)
dataset.create()
For a detail guide of the dataset creation and publication process, see the Dataset how to guide.
Retrieving an existing Dataset¶
To retrieve an existing dataset, use client.datasets("my_dataset")
instead.
Class Reference¶
rg.Dataset
¶
Bases: Resource
, DiskImportExportMixin
Class for interacting with Argilla Datasets
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Name of the dataset. |
records |
DatasetRecords
|
The records object for the dataset. Used to interact with the records of the dataset by iterating, searching, etc. |
settings |
Settings
|
The settings object of the dataset. Used to configure the dataset with fields, questions, guidelines, etc. |
fields |
list
|
The fields of the dataset, for example the |
questions |
list
|
The questions of the dataset defined in the settings. For example, the |
guidelines |
str
|
The guidelines of the dataset defined in the settings. Used to provide instructions to labelers. |
allow_extra_metadata |
bool
|
True if extra metadata is allowed, False otherwise. |
Source code in src/argilla_sdk/datasets/_resource.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 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 |
|
__init__(name=None, workspace=None, settings=None, client=None, _model=None)
¶
Initializes a new Argilla Dataset object with the given parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of the dataset. Replaced by random UUID if not assigned. |
None
|
workspace |
UUID
|
Workspace of the dataset. Default is the first workspace found in the server. |
None
|
settings |
Settings
|
Settings class to be used to configure the dataset. |
None
|
client |
Argilla
|
Instance of Argilla to connect with the server. Default is the default client. |
None
|
_model |
DatasetModel
|
Model of the dataset. Used to create the dataset from an existing model. |
None
|
Source code in src/argilla_sdk/datasets/_resource.py
create()
¶
Creates the dataset on the server with the Settings
configuration.
Returns:
Name | Type | Description |
---|---|---|
Dataset |
Dataset
|
The created dataset object. |
Source code in src/argilla_sdk/datasets/_resource.py
exists()
¶
Checks if the dataset exists on the server
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the dataset exists, False otherwise |