Packages

class BertAssertionClassifier extends AnnotatorModel[BertAssertionClassifier] with HasSimpleAnnotate[BertAssertionClassifier] with WhiteAndBlackListParams with HasEngine with WriteTensorflowModel with WriteOnnxModel with HasFeatures with CheckLicense

BertAssertionClassifier extracts the assertion status from text by analyzing both the extracted entities and their surrounding context.

This classifier leverages pre-trained BERT models fine-tuned on biomedical text (e.g., BioBERT) and applies a sequence classification/regression head (a linear layer on the pooled output) to support multi-class document classification.

Key features:

  • Accepts DOCUMENT and CHUNK type inputs and produces ASSERTION type annotations.
  • Emphasizes entity context by marking target entities with special tokens (e.g., [entity]), allowing the model to better focus on them.
  • Utilizes a transformer-based architecture (BERT for Sequence Classification) to achieve accurate assertion status prediction.

Input Example:

This annotator preprocesses the input text to emphasize the target entities as follows:
   [CLS] Patient with [entity] severe fever [entity].

Pretrained models can be loaded with pretrained of the companion object:

val assertion = BertAssertionClassifier.pretrained()
  .setInputCols("sentence", "chunk")
  .setOutputCol("assertion")

Models from the HuggingFace 🤗 Transformers library are also compatible with Spark NLP 🚀. The Spark NLP Workshop example shows how to import them https://github.com/JohnSnowLabs/spark-nlp/discussions/5669.

Example

val documentAssembler = new DocumentAssembler()
  .setInputCol("text")
  .setOutputCol("document")

val sentenceDetector = new SentenceDetector()
  .setInputCols("document")
  .setOutputCol("sentence")

val tokenizer = new Tokenizer()
  .setInputCols("sentence")
  .setOutputCol("token")

val wordEmbeddings = WordEmbeddingsModel.pretrained("embeddings_clinical", "en", "clinical/models")
  .setInputCols(Array("sentence", "token"))
  .setOutputCol("embeddings")

val clinicalNer = MedicalNerModel.pretrained("ner_clinical", "en", "clinical/models")
  .setInputCols(Array("sentence", "token", "embeddings"))
  .setOutputCol("ner")

val nerConverter = new NerConverterInternal()
  .setInputCols(Array("sentence", "token", "ner"))
  .setOutputCol("ner_chunk")

val assertion = BertAssertionClassifier.pretrained()
  .setInputCols("sentence", "ner_chunk")
  .setOutputCol("assertion")

val pipeline = new Pipeline().setStages(Array(
  documentAssembler, sentenceDetector, tokenizer, wordEmbeddings, clinicalNer, nerConverter, assertion
))
val text ="""Patient with severe fever and sore throat. He shows no stomach pain and he maintained on an epidural
|and PCA for pain control. He also became short of breath with climbing a flight of stairs. After CT, lung tumor
|located at the right lower lobe. Father with Alzheimer.""".stripMargin

val data = Seq(text).toDF("text")
val result = pipeline.fit(data).transform(data)
result.selectExpr("explode(assertion) as assertion").show(false)

Results:

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|assertion                                                                                                                                                                  |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|{assertion, 13, 24, present, {assertion_source -> assertion, chunk -> 0, ner_chunk -> severe fever, confidence -> 0.9996883, ner_label -> PROBLEM, sentence -> 0}, []}     |
|{assertion, 30, 40, present, {assertion_source -> assertion, chunk -> 1, ner_chunk -> sore throat, confidence -> 0.999676, ner_label -> PROBLEM, sentence -> 0}, []}       |
|{assertion, 55, 66, absent, {assertion_source -> assertion, chunk -> 2, ner_chunk -> stomach pain, confidence -> 0.9989444, ner_label -> PROBLEM, sentence -> 1}, []}      |
|{assertion, 89, 99, present, {assertion_source -> assertion, chunk -> 3, ner_chunk -> an epidural, confidence -> 0.99903834, ner_label -> TREATMENT, sentence -> 1}, []}   |
|{assertion, 106, 108, present, {assertion_source -> assertion, chunk -> 4, ner_chunk -> PCA, confidence -> 0.99900436, ner_label -> TREATMENT, sentence -> 1}, []}         |
|{assertion, 114, 125, present, {assertion_source -> assertion, chunk -> 5, ner_chunk -> pain control, confidence -> 0.9993321, ner_label -> PROBLEM, sentence -> 1}, []}   |
|{assertion, 143, 157, present, {assertion_source -> assertion, chunk -> 6, ner_chunk -> short of breath, confidence -> 0.9997882, ner_label -> PROBLEM, sentence -> 2}, []}|
|{assertion, 199, 200, present, {assertion_source -> assertion, chunk -> 7, ner_chunk -> CT, confidence -> 0.9996158, ner_label -> TEST, sentence -> 3}, []}                |
|{assertion, 203, 212, present, {assertion_source -> assertion, chunk -> 8, ner_chunk -> lung tumor, confidence -> 0.9997308, ner_label -> PROBLEM, sentence -> 3}, []}     |
|{assertion, 260, 268, present, {assertion_source -> assertion, chunk -> 9, ner_chunk -> Alzheimer, confidence -> 0.98367596, ner_label -> PROBLEM, sentence -> 4}, []}     |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
See also

