Model Card Toolkit
Project description
Model Card Toolkit
The Model Card Toolkit (MCT) streamlines and automates generation of Model Cards [1], machine learning documents that provide context and transparency into a model's development and performance. Integrating the MCT into your ML pipeline enables the sharing model metadata and metrics with researchers, developers, reporters, and more.
Some use cases of model cards include:
- Facilitating the exchange of information between model builders and product developers.
- Informing users of ML models to make better-informed decisions about how to use them (or how not to use them).
- Providing model information required for effective public oversight and accountability.
Installation
The Model Card Toolkit is hosted on PyPI, and can be installed with pip install model-card-toolkit
(or pip install model-card-toolkit --use-deprecated=legacy-resolver
for versions of pip starting with 20.3). See the installation guide for more details.
Getting Started
import model_card_toolkit
# Initialize the Model Card Toolkit with a path to store generate assets
model_card_output_path = ...
mct = model_card_toolkit.ModelCardToolkit(model_card_output_path)
# Initialize the model_card_toolkit.ModelCard, which can be freely populated
model_card = mct.scaffold_assets()
model_card.model_details.name = 'My Model'
# Write the model card data to a proto file
mct.update_model_card(model_card)
# Return the model card document as an HTML page
html = mct.export_format()
Model Card Generation on TFX
If you are using TensorFlow Extended (TFX), you can
incorporate model card generation into your TFX pipeline via the ModelCardGenerator
component.
The ModelCardGenerator
component is moving to the
TFX Addons library and will no longer
be packaged in Model Card Toolkit from version 2.0.0. Before you can use the
component, you will need to install the tfx-addons
package:
pip install tfx-addons[model_card_generator]
This page will be updated to include the new links for the Model Cards in TFX guide and the end-to-end demo when the migration is completed.
Schema
Model cards are stored in proto as an intermediate format. You can see the model card JSON schema in the schema
directory.
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file model_card_toolkit-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: model_card_toolkit-2.0.0-py3-none-any.whl
- Upload date:
- Size: 68.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b195c4678529c6f14096b60ee263c81ff7c81c27773f90e81e55d06923d95844 |
|
MD5 | 457907e5797ffad644a443200fce6651 |
|
BLAKE2b-256 | e686e4c3f63cd6dbba95e22d56f4f5e486f3dc78762b3b053f7ee0b50bafd0c5 |