Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit 3c0aa7c

Browse files
divide code example
1 parent 49ab7c3 commit 3c0aa7c

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

docs/python-sdk.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,26 @@ items = refuel_client.get_items(
182182

183183
#### Applying sort ordering when querying items
184184

185-
By default, the API will use Refuel’s sort order (by decreasing order of diversity). But you can specify any other column(s) in the dataset that you would like to sort by, when querying for items in the dataset with the order_by param:
185+
By default, the API will use Refuel’s sort order (by decreasing order of diversity). You can use the `order_by` param to sort by any other columns in the dataset or by the label or confidence score from a labeling task.
186+
187+
1) Sort by dataset column
188+
189+
```python
190+
items = refuel_client.get_items(
191+
dataset='<DATASET NAME>',
192+
max_items=100,
193+
order_by=[{'field': '<COLUMN NAME TO SORT BY>', 'direction': '<ASC or DESC>'}],
194+
)
195+
```
196+
197+
2) Sort by label or confidence score from a labeling task. Note that this requires a task name and a subtask name to be specified.
186198

187199
```python
188200
items = refuel_client.get_items(
189201
dataset='<DATASET NAME>',
202+
task='<LABELING TASK NAME>',
190203
max_items=100,
191-
order_by=[{'field': '<COLUMN NAME TO SORT BY>', 'direction': '<ASC or DESC>', 'subtask': '<SUBTASK NAME>'}],
204+
order_by=[{'field': '<label or confidence>', 'direction': 'ASC', 'subtask': '<SUBTASK NAME>'}],
192205
)
193206
```
194207

0 commit comments

Comments
 (0)