-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Model Metadata
A full model is composed of 3 types of entities:
- The model
- The instances
- The instance versions
Let's take the example of efficientnet to explain these entities.
A model like efficientnet contains multiple instances.
An instance is a specific variation of the model (e.g. B0, B1, ...) with a certain framework (e.g. TensorFlow2).
To create a model, a special model-metadata.json file must be specified.
Here's a basic example for model-metadata.json:
{
"ownerSlug": "INSERT_OWNER_SLUG_HERE",
"title": "INSERT_TITLE_HERE",
"slug": "INSERT_SLUG_HERE",
"licenseName": "apache-2.0",
"subtitle": "",
"isPrivate": True,
"description": "Model Card Markdown, see below",
"publishTime": ""
}
You can also use the API command kaggle models init -p /path/to/model to have the API create this file for you for a new model. If you wish to get the metadata for an existing model, you can use kaggle models get username/model-slug.
We currently support the following metadata fields for models.
-
ownerSlug: the slug of the user or organization -
title: the model's title -
slug: the model's slug (unique per owner) -
licenseName: the name of the license (see the list below) -
subtitle: the model's subtitle -
isPrivate: whether or not the model should be private (only visible by the owners). If not specified, will betrue -
description: the model's card in markdown syntax (see the template below) -
publishTime: the original publishing time of the model
Here is a list of the available licenses for models:
- AGPL 3.0
- apache-2.0
- bsd-3-clause
- CC BY 3.0
- CC BY 3.0 IGO
- CC BY 4.0
- CC BY-NC 4.0
- CC BY-NC-ND 4.0
- CC BY-NC-SA 3.0 IGO
- CC BY-NC-SA 4.0
- CC BY-ND 4.0
- CC BY-SA 3.0
- CC BY-SA 4.0
- CC0 1.0
- CDLA Permissive 1.0
- CDLA Sharing 1.0
- FDL 1.3
- GPL 2
- LGPL 3.0
- mit
- ODC-BY 1.0
- PDDL
You can find a template of the model card on this wiki page: https://github.com/Kaggle/kaggle-api/wiki/Model-Card
To create a model instance, a special model-instance-metadata.json file must be specified.
Here's a basic example for model-instance-metadata.json:
{
"ownerSlug": "INSERT_OWNER_SLUG_HERE",
"modelSlug": "INSERT_EXISTING_MODEL_SLUG_HERE",
"instanceSlug": "INSERT_INSTANCE_SLUG_HERE",
"framework": "INSERT_FRAMEWORK_HERE",
"overview": "",
"usage": "Usage Markdown, see below",
"fineTunable": False,
"trainingData": []
}
You can also use the API command kaggle models instances init -p /path/to/model-instance to have the API create this file for you for a new model instance.
You can find a template of the Usage markdown on this wiki page: https://github.com/Kaggle/kaggle-api/wiki/ModelInstance-Usage
To create a model instance version, a special model-instance-version-metadata.json file must be specified.
Here's a basic example for model-instance-version-metadata.json:
{
"ownerSlug": "INSERT_OWNER_SLUG_HERE",
"modelSlug": "INSERT_EXISTING_MODEL_SLUG_HERE",
"instanceSlug": "INSERT_EXISTING_INSTANCE_SLUG_HERE",
"framework": "INSERT_EXISTING_FRAMEWORK_SLUG_HERE",
"versionNotes": "",
}
You can also use the API command kaggle models instances versions init -p /path/to/model-instance -version to have the API create this file for you for a new model instance version.