Skip to main content

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

Click on "user" icon in the rigth-top corner, select "User settings". Click on Get API token. Copy token into clipboard.

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


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.1.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

labelatorio-0.1.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file labelatorio-0.1.1.tar.gz.

File metadata

  • Download URL: labelatorio-0.1.1.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for labelatorio-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bf7d742f06ff5bd973727057d8f2174912793feb55699366c3020e6d15800345
MD5 aa41ad5ccc83e47f1f8d5e605dd6c158
BLAKE2b-256 5a0ff9751e75e336796f39b546f5753511974308765389c6ea3484d652d6774d

See more details on using hashes here.

File details

Details for the file labelatorio-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: labelatorio-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for labelatorio-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ef1453f91b84da366e8f58ce75ce0631beca750630ea7c61d7893c2e3d452ba
MD5 9a5138f3d9b4621de347f847ea9e28eb
BLAKE2b-256 27a167060069a3c1d651c86957a5399d14ed43a2e0888367cc1fd6314cd88064

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page