class_docstr: The model card stores the recommended attributes for model reporting.
  
  # Parameters
  
  id : `str`
      Model's id, following the convention of task-model-relevant-details.
      Example: rc-bidaf-elmo for a reading comprehension BiDAF model using ELMo embeddings.
  registered_model_name : `str`, optional
      The model's registered name. If `model_class` is not given, this will be used
      to find any available `Model` registered with this name.
  model_class : `type`, optional
      If given, the `ModelCard` will pull some default information from the class.
  registered_predictor_name : `str`, optional
      The registered name of the corresponding predictor.
  display_name : `str`, optional
      The pretrained model's display name.
  task_id : `str`, optional
      The id of the task for which the model was built.
  model_usage: `Union[ModelUsage, str]`, optional
  model_details : `Union[ModelDetails, str]`, optional
  intended_use : `Union[IntendedUse, str]`, optional
  factors : `Union[Factors, str]`, optional
  metrics : `Union[Metrics, str]`, optional
  evaluation_data : `Union[EvaluationData, str]`, optional
  quantitative_analyses : `Union[QuantitativeAnalyses, str]`, optional
  ethical_considerations : `Union[ModelEthicalConsiderations, str]`, optional
  caveats_and_recommendations : `Union[ModelCaveatsAndRecommendations, str]`, optional
  
  !!! Note
      For all the fields that are `Union[ModelCardInfo, str]`, a `str` input will be
      treated as the first argument of the relevant constructor.
class_docstr_tok: ["The","model","card","stores","the","recommended","attributes","for","model","reporting",".","#","Parameters","id",":","`","str","`","Model","'s","id",",","following","the","convention","of","task-model-relevant-details",".","Example",":","rc-bidaf-elmo","for","a","reading","comprehension","BiDAF","model","using","ELMo","embeddings",".","registered_model_name",":","`","str","`",",","optional","The","model","'s","registered","name",".","If","`","model_class","`","is","not","given",",","this","will","be","used","to","find","any","available","`","Model","`","registered","with","this","name",".","model_class",":","`","type","`",",","optional","If","given",",","the","`","ModelCard","`","will","pull","some","default","information","from","the","class",".","registered_predictor_name",":","`","str","`",",","optional","The","registered","name","of","the","corresponding","predictor",".","display_name",":","`","str","`",",","optional","The","pretrained","model","'s","display","name",".","task_id",":","`","str","`",",","optional","The","id","of","the","task","for","which","the","model","was","built",".","model_usage",":","`","Union","[","ModelUsage",",","str","]","`",",","optional","model_details",":","`","Union","[","ModelDetails",",","str","]","`",",","optional","intended_use",":","`","Union","[","IntendedUse",",","str","]","`",",","optional","factors",":","`","Union","[","Factors",",","str","]","`",",","optional","metrics",":","`","Union","[","Metrics",",","str","]","`",",","optional","evaluation_data",":","`","Union","[","EvaluationData",",","str","]","`",",","optional","quantitative_analyses",":","`","Union","[","QuantitativeAnalyses",",","str","]","`",",","optional","ethical_considerations",":","`","Union","[","ModelEthicalConsiderations",",","str","]","`",",","optional","caveats_and_recommendations",":","`","Union","[","ModelCaveatsAndRecommendations",",","str","]","`",",","optional","!","!","!","Note","For","all","the","fields","that","are","`","Union","[","ModelCardInfo",",","str","]","`",",","a","`","str","`","input","will","be","treated","as","the","first","argument","of","the","relevant","constructor","."]
code: def __init__(
      self,
      id: str,
      registered_model_name: Optional[str] = None,
      model_class: Optional[Callable[..., Model]] = None,
      registered_predictor_name: Optional[str] = None,
      display_name: Optional[str] = None,
      task_id: Optional[str] = None,
      model_usage: Optional[Union[str, ModelUsage]] = None,
      model_details: Optional[Union[str, ModelDetails]] = None,
      intended_use: Optional[Union[str, IntendedUse]] = None,
      factors: Optional[Union[str, Factors]] = None,
      metrics: Optional[Union[str, Metrics]] = None,
      evaluation_data: Optional[Union[str, EvaluationData]] = None,
      training_data: Optional[Union[str, TrainingData]] = None,
      quantitative_analyses: Optional[
          Union[str, QuantitativeAnalyses]
      ] = None,
      model_ethical_considerations: Optional[
          Union[str, ModelEthicalConsiderations]
      ] = None,
      model_caveats_and_recommendations: Optional[
          Union[str, ModelCaveatsAndRecommendations]
      ] = None,
  ):
      assert id
      if not model_class and registered_model_name:
          try:
              model_class = Model.by_name(registered_model_name)
          except ConfigurationError:
              logger.warning(
                  "{} is not a registered model.".format(
                      registered_model_name
                  )
              )
  
      if model_class:
          display_name = display_name or model_class.__name__
          model_details = model_details or get_description(model_class)
          if not registered_predictor_name:
              registered_predictor_name = model_class.default_predictor  # type: ignore
  
      if isinstance(model_usage, str):
          model_usage = ModelUsage(archive_file=model_usage)
      if isinstance(model_details, str):
          model_details = ModelDetails(description=model_details)
      if isinstance(intended_use, str):
          intended_use = IntendedUse(primary_uses=intended_use)
      if isinstance(factors, str):
          factors = Factors(relevant_factors=factors)
      if isinstance(metrics, str):
          metrics = Metrics(model_performance_measures=metrics)
      if isinstance(evaluation_data, str):
          evaluation_data = EvaluationData(dataset=evaluation_data)
      if isinstance(training_data, str):
          training_data = TrainingData(dataset=training_data)
      if isinstance(quantitative_analyses, str):
          quantitative_analyses = QuantitativeAnalyses(
              unitary_results=quantitative_analyses
          )
      if isinstance(model_ethical_considerations, str):
          model_ethical_considerations = ModelEthicalConsiderations(
              model_ethical_considerations
          )
      if isinstance(model_caveats_and_recommendations, str):
          model_caveats_and_recommendations = (
              ModelCaveatsAndRecommendations(
                  model_caveats_and_recommendations
              )
          )
  
      self.id = id
      self.registered_model_name = registered_model_name
      self.registered_predictor_name = registered_predictor_name
      self.display_name = display_name
      self.task_id = task_id
      self.model_usage = model_usage
      self.model_details = model_details
      self.intended_use = intended_use
      self.factors = factors
      self.metrics = metrics
      self.evaluation_data = evaluation_data
      self.training_data = training_data
      self.quantitative_analyses = quantitative_analyses
      self.model_ethical_considerations = model_ethical_considerations
      self.model_caveats_and_recommendations = (
          model_caveats_and_recommendations
      )
  
imports: import os
  import logging
  from dataclasses import dataclass
  from typing import Optional, Union, Dict, Any, Callable
  from allennlp.common.from_params import FromParams
  from allennlp.models import Model
  from allennlp.common.checks import ConfigurationError
label_desc: Use image node_id 1 to create a new ModelCard object from inherited base classes: ModelCardInfo with example: obj = ModelCard(id, registered_model_name, model_class, registered_predictor_name, display_name, task_id, model_usage, model_details, intended_use, factors, metrics, evaluation_data, training_data, quantitative_analyses, model_ethical_considerations, model_caveats_and_recommendations)