filename
stringclasses 29
values | chunks
stringlengths 68
1.18k
|
|---|---|
argilla-python/docs/index.md
|
# Welcome to Argilla. Argilla is a **collaboration platform for AI engineers and domain experts** that require **high-quality outputs, full data ownership, and overall efficiency**.. <div class="grid cards" markdown>. - __Get started in 5 minutes!__. ---. Install `argilla` with `pip` and deploy a `Docker` locally or for free on Hugging Face to get up and running in minutes.. [:octicons-arrow-right-24: Quickstart](getting_started/quickstart.md). - __Educational guides__. ---
|
argilla-python/docs/index.md
|
Get familiar with basic and complex workflows for Argilla. From managing `Users`, `Workspaces`. `Datasets` and `Records` to fine-tuning a model.. [:octicons-arrow-right-24: Learn more](guides/how_to_guides/index.md). </div>. ## Why use Argilla?
|
argilla-python/docs/index.md
|
Whether you are working on monitoring and improving complex **generative tasks** involving LLM pipelines with RAG, or you are working on a **predictive task** for things like AB-testing of span- and text-classification models. Our versatile platform helps you ensure **your data work pays off**.. <p style="font-size:20px">Improve your AI output quality through data quality</p>
|
argilla-python/docs/index.md
|
Compute is expensive and output quality is important. We help you focus on data, which tackles the root cause of both of these problems at once. Argilla helps you to **achieve and keep high-quality standards** for your data. This means you can improve the quality of your AI output.. <p style="font-size:20px">Take control of your data and models</p>
|
argilla-python/docs/index.md
|
Most AI platforms are black boxes. Argilla is different. We believe that you should be the owner of both your data and your models. That's why we provide you with all the tools your team needs to **manage your data and models in a way that suits you best**.. <p style="font-size:20px">Improve efficiency by quickly iterating on the right data and models</p>
|
argilla-python/docs/index.md
|
Gathering data is a time-consuming process. Argilla helps by providing a platform that allows you to **interact with your data in a more engaging way**. This means you can quickly and easily label your data with filters, AI feedback suggestions and semantic search. So you can focus on training your models and monitoring their performance.. ## What do people build with Argilla?. <p style="font-size:20px">Datasets and models</p>
|
argilla-python/docs/index.md
|
- Our [cleaned UltraFeedback dataset](https://huggingface.co/datasets/argilla/ultrafeedback-binarized-preferences-cleaned) and the [Notus](https://huggingface.co/argilla/notus-7b-v1) and [Notux](https://huggingface.co/argilla/notux-8x7b-v1) models, where we improved benchmark and empirical human judgment for the Mistral and Mixtral models with cleaner data using **human feedback**.
|
argilla-python/docs/index.md
|
- Our [distilabeled Intel Orca DPO dataset](https://huggingface.co/datasets/argilla/distilabel-intel-orca-dpo-pairs) and the [improved OpenHermes model](https://huggingface.co/argilla/distilabeled-OpenHermes-2.5-Mistral-7B), show how we improve model performance by filtering out 50% of the original dataset through **human and AI feedback**.
|
argilla-python/docs/index.md
|
Argilla is a tool that can be used to achieve and keep **high-quality data standards** with a **focus on NLP and LLMs**. Our community uses Argilla to create amazing open-source [datasets](https://huggingface.co/datasets?other=argilla) and [models](https://huggingface.co/models?other=distilabel), and **we love contributions to open-source** ourselves too.. <p style="font-size:20px">Projects and pipelines</p>
|
argilla-python/docs/index.md
|
- AI for good: [the Red Cross presentation](https://youtu.be/ZsCqrAhzkFU?feature=shared) showcases **how their experts and AI team collaborate** by classifying and redirecting requests from refugees of the Ukrainian crisis to streamline the support processes of the Red Cross.
|
argilla-python/docs/index.md
|
- Customer support: during [the Loris meetup](https://youtu.be/jWrtgf2w4VU?feature=shared) they showed how their AI team uses unsupervised and few-shot contrastive learning to help them **quickly validate and gain labelled samples for a huge amount of multi-label classifiers**.. - Research studies: [the showcase from Prolific](https://youtu.be/ePDlhIxnuAs?feature=shared) announced their integration with our platform.
|
argilla-python/docs/index.md
|
They use it to actively **distribute data collection projects** among their annotating workforce.. This allows them to quickly and **efficiently collect high-quality data** for their research studies.
|
argilla-python/docs/index.md
|
AI teams from companies like [the Red Cross](https://510.global/), [Loris.ai](https://loris.ai/) and [Prolific](https://www.prolific.com/) use Argilla to **improve the quality and efficiency of AI** projects. They shared their experiences in our [AI community meetup](https://lu.ma/embed-checkout/evt-IQtRiSuXZCIW6FB).
|
argilla-python/docs/guides/how_to_guides/record.md
|
# Add, update, and delete records. This guide provides an overview of records, explaining the basics of how to define and manage them in Argilla.
|
argilla-python/docs/guides/how_to_guides/record.md
|
A **record** in Argilla is a data item that requires annotation, consisting of one or more fields. These are the pieces of information displayed to the user in the UI to facilitate the completion of the annotation task. Each record also includes questions that annotators are required to answer, with the option of adding suggestions and responses to assist them. Guidelines are also provided to help annotators effectively complete their tasks.
|
argilla-python/docs/guides/how_to_guides/record.md
|
",
"answer": "Yes"
},
metadata={
"category": "A"
},
vectors={
"my_vector": [0.1, 0.2, 0.3],
},
suggestions=[
rg.suggestion("my_label", "positive", score=0.9, agent="model_name")
],
responses=[
rg.response("label", "positive", user_id=user_id)
],
)
```
> Check the [Record - Python Reference](../../reference/argilla_sdk/records/records.md) to see the attributes, arguments, and methods of the `Record` class in detail.
|
argilla-python/docs/guides/how_to_guides/record.md
|
```python
rg.Record(
external_id="1234",
fields={
"question": "Do you need oxygen to breathe?. ",
"answer": "Yes"
},
metadata={
"category": "A"
},
vectors={
"my_vector": [0.1, 0.2, 0.3],
},
suggestions=[
rg.suggestion("my_label", "positive", score=0.9, agent="model_name")
],
responses=[
rg.response("label", "positive", user_id=user_id)
],
)
```
> Check the [Record - Python Reference](../../reference/argilla_sdk/records/records.md) to see the attributes, arguments, and methods of the `Record` class in detail.
|
argilla-python/docs/guides/how_to_guides/record.md
|
> A record is part of a dataset, so you will need to create a dataset before adding records. Check these guides to learn how to [create a dataset](dataset.md).. !!! info "Main Class". ## Add records
|
argilla-python/docs/guides/how_to_guides/record.md
|
You can add records to a dataset in two different ways: either by using a dictionary or by directly initializing a `Record` object. You should ensure that fields, metadata and vectors match those configured in the dataset settings. In both cases, are added via the `Dataset.records.log` method. As soon as you add the records, these will be available in the Argilla UI. If they do not appear in the UI, you may need to click the refresh button to update the view.
|
argilla-python/docs/guides/how_to_guides/record.md
|
!!! tip
Take some time to inspect the data before adding it to the dataset in case this triggers changes in the `questions` or `fields`.. !!! note
If you are planning to use public data, the [Datasets page](https://huggingface.co/datasets) of the Hugging Face Hub is a good place to start. Remember to always check the license to make sure you can legally use it for your specific use case.. === "As `Record` objects"
|
argilla-python/docs/guides/how_to_guides/record.md
|
You can add records to a dataset by initializing a `Record` object directly. This is ideal if you need to apply logic to the data before defining the record. If the data is already structured, you should consider adding it directly as a dictionary or Hugging Face dataset.. ```python
import argilla_sdk as rg. client = rg.Argilla(api_url="<api_url>", api_key="<api_key>"). dataset = client.datasets(name="my_dataset")
|
argilla-python/docs/guides/how_to_guides/record.md
|
records = [
rg.Record(
fields={
"question": "Do you need oxygen to breathe?",
"answer": "Yes"
},
),
rg.Record(
fields={
"question": "What is the boiling point of water?",
"answer": "100 degrees Celsius"
},
), # (1)
]
|
argilla-python/docs/guides/how_to_guides/record.md
|
dataset.records.log(records)
```
1. This is an illustration of a definition. In a real world scenario, you would iterate over a data structure and create `Record` objects for each iteration.. === "From a generic data structure". You can add the data directly as a dictionary like structure, where the keys correspond to the names of fields, questions, metadata or vectors in the dataset and the values are the data to be added.
|
argilla-python/docs/guides/how_to_guides/record.md
|
If your data structure does not correspond to your Argilla dataset names, you can use a `mapping` to indicate which keys in the source data correspond to the dataset fields.. We illustrate this python dictionaries that represent your data, but we would not advise you to to define dictionaries. Instead use the `Record` object for instatiating records.. ```python
import argilla_sdk as rg. client = rg.Argilla(api_url="<api_url>", api_key="<api_key>"). dataset = client.datasets(name="my_dataset")
|
argilla-python/docs/guides/how_to_guides/record.md
|
# Add records to the dataset with the fields 'question' and 'answer'
data = [
{
"question": "Do you need oxygen to breathe?",
"answer": "Yes",
},
{
"question": "What is the boiling point of water?",
"answer": "100 degrees Celsius",
}, # (2)
]
dataset.records.log(data)
|
argilla-python/docs/guides/how_to_guides/record.md
|
# Add records to the dataset with the a mapping of the fields 'question' and 'answer'
data = [
{
"query": "Do you need oxygen to breathe?",
"response": "Yes",
},
{
"query": "What is the boiling point of water?",
"response": "100 degrees Celsius",
},
]
dataset.records.log(data, mapping={"query": "question", "response": "answer"}) # (3)
```
|
argilla-python/docs/guides/how_to_guides/record.md
|
1. The data structure's keys must match the fields or questions in the Argilla dataset. In this case, there are fields named `question` and `answer`.
2. The data structure has keys `query` and `response` and the Argilla dataset has `question` and `answer`. You can use the `mapping` parameter to map the keys in the data structure to the fields in the Argilla dataset.. === "From a Hugging Face dataset"
|
argilla-python/docs/guides/how_to_guides/record.md
|
You can also add records to a dataset using a Hugging Face dataset. This is useful when you want to use a dataset from the Hugging Face Hub and add it to your Argilla dataset.. You can add the dataset where the column names correspond to the names of fields, questions, metadata or vectors in the Argilla dataset.. If the dataset's schema does not correspond to your Argilla dataset names, you can use a `mapping` to indicate which columns in the dataset correspond to the Argilla dataset fields.
|
argilla-python/docs/guides/how_to_guides/record.md
|
```python
from uuid import uuid4. import argilla_sdk as rg
from datasets import load_dataset. client = rg.Argilla(api_url="<api_url>", api_key="<api_key>")
dataset = client.datasets(name="my_dataset") # (1). hf_dataset = load_dataset("imdb", split="train[:100]") # (2). dataset.records.log(records=hf_dataset)
```. 1. In this case, we are using the `my_dataset` dataset from the Argilla workspace. The dataset has a `text` field and a `label` question.
|
argilla-python/docs/guides/how_to_guides/record.md
|
2. In this example, the Hugging Face dataset matches the Argilla dataset schema. If that is not the case, you could use the `.map` of the `datasets` library to prepare the data before adding it to the Argilla dataset.. Here we use the `mapping` parameter to specify the relationship between the Hugging Face dataset and the Argilla dataset.. ```python
dataset.records.log(records=hf_dataset, mapping={"txt": "text", "y": "label"}) # (1)
```
|
argilla-python/docs/guides/how_to_guides/record.md
|
1. In this case, the `txt` key in the Hugging Face dataset corresponds to the `text` field in the Argilla dataset, and the `y` key in the Hugging Face dataset corresponds to the `label` field in the Argilla dataset.. ### Metadata
|
argilla-python/docs/guides/how_to_guides/record.md
|
Record metadata can include any information about the record that is not part of the fields in the form of a dictionary. To use metadata for filtering and sorting records, make sure that the key of the dictionary corresponds with the metadata property `name`. When the key doesn't correspond, this will be considered extra metadata that will get stored with the record (as long as `allow_extra_metadata` is set to `True` for the dataset), but will not be usable for filtering and sorting.
|
argilla-python/docs/guides/how_to_guides/record.md
|
```python
# Add records to the dataset with the metadata 'category'
records = [
rg.Record(
fields={
"question": "Do you need oxygen to breathe?. ",
"answer": "Yes"
},
metadata={"category": "A"},
),
rg.Record(
fields={
"question": "What is the boiling point of water?
|
argilla-python/docs/guides/how_to_guides/record.md
|
",
"answer": "100 degrees Celsius"
},
metadata={"category": "B"},
),
]
dataset.records.log(records)
```
|
argilla-python/docs/guides/how_to_guides/record.md
|
!!! note
Remember that to use metadata within a dataset, you must define a metadata property in the [dataset settings](dataset.md).. === "As `Record` objects". You can add metadata to a record in an initialized `Record` object.
|
argilla-python/docs/guides/how_to_guides/record.md
|
=== "From a generic data structure"
You can add metadata to a record directly as a dictionary structure, where the keys correspond to the names of metadata properties in the dataset and the values are the metadata to be added. Remember that you can also use the `mapping` parameter to specify the data structure.
|
argilla-python/docs/guides/how_to_guides/record.md
|
```python
# Add records to the dataset with the metadata 'category'
data = [
{
"question": "Do you need oxygen to breathe?",
"answer": "Yes",
"category": "A",
},
{
"question": "What is the boiling point of water?",
"answer": "100 degrees Celsius",
"category": "B",
},
]
dataset.records.log(data)
```. ### Vectors
|
argilla-python/docs/guides/how_to_guides/record.md
|
You can associate vectors, like text embeddings, to your records. They can be used for semantic search in the UI and the Python SDK. Make sure that the length of the list corresponds to the dimensions set in the vector settings.. !!! note
Remember that to use vectors within a dataset, you must define them in the [dataset settings](dataset.md).. === "As `Record` objects". You can also add vectors to a record in an initialized `Record` object.
|
argilla-python/docs/guides/how_to_guides/record.md
|
```python
# Add records to the dataset with the vector 'my_vector' and dimension=3
records = [
rg.Record(
fields={
"question": "Do you need oxygen to breathe?. ",
"answer": "Yes"
},
vectors=[
rg.Vector("my_vector", [0.1, 0.2, 0.3])
],
),
rg.Record(
fields={
"question": "What is the boiling point of water?
|
argilla-python/docs/guides/how_to_guides/record.md
|
",
"answer": "100 degrees Celsius"
},
vectors=[
rg.Vector("my_vector", [0.2, 0.5, 0.3])
],
),
]
dataset.records.log(records)
```
|
argilla-python/docs/guides/how_to_guides/record.md
|
> Check the [Vector - Python Reference](../../reference/argilla_sdk/records/vectors.md) to see the attributes, arguments, and methods of the `Vector` class in detail.. === "From a generic data structure". You can add vectors from a dictionary like structure, where the keys correspond to the `name`s of the vector settings that were configured for your dataset and the value is a list of floats. Remember that you can also use the `mapping` parameter to specify the data structure.
|
argilla-python/docs/guides/how_to_guides/record.md
|
```python
# Add records to the dataset with the vector 'my_vector' and dimension=3
data = [
{
"question": "Do you need oxygen to breathe?",
"answer": "Yes",
"my_vector": [0.1, 0.2, 0.3],
},
{
"question": "What is the boiling point of water?",
"answer": "100 degrees Celsius",
"my_vector": [0.2, 0.5, 0.3],
},
]
dataset.records.log(data)
```. ### Suggestions
|
argilla-python/docs/guides/how_to_guides/record.md
|
Suggestions refer to suggested responses (e.g. model predictions) that you can add to your records to make the annotation process faster. These can be added during the creation of the record or at a later stage. Only one suggestion can be provided for each question, and suggestion values must be compliant with the pre-defined questions e.g. if we have a `RatingQuestion` between 1 and 5, the suggestion should have a valid value within that range.
|
argilla-python/docs/guides/how_to_guides/record.md
|
```python
# Add records to the dataset with the label 'my_label'
records = [
rg.Record(
fields={
"question": "Do you need oxygen to breathe?
|
argilla-python/docs/guides/how_to_guides/record.md
|
",
"answer": "Yes"
},
suggestions=[
rg.Suggestion(
"my_label",
"positive",
score=0.9,
agent="model_name"
)
],
),
rg.Record(
fields={
"question": "What is the boiling point of water?
|
argilla-python/docs/guides/how_to_guides/record.md
|
",
"answer": "100 degrees Celsius"
},
suggestions=[
rg.Suggestion(
"my_label",
"negative",
score=0.9,
agent="model_name"
)
],
),
]
dataset.records.log(records)
```
|
argilla-python/docs/guides/how_to_guides/record.md
|
=== "As `Record objects"
You can also add suggestions to a record in an initialized `Record` object.. > Check the [Suggestions - Python Reference](../../reference/argilla_sdk/records/suggestions.md) to see the attributes, arguments, and methods of the `Suggestion` class in detail.
|
argilla-python/docs/guides/how_to_guides/record.md
|
```python
# Add records to the dataset with the label 'my_label'
data = [
{
"question": "Do you need oxygen to breathe?. ",
"answer": "Yes",
"my_label.suggestion": "positive",
"my_label.suggestion.score": 0.9,
"my_label.suggestion.agent": "model_name"
},
{
"question": "What is the boiling point of water?
|
argilla-python/docs/guides/how_to_guides/record.md
|
",
"answer": "100 degrees Celsius",
"my_label.suggestion": "negative",
"my_label.suggestion.score": 0.9,
"my_label.suggestion.agent": "model_name"
},
]
dataset.records.log(data)
```
|
argilla-python/docs/guides/how_to_guides/record.md
|
=== "From a generic data structure"
You can add suggestions as a dictionary, where the keys correspond to the `name`s of the labels that were configured for your dataset. Remember that you can also use the `mapping` parameter to specify the data structure.. ### Responses
|
argilla-python/docs/guides/how_to_guides/record.md
|
If your dataset includes some annotations, you can add those to the records as you create them. Make sure that the responses adhere to the same format as Argilla's output and meet the schema requirements for the specific type of question being answered. Make sure to include the `user_id` in case you're planning to add more than one response for the same question, if not responses will apply to all the annotators.. !!! note
Keep in mind that records with responses will be displayed as "Draft" in the UI.
|
argilla-python/docs/guides/how_to_guides/record.md
|
```python
# Add records to the dataset with the label 'my_label'
records = [
rg.Record(
fields={
"question": "Do you need oxygen to breathe?. ",
"answer": "Yes"
},
responses=[
rg.Response("my_label", "positive", user_id=user.id)
]
),
rg.Record(
fields={
"question": "What is the boiling point of water?
|
argilla-python/docs/guides/how_to_guides/record.md
|
",
"answer": "100 degrees Celsius"
},
responses=[
rg.Response("my_label", "negative", user_id=user.id)
]
),
]
dataset.records.log(records)
```
|
argilla-python/docs/guides/how_to_guides/record.md
|
=== "As `Record` objects"
You can also add suggestions to a record in an initialized `Record` object.. > Check the [Responses - Python Reference](../../reference/argilla_sdk/records/responses.md) to see the attributes, arguments, and methods of the `Suggestion` class in detail.. === "From a generic data structure"
|
argilla-python/docs/guides/how_to_guides/record.md
|
You can add suggestions as a dictionary, where the keys correspond to the `name`s of the labels that were configured for your dataset. Remember that you can also use the `mapping` parameter to specify the data structure. If you want to specify the user that added the response, you can use the `user_id` parameter.
|
argilla-python/docs/guides/how_to_guides/record.md
|
```python
# Add records to the dataset with the label 'my_label'
data = [
{
"question": "Do you need oxygen to breathe?",
"answer": "Yes",
"my_label.response": "positive",
},
{
"question": "What is the boiling point of water?",
"answer": "100 degrees Celsius",
"my_label.response": "negative",
},
]
dataset.records.log(data, user_id=user.id)
```. ## List records
|
argilla-python/docs/guides/how_to_guides/record.md
|
To list records in a dataset, you can use the `records` method on the `Dataset` object. This method returns a list of `Record` objects that can be iterated over to access the record properties.. ```python
for record in dataset.records(
with_suggestions=True,
with_responses=True,
with_vectors=True
):. # Access the record properties
print(record.metadata)
print(record.vectors)
print(record.suggestions)
print(record.responses)
|
argilla-python/docs/guides/how_to_guides/record.md
|
# Access the responses of the record
for response in record.responses:
print(record.question_name.value)
```. ## Update records. You can update records in a dataset calling the `update` method on the `Dataset` object. To update a record, you need to provide the record `id` and the new data to be updated.. ```python
data = dataset.records.to_list(flatten=True)
|
argilla-python/docs/guides/how_to_guides/record.md
|
updated_data = [
{
"text": sample["text"],
"label": "positive",
"id": sample["id"],
}
for sample in data
]
dataset.records.log(records=updated_data). ```
!!! note "Update the metadata"
The `metadata` of `Record` object is a python dictionary. So to update the metadata of a record, you can iterate over the records and update the metadata by key or using `metadata.update`. After that, you should update the records in the dataset.. ```python
updated_records = []
|
argilla-python/docs/guides/how_to_guides/record.md
|
for record in dataset.records():. record.metadata["my_metadata"] = "new_value"
record.metadata["my_new_metadata"] = "new_value". updated_records.append(record). dataset.records.log(records=updated_records)
```
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
A **dataset** is a collection of records that you can configure for labelers to provide feedback using the UI.. Depending on the specific requirements of your task, you may need various types of feedback.. You can customize the dataset to include different kinds of questions, so the first step will be to define the aim of your project and the kind of data and feedback you will need.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
With this information, you can start configuring a dataset by defining fields, questions, metadata, vectors, and guidelines through settings.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
# Dataset management. This guide provides an overview of datasets, explaining the basics of how to set them up and manage them in Argilla.. ??? Question "Question: Who can manage datasets?". Only users with the `owner` role can manage (create, retrieve, update and delete) all the datasets.. The users with the `admin` role can manage (create, retrieve, update and delete) the datasets in the workspaces they have access to.. !!! info "Main Classes"
=== "`rg.Dataset`"
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
```python
rg.Dataset(
name="name",
workspace="workspace",
settings=settings,
client=client
)
```
> Check the [Dataset - Python Reference](../../reference/argilla_sdk/datasets/datasets.md) to see the attributes, arguments, and methods of the `Dataset` class in detail.. === "`rg.Settings`"
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
```python
rg.Settings(
fields=[rg.TextField(name="text")],
questions=[
rg.LabelQuestion(
name="label",
labels=["label_1", "label_2", "label_3"]
)
],
metadata=[rg.TermsMetadataProperty(name="metadata")],
vectors=[rg.VectorField(name="vector", dimensions=10)],
guidelines="guidelines",
allow_extra_metadata=True,
)
```
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
> Check the [Settings - Python Reference](../../reference/argilla_sdk/settings/settings.md) to see the attributes, arguments, and methods of the `Settings` class in detail.. ## Create a dataset
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
To create a dataset, you can define it in the `Dataset` class and then call the `create` method that will send the dataset to the server so that it can be visualized in the UI. If the dataset does not appear in the UI, you may need to click the refresh button to update the view. For further configuration of the dataset, you can refer to the [settings section](#define-dataset-settings).. > The created dataset will be empty, to add the records refer to this [how-to guide](record.md).
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
```python
import argilla_sdk as rg. client = rg.Argilla(api_url="<api_url>", api_key="<api_key>"). settings = rg.Settings(
guidelines="These are some guidelines.",
fields=[
rg.TextField(
name="text",
),
],
questions=[
rg.LabelQuestion(
name="label",
labels=["label_1", "label_2", "label_3"]
),
],
). dataset = rg.Dataset(
name="my_dataset",
workspace="my_workspace",
settings=settings,
client=client,
)
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
dataset.create()
```
!!! tip "Accessing attributes"
Access the attributes of a dataset by calling them directly on the `dataset` object. For example, `dataset.id`, `dataset.name` or `dataset.settings`. You can similarly access the fields, questions, metadata, vectors and guidelines. For instance, `dataset.fields` or `dataset.questions`.. ### Create multiple datasets with the same settings. To create multiple datasets with the same settings, define the settings once and pass it to each dataset.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
```python
import argilla_sdk as rg. settings = rg.Settings(
guidelines="Select the sentiment of the prompt.",
fields=[rg.TextField(name="prompt", use_markdown=True)],
questions=[rg.LabelQuestion(name="sentiment", labels=["positive", "negative"])],
). dataset1 = rg.Dataset(name="sentiment_analysis_1", settings=settings)
dataset2 = rg.Dataset(name="sentiment_analysis_2", settings=settings). # Create the datasets on the server
dataset1.create()
dataset2.create()
```
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
### Create a dataset with settings from an existing dataset. To create a new dataset with settings from an existing dataset, get the settings from the existing dataset and pass it
to the new dataset.. ```python
import argilla_sdk as rg. # Get the settings from an existing dataset
existing_dataset = client.datasets("sentiment_analysis"). # Create a new dataset with the same settings
dataset = rg.Dataset(name="sentiment_analysis_copy", settings=existing_dataset.settings)
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
# Create the dataset on the server
dataset.create()
```. ## Define dataset settings. ### Fields. The fields in a dataset consist of one or more data items requiring annotation. Currently, Argilla only supports plain text and markdown through the `TextField`, though we plan to introduce additional field types in future updates.. A **field** is defined in the `TextField` class that has the following arguments:
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
* `name`: The name of the field.
* `title` (optional): The name of the field, as it will be displayed in the UI. Defaults to the `name` value.
* `required` (optional): Whether the field is required or not. Defaults to `True`. At least one field must be required.
* `use_markdown` (optional): Specify whether you want markdown rendered in the UI. Defaults to `False`. If you set it to True, you will be able to use all the Markdown features for text formatting, as well as embed multimedia content and PDFs.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
!!! note
The order of the fields in the UI follows the order in which these are added to the fields attribute in the Python SDK.. ```python
rg.TextField(
name="text",
title="Text",
required=True,
use_markdown=False
)
```
. ### Questions
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
- `name`: The name of the question.. - `title` (optional): The name of the question, as it will be displayed in the UI.. Defaults to the `name` value.. - `description` (optional): The text to be displayed in the question tooltip in the UI.. You can use it to give more context or information to annotators.. - `required` (optional): Whether the question is required or not.. Defaults to `True`.. At least one question must be required.. - `labels`: A list of strings with the options for these questions.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
If you'd like the text of the labels to be different in the UI and internally, you can pass a dictionary instead where the key is the internal name and the value will be the text displayed in the UI.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
To collect feedback for your dataset, you need to formulate questions that annotators will be asked to answer. Currently, Argilla supports the following types of questions: `LabelQuestion`, `MultiLabelQuestion`, `RankingQuestion`, `RatingQuestion`, `SpanQuestion`, and `TextQuestion`.. === "Label"
A `LabelQuestion` asks annotators to choose a unique label from a list of options. This type is useful for text classification tasks. In the UI, they will have a rounded shape. It has the following configuration:
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
```python
rg.LabelQuestion(
name="label",
title="Is the response relevant for the given prompt?",
description="Select the one that applies.",
required=True,
labels={"YES": "Yes", "NO": "No"}, # or ["YES", "NO"]
)
```

|
argilla-python/docs/guides/how_to_guides/dataset.md
|
- `name`: The name of the question.. - `title` (optional): The name of the question, as it will be displayed in the UI.. Defaults to the `name` value.. - `description` (optional): The text to be displayed in the question tooltip in the UI.. You can use it to give more context or information to annotators.. - `required` (optional): Whether the question is required or not.. Defaults to `True`.. At least one question must be required.. - `labels`: A list of strings with the options for these questions.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
If you'd like the text of the labels to be different in the UI and internally, you can pass a dictionary instead where the key is the internal name and the value will be the text displayed in the UI.. - `visible_labels` (optional): The number of labels that will be visible at first sight in the UI.. By default, the UI will show 20 labels and collapse the rest.. Set your preferred number to change this limit or set `visible_labels=None` to show all options.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
```python
rg.MultiLabelQuestion(
name="multi_label",
title="Does the response include any of the following?. ",
description="Select all that apply.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
",
required=True,
labels={
"hate": "Hate Speech",
"sexual": "Sexual content",
"violent": "Violent content",
"pii": "Personal information",
"untruthful": "Untruthful info",
"not_english": "Not English",
"inappropriate": "Inappropriate content"
}, # or ["hate", "sexual", "violent", "pii", "untruthful", "not_english", "inappropriate"]
visible_labels=4
)
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
=== "Multi-label"
A `MultiLabelQuestion` asks annotators to choose all applicable labels from a list of options. This type is useful for multi-label text classification tasks. In the UI, they will have a squared shape. It has the following configuration:. ```

|
argilla-python/docs/guides/how_to_guides/dataset.md
|
- `name`: The name of the question.. - `title` (optional): The name of the question, as it will be displayed in the UI.. Defaults to the `name` value.. - `description` (optional): The text to be displayed in the question tooltip in the UI.. You can use it to give more context or information to annotators.. - `required` (optional): Whether the question is required or not.. Defaults to `True`.. At least one question must be required.. - `values`: A list of strings with the options they will need to rank.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
If you'd like the text of the options to be different in the UI and internally, you can pass a dictionary instead where the key is the internal name and the value is the text to display in the UI.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
=== "Ranking"
A `RankingQuestion` asks annotators to order a list of options. It is useful to gather information on the preference or relevance of a set of options. Ties are allowed and all options will need to be ranked. It has the following configuration:
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
```python
rg.RankingQuestion(
name="ranking",
title="Order replies based on your preference",
description="1 = best, 3 = worst. Ties are allowed.",
required=True,
values={
"reply-1": "Reply 1",
"reply-2": "Reply 2",
"reply-3": "Reply 3"
} # or ["reply-1", "reply-2", "reply-3"]
)
```
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
- `name`: The name of the question.. - `title` (optional): The name of the question, as it will be displayed in the UI.. Defaults to the `name` value.. - `description` (optional): The text to be displayed in the question tooltip in the UI.. You can use it to give more context or information to annotators.. - `required` (optional): Whether the question is required or not.. Defaults to `True`.. At least one question must be required.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
- `values`: A list of unique integers representing the scores that annotators can select from should be defined within the range [1, 10].
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
=== "Rating"
A `RatingQuestion` asks annotators to select one option from a list of integer values. This type is useful for collecting numerical scores. It has the following configuration:. ```python
rg.RatingQuestion(
name="rating",
title="How satisfied are you with the response?",
description="1 = very unsatisfied, 10 = very satisfied",
required=True,
values=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
)
```
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
- `name`: The name of the question.. - `title` (optional): The name of the question, as it will be displayed in the UI.. Defaults to the `name` value, but capitalized.. - `description` (optional): The text to be displayed in the question tooltip in the UI.. You can use it to give more context or information to annotators.. - `required` (optional): Whether the question is required or not.. Defaults to `True`.. At least one question must be required.. - `labels`: A list of strings with the options for these questions.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
If you'd like the text of the labels to be different in the UI and internally, you can pass a dictionary instead where the key is the internal name and the value will be the text to display in the UI.. - `field`: This question is always attached to a specific field.. You should pass a string with the name of the field where the labels of the `SpanQuestion` should be used.. - `allow_overlapping`: This value specifies whether overlapped spans are allowed or not.. Defaults to `False`.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
- `visible_labels` (optional): The number of labels that will be visible at first sight in the UI.. By default, the UI will show 20 labels and collapse the rest.. Set your preferred number to change this limit or set `visible_labels=None` to show all options.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
=== "Span"
A `SpanQuestion` asks annotators to select a portion of the text of a specific field and apply a label to it. This type of question is useful for named entity recognition or information extraction tasks. It has the following configuration:
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
```python
rg.SpanQuestion(
name="span",
title="Select the entities in the text",
description="Select the entities in the text",
required=True,
labels={
"PERSON": "Person",
"ORG": "Organization",
"LOC": "Location",
"MISC": "Miscellaneous"
},
field="text",
allow_overlapping=False,
visible_labels=None
)
```
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
- `name`: The name of the question.. - `title` (optional): The name of the question, as it will be displayed in the UI.. Defaults to the `name` value, but capitalized.. - `description` (optional): The text to be displayed in the question tooltip in the UI.. You can use it to give more context or information to annotators.. - `required` (optional): Whether the question is required or not.. Defaults to `True`.. At least one question must be required.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
- `use_markdown` (optional): Define whether the field should render markdown text.. Defaults to `False`.. If you set it to `True`, you will be able to use all the Markdown features for text formatting, as well as embed multimedia content and PDFs.
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
=== "Text"
A `TextQuestion` offers to annotators a free-text area where they can enter any text. This type is useful for collecting natural language data, such as corrections or explanations. It has the following configuration:. ```python
rg.TextQuestion(
name="text",
title="Please provide feedback on the response",
description="Please provide feedback on the response",
required=True,
use_markdown=True
)
```. ### Metadata
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
Metadata properties allow you to configure the use of metadata information for the filtering and sorting features available in the UI and Python SDK. There exist three types of metadata you can add: `TermsMetadataProperty`, `IntegerMetadataProperty` and `FloatMetadataProperty`.. === "Terms"
A `TermsMetadataProperty` allows to add a list of strings as metadata options. It has the following configuration:
|
argilla-python/docs/guides/how_to_guides/dataset.md
|
- `name`: The name of the metadata property.
- `title` (optional): The name of the metadata property, as it will be displayed in the UI. Defaults to the `name` value, but capitalized.
- `options` (optional): You can pass a list of valid values for this metadata property, in case you want to run any validation.
|
End of preview. Expand
in Data Studio
Dataset info
This dataset contains chunks of the documentation of argilla-io/argilla-python repository, as obtained running the script docs_dataset.py like:
python docs_dataset.py \
"argilla-io/argilla-python" \
"plaguss/argilla_sdk_docs_raw" \
--max_chars 512
Ideally it could be used to start a knowledge base from your documentation.
Disclaimer
The script to generate the dataset is still experimental:
- There are repeated chunks (definitely a bug).
- The chunks generated are not properly sorted (although not entirely relevant).
- The code should be partitioned better (currently there's no distinction between code/plain text).
- Downloads last month
- -