Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 2d03ab0

Browse files
authored
fix docstrings to render correctly in docs (#150)
1 parent cdd505e commit 2d03ab0

1 file changed

Lines changed: 49 additions & 49 deletions

File tree

allennlp_models/common/model_card.py

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ class ModelDetails(ModelCardInfo):
5959
"""
6060
This provides the basic information about the model.
6161
62-
# Parameters:
62+
# Parameters
6363
64-
description: `str`
64+
description : `str`
6565
A high-level overview of the model.
6666
Eg. The model implements a reading comprehension model patterned
6767
after the proposed model in [Devlin et al, 2018]
@@ -70,50 +70,50 @@ class ModelDetails(ModelCardInfo):
7070
It predicts start tokens and end tokens with a linear layer on top of
7171
word piece embeddings.
7272
73-
developed_by: `str`
73+
developed_by : `str`
7474
Person/organization that developed the model. This can be used by all
7575
stakeholders to infer details pertaining to model development and
7676
potential conflicts of interest.
7777
78-
contributed_by: `str`
78+
contributed_by : `str`
7979
Person that contributed the model to the repository.
8080
81-
date: `str`
81+
date : `str`
8282
The date on which the model was contributed. This is useful for all
8383
stakeholders to become further informed on what techniques and
8484
data sources were likely to be available during model development.
8585
Format example: 2020-09-23
8686
87-
version: `str`
87+
version : `str`
8888
The version of the model, and how it differs from previous versions.
8989
This is useful for all stakeholders to track whether the model is the
9090
latest version, associate known bugs to the correct model versions,
9191
and aid in model comparisons.
9292
93-
model_type: `str`
93+
model_type : `str`
9494
The type of the model; the basic architecture. This is likely to be
9595
particularly relevant for software and model developers, as well as
9696
individuals knowledgeable about machine learning, to highlight what
9797
kinds of assumptions are encoded in the system.
9898
Eg. Naive Bayes Classifier.
9999
100-
paper: `str`
100+
paper : `str`
101101
The paper on which the model is based.
102102
Format example:
103103
[Model Cards for Model Reporting (Mitchell et al, 2019)]
104104
(https://api.semanticscholar.org/CorpusID:52946140)
105105
106-
citation: `str`
106+
citation : `str`
107107
The BibTex for the paper.
108108
109-
license: `str`
109+
license : `str`
110110
License information for the model.
111111
112-
contact: `str`
112+
contact : `str`
113113
The email address to reach out to the relevant developers/contributors
114114
for questions/feedback about the model.
115115
116-
training_config: `str`
116+
training_config : `str`
117117
Link to training configuration.
118118
"""
119119

@@ -135,22 +135,22 @@ class IntendedUse(ModelCardInfo):
135135
"""
136136
This determines what the model should and should not be used for.
137137
138-
# Parameters:
138+
# Parameters
139139
140-
primary_uses: `str`
140+
primary_uses : `str`
141141
Details the primary intended uses of the model; whether it was developed
142142
for general or specific tasks.
143143
Eg. The toxic text identifier model was developed to identify
144144
toxic comments on online platforms. An example use case is
145145
to provide feedback to comment authors.
146146
147-
primary_users: `str`
147+
primary_users : `str`
148148
The primary intended users. For example, was the model developed
149149
for entertainment purposes, for hobbyists, or enterprise solutions?
150150
This helps users gain insight into how robust the model may be to
151151
different kinds of inputs.
152152
153-
out_of_scope_use_cases: `str`
153+
out_of_scope_use_cases : `str`
154154
Highlights the technology that the model might easily be confused with,
155155
or related contexts that users could try to apply the model to.
156156
Eg. the toxic text identifier model is not intended for fully automated
@@ -174,14 +174,14 @@ class Factors(ModelCardInfo):
174174
demographics, instrumentation used, etc. for which the
175175
model performance may vary.
176176
177-
# Parameters:
177+
# Parameters
178178
179-
relevant_factors: `str`
179+
relevant_factors : `str`
180180
The foreseeable salient factors for which model performance may vary,
181181
and how these were determined.
182182
Eg. the model performance may vary for variations in dialects of English.
183183
184-
evaluation_factors: `str`
184+
evaluation_factors : `str`
185185
Mentions the factors that are being reported, and the reasons for why
186186
they were chosen. Also includes the reasons for choosing different
187187
evaluation factors than relevant factors.
@@ -201,15 +201,15 @@ class Metrics(ModelCardInfo):
201201
This lists the reported metrics and the reasons
202202
for choosing them.
203203
204-
# Parameters:
204+
# Parameters
205205
206-
model_performance_measures: `str`
206+
model_performance_measures : `str`
207207
Which model performance measures were selected and the reasons for
208208
selecting them.
209-
decision_thresholds: `str`
209+
decision_thresholds : `str`
210210
If decision thresholds are used, what are they, and the reasons for
211211
choosing them.
212-
variation_approaches: `str`
212+
variation_approaches : `str`
213213
How are the measurements and estimations of these metrics calculated?
214214
Eg. standard deviation, variance, confidence intervals, KL divergence.
215215
Details of how these values are approximated should also be included.
@@ -226,16 +226,16 @@ class EvaluationData(ModelCardInfo):
226226
"""
227227
This provides information about the evaluation data.
228228
229-
# Parameters:
229+
# Parameters
230230
231-
dataset: `str`
231+
dataset : `str`
232232
The name(s) (and link(s), if available) of the dataset(s) used to evaluate
233233
the model. Optionally, provide a link to the relevant datasheet(s) as well.
234-
motivation: `str`
234+
motivation : `str`
235235
The reasons for selecting the dataset(s).
236236
Eg. For the BERT model, document-level corpora were used rather than a
237237
shuffled sentence-level corpus in order to extract long contiguous sequences.
238-
preprocessing: `str`
238+
preprocessing : `str`
239239
How was the data preprocessed for evaluation?
240240
Eg. tokenization of sentences, filtering of paragraphs by length, etc.
241241
"""
@@ -260,21 +260,21 @@ class TrainingData(ModelCardInfo):
260260
data can additionally be provided, if available. Any relevant definitions should
261261
also be included.
262262
263-
# Parameters:
263+
# Parameters
264264
265-
dataset: `str`
265+
dataset : `str`
266266
The name(s) (and link(s), if available) of the dataset(s) used to train
267267
the model. Optionally, provide a link to the relevant datasheet(s) as well.
268268
Eg. * Proprietary data from Perspective API; includes comments from online
269269
forums such as Wikipedia and New York Times, with crowdsourced labels of
270270
whether the comment is "toxic".
271271
* "Toxic" is defined as "a rude, disrespectful, or unreasonable comment
272272
that is likely to make you leave a discussion."
273-
motivation: `str`
273+
motivation : `str`
274274
The reasons for selecting the dataset(s).
275275
Eg. For the BERT model, document-level corpora were used rather than a
276276
shuffled sentence-level corpus in order to extract long contiguous sequences.
277-
preprocessing: `str`
277+
preprocessing : `str`
278278
Eg. Only the text passages were extracted from English Wikipedia; lists, tables,
279279
and headers were ignored.
280280
"""
@@ -299,12 +299,12 @@ class QuantitativeAnalyses(ModelCardInfo):
299299
intervals, if possible. Links to plots/figures showing
300300
the metrics can also be provided.
301301
302-
# Parameters:
302+
# Parameters
303303
304-
unitary_results: `str`
304+
unitary_results : `str`
305305
The performance of the model with respect to each chosen
306306
factor.
307-
intersectional_results: `str`
307+
intersectional_results : `str`
308308
The performance of the model with respect to the intersection
309309
of the evaluated factors.
310310
"""
@@ -349,30 +349,30 @@ class ModelCard(ModelCardInfo):
349349
350350
# Parameters
351351
352-
id: `str`
352+
id : `str`
353353
Model's id, following the convention of task-model-relevant-details.
354354
Example: rc-bidaf-elmo for a reading comprehension BiDAF model using ELMo embeddings.
355-
registered_model_name: `str`, optional
355+
registered_model_name : `str`, optional
356356
The model's registered name. If `model_class` is not given, this will be used
357357
to find any available `Model` registered with this name.
358-
model_class: `type`, optional
358+
model_class : `type`, optional
359359
If given, the `ModelCard` will pull some default information from the class.
360-
registered_predictor_name: `str`, optional
360+
registered_predictor_name : `str`, optional
361361
The registered name of the corresponding predictor.
362-
display_name: `str`, optional
362+
display_name : `str`, optional
363363
The pretrained model's display name.
364-
archive_file: `str`, optional
364+
archive_file : `str`, optional
365365
The location of model's pretrained weights.
366-
overrides: `Dict`, optional
366+
overrides : `Dict`, optional
367367
Optional overrides for the model's architecture.
368-
model_details: `Union[ModelDetails, str]`, optional
369-
intended_use: `Union[IntendedUse, str]`, optional
370-
factors: `Union[Factors, str]`, optional
371-
metrics: `Union[Metrics, str]`, optional
372-
evaluation_data: `Union[EvaluationData, str]`, optional
373-
quantitative_analyses: `Union[QuantitativeAnalyses, str]`, optional
374-
ethical_considerations: `Union[EthicalConsiderations, str]`, optional
375-
caveats_and_recommendations: `Union[CaveatsAndRecommendations, str]`, optional
368+
model_details : `Union[ModelDetails, str]`, optional
369+
intended_use : `Union[IntendedUse, str]`, optional
370+
factors : `Union[Factors, str]`, optional
371+
metrics : `Union[Metrics, str]`, optional
372+
evaluation_data : `Union[EvaluationData, str]`, optional
373+
quantitative_analyses : `Union[QuantitativeAnalyses, str]`, optional
374+
ethical_considerations : `Union[EthicalConsiderations, str]`, optional
375+
caveats_and_recommendations : `Union[CaveatsAndRecommendations, str]`, optional
376376
377377
!!! Note
378378
For all the fields that are `Union[ModelCardInfo, str]`, a `str` input will be

0 commit comments

Comments
 (0)