BertAssertionClassifier

com.johnsnowlabs.nlp.annotators.assertion.dl.AssertionDLModel

MedicalBertForSequenceClassification

Annotators Main Page for a list of transformer based classifiers and assertion annotators

Linear Supertypes
CheckLicense, WriteOnnxModel, WriteTensorflowModel, HasEngine, WhiteAndBlackListParams, HasSimpleAnnotate[BertAssertionClassifier], AnnotatorModel[BertAssertionClassifier], CanBeLazy, RawAnnotator[BertAssertionClassifier], HasOutputAnnotationCol, HasInputAnnotationCols, HasOutputAnnotatorType, ParamsAndFeaturesWritable, HasFeatures, DefaultParamsWritable, MLWritable, Model[BertAssertionClassifier], Transformer, PipelineStage, Logging, Params, Serializable, Serializable, Identifiable, AnyRef, Any
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. BertAssertionClassifier
  2. CheckLicense
  3. WriteOnnxModel
  4. WriteTensorflowModel
  5. HasEngine
  6. WhiteAndBlackListParams
  7. HasSimpleAnnotate
  8. AnnotatorModel
  9. CanBeLazy
  10. RawAnnotator
  11. HasOutputAnnotationCol
  12. HasInputAnnotationCols
  13. HasOutputAnnotatorType
  14. ParamsAndFeaturesWritable
  15. HasFeatures
  16. DefaultParamsWritable
  17. MLWritable
  18. Model
  19. Transformer
  20. PipelineStage
  21. Logging
  22. Params
  23. Serializable
  24. Serializable
  25. Identifiable
  26. AnyRef
  27. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BertAssertionClassifier()

    Annotator reference id

  2. new BertAssertionClassifier(uid: String)

    uid

    required uid for storing annotator to disk

