Packages

class BertForAssertionClassification extends AnnotatorModel[BertForAssertionClassification] with HasBatchedAnnotate[BertForAssertionClassification] with WhiteAndBlackListParams with HasEngine with WriteTensorflowModel with WriteOnnxModel with HasFeatures with CheckLicense

BertForAssertionClassification 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 = BertForAssertionClassification.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 = BertForAssertionClassification.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

BertForAssertionClassification

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, HasBatchedAnnotate[BertForAssertionClassification], AnnotatorModel[BertForAssertionClassification], CanBeLazy, RawAnnotator[BertForAssertionClassification], HasOutputAnnotationCol, HasInputAnnotationCols, HasOutputAnnotatorType, ParamsAndFeaturesWritable, HasFeatures, DefaultParamsWritable, MLWritable, Model[BertForAssertionClassification], Transformer, PipelineStage, Logging, Params, Serializable, Serializable, Identifiable, AnyRef, Any
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. BertForAssertionClassification
  2. CheckLicense
  3. WriteOnnxModel
  4. WriteTensorflowModel
  5. HasEngine
  6. WhiteAndBlackListParams
  7. HasBatchedAnnotate
  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 BertForAssertionClassification()

    Annotator reference id

  2. new BertForAssertionClassification(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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. def batchAnnotate(batchedAnnotations: Seq[Array[Annotation]]): Seq[Seq[Annotation]]

    Highly optimized batch annotation method that minimizes preprocessing overhead.

    Highly optimized batch annotation method that minimizes preprocessing overhead. This version focuses on reducing data transformations and memory allocations.

    batchedAnnotations

    A sequence of arrays of annotations, where each inner array represents annotations for a single original document.

    returns

    A sequence of sequences of annotations, where each inner sequence corresponds to the asserted annotations for an original document.

    Definition Classes
    BertForAssertionClassification → HasBatchedAnnotate
  13. def batchProcess(rows: Iterator[_]): Iterator[Row]
    Definition Classes
    HasBatchedAnnotate
  14. val batchSize: IntParam
    Definition Classes
    HasBatchedAnnotate
  15. def beforeAnnotate(dataset: Dataset[_]): Dataset[_]
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  16. 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
  17. 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
  18. final def checkSchema(schema: StructType, inputAnnotatorType: String): Boolean
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  19. def checkValidEnvironment(spark: Option[SparkSession], scopes: Seq[String]): Unit
    Definition Classes
    CheckLicense
  20. def checkValidScope(scope: String): Unit
    Definition Classes
    CheckLicense
  21. def checkValidScopeAndEnvironment(scope: String, spark: Option[SparkSession], checkLp: Boolean): Unit
    Definition Classes
    CheckLicense
  22. def checkValidScopesAndEnvironment(scopes: Seq[String], spark: Option[SparkSession], checkLp: Boolean): Unit
    Definition Classes
    CheckLicense
  23. val classificationCaseSensitive: BooleanParam

    Whether to use case sensitive on classification process.

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

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

    ConfigProto from tensorflow, serialized into byte array.

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

  27. def copy(extra: ParamMap): BertForAssertionClassification
    Definition Classes
    RawAnnotator → Model → Transformer → PipelineStage → Params
  28. def copyValues[T <: Params](to: T, extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  29. final def defaultCopy[T <: Params](extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  30. val engine: Param[String]
    Definition Classes
    HasEngine
  31. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  32. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  33. 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
  34. def explainParam(param: Param[_]): String
    Definition Classes
    Params
  35. def explainParams(): String
    Definition Classes
    Params
  36. def extraValidate(structType: StructType): Boolean
    Attributes
    protected
    Definition Classes
    RawAnnotator
  37. def extraValidateMsg: String
    Attributes
    protected
    Definition Classes
    RawAnnotator
  38. final def extractParamMap(): ParamMap
    Definition Classes
    Params
  39. final def extractParamMap(extra: ParamMap): ParamMap
    Definition Classes
    Params
  40. val features: ArrayBuffer[Feature[_, _, _]]
    Definition Classes
    HasFeatures
  41. 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
  42. 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
  43. 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
  44. 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
  45. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  46. def get[T](feature: StructFeature[T]): Option[T]
    Attributes
    protected
    Definition Classes
    HasFeatures
  47. def get[K, V](feature: MapFeature[K, V]): Option[Map[K, V]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  48. def get[T](feature: SetFeature[T]): Option[Set[T]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  49. def get[T](feature: ArrayFeature[T]): Option[Array[T]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  50. final def get[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  51. def getBatchSize: Int
    Definition Classes
    HasBatchedAnnotate
  52. def getBlackList: Array[String]

    Gets blackList param

    Gets blackList param

    Definition Classes
    WhiteAndBlackListParams
  53. def getCaseSensitive: Boolean

    Gets caseSensitive param

    Gets caseSensitive param

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

    Returns labels used to train this model

  56. def getClassificationCaseSensitive: Boolean

    Get classificationCaseSensitive param.

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

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

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

  67. def getWhiteList: Array[String]

    Gets whiteList param

    Gets whiteList param

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

    Input Annotator Types: DOCUMENT, CHUNK

    Input Annotator Types: DOCUMENT, CHUNK

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

    Labels used to decode predicted IDs back to string tags

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

    Output Annotator Types: ASSERTION

    Output Annotator Types: ASSERTION

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

  108. def sentenceStartTokenId: Int

  109. def set[T](feature: StructFeature[T], value: T): BertForAssertionClassification.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  110. def set[K, V](feature: MapFeature[K, V], value: Map[K, V]): BertForAssertionClassification.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  111. def set[T](feature: SetFeature[T], value: Set[T]): BertForAssertionClassification.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  112. def set[T](feature: ArrayFeature[T], value: Array[T]): BertForAssertionClassification.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  113. final def set(paramPair: ParamPair[_]): BertForAssertionClassification.this.type
    Attributes
    protected
    Definition Classes
    Params
  114. final def set(param: String, value: Any): BertForAssertionClassification.this.type
    Attributes
    protected
    Definition Classes
    Params
  115. final def set[T](param: Param[T], value: T): BertForAssertionClassification.this.type
    Definition Classes
    Params
  116. def setAllowList(list: String*): BertForAssertionClassification.this.type
    Definition Classes
    WhiteAndBlackListParams
  117. def setAllowList(list: Array[String]): BertForAssertionClassification.this.type
    Definition Classes
    WhiteAndBlackListParams
  118. def setBatchSize(size: Int): BertForAssertionClassification.this.type
    Definition Classes
    HasBatchedAnnotate
  119. def setBlackList(list: String*): BertForAssertionClassification.this.type
    Definition Classes
    WhiteAndBlackListParams
  120. def setBlackList(list: Array[String]): BertForAssertionClassification.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
  121. def setCaseSensitive(value: Boolean): BertForAssertionClassification.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
  122. def setClassificationCaseSensitive(value: Boolean): BertForAssertionClassification.this.type

    Set whether to use case sensitive on classification process.

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

  123. def setConfigProtoBytes(bytes: Array[Int]): BertForAssertionClassification.this.type

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

  135. def setLazyAnnotator(value: Boolean): BertForAssertionClassification.this.type
    Definition Classes
    CanBeLazy
  136. def setModelIfNotSet(spark: SparkSession, onnxWrapper: OnnxWrapper, sentenceSeparator: Option[String]): BertForAssertionClassification.this.type
  137. def setModelIfNotSet(spark: SparkSession, tensorflowWrapper: TensorflowWrapper, sentenceSeparator: Option[String] = None): BertForAssertionClassification.this.type

  138. def setModelIfNotSet(spark: SparkSession, model: MedicalBertClassification): BertForAssertionClassification.this.type
  139. final def setOutputCol(value: String): BertForAssertionClassification.this.type
    Definition Classes
    HasOutputAnnotationCol
  140. def setParent(parent: Estimator[BertForAssertionClassification]): BertForAssertionClassification
    Definition Classes
    Model
  141. def setSignatures(value: Map[String, String]): BertForAssertionClassification.this.type

  142. def setVocabulary(value: Map[String, Int]): BertForAssertionClassification.this.type

  143. def setWhiteList(list: String*): BertForAssertionClassification.this.type
    Definition Classes
    WhiteAndBlackListParams
  144. def setWhiteList(list: Array[String]): BertForAssertionClassification.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
  145. val signatures: MapFeature[String, String]
  146. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  147. def toString(): String
    Definition Classes
    Identifiable → AnyRef → Any
  148. final def transform(dataset: Dataset[_]): DataFrame
    Definition Classes
    AnnotatorModel → Transformer
  149. def transform(dataset: Dataset[_], paramMap: ParamMap): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" )
  150. def transform(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" ) @varargs()
  151. final def transformSchema(schema: StructType): StructType
    Definition Classes
    RawAnnotator → PipelineStage
  152. def transformSchema(schema: StructType, logging: Boolean): StructType
    Attributes
    protected
    Definition Classes
    PipelineStage
    Annotations
    @DeveloperApi()
  153. val uid: String
    Definition Classes
    BertForAssertionClassification → Identifiable
  154. def validate(schema: StructType): Boolean
    Attributes
    protected
    Definition Classes
    RawAnnotator
  155. val vocabulary: MapFeature[String, Int]

    Vocabulary used to encode the words to ids with WordPieceEncoder

  156. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  157. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  158. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  159. 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
  160. def wrapColumnMetadata(col: Column): Column
    Attributes
    protected
    Definition Classes
    RawAnnotator
  161. def write: MLWriter
    Definition Classes
    ParamsAndFeaturesWritable → DefaultParamsWritable → MLWritable
  162. def writeOnnxModel(path: String, spark: SparkSession, onnxWrapper: OnnxWrapper, suffix: String, fileName: String): Unit
    Definition Classes
    WriteOnnxModel
  163. def writeOnnxModels(path: String, spark: SparkSession, onnxWrappersWithNames: Seq[(OnnxWrapper, String)], suffix: String): Unit
    Definition Classes
    WriteOnnxModel
  164. def writeTensorflowHub(path: String, tfPath: String, spark: SparkSession, suffix: String): Unit
    Definition Classes
    WriteTensorflowModel
  165. def writeTensorflowModel(path: String, spark: SparkSession, tensorflow: TensorflowWrapper, suffix: String, filename: String, configProtoBytes: Option[Array[Byte]]): Unit
    Definition Classes
    WriteTensorflowModel
  166. 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 HasBatchedAnnotate[BertForAssertionClassification]

Inherited from AnnotatorModel[BertForAssertionClassification]

Inherited from CanBeLazy

Inherited from RawAnnotator[BertForAssertionClassification]

Inherited from HasOutputAnnotationCol

Inherited from HasInputAnnotationCols

Inherited from HasOutputAnnotatorType

Inherited from ParamsAndFeaturesWritable

Inherited from HasFeatures

Inherited from DefaultParamsWritable

Inherited from MLWritable

Inherited from Model[BertForAssertionClassification]

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