sparknlp_jsl._tf_graph_builders.graph_builders.NerTFGraphBuilder#

class sparknlp_jsl._tf_graph_builders.graph_builders.NerTFGraphBuilder(build_params)[source]#

Bases: TFGraphBuilder

Class to build the the TF graphs for MedicalNerApproach.

Examples

>>> from sparknlp_jsl.training import tf_graph
>>> from sparknlp_jsl.base import *
>>> from sparknlp.annotator import *
>>> from sparknlp_jsl.annotator import *
>>> from sparknlp_jsl.annotator import *
>>>feat_size = 200
>>>n_classes = 6
>>> tf_graph.build("ner_dl", build_params={"embeddings_dim": 200, "nchars": 83,"ntags": 12,"is_medical": 1},model_location="./medical_ner_graphs",model_filename="auto")
>>> nerTagger = MedicalNerApproach()    >>>                     .setInputCols(["sentence", "token", "embeddings"])    >>>                     .setLabelColumn("label")    >>>                     .setOutputCol("ner")    >>>                     .setMaxEpochs(2)    >>>                     .setBatchSize(64)    >>>                     .setRandomSeed(0)    >>>                     .setVerbose(1)    >>>                     .setValidationSplit(0.2)    >>>                     .setEvaluationLogExtended(True)     >>>                     .setEnableOutputLogs(True)    >>>                     .setIncludeConfidence(True)    >>>                     .setOutputLogsPath('ner_logs')    >>>                     .setGraphFolder('medical_ner_graphs')    >>>                     .setEnableMemoryOptimizer(True)

Methods

__init__(build_params)

build(model_location, model_filename)

check_build_params()

get_build_param(build_param)

get_build_params()

get_build_params_with_defaults()

get_model_build_param_explanations()

get_model_build_params()

get_model_filename()

supports_auto_file_name()