class_docstr: Factory class to create the different tensorflow graphs for ner_dl, generic_classifier, assertion_dl, relation_extraction annotators in spark-nlp healthcare
docstr: Method that create the tf graph.
  
  Parameters
  ----------
  model_name: str
      The name of the tf model that you want to build.Model availables ner_dl,generic_classifier,assertion_dl and relation_extraction
  build_params: dict
      Configuration params to build the tf graph for the specific model.
  model_location: str
      Path where the model will be saved
  model_filename: str
      Name of the .rb file. If you put auto the filename will be generated.
  
  Examples
  --------
  >>> from sparknlp.training.tfgraphs import tf_graph
  >>> tf_graph.build("ner_dl", build_params={"embeddings_dim": 200, "nchars": 83,"ntags": 12},model_location="./ner_graphs",model_filename="auto")
docstr_tok: ["Method","that","create","the","tf","graph",".","Parameters","--","--","--","--","--","model_name",":","str","The","name","of","the","tf","model","that","you","want","to","build.Model","availables","ner_dl",",","generic_classifier",",","assertion_dl","and","relation_extraction","build_params",":","dict","Configuration","params","to","build","the","tf","graph","for","the","specific","model",".","model_location",":","str","Path","where","the","model","will","be","saved","model_filename",":","str","Name","of","the",".rb","file",".","If","you","put","auto","the","filename","will","be","generated",".","Examples","--","--","--","--",">",">",">","from","sparknlp.training.tfgraphs","import","tf_graph",">",">",">","tf_graph.build","(","``","ner_dl","''",",","build_params=","{","``","embeddings_dim","''",":","200",",","``","nchars","''",":","83",",","''","ntags","''",":","12","}",",","model_location=","''",".\/ner_graphs","''",",","model_filename=","''","auto","''",")"]
code: def build(
      model_name, build_params, model_location, model_filename="auto"
  ):
      """
      Method that create the tf graph.
  
      Parameters
      ----------
      model_name: str
          The name of the tf model that you want to build.Model availables ner_dl,generic_classifier,assertion_dl and relation_extraction
      build_params: dict
          Configuration params to build the tf graph for the specific model.
      model_location: str
          Path where the model will be saved
      model_filename: str
          Name of the .rb file. If you put auto the filename will be generated.
  
      Examples
      --------
      >>> from sparknlp.training.tfgraphs import tf_graph
      >>> tf_graph.build("ner_dl", build_params={"embeddings_dim": 200, "nchars": 83,"ntags": 12},model_location="./ner_graphs",model_filename="auto")
  
      """
      try:
          import tensorflow as tf
  
          if tf.__version__[0] == "2":
              try:
                  import tensorflow_addons
  
              except ModuleNotFoundError:
                  raise TensorflowAddonsNeeded()
  
          if not (
              tf.__version__.startswith("1.15")
              or tf.__version__[0] == "2"
          ):
              raise WrongTFVersion()
  
      except WrongTFVersion:
          print(tf.version)
          raise Exception(
              "Tensorflow 2.xx or 1.15 is required to build model graphs."
          )
  
      except ModuleNotFoundError:
          raise Exception(
              "You need to install Tensorflow 2.xx or 1.15 to be able to build model graphs"
          )
  
      except TensorflowAddonsNeeded:
          raise Exception(
              "You need to install tensorflow_addons to be able to generate graphs in Tensorflow 2.x"
          )
  
      if model_name not in TFGraphBuilderFactory.__model_builders:
          raise Exception(
              f"Can't build a graph for {model_name}: model not supported."
          )
  
      model = TFGraphBuilderFactory.__model_builders[model_name](
          build_params
      )
      model.check_build_params()
  
      if model_filename == "auto":
          if not model.supports_auto_file_name():
              msg = f"""
                      {model_name} doesn't support automatic filename generation, please specify the filename of the
                      output graph
                  """.strip()
              raise Exception(msg)
          else:
              model_filename = model.get_model_filename()
  
          model.build(model_location, model_filename)
      else:
          if re.match(r"(\w+)://.*", model_location):
              tmp_location = "/tmp/relationModel"
              model.build(tmp_location, model_filename)
  
              file_location = os.path.join(tmp_location, model_filename)
              _ResourceHelper_moveFile(
                  file_location, model_location
              ).apply()
  
          else:
              model.build(model_location, model_filename)
  
          print(
              "{} graph exported to {}/{}".format(
                  model_name, model_location, model_filename
              )
          )
  
imports: import os
  import re
  from sparknlp.internal import _ResourceHelper_moveFile
  from sparknlp.training._tf_graph_builders.ner_dl.create_graph import create_graph
label_desc: Use image node_id 2 for calling the TFGraphBuilderFactory obj's underlying member method code with example usage: obj.build(model_name, build_params, model_location, model_filename) without return types