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 right-top corner, select "User settings". Click on Get API token. Copy token into clipboard.

Docs:

Full Labelator.io documentation can be found here docs.labelator.io

Page dedicated this client can be found here

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.3.8rc2.tar.gz (17.1 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.3.8rc2-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file labelatorio-0.3.8rc2.tar.gz.

File metadata

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

File hashes

Hashes for labelatorio-0.3.8rc2.tar.gz
Algorithm Hash digest
SHA256 65c577c1d3b7c11b2f7c6ad5af23097b61d1094bef9d745616ce8d07e5eb6d75
MD5 7bc6e14b8cc1bc7dd278b4b5ae07c1bd
BLAKE2b-256 d4d6677925a1a9af1a88f3849c1542a5b7751b02d028029f1bd39c9f371f0e79

See more details on using hashes here.

File details

Details for the file labelatorio-0.3.8rc2-py3-none-any.whl.

File metadata

  • Download URL: labelatorio-0.3.8rc2-py3-none-any.whl
  • Upload date:
  • Size: 17.4 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.3.8rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 0075426b25c07a32b8d1af547414671dec104fa5aefb2d0e41bf3454738e83c3
MD5 0c2c1c91bac499f2186c902ddb8f6d01
BLAKE2b-256 978737ff091fdc813d6c06cf80b75a01b76009429d7e469778d5b171cb6c016d

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