filename
stringclasses
33 values
chunks
stringlengths
28
500
repo_name
stringclasses
1 value
argilla-python/docs/index.md
description: Argilla is a collaboration platform for AI engineers and domain experts that require high-quality outputs, full data ownership, and overall efficiency. hide: navigation 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.
argilla-io/argilla-python
argilla-python/docs/index.md
__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__ --- 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)
argilla-io/argilla-python
argilla-python/docs/index.md
Why use Argilla? 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. Improve your AI output quality through data quality
argilla-io/argilla-python
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. Take control of your data and models
argilla-io/argilla-python
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. Improve efficiency by quickly iterating on the right data and models
argilla-io/argilla-python
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?
argilla-io/argilla-python
argilla-python/docs/index.md
Datasets and models 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 and models, and we love contributions to open-source ourselves too. Our cleaned UltraFeedback dataset and the Notus and Notux models, where we improved benchmark and empirical human judgment for the Mistral and Mixtral models with cleaner data using human feedback.
argilla-io/argilla-python
argilla-python/docs/index.md
Our distilabeled Intel Orca DPO dataset and the improved OpenHermes model, show how we improve model performance by filtering out 50% of the original dataset through human and AI feedback.
argilla-io/argilla-python
argilla-python/docs/index.md
Projects and pipelines AI teams from companies like the Red Cross, Loris.ai and Prolific use Argilla to improve the quality and efficiency of AI projects. They shared their experiences in our AI community meetup. AI for good: the Red Cross presentation 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-io/argilla-python
argilla-python/docs/index.md
Customer support: during the Loris meetup 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.
argilla-io/argilla-python
argilla-python/docs/index.md
Research studies: the showcase from Prolific announced their integration with our platform. 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-io/argilla-python
argilla-python/docs/guides/how_to_guides/record.md
description: In this section, we will provide a step-by-step guide to show how to manage records. 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-io/argilla-python
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-io/argilla-python
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. !!! info "Main Class"
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/record.md
Add records 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-io/argilla-python
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 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" === "From a generic data structure" === "From a Hugging Face dataset"
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/record.md
Metadata 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-io/argilla-python
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. === "As Record objects" === "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-io/argilla-python
argilla-python/docs/guides/how_to_guides/record.md
Vectors 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. === "As Record objects" === "From a generic data structure"
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/record.md
Suggestions 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-io/argilla-python
argilla-python/docs/guides/how_to_guides/record.md
=== "As Record objects" You can also add suggestions to a record in an initializedRecord` object. === "From a generic data structure" You can add suggestions as a dictionary, where the keys correspond to the names of the labels that were configured for your dataset. Remember that you can also use the mapping parameter to specify the data structure.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/record.md
Responses 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.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/record.md
!!! note Keep in mind that records with responses will be displayed as "Draft" in the UI. === "As Record objects" You can also add suggestions to a record in an initialized Record object. === "From a generic data structure"
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/record.md
List records 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 ): ```
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/record.md
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) updated_data = [ { "text": sample["text"], "label": "positive", "id": sample["id"], } for sample in data ] dataset.records.log(records=updated_data)
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/record.md
`` !!! note "Update the metadata" ThemetadataofRecordobject 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 usingmetadata.update`. After that, you should update the records in the dataset.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
description: In this section, we will provide a step-by-step guide to show how to manage datasets and configure dataset settings. Dataset management This guide provides an overview of datasets, explaining the basics of how to set them up and manage them in Argilla.
argilla-io/argilla-python
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. With this information, you can start configuring a dataset by defining fields, questions, metadata, vectors, and
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
guidelines through settings.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
??? Question "Question: Who can manage datasets?" !!! info "Main Classes" === "rg.Dataset"
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
Create a dataset 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. The created dataset will be empty, to add the records refer to this how-to guide. ```python import argilla_sdk as rg
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
client = rg.Argilla(api_url="", 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-io/argilla-python
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 thedatasetobject. For example,dataset.id,dataset.nameordataset.settings. You can similarly access the fields, questions, metadata, vectors and guidelines. For instance,dataset.fieldsordataset.questions`.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
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. ```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"])], )
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
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() ``` 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
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
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) Create the dataset on the server dataset.create() ``` Define dataset settings
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
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: 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.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
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. !!! 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.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
python rg.TextField( name="text", title="Text", required=True, use_markdown=False ) Questions 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.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
=== "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: === "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-io/argilla-python
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-io/argilla-python
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-io/argilla-python
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: === "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:
argilla-io/argilla-python
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: === "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-io/argilla-python
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: === "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:
argilla-io/argilla-python
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: Metadata
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
Metadata 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-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
=== "Integer" An IntegerMetadataProperty allows to add integer values as metadata. It has the following configuration: === "Integer" An IntegerMetadataProperty allows to add integer values as metadata. It has the following configuration: === "Float" A FloatMetadataProperty allows to add float values as metadata. It has the following configuration: === "Float" A FloatMetadataProperty allows to add float values as metadata. It has the following configuration: Vectors
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
Vectors To use the similarity search in the UI and the Python SDK, you will need to configure vectors using the VectorField class. It has the following configuration: name: The name of the vector. title (optional): A name for the vector to display in the UI for better readability. dimensions: The dimensions of the vectors used in this setting. python rg.VectorField( name="my_vector", title="My Vector", dimensions=768 ),
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
Guidelines Once you have decided on the data to show and the questions to ask, it's important to provide clear guidelines to the annotators. These guidelines help them understand the task and answer the questions consistently. You can provide guidelines in two ways:
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
In the dataset guidelines: this is added as an argument when you create your dataset in the Python SDK. It will appear in the dataset settings in the UI. python guidelines = "In this dataset, you will find a collection of records that show a category, an instruction, a context and a response to that instruction. [...]" As question descriptions: these are added as an argument when you create questions in the Python SDK. This text will appear in a tooltip next to the question in the UI.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
It is good practice to use at least the dataset guidelines if not both methods. Question descriptions should be short and provide context to a specific question. They can be a summary of the guidelines to that question, but often that is not sufficient to align the whole annotation team. In the guidelines, you can include a description of the project, details on how to answer each question with examples, instructions on when to discard a record, etc.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
!!! tip If you want further guidance on good practices for guidelines during the project development, check our blog post. List datasets You can list all the datasets available in a workspace using the datasets attribute of the Workspace class. You can also use len(workspace.datasets) to get the number of datasets in a workspace. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") workspace = client.workspaces("my_workspace") datasets = workspace.datasets
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
for dataset in datasets: print(dataset) ``` Retrieve a dataset You can retrieve a dataset by calling the datasets method on the Argilla class and passing the name of the dataset as an argument. By default, this method attempts to retrieve the dataset from the first workspace. If the dataset is in a different workspace, you must specify either the workspace name or id as an argument. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="")
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
workspace = client.workspaces("my_workspace") Retrieve the dataset from the first workspace retrieved_dataset = client.datasets(name="my_dataset") Retrieve the dataset from the specified workspace retrieved_dataset = client.datasets(name="my_dataset", workspace=workspace) ``` Check dataset existence You can check if a dataset exists by calling the exists method on the Dataset class. This method returns a boolean value. ```python import argilla_sdk as rg
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
client = rg.Argilla(api_url="", api_key="") dataset = client.datasets(name="my_dataset") dataset_existed = dataset.exists() ``` Update a dataset You can update a dataset by calling the update method on the Dataset class and passing the new settings as an argument. !!! note Keep in mind that once your dataset is published, only the guidelines can be updated. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="")
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
dataset_to_update = client.datasets(name="my_dataset") settings_to_update = rg.Settings( guidelines="These are some updated guidelines.", fields=[ rg.TextField( name="text", ), ], questions=[ rg.LabelQuestion( name="label", labels=["label_4", "label_5", "label_6"] ), ], ) dataset_to_update.settings = settings_to_update dataset_updated = dataset_to_update.update() ```
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/dataset.md
Delete a dataset You can delete an existing dataset by calling the delete method on the Dataset class. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") dataset_to_delete = client.datasets(name="my_dataset") dataset_deleted = dataset_to_delete.delete() ```
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/query_export.md
description: In this section, we will provide a step-by-step guide to show how to filter and query a dataset. Query, filter, and export records This guide provides an overview of how to query and filter a dataset in Argilla and export records.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/query_export.md
You can search for records in your dataset by querying or filtering. The query focuses on the content of the text field, while the filter is used to filter the records based on conditions. You can use them independently or combine multiple filters to create complex search queries. You can also export records from a dataset either as a single dictionary or a list of dictionaries. !!! info "Main Classes"
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/query_export.md
Query with search terms To search for records with terms, you can use the Dataset.records attribute with a query string. The search terms are used to search for records that contain the terms in the text field. You can search a single term or various terms, in the latter, all of them should appear in the record to be retrieved. === "Single search term" === "Multiple search term"
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/query_export.md
Filter by conditions You can use the Filter class to define the conditions and pass them to the Dataset.records attribute to fetch records based on the conditions. Conditions include "==", ">=", "<=", or "in". Conditions can be combined with dot notation to filter records based on metadata, suggestions, or responses. You can use a single condition or multiple conditions to filter records.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/query_export.md
operator description == The field value is equal to the value >= The field value is greater than or equal to the value <= The field value is less than or equal to the value in TThe field value is included in a list of values
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/query_export.md
=== "Single condition" === "Multiple conditions" Filter by status You can filter records based on their status. The status can be pending, draft, submitted, or discarded. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") workspace = client.workspaces("my_workspace") dataset = client.datasets(name="my_dataset", workspace=workspace) status_filter = rg.Query( filter = rg.Filter(("status", "==", "submitted")) )
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/query_export.md
filtered_records = list(dataset.records(status_filter)) ``` Query and filter a dataset As mentioned, you can use a query with a search term and a filter or various filters to create complex search queries. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") workspace = client.workspaces("my_workspace")
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/query_export.md
dataset = client.datasets(name="my_dataset", workspace=workspace) query_filter = rg.Query( query="my_term", filter= rg.Filter( [ ("label.suggestion", "==", "positive"), ("metadata.count", ">=", 10), ] ) ) queried_filtered_records = list(dataset.records( query=query_filter, with_metadata=True, with_suggestions=True ) ) ```
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/query_export.md
Export records to a dictionary Records can be exported from Dataset.records as a dictionary. The to_dict method can be used to export records as a dictionary. You can specify the orientation of the dictionary output. You can also decide if to flatten or not the dictionary. === " ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") workspace = client.workspaces("my_workspace") dataset = client.datasets(name="my_dataset", workspace=workspace)
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/query_export.md
Export records as a dictionary exported_records = dataset.records.to_dict() {'fields': [{'text': 'Hello'},{'text': 'World'}], suggestions': [{'label': {'value': 'positive'}}, {'label': {'value': 'negative'}}] Export records as a dictionary with orient=index exported_records = dataset.records.to_dict(orient="index") {"uuid": {'fields': {'text': 'Hello'}, 'suggestions': {'label': {'value': 'positive'}}}, {"uuid": {'fields': {'text': 'World'}, 'suggestions': {'label': {'value': 'negative'}}},
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/query_export.md
Export records as a dictionary with flatten=false exported_records = dataset.records.to_dict(flatten=True) {"text": ["Hello", "World"], "label.suggestion": ["greeting", "greeting"]} ``` Export records to a list Records can be exported from Dataset.records as a list of dictionaries. The to_list method can be used to export records as a list of dictionaries. You can decide if to flatten it or not. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="")
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/query_export.md
workspace = client.workspaces("my_workspace") dataset = client.datasets(name="my_dataset", workspace=workspace) Export records as a list of dictionaries exported_records = dataset.records.to_list() [{'fields': {'text': 'Hello'}, 'suggestion': {'label': {value: 'greeting'}}}, {'fields': {'text': 'World'}, 'suggestion': {'label': {value: 'greeting'}}}] Export records as a list of dictionaries with flatten=False exported_records = dataset.records.to_list(flatten=True)
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/query_export.md
[{"text": "Hello", "label": "greeting"}, {"text": "World", "label": "greeting"}] ```
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/workspace.md
description: In this section, we will provide a step-by-step guide to show how to manage workspaces. Workspace Management This guide provides an overview of workspaces, explaining how to set up and manage workspaces in Argilla. A workspace is a space inside your Argilla instance where authorized users can collaborate on datasets. It is accessible through the Python SDK and the UI. ??? Question "Question: Who can manage workspaces?"
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/workspace.md
Default workspaces Argilla provides a default workspace to help you get started in Python and the UI. The name of this workspace varies depending on the server configuration.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/workspace.md
Environment Name Quickstart Docker and HF Space admin Server image argilla
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/workspace.md
!!! info "Main Class" Create a new workspace To create a new workspace in Argilla, you can define it in the Workspace class and then call the create method. This method is inherited from the Resource base class and operates without modifications. When you create a new workspace, it will be empty. To create and add a new dataset, check these guides. ```python import argilla_sdk as rg
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/workspace.md
client = rg.Argilla(api_url="", api_key="") workspace_to_create = rg.Workspace( name = "my_workspace", client=client ) created_workspace = workspace_to_create.create() created_workspace `` !!! tip "Accessing attributes" Access the attributes of a workspace by calling them directly on theWorkspaceobject. For example,workspace.idorworkspace.name`.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/workspace.md
List workspaces You can list all the existing workspaces in Argilla by calling the workspaces attribute on the Argilla class and iterating over them. You can also use len(client.workspaces) to get the number of workspaces. ```python import argilla_sdk as rg
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/workspace.md
client = rg.Argilla(api_url="", api_key="") workspaces = client.workspaces for workspace in workspaces: print(workspace) `` !!! tip "Notebooks" When using a notebook, executingclient.workspaceswill display a table with the number ofdatasetsin each workspace,name,id, and the last update asupdated_at`.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/workspace.md
Retrieve a workspace You can retrieve a workspace by accessing the workspaces method on the Argilla class and passing the name of the workspace as an argument. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") retrieved_workspace = client.workspaces("my_workspace") ``` Check workspace existence You can check if a workspace exists by calling the exists method on the Workspace class. This method returns a boolean value. ```python import argilla_sdk as rg
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/workspace.md
client = rg.Argilla(api_url="", api_key="") workspace = client.workspaces("my_workspace") workspace_existed = workspace.exists() ``` List users in a workspace You can list all the users in a workspace by accessing the users attribute on the Workspace class and iterating over them. You can also use len(workspace.users) to get the number of users by workspace. For further information on how to manage users, check this how-to guide. ```python import argilla_sdk as rg
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/workspace.md
client = rg.Argilla(api_url="", api_key="") workspace = client.workspaces('my_workspace') for user in workspace.users: print(user) ``` Add a user to a workspace You can also add a user to a workspace by calling the add_user method on the Workspace class. For further information on how to manage users, check this how-to guide. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") workspace = client.workspaces("my_workspace")
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/workspace.md
added_user = workspace.add_user("my_username") ``` Remove a user from workspace You can also remove a user from a workspace by calling the remove_user method on the Workspace class. For further information on how to manage users, check this how-to guide. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") workspace = client.workspaces("my_workspace") removed_user = workspace.remove_user("my_username") ```
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/workspace.md
Delete a workspace To delete a workspace, no dataset can be associated with it. If the workspace contains any dataset, deletion will fail. You can delete a workspace by calling the delete method on the Workspace class. To clear a workspace and delete all their datasets, refer to this how-to guide. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") workspace_to_delete = client.workspaces("my_workspace") deleted_workspace = workspace_to_delete.delete() ```
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/index.md
description: These are the how-to guides for the Argilla-python SDK. They provide step-by-step instructions for common scenarios, including detailed explanations and code samples. hide: toc How-to guides These are the how-to guides for the Argilla-python SDK. They provide step-by-step instructions for common scenarios, including detailed explanations and code samples.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/index.md
__Manage users and credentials__ --- Learn what they are and how to manage (create, read and delete) [`Users`](user.md) in Argilla. [:octicons-arrow-right-24: How-to guide](user.md) - __Manage workspaces__ --- Learn what they are and how to manage (create, read and delete) [`Workspaces`](workspace.md) in Argilla. [:octicons-arrow-right-24: How-to guide](workspace.md) - __Manage and create datasets__ ---
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/index.md
Learn what they are and how to manage (create, read and delete) [`Datasets`](dataset.md) and customize them using the `Settings` for `Fields`, `Questions`, `Metadata` and `Vectors`. [:octicons-arrow-right-24: How-to guide](dataset.md) - __Add, update, and delete records__ --- Learn what they are and how to add, update and delete the values for a [`Record`](record.md), which are made up of `Metadata`, `Vectors`, `Suggestions` and `Responses`.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/index.md
[:octicons-arrow-right-24: How-to guide](record.md) - __Query, filter and export records__ --- Learn how to query and filter a `Dataset` and export their `Records`. [:octicons-arrow-right-24: How-to guide](query_export.md)
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/user.md
description: In this section, we will provide a step-by-step guide to show how to manage users and their credentials.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/user.md
User Management This guide provides an overview of user roles and credentials, explaining how to set up and manage users in Argilla. A user in Argilla is an authorized person, who depending on their role, can use the Python SDK and access the UI in a running Argilla instance. We differentiate between three types of users depending on their role, permissions and needs: owner, admin and annotator.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/user.md
=== "Overview" | | Owner | Admin | Annotator | |-------------------------------|------------|---------------------------|-----------| | Number | Unlimited | Unlimited | Unlimited | | Create and delete workspaces | Yes | No | No | | Assign users to workspaces | Yes | No | No |
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/user.md
| Create, configure, update, and delete datasets | Yes | Only within assigned workspaces | No | | Create, update, and delete users | Yes | No | No | | Provide feedback with Argila UI | Yes | Yes | Yes |
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/user.md
=== "Owner" === "Admin" === "Annotator" ??? Question "Question: Who can manage users?" Default users and credentials Argilla provides a default user with the owner role to help you get started in Python and the UI. The credentials for this user vary depending on the server configuration.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/user.md
Environment Username Password API Key Quickstart Docker and HF Space owner 12345678 owner.apikey Server image argilla 1234 argilla.apikey
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/user.md
!!! info "Main Class" Get current user To ensure you're using the correct credentials for managing users, you can get the current user in Argilla using the me attribute of the Argilla class. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") current_user = client.me ```
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/user.md
Create a user To create a new user in Argilla, you can define it in the User class and then call the create method. This method is inherited from the Resource base class and operates without modifications. !!! info Password generation If you don't provide a password, a random one will be generated for you. Ensure you store this password securely by accessing it through user.password immediately after user creation. For security reasons, the password will not be retrievable later.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/user.md
```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") user_to_create = rg.User( username="my_username", password="12345678", client=client ) created_user = user_to_create.create() `` !!! tip "Accessing attributes" Access the attributes of a user by calling them directly on theUserobject. For example,user.idoruser.username`.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/user.md
List users You can list all the existing users in Argilla by accessing the users attribute on the Argilla class and iterating over them. You can also use len(client.users) to get the number of users. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") users = client.users for user in users: print(user) `` !!! tip "Notebooks" When using a notebook, executingclient.userswill display a table withusername,id,role, and the last update asupdated_at`.
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/user.md
Retrieve a user You can retrieve an existing user from Argilla by accessing the users attribute on the Argilla class and passing the username as an argument. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") retrieved_user = client.users("my_username") ```
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/user.md
List users in a workspace You can list all the users in a workspace by accessing the users attribute on the Workspace class and iterating over them. You can also use len(workspace.users) to get the number of users by workspace. For further information on how to manage workspaces, check this how-to guide. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") workspace = client.workspaces('my_workspace') for user in workspace.users: print(user) ```
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/user.md
Add a user to a workspace You can add an existing user to a workspace in Argilla by calling the add_to_workspace method on the User class. For further information on how to manage workspaces, check this how-to guide. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") user = client.users('my_username') workspace = client.workspaces('my_workspace') added_user = user.add_to_workspace(workspace) ```
argilla-io/argilla-python

Dataset info

This dataset contains documentation chunks from repositories (ADD REPOS).

Postprocessing

After some inspection, some chunks contain text too short to be meaningful, so we decided to remove those by removing chunks whose number of tokens (computed with the same tokenizer of the model to be used for the embeddings) is lower or equal to the 5%:

from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("BAAI/bge-base-en-v1.5")

df = ds.to_pandas()
df["token_length"] = df["chunks"].apply(lambda x: len(tokenizer.encode(x)))

df_short = df[df["token_length"] >= df["token_length"].quantile(0.05)]
ds = Dataset.from_pandas(df_short[["filename", "chunks", "repo_name"]], preserve_index=False)
Downloads last month
47
Edit dataset card