Type Members

  1. type AnnotationContent = Seq[Row]
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  2. type AnnotatorType = String
    Definition Classes
    HasOutputAnnotatorType

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def $[T](param: Param[T]): T
    Attributes
    protected
    Definition Classes
    Params
  4. def $$[T](feature: StructFeature[T]): T
    Attributes
    protected
    Definition Classes
    HasFeatures
  5. def $$[K, V](feature: MapFeature[K, V]): Map[K, V]
    Attributes
    protected
    Definition Classes
    HasFeatures
  6. def $$[T](feature: SetFeature[T]): Set[T]
    Attributes
    protected
    Definition Classes
    HasFeatures
  7. def $$[T](feature: ArrayFeature[T]): Array[T]
    Attributes
    protected
    Definition Classes
    HasFeatures
  8. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def _transform(dataset: Dataset[_], recursivePipeline: Option[PipelineModel]): DataFrame
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  10. def afterAnnotate(dataset: DataFrame): DataFrame
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  11. def annotate(annotations: Seq[Annotation]): Seq[Annotation]
    Definition Classes
    BertAssertionClassifier → HasSimpleAnnotate
  12. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  13. def beforeAnnotate(dataset: Dataset[_]): Dataset[_]
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  14. val blackList: StringArrayParam

    If defined, list of entities to ignore.

    If defined, list of entities to ignore. The rest will be processed. Should not include IOB prefix on labels. Default: Array()

    Definition Classes
    WhiteAndBlackListParams
  15. val caseSensitive: BooleanParam

    Determines whether the definitions of the white listed and black listed entities are case sensitive or not.

    Determines whether the definitions of the white listed and black listed entities are case sensitive or not. Default: true

    Definition Classes
    WhiteAndBlackListParams
  16. final def checkSchema(schema: StructType, inputAnnotatorType: String): Boolean
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  17. def checkValidEnvironment(spark: Option[SparkSession], scopes: Seq[String]): Unit
    Definition Classes
    CheckLicense
  18. def checkValidScope(scope: String): Unit
    Definition Classes
    CheckLicense
  19. def checkValidScopeAndEnvironment(scope: String, spark: Option[SparkSession], checkLp: Boolean): Unit
    Definition Classes
    CheckLicense
  20. def checkValidScopesAndEnvironment(scopes: Seq[String], spark: Option[SparkSession], checkLp: Boolean): Unit
    Definition Classes
    CheckLicense
  21. val classificationCaseSensitive: BooleanParam

    Whether to use case sensitive on classification process.

    Whether to use case sensitive on classification process. Default: true.

  22. final def clear(param: Param[_]): BertAssertionClassifier.this.type
    Definition Classes
    Params
  23. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  24. val configProtoBytes: IntArrayParam

    ConfigProto from tensorflow, serialized into byte array.

    ConfigProto from tensorflow, serialized into byte array. Get with config_proto.SerializeToString()

  25. def copy(extra: ParamMap): BertAssertionClassifier
    Definition Classes
    RawAnnotator → Model → Transformer → PipelineStage → Params
  26. def copyValues[T <: Params](to: T, extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  27. final def defaultCopy[T <: Params](extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  28. def dfAnnotate: UserDefinedFunction
    Definition Classes
    HasSimpleAnnotate
  29. val engine: Param[String]
    Definition Classes
    HasEngine
  30. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  32. def evaluateFilter(filter: String): Boolean

    Filter annotations by blackList and whiteList, taking into account the caseSensitive param.

    Filter annotations by blackList and whiteList, taking into account the caseSensitive param.

    Attributes
    protected
    Definition Classes
    WhiteAndBlackListParams
  33. def explainParam(param: Param[_]): String
    Definition Classes
    Params
  34. def explainParams(): String
    Definition Classes
    Params
  35. def extraValidate(structType: StructType): Boolean
    Attributes
    protected
    Definition Classes
    RawAnnotator
  36. def extraValidateMsg: String
    Attributes
    protected
    Definition Classes
    RawAnnotator
  37. final def extractParamMap(): ParamMap
    Definition Classes
    Params
  38. final def extractParamMap(extra: ParamMap): ParamMap
    Definition Classes
    Params
  39. val features: ArrayBuffer[Feature[_, _, _]]
    Definition Classes
    HasFeatures
  40. def filterByEntityField(annotation: Annotation): Boolean

    Filter annotation by blackList and whiteList, taking into account the caseSensitive param.

    Filter annotation by blackList and whiteList, taking into account the caseSensitive param. It filters by annotation.metadata.getOrElse("entity", annotation.metadata.getOrElse("identifier", "")).toString

    returns

    Boolean

    Attributes
    protected
    Definition Classes
    WhiteAndBlackListParams
  41. def filterByEntityField(annotations: Seq[Annotation]): Seq[Annotation]

    Filter annotations by blackList and whiteList, taking into account the caseSensitive param.

    Filter annotations by blackList and whiteList, taking into account the caseSensitive param. It filters by annotation.metadata.getOrElse("entity", annotation.metadata.getOrElse("identifier", "")).toString

    Attributes
    protected
    Definition Classes
    WhiteAndBlackListParams
  42. def filterByWhiteAndBlackList(annotation: Annotation): Boolean

    Filter annotation by blackList and whiteList, taking into account the caseSensitive param.

    Filter annotation by blackList and whiteList, taking into account the caseSensitive param. It filters by annotation.result

    returns

    Boolean

    Attributes
    protected
    Definition Classes
    WhiteAndBlackListParams
  43. def filterByWhiteAndBlackList(annotations: Seq[Annotation]): Seq[Annotation]

    Filter annotations by blackList and whiteList, taking into account the caseSensitive param.

    Filter annotations by blackList and whiteList, taking into account the caseSensitive param. It filters by annotation.result

    Attributes
    protected
    Definition Classes
    WhiteAndBlackListParams
  44. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  45. def get[T](feature: StructFeature[T]): Option[T]
    Attributes
    protected
    Definition Classes
    HasFeatures
  46. def get[K, V](feature: MapFeature[K, V]): Option[Map[K, V]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  47. def get[T](feature: SetFeature[T]): Option[Set[T]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  48. def get[T](feature: ArrayFeature[T]): Option[Array[T]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  49. final def get[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  50. def getBlackList: Array[String]

    Gets blackList param

    Gets blackList param

    Definition Classes
    WhiteAndBlackListParams
  51. def getCaseSensitive: Boolean

    Gets caseSensitive param

    Gets caseSensitive param

    Definition Classes
    WhiteAndBlackListParams
  52. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  53. def getClasses: Array[String]

    Returns labels used to train this model

  54. def getClassificationCaseSensitive: Boolean

    Get classificationCaseSensitive param.

  55. def getConfigProtoBytes: Option[Array[Byte]]

  56. final def getDefault[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  57. def getEngine: String
    Definition Classes
    HasEngine
  58. def getInputCols: Array[String]
    Definition Classes
    HasInputAnnotationCols
  59. def getLazyAnnotator: Boolean
    Definition Classes
    CanBeLazy
  60. def getModelIfNotSet: MedicalBertClassification

  61. final def getOrDefault[T](param: Param[T]): T
    Definition Classes
    Params
  62. final def getOutputCol: String
    Definition Classes
    HasOutputAnnotationCol
  63. def getParam(paramName: String): Param[Any]
    Definition Classes
    Params
  64. def getSignatures: Option[Map[String, String]]

  65. def getWhiteList: Array[String]

    Gets whiteList param

    Gets whiteList param

    Definition Classes
    WhiteAndBlackListParams
  66. final def hasDefault[T](param: Param[T]): Boolean
    Definition Classes
    Params
  67. def hasParam(paramName: String): Boolean
    Definition Classes
    Params
  68. def hasParent: Boolean
    Definition Classes
    Model
  69. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  70. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  71. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  72. val inputAnnotatorTypes: Array[String]

    Input Annotator Types: DOCUMENT, CHUNK

    Input Annotator Types: DOCUMENT, CHUNK

    Definition Classes
    BertAssertionClassifier → HasInputAnnotationCols
  73. final val inputCols: StringArrayParam
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  74. final def isDefined(param: Param[_]): Boolean
    Definition Classes
    Params
  75. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  76. final def isSet(param: Param[_]): Boolean
    Definition Classes
    Params
  77. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  78. def isValueInList(value: String, list: Array[String]): Boolean
    Attributes
    protected
    Definition Classes
    WhiteAndBlackListParams
  79. def isWhiteListAndBlacklistEmpty: Boolean
    Attributes
    protected
    Definition Classes
    WhiteAndBlackListParams
  80. val labels: MapFeature[String, Int]

    Labels used to decode predicted IDs back to string tags

  81. val lazyAnnotator: BooleanParam
    Definition Classes
    CanBeLazy
  82. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  83. def logDebug(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  84. def logDebug(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  85. def logError(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  86. def logError(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  87. def logInfo(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  88. def logInfo(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  89. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  90. def logTrace(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  91. def logTrace(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  92. def logWarning(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  93. def logWarning(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  94. def msgHelper(schema: StructType): String
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  95. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  96. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  97. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  98. def onWrite(path: String, spark: SparkSession): Unit
    Definition Classes
    BertAssertionClassifier → ParamsAndFeaturesWritable
  99. val optionalInputAnnotatorTypes: Array[String]
    Definition Classes
    HasInputAnnotationCols
  100. val outputAnnotatorType: AnnotatorType

    Output Annotator Types: ASSERTION

    Output Annotator Types: ASSERTION

    Definition Classes
    BertAssertionClassifier → HasOutputAnnotatorType
  101. final val outputCol: Param[String]
    Attributes
    protected
    Definition Classes
    HasOutputAnnotationCol
  102. lazy val params: Array[Param[_]]
    Definition Classes
    Params
  103. var parent: Estimator[BertAssertionClassifier]
    Definition Classes
    Model
  104. def save(path: String): Unit
    Definition Classes
    MLWritable
    Annotations
    @Since( "1.6.0" ) @throws( ... )
  105. def sentenceEndTokenId: Int

  106. def sentenceStartTokenId: Int

  107. def set[T](feature: StructFeature[T], value: T): BertAssertionClassifier.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  108. def set[K, V](feature: MapFeature[K, V], value: Map[K, V]): BertAssertionClassifier.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  109. def set[T](feature: SetFeature[T], value: Set[T]): BertAssertionClassifier.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  110. def set[T](feature: ArrayFeature[T], value: Array[T]): BertAssertionClassifier.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  111. final def set(paramPair: ParamPair[_]): BertAssertionClassifier.this.type
    Attributes
    protected
    Definition Classes
    Params
  112. final def set(param: String, value: Any): BertAssertionClassifier.this.type
    Attributes
    protected
    Definition Classes
    Params
  113. final def set[T](param: Param[T], value: T): BertAssertionClassifier.this.type
    Definition Classes
    Params
  114. def setAllowList(list: String*): BertAssertionClassifier.this.type
    Definition Classes
    WhiteAndBlackListParams
  115. def setAllowList(list: Array[String]): BertAssertionClassifier.this.type
    Definition Classes
    WhiteAndBlackListParams
  116. def setBlackList(list: String*): BertAssertionClassifier.this.type
    Definition Classes
    WhiteAndBlackListParams
  117. def setBlackList(list: Array[String]): BertAssertionClassifier.this.type

    If defined, list of entities to ignore.

    If defined, list of entities to ignore. The rest will be processed. Should not include IOB prefix on labels. Default: Array()

    Definition Classes
    WhiteAndBlackListParams
  118. def setCaseSensitive(value: Boolean): BertAssertionClassifier.this.type

    Determines whether the definitions of the white listed and black listed entities are case sensitive or not.

    Determines whether the definitions of the white listed and black listed entities are case sensitive or not. Default: true

    Definition Classes
    WhiteAndBlackListParams
  119. def setClassificationCaseSensitive(value: Boolean): BertAssertionClassifier.this.type

    Set whether to use case sensitive on classification process.

    Set whether to use case sensitive on classification process. Default: true.

  120. def setConfigProtoBytes(bytes: Array[Int]): BertAssertionClassifier.this.type

  121. def setDefault[T](feature: StructFeature[T], value: () ⇒ T): BertAssertionClassifier.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  122. def setDefault[K, V](feature: MapFeature[K, V], value: () ⇒ Map[K, V]): BertAssertionClassifier.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  123. def setDefault[T](feature: SetFeature[T], value: () ⇒ Set[T]): BertAssertionClassifier.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  124. def setDefault[T](feature: ArrayFeature[T], value: () ⇒ Array[T]): BertAssertionClassifier.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  125. final def setDefault(paramPairs: ParamPair[_]*): BertAssertionClassifier.this.type
    Attributes
    protected
    Definition Classes
    Params
  126. final def setDefault[T](param: Param[T], value: T): BertAssertionClassifier.this.type
    Attributes
    protected[org.apache.spark.ml]
    Definition Classes
    Params
  127. def setDenyList(list: String*): BertAssertionClassifier.this.type
    Definition Classes
    WhiteAndBlackListParams
  128. def setDenyList(list: Array[String]): BertAssertionClassifier.this.type
    Definition Classes
    WhiteAndBlackListParams
  129. final def setInputCols(value: String*): BertAssertionClassifier.this.type
    Definition Classes
    HasInputAnnotationCols
  130. def setInputCols(value: Array[String]): BertAssertionClassifier.this.type
    Definition Classes
    HasInputAnnotationCols
  131. def setLabels(value: Map[String, Int]): BertAssertionClassifier.this.type

  132. def setLazyAnnotator(value: Boolean): BertAssertionClassifier.this.type
    Definition Classes
    CanBeLazy
  133. def setModelIfNotSet(spark: SparkSession, onnxWrapper: OnnxWrapper, sentenceSeparator: Option[String]): BertAssertionClassifier.this.type
  134. def setModelIfNotSet(spark: SparkSession, tensorflowWrapper: TensorflowWrapper, sentenceSeparator: Option[String] = None): BertAssertionClassifier.this.type

  135. def setModelIfNotSet(spark: SparkSession, model: MedicalBertClassification): BertAssertionClassifier.this.type
  136. final def setOutputCol(value: String): BertAssertionClassifier.this.type
    Definition Classes
    HasOutputAnnotationCol
  137. def setParent(parent: Estimator[BertAssertionClassifier]): BertAssertionClassifier
    Definition Classes
    Model
  138. def setSignatures(value: Map[String, String]): BertAssertionClassifier.this.type

  139. def setVocabulary(value: Map[String, Int]): BertAssertionClassifier.this.type

  140. def setWhiteList(list: String*): BertAssertionClassifier.this.type
    Definition Classes
    WhiteAndBlackListParams
  141. def setWhiteList(list: Array[String]): BertAssertionClassifier.this.type

    Sets the list of entities to process.

    Sets the list of entities to process. The rest will be ignored. Should not include IOB prefix on labels. Default: Array()

    Definition Classes
    WhiteAndBlackListParams
  142. val signatures: MapFeature[String, String]
  143. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  144. def toString(): String
    Definition Classes
    Identifiable → AnyRef → Any
  145. final def transform(dataset: Dataset[_]): DataFrame
    Definition Classes
    AnnotatorModel → Transformer
  146. def transform(dataset: Dataset[_], paramMap: ParamMap): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" )
  147. def transform(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" ) @varargs()
  148. final def transformSchema(schema: StructType): StructType
    Definition Classes
    RawAnnotator → PipelineStage
  149. def transformSchema(schema: StructType, logging: Boolean): StructType
    Attributes
    protected
    Definition Classes
    PipelineStage
    Annotations
    @DeveloperApi()
  150. val uid: String
    Definition Classes
    BertAssertionClassifier → Identifiable
  151. def validate(schema: StructType): Boolean
    Attributes
    protected
    Definition Classes
    RawAnnotator
  152. val vocabulary: MapFeature[String, Int]

    Vocabulary used to encode the words to ids with WordPieceEncoder

  153. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  154. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  155. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  156. val whiteList: StringArrayParam

    If defined, list of entities to process.

    If defined, list of entities to process. The rest will be ignored. Should not include IOB prefix on labels. Default: Array()

    Definition Classes
    WhiteAndBlackListParams
  157. def wrapColumnMetadata(col: Column): Column
    Attributes
    protected
    Definition Classes
    RawAnnotator
  158. def write: MLWriter
    Definition Classes
    ParamsAndFeaturesWritable → DefaultParamsWritable → MLWritable
  159. def writeOnnxModel(path: String, spark: SparkSession, onnxWrapper: OnnxWrapper, suffix: String, fileName: String): Unit
    Definition Classes
    WriteOnnxModel
  160. def writeOnnxModels(path: String, spark: SparkSession, onnxWrappersWithNames: Seq[(OnnxWrapper, String)], suffix: String): Unit
    Definition Classes
    WriteOnnxModel
  161. def writeTensorflowHub(path: String, tfPath: String, spark: SparkSession, suffix: String): Unit
    Definition Classes
    WriteTensorflowModel
  162. def writeTensorflowModel(path: String, spark: SparkSession, tensorflow: TensorflowWrapper, suffix: String, filename: String, configProtoBytes: Option[Array[Byte]]): Unit
    Definition Classes
    WriteTensorflowModel
  163. def writeTensorflowModelV2(path: String, spark: SparkSession, tensorflow: TensorflowWrapper, suffix: String, filename: String, configProtoBytes: Option[Array[Byte]], savedSignatures: Option[Map[String, String]]): Unit
    Definition Classes
    WriteTensorflowModel

Inherited from CheckLicense

Inherited from WriteOnnxModel

Inherited from WriteTensorflowModel

Inherited from HasEngine

Inherited from WhiteAndBlackListParams

Inherited from HasSimpleAnnotate[BertAssertionClassifier]

Inherited from AnnotatorModel[BertAssertionClassifier]

Inherited from CanBeLazy

Inherited from RawAnnotator[BertAssertionClassifier]

Inherited from HasOutputAnnotationCol

Inherited from HasInputAnnotationCols

Inherited from HasOutputAnnotatorType

Inherited from ParamsAndFeaturesWritable

Inherited from HasFeatures

Inherited from DefaultParamsWritable

Inherited from MLWritable

Inherited from Model[BertAssertionClassifier]

Inherited from Transformer

Inherited from PipelineStage

Inherited from Logging

Inherited from Params

Inherited from Serializable

Inherited from Serializable

Inherited from Identifiable

Inherited from AnyRef

Inherited from Any

Parameters

A list of (hyper-)parameter keys this annotator can take. Users can set and get the parameter values through setters and getters, respectively.

Annotator types

Required input and expected output annotator types

Members

Parameter setters

Parameter getters