com.johnsnowlabs.nlp.annotators.assertion
BertAssertionClassifier
Companion object BertAssertionClassifier
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
com.johnsnowlabs.nlp.annotators.assertion.dl.AssertionDLModel
MedicalBertForSequenceClassification
Annotators Main Page for a list of transformer based classifiers and assertion annotators
- Grouped
- Alphabetic
- By Inheritance
- BertAssertionClassifier
- CheckLicense
- WriteOnnxModel
- WriteTensorflowModel
- HasEngine
- WhiteAndBlackListParams
- HasSimpleAnnotate
- AnnotatorModel
- CanBeLazy
- RawAnnotator
- HasOutputAnnotationCol
- HasInputAnnotationCols
- HasOutputAnnotatorType
- ParamsAndFeaturesWritable
- HasFeatures
- DefaultParamsWritable
- MLWritable
- Model
- Transformer
- PipelineStage
- Logging
- Params
- Serializable
- Serializable
- Identifiable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Type Members
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
$[T](param: Param[T]): T
- Attributes
- protected
- Definition Classes
- Params
-
def
$$[T](feature: StructFeature[T]): T
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
$$[K, V](feature: MapFeature[K, V]): Map[K, V]
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
$$[T](feature: SetFeature[T]): Set[T]
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
$$[T](feature: ArrayFeature[T]): Array[T]
- Attributes
- protected
- Definition Classes
- HasFeatures
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
_transform(dataset: Dataset[_], recursivePipeline: Option[PipelineModel]): DataFrame
- Attributes
- protected
- Definition Classes
- AnnotatorModel
-
def
afterAnnotate(dataset: DataFrame): DataFrame
- Attributes
- protected
- Definition Classes
- AnnotatorModel
-
def
annotate(annotations: Seq[Annotation]): Seq[Annotation]
- Definition Classes
- BertAssertionClassifier → HasSimpleAnnotate
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
beforeAnnotate(dataset: Dataset[_]): Dataset[_]
- Attributes
- protected
- Definition Classes
- AnnotatorModel
-
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
-
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
-
final
def
checkSchema(schema: StructType, inputAnnotatorType: String): Boolean
- Attributes
- protected
- Definition Classes
- HasInputAnnotationCols
-
def
checkValidEnvironment(spark: Option[SparkSession], scopes: Seq[String]): Unit
- Definition Classes
- CheckLicense
-
def
checkValidScope(scope: String): Unit
- Definition Classes
- CheckLicense
-
def
checkValidScopeAndEnvironment(scope: String, spark: Option[SparkSession], checkLp: Boolean): Unit
- Definition Classes
- CheckLicense
-
def
checkValidScopesAndEnvironment(scopes: Seq[String], spark: Option[SparkSession], checkLp: Boolean): Unit
- Definition Classes
- CheckLicense
-
val
classificationCaseSensitive: BooleanParam
Whether to use case sensitive on classification process.
Whether to use case sensitive on classification process. Default: true.
-
final
def
clear(param: Param[_]): BertAssertionClassifier.this.type
- Definition Classes
- Params
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
val
configProtoBytes: IntArrayParam
ConfigProto from tensorflow, serialized into byte array.
ConfigProto from tensorflow, serialized into byte array. Get with
config_proto.SerializeToString()
-
def
copy(extra: ParamMap): BertAssertionClassifier
- Definition Classes
- RawAnnotator → Model → Transformer → PipelineStage → Params
-
def
copyValues[T <: Params](to: T, extra: ParamMap): T
- Attributes
- protected
- Definition Classes
- Params
-
final
def
defaultCopy[T <: Params](extra: ParamMap): T
- Attributes
- protected
- Definition Classes
- Params
-
def
dfAnnotate: UserDefinedFunction
- Definition Classes
- HasSimpleAnnotate
-
val
engine: Param[String]
- Definition Classes
- HasEngine
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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
-
def
explainParam(param: Param[_]): String
- Definition Classes
- Params
-
def
explainParams(): String
- Definition Classes
- Params
-
def
extraValidate(structType: StructType): Boolean
- Attributes
- protected
- Definition Classes
- RawAnnotator
-
def
extraValidateMsg: String
- Attributes
- protected
- Definition Classes
- RawAnnotator
-
final
def
extractParamMap(): ParamMap
- Definition Classes
- Params
-
final
def
extractParamMap(extra: ParamMap): ParamMap
- Definition Classes
- Params
-
val
features: ArrayBuffer[Feature[_, _, _]]
- Definition Classes
- HasFeatures
-
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
-
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
-
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
-
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
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get[T](feature: StructFeature[T]): Option[T]
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
get[K, V](feature: MapFeature[K, V]): Option[Map[K, V]]
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
get[T](feature: SetFeature[T]): Option[Set[T]]
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
get[T](feature: ArrayFeature[T]): Option[Array[T]]
- Attributes
- protected
- Definition Classes
- HasFeatures
-
final
def
get[T](param: Param[T]): Option[T]
- Definition Classes
- Params
-
def
getBlackList: Array[String]
Gets blackList param
Gets blackList param
- Definition Classes
- WhiteAndBlackListParams
-
def
getCaseSensitive: Boolean
Gets caseSensitive param
Gets caseSensitive param
- Definition Classes
- WhiteAndBlackListParams
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getClasses: Array[String]
Returns labels used to train this model
-
def
getClassificationCaseSensitive: Boolean
Get classificationCaseSensitive param.
- def getConfigProtoBytes: Option[Array[Byte]]
-
final
def
getDefault[T](param: Param[T]): Option[T]
- Definition Classes
- Params
-
def
getEngine: String
- Definition Classes
- HasEngine
-
def
getInputCols: Array[String]
- Definition Classes
- HasInputAnnotationCols
-
def
getLazyAnnotator: Boolean
- Definition Classes
- CanBeLazy
- def getModelIfNotSet: MedicalBertClassification
-
final
def
getOrDefault[T](param: Param[T]): T
- Definition Classes
- Params
-
final
def
getOutputCol: String
- Definition Classes
- HasOutputAnnotationCol
-
def
getParam(paramName: String): Param[Any]
- Definition Classes
- Params
- def getSignatures: Option[Map[String, String]]
-
def
getWhiteList: Array[String]
Gets whiteList param
Gets whiteList param
- Definition Classes
- WhiteAndBlackListParams
-
final
def
hasDefault[T](param: Param[T]): Boolean
- Definition Classes
- Params
-
def
hasParam(paramName: String): Boolean
- Definition Classes
- Params
-
def
hasParent: Boolean
- Definition Classes
- Model
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
def
initializeLogIfNecessary(isInterpreter: Boolean): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
val
inputAnnotatorTypes: Array[String]
Input Annotator Types: DOCUMENT, CHUNK
Input Annotator Types: DOCUMENT, CHUNK
- Definition Classes
- BertAssertionClassifier → HasInputAnnotationCols
-
final
val
inputCols: StringArrayParam
- Attributes
- protected
- Definition Classes
- HasInputAnnotationCols
-
final
def
isDefined(param: Param[_]): Boolean
- Definition Classes
- Params
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
isSet(param: Param[_]): Boolean
- Definition Classes
- Params
-
def
isTraceEnabled(): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
def
isValueInList(value: String, list: Array[String]): Boolean
- Attributes
- protected
- Definition Classes
- WhiteAndBlackListParams
-
def
isWhiteListAndBlacklistEmpty: Boolean
- Attributes
- protected
- Definition Classes
- WhiteAndBlackListParams
-
val
labels: MapFeature[String, Int]
Labels used to decode predicted IDs back to string tags
-
val
lazyAnnotator: BooleanParam
- Definition Classes
- CanBeLazy
-
def
log: Logger
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logName: String
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
msgHelper(schema: StructType): String
- Attributes
- protected
- Definition Classes
- HasInputAnnotationCols
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
onWrite(path: String, spark: SparkSession): Unit
- Definition Classes
- BertAssertionClassifier → ParamsAndFeaturesWritable
-
val
optionalInputAnnotatorTypes: Array[String]
- Definition Classes
- HasInputAnnotationCols
-
val
outputAnnotatorType: AnnotatorType
Output Annotator Types: ASSERTION
Output Annotator Types: ASSERTION
- Definition Classes
- BertAssertionClassifier → HasOutputAnnotatorType
-
final
val
outputCol: Param[String]
- Attributes
- protected
- Definition Classes
- HasOutputAnnotationCol
-
lazy val
params: Array[Param[_]]
- Definition Classes
- Params
-
var
parent: Estimator[BertAssertionClassifier]
- Definition Classes
- Model
-
def
save(path: String): Unit
- Definition Classes
- MLWritable
- Annotations
- @Since( "1.6.0" ) @throws( ... )
- def sentenceEndTokenId: Int
- def sentenceStartTokenId: Int
-
def
set[T](feature: StructFeature[T], value: T): BertAssertionClassifier.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
set[K, V](feature: MapFeature[K, V], value: Map[K, V]): BertAssertionClassifier.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
set[T](feature: SetFeature[T], value: Set[T]): BertAssertionClassifier.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
set[T](feature: ArrayFeature[T], value: Array[T]): BertAssertionClassifier.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
final
def
set(paramPair: ParamPair[_]): BertAssertionClassifier.this.type
- Attributes
- protected
- Definition Classes
- Params
-
final
def
set(param: String, value: Any): BertAssertionClassifier.this.type
- Attributes
- protected
- Definition Classes
- Params
-
final
def
set[T](param: Param[T], value: T): BertAssertionClassifier.this.type
- Definition Classes
- Params
-
def
setAllowList(list: String*): BertAssertionClassifier.this.type
- Definition Classes
- WhiteAndBlackListParams
-
def
setAllowList(list: Array[String]): BertAssertionClassifier.this.type
- Definition Classes
- WhiteAndBlackListParams
-
def
setBlackList(list: String*): BertAssertionClassifier.this.type
- Definition Classes
- WhiteAndBlackListParams
-
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
-
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
-
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.
- def setConfigProtoBytes(bytes: Array[Int]): BertAssertionClassifier.this.type
-
def
setDefault[T](feature: StructFeature[T], value: () ⇒ T): BertAssertionClassifier.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
setDefault[K, V](feature: MapFeature[K, V], value: () ⇒ Map[K, V]): BertAssertionClassifier.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
setDefault[T](feature: SetFeature[T], value: () ⇒ Set[T]): BertAssertionClassifier.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
def
setDefault[T](feature: ArrayFeature[T], value: () ⇒ Array[T]): BertAssertionClassifier.this.type
- Attributes
- protected
- Definition Classes
- HasFeatures
-
final
def
setDefault(paramPairs: ParamPair[_]*): BertAssertionClassifier.this.type
- Attributes
- protected
- Definition Classes
- Params
-
final
def
setDefault[T](param: Param[T], value: T): BertAssertionClassifier.this.type
- Attributes
- protected[org.apache.spark.ml]
- Definition Classes
- Params
-
def
setDenyList(list: String*): BertAssertionClassifier.this.type
- Definition Classes
- WhiteAndBlackListParams
-
def
setDenyList(list: Array[String]): BertAssertionClassifier.this.type
- Definition Classes
- WhiteAndBlackListParams
-
final
def
setInputCols(value: String*): BertAssertionClassifier.this.type
- Definition Classes
- HasInputAnnotationCols
-
def
setInputCols(value: Array[String]): BertAssertionClassifier.this.type
- Definition Classes
- HasInputAnnotationCols
- def setLabels(value: Map[String, Int]): BertAssertionClassifier.this.type
-
def
setLazyAnnotator(value: Boolean): BertAssertionClassifier.this.type
- Definition Classes
- CanBeLazy
- def setModelIfNotSet(spark: SparkSession, onnxWrapper: OnnxWrapper, sentenceSeparator: Option[String]): BertAssertionClassifier.this.type
- def setModelIfNotSet(spark: SparkSession, tensorflowWrapper: TensorflowWrapper, sentenceSeparator: Option[String] = None): BertAssertionClassifier.this.type
- def setModelIfNotSet(spark: SparkSession, model: MedicalBertClassification): BertAssertionClassifier.this.type
-
final
def
setOutputCol(value: String): BertAssertionClassifier.this.type
- Definition Classes
- HasOutputAnnotationCol
-
def
setParent(parent: Estimator[BertAssertionClassifier]): BertAssertionClassifier
- Definition Classes
- Model
- def setSignatures(value: Map[String, String]): BertAssertionClassifier.this.type
- def setVocabulary(value: Map[String, Int]): BertAssertionClassifier.this.type
-
def
setWhiteList(list: String*): BertAssertionClassifier.this.type
- Definition Classes
- WhiteAndBlackListParams
-
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
- val signatures: MapFeature[String, String]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Identifiable → AnyRef → Any
-
final
def
transform(dataset: Dataset[_]): DataFrame
- Definition Classes
- AnnotatorModel → Transformer
-
def
transform(dataset: Dataset[_], paramMap: ParamMap): DataFrame
- Definition Classes
- Transformer
- Annotations
- @Since( "2.0.0" )
-
def
transform(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DataFrame
- Definition Classes
- Transformer
- Annotations
- @Since( "2.0.0" ) @varargs()
-
final
def
transformSchema(schema: StructType): StructType
- Definition Classes
- RawAnnotator → PipelineStage
-
def
transformSchema(schema: StructType, logging: Boolean): StructType
- Attributes
- protected
- Definition Classes
- PipelineStage
- Annotations
- @DeveloperApi()
-
val
uid: String
- Definition Classes
- BertAssertionClassifier → Identifiable
-
def
validate(schema: StructType): Boolean
- Attributes
- protected
- Definition Classes
- RawAnnotator
-
val
vocabulary: MapFeature[String, Int]
Vocabulary used to encode the words to ids with WordPieceEncoder
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
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
-
def
wrapColumnMetadata(col: Column): Column
- Attributes
- protected
- Definition Classes
- RawAnnotator
-
def
write: MLWriter
- Definition Classes
- ParamsAndFeaturesWritable → DefaultParamsWritable → MLWritable
-
def
writeOnnxModel(path: String, spark: SparkSession, onnxWrapper: OnnxWrapper, suffix: String, fileName: String): Unit
- Definition Classes
- WriteOnnxModel
-
def
writeOnnxModels(path: String, spark: SparkSession, onnxWrappersWithNames: Seq[(OnnxWrapper, String)], suffix: String): Unit
- Definition Classes
- WriteOnnxModel
-
def
writeTensorflowHub(path: String, tfPath: String, spark: SparkSession, suffix: String): Unit
- Definition Classes
- WriteTensorflowModel
-
def
writeTensorflowModel(path: String, spark: SparkSession, tensorflow: TensorflowWrapper, suffix: String, filename: String, configProtoBytes: Option[Array[Byte]]): Unit
- Definition Classes
- WriteTensorflowModel
-
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