-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENHANCEMENT] docs: Add howto update record vectors #5052
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps we can work with tabs like shown below
=== "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 = []
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)
=== "Update vectors"
When a new vector field is added to the dataset settings, or some value for the existing record vectors must updated, you can iterate over the records and update the vectors in the same way as the metadata.
```python
updated_records = []
for record in dataset.records():
record.vectors["new_vector"] = [...]
record.vector["v"] = [...]
updated_records.append(record)
dataset.records.log(records=updated_records)
```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also , the general Update records text might emphasize we are not updating fields but only question suggestions?
Yes. Indeed we can update all about records but fields. I will create an issue to improve the docs about record updates. We should tackle it after the enhancement updating responses and suggestions (thanks to @burtenshaw ) |
Done https://argilla-io.github.io/argilla/docs_update-vectors-howto/how_to_guides/record/#__tabbed_6_1 |
Description
This PR adds how to update record vectors in how-to guides. Since the fields cannot be updated, the how-to guides skip them for now.
How Has This Been Tested
(Please describe the tests that you ran to verify your changes.)
sphinx-autobuild
(read Developer Documentation for more details)Checklist
CHANGELOG.md
file (See https://keepachangelog.com/)