sparknlp_jsl._tf_graph_builders.graph_builders.TFGraphBuilderFactory#

class sparknlp_jsl._tf_graph_builders.graph_builders.TFGraphBuilderFactory[source]#

Bases: object

Factory class to create the the different tensorflow graphs for ner_dl, generic_classifier, assertion_dl, relation_extraction annotators in spark-nlp healthcare

Methods

__init__(*args, **kwargs)

build(model_name, build_params, model_location)

Method that create the tf graph.

get_models()

Method that return the available tf models in spark-nlp healthcare Examples -------- >>> from sparknlp_jsl.training import tf_graph >>> tf_graph.get_models()

print_model_params(model_name)

Method that return the params allowed for the tf model.This method return the params with the description for every param.

static build(model_name, build_params, model_location, model_filename='auto')[source]#

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_jsl.training import tf_graph
>>> tf_graph.build("assertion_dl",build_params={"n_classes": 10}, model_location="/tmp", model_filename="assertion_dl.pb")
static get_models()[source]#

Method that return the available tf models in spark-nlp healthcare Examples ——– >>> from sparknlp_jsl.training import tf_graph >>> tf_graph.get_models()

static print_model_params(model_name)[source]#

Method that return the params allowed for the tf model.This method return the params with the description for every param.

Parameters:
model_name: str

The name of the tf model name.Model availables ner_dl,generic_classifier,assertion_dl and relation_extraction

Examples

>>> from sparknlp_jsl.training import tf_graph
>>> tf_graph.print_model_params("assertion_dl")