跳转到主要内容

模型卡片工具包

项目描述

模型卡片工具包

模型卡片工具包(MCT)简化并自动化生成模型卡片 [1],这些卡片是提供模型开发性能背景和透明度的机器学习文档。将 MCT 集成到您的机器学习管道中,可以与研究人员、开发者、记者等共享模型元数据和指标。

模型卡的一些用例包括

  • 促进模型构建者与产品开发者之间的信息交换。
  • 告知用户机器学习模型,以便他们可以做出更明智的决策关于如何使用它们(或如何不使用它们)。
  • 提供有效的公众监督和问责制所需的模型信息。

Generated model card image

安装

模型卡片工具包托管在 PyPI 上,可以使用 pip install model-card-toolkit 安装(或对于从 20.3 版本开始的 pip,请使用 pip install model-card-toolkit --use-deprecated=legacy-resolver)。有关详细信息,请参阅安装指南

入门

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()

在 TFX 上生成模型卡片

如果您正在使用 TensorFlow Extended (TFX),则可以通过 ModelCardGenerator 组件将模型卡片生成集成到您的 TFX 管道中。

ModelCardGenerator 组件正在迁移到 TFX Addons 库,并且从 2.0.0 版本开始将不再包含在模型卡片工具包中。在您可以使用此组件之前,您需要安装 tfx-addons 包。

pip install tfx-addons[model_card_generator]

在迁移完成后,此页面将更新以包含 TFX 模型卡片指南和端到端演示的新链接。

模式

模型卡片以 proto 作为中间格式存储。您可以在 schema 目录中查看模型卡片 JSON 模式。

参考文献

[1] https://arxiv.org/abs/1810.03993

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装软件包的信息。

源分布

本发布中没有可用的源分布文件。请参阅生成分布存档的教程

构建分布

model_card_toolkit-2.0.0-py3-none-any.whl (68.8 kB 查看哈希值)

上传时间 Python 3

由以下支持