Skip to content
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

[DOCS] Token Classification tutorial Issue adding suggestions #5781

Open
javilonso opened this issue Jan 15, 2025 · 1 comment
Open

[DOCS] Token Classification tutorial Issue adding suggestions #5781

javilonso opened this issue Jan 15, 2025 · 1 comment
Assignees

Comments

@javilonso
Copy link

javilonso commented Jan 15, 2025

Which page or section is this issue related to?

https://docs.argilla.io/latest/tutorials/token_classification/#add-initial-model-suggestions

I was following this tutorial and was stuck on this part where you add the NER suggestions from the model, as the updated records were not uploaded due to an issue.
image

I ended up changing the code with the following, and now it works as expected:

records = list(dataset.records())
suggestions = [
    predict_gliner(
        model=gliner_model, text=sample.fields["text"], labels=labels, threshold=0.7
    )
    for sample in records
]

for record, suggestion in zip(records, suggestions):
   print(record, suggestion)
   record.suggestions.add(rg.Suggestion(question_name="span_label", value=suggestion))

dataset.records.log(records=records)
@javilonso javilonso changed the title [DOCS] [DOCS] Token Classification tutorial Issue Jan 15, 2025
@javilonso javilonso changed the title [DOCS] Token Classification tutorial Issue [DOCS] Token Classification tutorial Issue adding suggestions Jan 15, 2025
@davidberenstein1957
Copy link
Member

That is great @javilonso. Would you be able to capture this in a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants