Labelator.io python client
Project description
Labelator.io - python client
Python client for Labelator.io - labeling and ML training studio
Install
pip install labelatorio
Getting your API token
Usage
Connecting client
import labelatorio
client = labelatorio.Client(api_token="your_api_token")
Getting project info
Package requirements are handled using pip. To install them do
# get project by id
existing_project = client.projects.get("2fab1778-e8b1-4327-ac83-16dd0e783ab4")
# if you have just name
existing_project = client.projects.get_by_name("my name")
# or if you don't know the exact name
existing_project = client.projects.search("my name")
Adding, updating documents
df = pd.DataFrame({
"key":["first","second"], # mandatory
"text":["this is my first text", "completely different text..."], # mandatory
"my_custom_column":["note 1",None] # optional
"labels":[["ClassA"],None] #optional if you have labels - should be defined in project
})
ids = client.documents.add_documents(project_id, data=df)
client.documents.set_labels(project_id,ids[1],["ClassB"])
Quering documents
# simple keyword search ...
found = client.documents.search(keyword="completely different")
# find all documents where "ClassA" was predicted
found = client.documents.search( predicted_label="ClassA")
# find all documents where "ClassA" was incorrectly predicted
found = client.documents.search( false_positives="ClassA")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
labelatorio-0.1.0.tar.gz
(10.7 kB
view hashes)
Built Distribution
Close
Hashes for labelatorio-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54ec74163e23a61ea199d2189637470e07d4ea37ae82678d1d443d6fde123cf0 |
|
MD5 | a1bf3bb14a8bd8e36042ff21b3de102b |
|
BLAKE2b-256 | 736e3a6ce06bc740bdf7c71d5da52c5a79ea3a3648773573449d53669b81fe90 |