Class/Object

com.johnsnowlabs.nlp.annotators.re

RelationExtractionModel

Related Docs: object RelationExtractionModel | package re

Permalink

class RelationExtractionModel extends GenericClassifierModel

ClassifierDL is a generic Multi-class Text Classification. ClassifierDL uses the state-of-the-art Universal Sentence Encoder as an input for text classifications. The ClassifierDL annotator uses a deep learning model (DNNs) we have built inside TensorFlow and supports up to 50 classes

NOTE: This annotator accepts a label column of a single item in either type of String, Int, Float, or Double.

NOTE: UniversalSentenceEncoder and SentenceEmbeddings can be used for the inputCol

See https://github.com/JohnSnowLabs/spark-nlp/blob/master/src/test/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/ClassifierDLTestSpec.scala for further reference on how to use this API

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

Instance Constructors

  1. new RelationExtractionModel()

    Permalink
  2. new RelationExtractionModel(uid: String)

    Permalink

Type Members

  1. type AnnotationContent = Seq[Row]

    Permalink
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  2. type AnnotatorType = String

    Permalink
    Definition Classes
    HasOutputAnnotatorType

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def $[T](param: Param[T]): T

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  4. def $$[T](feature: StructFeature[T]): T

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  5. def $$[K, V](feature: MapFeature[K, V]): Map[K, V]

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  6. def $$[T](feature: SetFeature[T]): Set[T]

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  7. def $$[T](feature: ArrayFeature[T]): Array[T]

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  8. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def _transform(dataset: Dataset[_], recursivePipeline: Option[PipelineModel]): DataFrame

    Permalink
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  10. def afterAnnotate(dataset: DataFrame): DataFrame

    Permalink
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  11. def annotate(annotations: Seq[Annotation]): Seq[Annotation]

    Permalink

    takes a document and annotations and produces new annotations of this annotator's annotation type

    takes a document and annotations and produces new annotations of this annotator's annotation type

    annotations

    Annotations that correspond to inputAnnotationCols generated by previous annotators if any

    returns

    any number of annotations processed for every input annotation. Not necessary one to one relationship

    Definition Classes
    RelationExtractionModelGenericClassifierModel → AnnotatorModel
  12. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  13. def beforeAnnotate(dataset: Dataset[_]): Dataset[_]

    Permalink
    Definition Classes
    RelationExtractionModelGenericClassifierModel → AnnotatorModel
  14. def categorizeRel(relation: RelationInstance): (Long, Float)

    Permalink
    Attributes
    protected
  15. final def checkSchema(schema: StructType, inputAnnotatorType: String): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  16. final def clear(param: Param[_]): RelationExtractionModel.this.type

    Permalink
    Definition Classes
    Params
  17. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. def copy(extra: ParamMap): GenericClassifierModel

    Permalink
    Definition Classes
    RawAnnotator → Model → Transformer → PipelineStage → Params
  19. def copyValues[T <: Params](to: T, extra: ParamMap): T

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  20. def createDatabaseConnection(database: Name): RocksDBConnection

    Permalink
    Definition Classes
    HasStorageRef
  21. final def defaultCopy[T <: Params](extra: ParamMap): T

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  22. def dfAnnotate: UserDefinedFunction

    Permalink
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  23. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  24. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  25. def explainParam(param: Param[_]): String

    Permalink
    Definition Classes
    Params
  26. def explainParams(): String

    Permalink
    Definition Classes
    Params
  27. def extraValidate(structType: StructType): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    RawAnnotator
  28. def extraValidateMsg: String

    Permalink
    Attributes
    protected
    Definition Classes
    RawAnnotator
  29. final def extractParamMap(): ParamMap

    Permalink
    Definition Classes
    Params
  30. final def extractParamMap(extra: ParamMap): ParamMap

    Permalink
    Definition Classes
    Params
  31. val featureScaling: Param[String]

    Permalink

    Feature scaling method.

    Feature scaling method. Possible values are 'zscore', 'minmax' or empty (no scaling)

    Definition Classes
    GenericClassifierModel
  32. val features: ArrayBuffer[Feature[_, _, _]]

    Permalink
    Definition Classes
    HasFeatures
  33. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  34. def get[T](feature: StructFeature[T]): Option[T]

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  35. def get[K, V](feature: MapFeature[K, V]): Option[Map[K, V]]

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  36. def get[T](feature: SetFeature[T]): Option[Set[T]]

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  37. def get[T](feature: ArrayFeature[T]): Option[Array[T]]

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  38. final def get[T](param: Param[T]): Option[T]

    Permalink
    Definition Classes
    Params
  39. def getCategories(): Array[String]

    Permalink

    Get all categories

    Get all categories

    Definition Classes
    GenericClassifierModel
  40. def getCategoryName(id: Int): String

    Permalink

    Definition Classes
    GenericClassifierModel
  41. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  42. final def getDefault[T](param: Param[T]): Option[T]

    Permalink
    Definition Classes
    Params
  43. def getEncoder: GenericClassifierDataEncoder

    Permalink
    Definition Classes
    GenericClassifierModel
  44. def getFeatureScaling: String

    Permalink

    Get feature scaling method

    Get feature scaling method

    Definition Classes
    GenericClassifierModel
  45. def getInputCols: Array[String]

    Permalink
    Definition Classes
    HasInputAnnotationCols
  46. def getLazyAnnotator: Boolean

    Permalink
    Definition Classes
    CanBeLazy
  47. def getMaxSyntacticDistance: Float

    Permalink

    Get prediction threshold

  48. final def getOrDefault[T](param: Param[T]): T

    Permalink
    Definition Classes
    Params
  49. final def getOutputCol: String

    Permalink
    Definition Classes
    HasOutputAnnotationCol
  50. def getParam(paramName: String): Param[Any]

    Permalink
    Definition Classes
    Params
  51. def getPredictionThreshold: Float

    Permalink

    Get prediction threshold

  52. def getRelationPairs: Array[String]

    Permalink

    Get relation pairs

  53. def getStorageRef: String

    Permalink
    Definition Classes
    HasStorageRef
  54. final def hasDefault[T](param: Param[T]): Boolean

    Permalink
    Definition Classes
    Params
  55. def hasParam(paramName: String): Boolean

    Permalink
    Definition Classes
    Params
  56. def hasParent: Boolean

    Permalink
    Definition Classes
    Model
  57. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  58. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  59. def initializeLogIfNecessary(isInterpreter: Boolean): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  60. val inputAnnotatorTypes: Array[AnnotatorType]

    Permalink

    Output annotator type : SENTENCE_EMBEDDINGS

    Output annotator type : SENTENCE_EMBEDDINGS

    Definition Classes
    RelationExtractionModelGenericClassifierModel → HasInputAnnotationCols
  61. final val inputCols: StringArrayParam

    Permalink
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  62. final def isDefined(param: Param[_]): Boolean

    Permalink
    Definition Classes
    Params
  63. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  64. final def isSet(param: Param[_]): Boolean

    Permalink
    Definition Classes
    Params
  65. def isTraceEnabled(): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  66. val lazyAnnotator: BooleanParam

    Permalink
    Definition Classes
    CanBeLazy
  67. def loadModel(sparkSession: SparkSession, tfModel: TensorflowWrapper, categories: Array[String], encoder: GenericClassifierDataEncoder, nerTags: Array[String]): RelationExtractionModel.this.type

    Permalink
  68. def log: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  69. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  70. def logDebug(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  71. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  72. def logError(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  73. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  74. def logInfo(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  75. def logName: String

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  76. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  77. def logTrace(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  78. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  79. def logWarning(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  80. var maxSyntacticDistance: IntParam

    Permalink
  81. def model: TensorflowGenericClassifier

    Permalink
    Definition Classes
    GenericClassifierModel
  82. def msgHelper(schema: StructType): String

    Permalink
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  83. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  84. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  85. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  86. def onWrite(path: String, spark: SparkSession): Unit

    Permalink
    Definition Classes
    GenericClassifierModel → ParamsAndFeaturesWritable
  87. val outputAnnotatorType: String

    Permalink

    Output annotator type : CATEGORY

    Output annotator type : CATEGORY

    Definition Classes
    RelationExtractionModelGenericClassifierModel → HasOutputAnnotatorType
  88. final val outputCol: Param[String]

    Permalink
    Attributes
    protected
    Definition Classes
    HasOutputAnnotationCol
  89. lazy val params: Array[Param[_]]

    Permalink
    Definition Classes
    Params
  90. var parent: Estimator[GenericClassifierModel]

    Permalink
    Definition Classes
    Model
  91. var predictionThreshold: FloatParam

    Permalink
  92. var relationPairs: Param[String]

    Permalink

    List of pairs of named entities ("ENTITY1-ENTITY2", e.g.

    List of pairs of named entities ("ENTITY1-ENTITY2", e.g. "Biomarker-RelativeDay"), which will be processed

  93. def save(path: String): Unit

    Permalink
    Definition Classes
    MLWritable
    Annotations
    @Since( "1.6.0" ) @throws( ... )
  94. def scaleFeatures(features: Array[Array[Float]]): Array[Array[Float]]

    Permalink
    Attributes
    protected
    Definition Classes
    GenericClassifierModel
  95. def set[T](feature: StructFeature[T], value: T): RelationExtractionModel.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  96. def set[K, V](feature: MapFeature[K, V], value: Map[K, V]): RelationExtractionModel.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  97. def set[T](feature: SetFeature[T], value: Set[T]): RelationExtractionModel.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  98. def set[T](feature: ArrayFeature[T], value: Array[T]): RelationExtractionModel.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  99. final def set(paramPair: ParamPair[_]): RelationExtractionModel.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  100. final def set(param: String, value: Any): RelationExtractionModel.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  101. final def set[T](param: Param[T], value: T): RelationExtractionModel.this.type

    Permalink
    Definition Classes
    Params
  102. def setCategoryNames(categoryNames: Array[String]): RelationExtractionModel.this.type

    Permalink

    Definition Classes
    GenericClassifierModel
  103. def setDefault[T](feature: StructFeature[T], value: () ⇒ T): RelationExtractionModel.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  104. def setDefault[K, V](feature: MapFeature[K, V], value: () ⇒ Map[K, V]): RelationExtractionModel.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  105. def setDefault[T](feature: SetFeature[T], value: () ⇒ Set[T]): RelationExtractionModel.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  106. def setDefault[T](feature: ArrayFeature[T], value: () ⇒ Array[T]): RelationExtractionModel.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    HasFeatures
  107. final def setDefault(paramPairs: ParamPair[_]*): RelationExtractionModel.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  108. final def setDefault[T](param: Param[T], value: T): RelationExtractionModel.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  109. def setEncoder(encoder: GenericClassifierDataEncoder): RelationExtractionModel.this.type

    Permalink
    Definition Classes
    GenericClassifierModel
  110. def setFeatureScaling(featureScaling: String): RelationExtractionModel.this.type

    Permalink

    Set the feature scaling method.

    Set the feature scaling method. Possible values are 'zscore', 'minmax' or empty (no scaling)

    Definition Classes
    GenericClassifierModel
  111. final def setInputCols(value: String*): RelationExtractionModel.this.type

    Permalink
    Definition Classes
    HasInputAnnotationCols
  112. final def setInputCols(value: Array[String]): RelationExtractionModel.this.type

    Permalink
    Definition Classes
    HasInputAnnotationCols
  113. def setLazyAnnotator(value: Boolean): RelationExtractionModel.this.type

    Permalink
    Definition Classes
    CanBeLazy
  114. def setMaxSyntacticDistance(maxSyntacticDistance: Int): RelationExtractionModel.this.type

    Permalink

    Set prediction threshold

  115. final def setOutputCol(value: String): RelationExtractionModel.this.type

    Permalink
    Definition Classes
    HasOutputAnnotationCol
  116. def setParent(parent: Estimator[GenericClassifierModel]): GenericClassifierModel

    Permalink
    Definition Classes
    Model
  117. def setPredictionThreshold(predictionThreshold: Float): RelationExtractionModel.this.type

    Permalink

    Set prediction threshold

  118. def setRelationPairs(relationPairs: Array[String]): RelationExtractionModel.this.type

    Permalink

    Set relation pairs

  119. def setStorageRef(value: String): RelationExtractionModel.this.type

    Permalink
    Definition Classes
    HasStorageRef
  120. def setTensorflowModel(spark: SparkSession, tf: TensorflowWrapper): RelationExtractionModel.this.type

    Permalink
    Definition Classes
    GenericClassifierModel
  121. val storageRef: Param[String]

    Permalink
    Definition Classes
    HasStorageRef
  122. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  123. def toString(): String

    Permalink
    Definition Classes
    Identifiable → AnyRef → Any
  124. final def transform(dataset: Dataset[_]): DataFrame

    Permalink
    Definition Classes
    AnnotatorModel → Transformer
  125. def transform(dataset: Dataset[_], paramMap: ParamMap): DataFrame

    Permalink
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" )
  126. def transform(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DataFrame

    Permalink
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" ) @varargs()
  127. final def transformSchema(schema: StructType): StructType

    Permalink
    Definition Classes
    RawAnnotator → PipelineStage
  128. def transformSchema(schema: StructType, logging: Boolean): StructType

    Permalink
    Attributes
    protected
    Definition Classes
    PipelineStage
    Annotations
    @DeveloperApi()
  129. val uid: String

    Permalink
    Definition Classes
    RelationExtractionModelGenericClassifierModel → Identifiable
  130. def validate(schema: StructType): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    RawAnnotator
  131. def validateStorageRef(dataset: Dataset[_], inputCols: Array[String], annotatorType: String): Unit

    Permalink
    Definition Classes
    HasStorageRef
  132. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  133. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  134. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  135. def wrapColumnMetadata(col: Column): Column

    Permalink
    Attributes
    protected
    Definition Classes
    RawAnnotator
  136. def write: MLWriter

    Permalink
    Definition Classes
    ParamsAndFeaturesWritable → DefaultParamsWritable → MLWritable
  137. def writeTensorflowHub(path: String, tfPath: String, spark: SparkSession, suffix: String): Unit

    Permalink
    Definition Classes
    WriteTensorflowModel
  138. def writeTensorflowModel(path: String, spark: SparkSession, tensorflow: TensorflowWrapper, suffix: String, filename: String, configProtoBytes: Option[Array[Byte]]): Unit

    Permalink
    Definition Classes
    WriteTensorflowModel
  139. def writeTensorflowModelV2(path: String, spark: SparkSession, tensorflow: TensorflowWrapper, suffix: String, filename: String, configProtoBytes: Option[Array[Byte]]): Unit

    Permalink
    Definition Classes
    WriteTensorflowModel

Inherited from GenericClassifierModel

Inherited from Licensed

Inherited from WriteTensorflowModel

Inherited from HasStorageRef

Inherited from AnnotatorModel[GenericClassifierModel]

Inherited from CanBeLazy

Inherited from RawAnnotator[GenericClassifierModel]

Inherited from HasOutputAnnotationCol

Inherited from HasInputAnnotationCols

Inherited from HasOutputAnnotatorType

Inherited from ParamsAndFeaturesWritable

Inherited from HasFeatures

Inherited from DefaultParamsWritable

Inherited from MLWritable

Inherited from Model[GenericClassifierModel]

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

Annotator types

Required input and expected output annotator types

Members

Parameter setters

Parameter getters