filename
stringclasses
33 values
chunks
stringlengths
28
500
repo_name
stringclasses
1 value
argilla-python/docs/guides/how_to_guides/user.md
Remove a user from a workspace You can remove an existing user from a workspace in Argilla by calling the remove_from_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') removed_user = user.remove_from_workspace(workspace) ```
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/user.md
Delete a user You can delete an existing user from Argilla by calling the delete method on the User class. ```python import argilla_sdk as rg client = rg.Argilla(api_url="", api_key="") user_to_delete = client.users('my_username') deleted_user = user_to_delete.delete() ```
argilla-io/argilla-python
argilla-python/docs/guides/how_to_guides/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/record-checkpoint.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/.ipynb_checkpoints/index-checkpoint.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/.ipynb_checkpoints/index-checkpoint.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/.ipynb_checkpoints/index-checkpoint.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/.ipynb_checkpoints/index-checkpoint.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/.ipynb_checkpoints/index-checkpoint.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/.ipynb_checkpoints/index-checkpoint.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/.ipynb_checkpoints/index-checkpoint.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/.ipynb_checkpoints/index-checkpoint.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/.ipynb_checkpoints/index-checkpoint.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/.ipynb_checkpoints/index-checkpoint.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/.ipynb_checkpoints/index-checkpoint.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/community/contributor.md
description: Argilla-python is the reference argilla python server SDK. hide: - footer Thank you for investing your time in contributing to the project! Any contribution you make will be reflected in the most recent version of Argilla 🤩. ??? Question "New to contributing in general?" If you're a new contributor, read the README to get an overview of the project. In addition, here are some resources to help you get started with open-source contributions: First Contact in Slack
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
First Contact in Slack Slack is a very useful tool for more casual conversations and to answer day-to-day questions. Click here to join our Slack community effortlessly. The following screens will be displayed, choose how you wish to join and enter the code sent to you via email. Once you have joined the community, you'll be added to some channels by default, but below we show you all the community channels you can join: 00-announcements: 📣 Stay up-to-date on official Argilla
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
01-introductions: 👋 Say hi! to the community Fun facts are appreciated. 02-support-and-questions: 🙋‍♀️ Need help with Argilla or NLP? We are always here. 03-discoveries-and-news: 📚 Looking for resources and news related to everything NLP? 04-contributors: 🏗️ A channel for contributions and contributors. 05-beta-testing: 🚧 For access to the latest features and help us with testing the newest features. 06-general: 🐒 This channel is for... well, everything else.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
07-distilabel: ⚗️ For all of you questions about our Distilabel project. So now there is only one thing left to do, introduce yourself and talk to the community. You'll be always welcome! 🤗👋 Contributor Workflow with Git and GitHub If you're working with Argilla and suddenly a new idea comes to your mind or you find an issue that can be improved, it's time to actively participate and contribute to the project!
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
Report an issue If you spot a problem, search if an issue already exists. You can use the Label filter. If that is the case, participate in the conversation. If it does not exist, create an issue by clicking on New Issue. This will show various templates, choose the one that best suits your issue.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
Below, you can see an example of the Feature request template. Once you choose one, you will need to fill in it following the guidelines. Try to be as clear as possible. In addition, you can assign yourself to the issue and add or choose the right labels. Finally, click on Submit new issue. Work with a fork
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
Fork the Argilla repository After having reported the issue, you can start working on it. For that, you will need to create a fork of the project. To do that, click on the Fork button. Now, fill in the information. Remember to uncheck the Copy develop branch only if you are going to work in or from another branch (for instance, to fix documentation the main branch is used). Then, click on Create fork.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
Now, you will be redirected to your fork. You can see that you are in your fork because the name of the repository will be your username/argilla, and it will indicate forked from argilla-io/argilla. Clone your forked repository In order to make the required adjustments, clone the forked repository to your local machine. Choose the destination folder and run the following command:
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
sh git clone https://github.com/[your-github-username]/argilla.git cd argilla To keep your fork’s main/develop branch up to date with our repo, add it as an upstream remote branch. For more info, check the documentation. sh git remote add upstream https://github.com/argilla-io/argilla.git
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
Create a new branch For each issue you're addressing, it's advisable to create a new branch. GitHub offers a straightforward method to streamline this process. ⚠️ Never work directly on the main or develop branch. Always create a new branch for your changes. Navigate to your issue and on the right column, select Create a branch.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
After the new window pops up, the branch will be named after the issue, include a prefix such as feature/, bug/, or docs/ to facilitate quick recognition of the issue type. In the Repository destination, pick your fork ( [your-github-username]/argilla), and then select Change branch source to specify the source branch for creating the new one. Complete the process by clicking Create branch.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
🤔 Remember that the main branch is only used to work with the documentation. For any other changes, use the develop branch. Now, locally change to the new branch you just created. sh git fetch origin git checkout [branch-name] Use CHANGELOG.md
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
If you are working on a new feature, it is a good practice to make note of it for others to keep up with the changes. For that, we utilize the CHANGELOG.md file in the root directory. This file is used to list changes made in each version of the project and there are headers that we use to denote each type of change. - Added: for new features. - Changed: for changes in existing functionality. - Deprecated: for soon-to-be removed features. - Removed: for now removed features.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
- Fixed: for any bug fixes. - Security: in case of vulnerabilities.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
A sample addition would be: md - Fixed the key errors for the `init` method ([#NUMBER_OF_PR](LINK_TO_PR)). Contributed by @github_handle. You can have a look at the CHANGELOG.md file to see more cases and examples.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
Make changes and push them Make the changes you want in your local repository, and test that everything works and you are following the guidelines. Check the documentation for more information about the development. Once you have finished, you can check the status of your repository and synchronize with the upstreaming repo with the following command: ```sh Check the status of your repository git status Synchronize with the upstreaming repo
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
git checkout [branch-name] git rebase [default-branch] ``` If everything is right, we need to commit and push the changes to your fork. For that, run the following commands: ```sh Add the changes to the staging area git add filename Commit the changes by writing a proper message git commit -m "commit-message" Push the changes to your fork
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
git push origin [branch-name] ``` When pushing, you will be asked to enter your GitHub login credentials. Once the push is complete, all local commits will be on your GitHub repository.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
Create a pull request Come back to GitHub, navigate to the original repository where you created your fork, and click on Compare & pull request. First, click on compare across forks and select the right repositories and branches. In the base repository, keep in mind to select either main or develop based on the modifications made. In the head repository, indicate your forked repository and the branch corresponding to the issue.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
Then, fill in the pull request template. In the title, add the feat, bug or docs prefix depending on the type of modification. A general template will be shown, please click on Preview and choose the corresponding pull request template. In addition, on the right side, you can select a reviewer (for instance, if you discussed the issue with a member of the Argilla team) and assign the pull request to yourself.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
It is highly advisable to add labels to PR as well. You can do this again by the labels section right to the screen. For instance, if you are addressing a bug, add the bug label or if the PR is related to the documentation, add the documentation label. This way, PRs can be easily filtered.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
Additionally, you should add a prefix to the PR name as we did with the branch above. If you are working on a new feature, you can name your PR as feat: TITLE. If your PR consists of a solution for a bug, you can name your PR as bug: TITLE And, if your work is for improving the documentation, you can name your PR as docs: TITLE.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
Finally, click on Create pull request. Below, we chose the feature template. Now, fill in it carefully and follow the guidelines. Remember to link the original issue. Finally, enable the checkbox to allow maintainer edits so the branch can be updated for a merge and click on Create pull request.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
Review your pull request Once you submit your PR, a team member will review your proposal. We may ask questions, request additional information or ask for changes to be made before a PR can be merged, either using suggested changes or pull request comments.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
You can apply the changes directly through the UI (check the files changed and click on the right-corner three dots, see image below) or from your fork, and then commit them to your branch. The PR will be updated automatically and the suggestions will appear as outdated. If you run into any merge issues, check out this git tutorial to help you resolve merge conflicts and other issues.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
Your PR is merged! Congratulations 🎉🎊 We thank you 🤩 Once your PR is merged, your contributions will be publicly visible on the Argilla GitHub. Additionally, we will include your changes in the next release based on our development branch. We will probably contact you, but if you would like to send your personal information (LinkedIn, profile picture, GitHub) to David, he can set everything up for receiving your JustDiggit bunds and a LinkedIn shoutout.
argilla-io/argilla-python
argilla-python/docs/community/contributor.md
Additional resources Here are some helpful resources for your reference. Configuring Slack, a guide to learn how to configure Slack. Pro Git, a book to learn Git. Git in VSCode, a guide to learn how to easily use Git in VSCode. GitHub Skills, an interactive course to learn GitHub.
argilla-io/argilla-python
argilla-python/docs/community/index.md
description: Argilla-python is the reference argilla python server SDK. hide: - toc - footer We are an open-source community-driven project not only focused on building a great product but also on building a great community, where you can get support, share your experiences, and contribute to the project! We would love to hear from you and help you get started with Argilla.
argilla-io/argilla-python
argilla-python/docs/community/index.md
__Slack__ --- In our Slack you can get direct support from the community. [:octicons-arrow-right-24: Slack ↗](https://join.slack.com/t/rubrixworkspace/shared_invite/zt-whigkyjn-a3IUJLD7gDbTZ0rKlvcJ5g) - __Community Meetup__ --- We host bi-weekly community meetups where you can listen in or present your work. [:octicons-arrow-right-24: Community Meetup ↗](https://lu.ma/argilla-event-calendar) - __Changelog__ ---
argilla-io/argilla-python
argilla-python/docs/community/index.md
The changelog is where you can find the latest updates and changes to the Argilla project. [:octicons-arrow-right-24: Changelog ↗](https://github.com/argilla-io/argilla/blob/develop/argilla/CHANGELOG.md) - __Roadmap__ --- We love to discuss our plans with the community. Feel encouraged to participate in our roadmap discussions. [:octicons-arrow-right-24: Roadmap ↗](https://github.com/orgs/argilla-io/projects/10/views/1)
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/search.md
hide: footer rg.Query To collect records based on searching criteria, you can use the Query and Filter classes. The Query class is used to define the search criteria, while the Filter class is used to filter the search results. Filter is passed to a Query object so you can combine multiple filters to create complex search queries. A Query object can also be passed to Dataset.records to fetch records based on the search criteria. Usage Examples
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/search.md
Searching for records with 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. ```python for record in dataset.records(query="paris"): print(record) ```
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/search.md
Filtering records by conditions Argilla allows you to filter records based on 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. ```python
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/search.md
create a range from 10 to 20 range_filter = rg.Filter( [ ("metadata.count", ">=", 10), ("metadata.count", "<=", 20) ] ) query records with metadata count greater than 10 and less than 20 query = rg.Query(filters=range_filter, query="paris") iterate over the results for record in dataset.records(query=query): print(record) ``` Class Reference rg.Query ::: argilla_sdk.records._search.Query options: heading_level: 3
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/search.md
rg.Filter ::: argilla_sdk.records._search.Filter options: heading_level: 3
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/SUMMARY.md
rg.Argilla rg.Workspace rg.User rg.Dataset rg.Dataset.records rg.Settings Fields Questions Metadata Vectors rg.Record rg.Response rg.Suggestion rg.Vector rg.Metadata rg.Query
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/workspaces.md
hide: footer rg.Workspace In Argilla, workspaces are used to organize datasets in to groups. For example, you might have a workspace for each project or team. Usage Examples To create a new workspace, instantiate the Workspace object with the client and the name: python workspace = rg.Workspace(name="my_workspace") workspace.create() To retrieve an existing workspace, use the client.workspaces attribute: python workspace = client.workspaces("my_workspace") Class Reference
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/workspaces.md
rg.Workspace ::: argilla_sdk.workspaces.Workspace options: heading_level: 4
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/users.md
hide: footer rg.User A user in Argilla is a profile that uses the SDK or UI. Their profile can be used to track their feedback activity and to manage their access to the Argilla server. Usage Examples To create a new user, instantiate the User object with the client and the username: python user = rg.User(username="my_username", password="my_password") user.create() Existing users can be retrieved by their username:
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/users.md
python user = client.users("my_username") The current user of the rg.Argilla client can be accessed using the me attribute: python client.me Class Reference rg.User ::: argilla_sdk.users.User options: heading_level: 3
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/client.md
hide: footer rg.Argilla To interact with the Argilla server from python you can use the Argilla class. The Argilla client is used to create, get, update, and delete all Argilla resources, such as workspaces, users, datasets, and records. Usage Examples Connecting to an Argilla server To connect to an Argilla server, instantiate the Argilla class and pass the api_url of the server and the api_key to authenticate. ```python import argilla_sdk as rg
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/client.md
client = rg.Argilla( api_url="https://argilla.example.com", api_key="my_token", ) ``` Accessing Dataset, Workspace, and User objects The Argilla clients provides access to the Dataset, Workspace, and User objects of the Argilla server. ```python my_dataset = client.datasets("my_dataset") my_workspace = client.workspaces("my_workspace")
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/client.md
my_user = client.users("my_user") ``` These resources can then be interacted with to access their properties and methods. For example, to list all datasets in a workspace: python for dataset in my_workspace.datasets: print(dataset.name) Class Reference rg.Argilla ::: argilla_sdk.client.Argilla options: heading_level: 3
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/settings.md
hide: footer rg.Settings rg.Settings is used to define the setttings of an Argilla Dataset. The settings can be used to configure the behavior of the dataset, such as the fields, questions, guidelines, metadata, and vectors. The Settings class is passed to the Dataset class and used to create the dataset on the server. Once created, the settings of a dataset cannot be changed. Usage Examples
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/settings.md
Creating a new dataset with settings To create a new dataset with settings, instantiate the Settings class and pass it to the Dataset class. ```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"])], ) dataset = rg.Dataset(name="sentiment_analysis", settings=settings)
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/settings.md
Create the dataset on the server dataset.create() ``` To define the settings for fields, questions, metadata, or vectors, refer to the rg.TextField, rg.LabelQuestion, rg.TermsMetadataProperty, and rg.VectorField class documentation. Class Reference rg.Settings ::: argilla_sdk.settings.Settings options: heading_level: 3
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/fields.md
hide: footer Fields Fields in Argilla are define the content of a record that will be reviewed by a user.
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/fields.md
Usage Examples To define a field, instantiate the TextField class and pass it to the fields parameter of the Settings class. python text_field = rg.TextField(name="text") markdown_field = rg.TextField(name="text", use_markdown=True) The fields parameter of the Settings class can accept a list of fields, like this: ```python settings = rg.Settings( fields=[ rg.TextField(name="text"), ], )
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/fields.md
data = rg.Dataset( name="my_dataset", settings=settings, ) ``` To add records with values for fields, refer to the rg.Dataset.records documentation. Class References rg.TextField ::: argilla_sdk.settings.TextField options: heading_level: 3
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/vectors.md
hide: footer Vectors Vector fields in Argilla are used to define the vector form of a record that will be reviewed by a user.
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/vectors.md
Usage Examples To define a vector field, instantiate the VectorField class with a name and dimenstions, then pass it to the vectors parameter of the Settings class. python settings = rg.Settings( fields=[ rg.TextField(name="text"), ], vectors=[ rg.VectorField( name="my_vector", dimension=768, title="Document Embedding", ), ], ) To add records with vectors, refer to the rg.Vector class documentation. Class Reference
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/vectors.md
rg.VectorField ::: argilla_sdk.settings.VectorField options: heading_level: 3
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/metadata_property.md
hide: footer Metadata Properties Metadata properties are used to define metadata fields in a dataset. Metadata fields are used to store additional information about the records in the dataset. For example, the category of a record, the price of a product, or any other information that is relevant to the record. Usage Examples
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/metadata_property.md
Defining Metadata Property for a dataset We define metadata properties via type specific classes. The following example demonstrates how to define metadata properties as either a float, integer, or terms metadata property:
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/metadata_property.md
TermsMetadataProperty is used to define a metadata field with a list of options. For example, a color field with options red, blue, and green. FloatMetadataProperty and IntegerMetadataProperty is used to define a metadata field with a float value. For example, a price field with a minimum value of 0.0 and a maximum value of 100.0. ```python import argilla_sdk as rg
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/metadata_property.md
Define metadata properties as terms metadata_field = rg.TermsMetadataProperty( name="color", options=["red", "blue", "green"], title="Color", ) Define metadata properties as float float_ metadata_field = rg.FloatMetadataProperty( name="price", min=0.0, max=100.0, title="Price", )
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/metadata_property.md
Define metadata properties as integer int_metadata_field = rg.IntegerMetadataProperty( name="quantity", min=0, max=100, title="Quantity", ) ``` Metadata properties can be added to a dataset settings object:
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/metadata_property.md
```python dataset = rg.Dataset( name="my_dataset", settings=rg.Settings( fields=[ rg.TextField(name="text"), ], metadata=[ metadata_field, float_metadata_field, int_metadata_field, ], ), ) ``` To add records with metadata, refer to the rg.Metadata class documentation. Class References rg.FloatMetadataProperty ::: argilla_sdk.settings.FloatMetadataProperty options: heading_level: 3
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/metadata_property.md
rg.IntegerMetadataProperty ::: argilla_sdk.settings.IntegerMetadataProperty options: heading_level: 3 rg.TermsMetadataProperty ::: argilla_sdk.settings.TermsMetadataProperty options: heading_level: 3
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/questions.md
hide: footer Questions Questions in Argilla are the questions that will be answered as feedback. They are used to define the questions that will be answered by users or models.
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/questions.md
Usage Examples To define a label question, for example, instantiate the LabelQuestion class and pass it to the Settings class. ```python label_question = rg.LabelQuestion(name="label", labels=["positive", "negative"]) settings = rg.Settings( fields=[ rg.TextField(name="text"), ], questions=[ label_question, ], ) ```
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/questions.md
Questions can be combined in extensible ways based on the type of feedback you want to collect. For example, you can combine a label question with a text question to collect both a label and a text response. ```python label_question = rg.LabelQuestion(name="label", labels=["positive", "negative"]) text_question = rg.TextQuestion(name="response") settings = rg.Settings( fields=[ rg.TextField(name="text"), ], questions=[ label_question, text_question, ], )
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/questions.md
dataset = rg.Dataset( name="my_dataset", settings=settings, ) ``` To add records with responses to questions, refer to the rg.Response class documentation. Class References rg.LabelQuestion ::: argilla_sdk.settings.LabelQuestion options: heading_level: 3 rg.MultiLabelQuestion ::: argilla_sdk.settings.MultiLabelQuestion options: heading_level: 3 rg.RankingQuestion ::: argilla_sdk.settings.RankingQuestion options: heading_level: 3
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/settings/questions.md
rg.TextQuestion ::: argilla_sdk.settings.TextQuestion options: heading_level: 3 rg.RatingQuestion ::: argilla_sdk.settings.RatingQuestion options: heading_level: 3 rg.SpanQuestion ::: argilla_sdk.settings.SpanQuestion options: heading_level: 3
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/records/metadata.md
hide: footer metadata Metadata in argilla is a dictionary that can be attached to a record. It is used to store additional information about the record that is not part of the record's fields or responses. For example, the source of the record, the date it was created, or any other information that is relevant to the record. Metadata can be added to a record directly or as valules within a dictionary.
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/records/metadata.md
Usage Examples To use metadata within a dataset, you must define a metadata property in the dataset settings. The metadata property is a list of metadata properties that can be attached to a record. The following example demonstrates how to add metadata to a dataset and how to access metadata from a record object: ```python import argilla_sdk as rg
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/records/metadata.md
dataset = Dataset( name="dataset_with_metadata", settings=Settings( fields=[TextField(name="text")], questions=[LabelQuestion(name="label", labels=["positive", "negative"])], metadata=[ rg.TermsMetadataProperty(name="category", options=["A", "B", "C"]), ], ), ) dataset.create() ``` Then, you can add records to the dataset with metadata that corresponds to the metadata property defined in the dataset settings:
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/records/metadata.md
python dataset_with_metadata.records.log( [ {"text": "text", "label": "positive", "category": "A"}, {"text": "text", "label": "negative", "category": "B"}, ] )
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/records/suggestions.md
hide: footer rg.Suggestion Class for interacting with Argilla Suggestions of records. Suggestions are typically created by a model prediction, unlike a Response which is typically created by a user in the UI or consumed from a data source as a label. Usage Examples
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/records/suggestions.md
Adding records with suggestions Suggestions can be added to a record directly or via a dictionary structure. The following examples demonstrate how to add suggestions to a record object and how to access suggestions from a record object: Add a response from a dictionary where key is the question name and value is the response:
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/records/suggestions.md
python dataset.records.log( [ { "text": "Hello World, how are you?", "label": "negative", # this will be used as a suggestion }, ] ) If your data contains scores for suggestions you can add them as well via the mapping parameter. The following example demonstrates how to add a suggestion with a score to a record object:
argilla-io/argilla-python
argilla-python/docs/reference/argilla_sdk/records/suggestions.md
python dataset.records.log( [ { "prompt": "Hello World, how are you?", "label": "negative", # this will be used as a suggestion "score": 0.9, # this will be used as the suggestion score "model": "model_name", # this will be used as the suggestion agent }, ], mapping={ "score": "label.suggestion.score", "model": "label.suggestion.agent", }, # `label` is the question name in the dataset settings )
argilla-io/argilla-python