sparknlp_jsl.pipeline_tracer#

Module Contents#

Classes#

PipelineStage

Represents a stage of a pipeline.

PipelineTracer

PipelineTracer is a class that allows to trace the stages of a pipeline and get information about them.

StageField

Represents a field of a stage. A stage field contains information about the name, value and fieldType of the field.

class PipelineStage(stage, uid, name, index, inputCol, outputCol, inputAnnotatorType, outputAnnotatorType)#

Represents a stage of a pipeline. It contains information about the stage such as the uid, name, index, inputCol, outputCol, inputAnnotatorType and outputAnnotatorType.

index#
inputAnnotatorType#
inputCol#
name#
outputAnnotatorType#
outputCol#
stage#
uid#
class PipelineTracer(pipeline)#

PipelineTracer is a class that allows to trace the stages of a pipeline and get information about them. The PipelineTracer class provides functionality for tracing and retrieving information about the various stages of a pipeline. It can be used to obtain detailed insights into the entities, assertions, and relationships utilized within the pipeline. Compatibility with both PipelineModel and PretrainedPipeline. It can be used with a PipelineModel or a PretrainedPipeline. Additionally, it can be used to create a parser dictionary that can be used to create a PipelineOutputParser.

createParserDictionary()#

Returns a parser dictionary that can be used to create a PipelineOutputParser. Notes: —— This method tries to return a compatible PipelineOutputParser. You should make sure that the parser dictionary is compatible with the PipelineOutputParser that you are using.

static getParserDictDirectly(model: str, language: str = 'en', source: str = 'clinical/models')#

Returns a parser dictionary that can be used to create a PipelineOutputParser. This method is used to get the parser dictionary directly without creating a PipelineTracer object. This method throws an IllegalArgumentException if the model is not available. You can use the listAvailableModels method to get a list of available models.

Parameters:#

model: str

The name of the model.

language: str

The language of the model. Default is “en”.

source: str

The source of the model. Default is “clinical/models”.

Returns:#

dict

A dictionary that can be used to create a PipelineOutputParser.

Throws:#

IllegalArgumentException

If the model is not available.

getPipelineStages()#

Returns a list of PipelineStage objects that represent the stages of the pipeline.

getPossibleAssertions()#

Returns a list of possible assertions that the pipeline can include.

getPossibleEntities()#

Returns a list of possible entities that the pipeline can include.

getPossibleRelations()#

Returns a list of possible relations that the pipeline can include.

static listAvailableModels(language: str = 'en', source: str = 'clinical/models')#

Returns a list of available models for a given language and source.

Parameters:#

language: str

The language of the models. Default is “en”.

source: str

The source of the models. Default is “clinical/models”.

printPipelineSchema()#

Prints the schema of the pipeline.

static showAvailableModels(language: str = 'en', source: str = 'clinical/models')#

Prints a list of available models for a given language and source.

Parameters:#

language: str

The language of the models. Default is “en”.

source: str

The source of the models. Default is “clinical/models”.

class StageField(name, value, fieldType)#

Represents a field of a stage. A stage field contains information about the name, value and fieldType of the field.

fieldType#
name#
value#