Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P16815
model_card_toolkit test
Active
Public
Actions
Authored by
•
ACraze
on Jul 12 2021, 6:30 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
Lift-Wing
ML-Governance
Referenced Files
F34548846: model_card_toolkit test
Jul 12 2021, 6:30 PM
2021-07-12 18:30:17 (UTC+0)
Subscribers
None
import
model_card_toolkit
# Initialize the Model Card Toolkit with a path to store generate assets
model_card_output_path
=
'assets'
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
=
'enwiki-goodfaith'
model_card
.
model_details
.
overview
=
(
'A revscoring model designed to predict if a revision was made in goodfaith or not.'
)
model_card
.
model_details
.
owners
=
[
{
'name'
:
'WMF Machine Learning Team'
,
'contact'
:
'machinelearning@wikimedia.org'
}
]
model_card
.
model_details
.
version
=
{
'name'
:
'v1.0'
,
'date'
:
'08/28/2020'
}
model_card
.
model_details
.
references
=
[
'https://www.mediawiki.org/wiki/ORES#Edit_quality'
,
'https://arxiv.org/abs/1909.05189'
,
]
model_card
.
model_details
.
license
=
'MIT'
model_card
.
model_details
.
citation
=
'https://gerrit.wikimedia.org/r/plugins/gitiles/machinelearning/liftwing/inference-services/+/refs/heads/main/revscoring/editquality/enwiki-goodfaith/service.yaml'
model_card
.
model_parameters
.
data
=
{
'name'
:
'enwiki.labeled_revisions.w_cache.20k_2015'
,
'link'
:
'https://labels.wmflabs.org/campaigns/enwiki/4/'
}
model_card
.
considerations
.
use_cases
=
[
'This model is useful in determining whether a revision was made in goodfaith or not.'
]
model_card
.
considerations
.
limitations
=
[
'This model is not able to classify any other types of other edits/revisions.'
]
# Write the model card data to a JSON file
mct
.
update_model_card_json
(
model_card
)
# Return the model card document as an HTML page
html
=
mct
.
export_format
()
Event Timeline
•
ACraze
created this paste.
Jul 12 2021, 6:30 PM
2021-07-12 18:30:17 (UTC+0)
•
ACraze
mentioned this in
T276398: Experiment with on-wiki model documentation
.
Jul 12 2021, 6:50 PM
2021-07-12 18:50:50 (UTC+0)
Log In to Comment