DocumentationRecipesReferenceGraphQLChangelogFAQ
Log In

Python SDK tutorials

To help you with your labeling tasks, Kili offers advanced tutorials prepared in Jupyter notebook format and hosted on Github.

For a full list, visit the kili-python-sdk repository.
If, rather than extensive tutorials, you're looking for simple recipes to copy-paste into your projects, refer to our recipes list.


Importing rich-text assets

When dealing with textual data, style can convey a lot of meaning. If you annotate a long list or a legal text, displaying structured text instead of plain boring text allows your annotator to rapidly grasp patterns within the document. Our tutorial will show you how to do that.

To access this tutorial, click here: Importing rich-text assets


Importing/exporting pixel-level masks

In this tutorial, we will show you how to import/export pixel-level masks when doing semantic annotation in Kili Technology. Such projects allow you to annotate image data at pixel level.

The data we use comes from the COCO dataset.

To access this tutorial, click here: Import/export pixel-level masks


Importing OCR pre-annotations

In this tutorial we will see how to import OCR pre-annotations in Kili using Google vision API. Pre-annotating your data will allow you to gain a significant time when performing OCR using Kili.

The data we use comes from The Street View Text Dataset.

To access this tutorial, click here: Importing OCR pre-annotations


Querying useful information using Kili API

In this tutorial, we will show you how to query useful information through Kili's API, interacting directly with the database.

There are 6 different types of data you could be interested in querying, all of them highly customizable:

  • Information about your organization
  • Information about the users in your organization
  • KPIs and labeling data for different project Users
  • The whole project or its selected parts
  • Project assets
  • Last but obviously not least, the labels

To access this tutorial, click here: Querying useful information using Kili API


Using webhooks

In this tutorial, we will show how to use webhooks to monitor actions in Kili, such as a label creation. The goal of this tutorial is to illustrate some basic components and concepts of Kili in a simple way, but also to dive into the actual process of iteratively developing real applications in Kili.

To access this tutorial, click here: Using webhooks


Leveraging counterfactually augmented data to have a more robust model

This recipe is inspired by the paper Learning the Difference that Makes a Difference with Counterfactually-Augmented Data.

In this study, the authors point out the difficulty for Machine Learning models to generalize the classification rules learned, because their decision rules, described as 'spurious patterns', often miss the key elements that affects most the class of a text. They thus decided to delete what can be considered as a confusion factor, by changing the label of an asset at the same time as changing the minimum amount of words so those key-words would be much easier for the model to spot.

We'll see in this tutorial :

  • How to create a project in Kili, both for IMDB and SNLI datasets, to reproduce such a data-augmentation task, in order to improve our model, and decrease its variance when used in production with unseen data.
  • We'll also try to reproduce the results of the paper, using similar models, to show how such a technique can be of key interest while working on a text-classification task.

To access this tutorial, click here: Leveraging counterfactually augmented data to have a more robust model.


Reading and uploading dicom image data

In this tutorial, we will show you how to upload medical images to Kili. We will use pydicom, a python package, to read medical data in a Dicom format.

Data used in this tutorial comes from the RSNA Pneumonia Detection Challenge hosted on Kaggle in 2018.

To access this tutorial, click here: Reading and uploading dicom image data