Created
May 17, 2023 06:27
-
-
Save nsorros/d00c67224b3598525efb85be75c2fb1c to your computer and use it in GitHub Desktop.
Load token classification data to Argilla
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import argilla as rg | |
rg.init( | |
api_url="https://pro.argilla.io", | |
api_key=os.environ.get("ARGILLA_API_KEY"), | |
workspace="mantisnlp", | |
#extra_headers={"X-Argilla-Workspace": "my_connection_headers"} | |
) | |
text = open("data.txt").read() | |
records = [ | |
rg.TokenClassificationRecord(text=text, tokens=text.split()), | |
] | |
dataset = rg.DatasetForTokenClassification(records) | |
rg.log(dataset, "jose") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment