You can refer to the following documentation. You can also refer to our recipe on how to create a project (run it here)
-
Edit
new_interface_settings.json. -
Execute:
python update_interface_settings.py-
Edit
new_users.yml. -
Execute:
python add_users.pyNote: You need to have ADMIN right at Organization level to create users.
Check out our recipe on how to import assets (run it here)
- Execute:
python delete_all_assets.pyCheck out our recipe on how to import predictions (run it here)
Check out our recipe on how to export labels (run it here)
Check out our recipe on how to import NER predictions into Kili. The script performs the following:
- downloads the data.
- gets the first 50 emails.
- creates a project with the appropriate JsonInterface to store the assets.
- pre-labels them with Google NLP.
- pushes both assets and predictions to Kili.
To run this example, do the following.
- Make sure that your GCP authentication is set up correctly (or follow this tutorial) and that the Google Natural Language API is enabled in your GCP project.
- Requirements:
pip install -r requirements.txt
pip install google-cloud-language==1.1.0
pip install kili # unless you have installed the version from this repository
- Execute:
GOOGLE_APPLICATION_CREDENTIALS=path_to_your_google_application_credentials_file python main.pyYou can query every asset, label, or project-related information through the API. A comprehensive example is our recipe on how to use the query methods (run it here) You can also refer to the SDK reference.
If you prefer, you can directly query GraphQL API without using Apollo Studio
-
Generate an API key in Kili interface in My account, under the tab API KEY. Store it in some place secured.
-
In the bottom left corner of the screen, click on
HTTP headersand write the retrieved token in the authorization headers:
{
"Authorization": "X-API-Key: YOUR_API_KEY"
}- Launch any query/mutation:
query {
users(where: { email: "YOUR_EMAIL" }, first: 10, skip: 0) {
id
activated
email
}
}-
Edit
new_assets.ymlwhere metadata has the format of./examples/invoice.jsonand the content points to the URL ofinvoice.png. -
Execute:
python import_assets.py-
Edit
new_assets.ymland change the fieldtoBeLabeledBy. When this field no exists, assets can be labeled by everyone. -
Execute:
python set_asset_to_be_labeled_by.py-
Generate an API key in Kili interface in My account, under the tab API KEY. Store it in some place secured.
-
Start automating your tasks :
from kili.client import Kili
kili = Kili(api_key=api_key)Use:
assets = kili.assets(project_id=project_id, external_id_contains=[external_id])
kili.delete_many_from_dataset(asset_ids=[a['id] for a in assets])Currently instructions can be set as a link to a PDF or an external web page.
You can update instructions with:
python update_project_instructions.pyYou can get an excel file summing up the asset / labeler / day doing:
python get_labeler_stats.py