c

com.johnsnowlabs.nlp.annotators.resolution

ChunkEntityResolverApproach

class ChunkEntityResolverApproach extends AnnotatorApproach[ChunkEntityResolverModel] with ResolverParams with HasCaseSensitiveProperties with Licensed

Contains all the parameters and methods to train a ChunkEntityResolverModel. It transform a dataset with two Input Annotations of types TOKEN and WORD_EMBEDDINGS, coming from e.g. ChunkTokenizer and ChunkEmbeddings Annotators and returns the normalized entity for a particular trained ontology / curated dataset. (e.g. ICD-10, RxNorm, SNOMED etc.)

To use pretrained models please use ChunkEntityResolverModel and see the Models Hub for available models.

Example

Training a SNOMED model

Define pre-processing pipeline for training data. It needs consists of columns for the normalized training data and their labels.

val document = new DocumentAssembler()
  .setInputCol("normalized_text")
  .setOutputCol("document")

val chunk = new Doc2Chunk()
  .setInputCols("document")
  .setOutputCol("chunk")

val token = new Tokenizer()
  .setInputCols("document")
  .setOutputCol("token")

val embeddings = WordEmbeddingsModel.pretrained("embeddings_healthcare_100d", "en", "clinical/models")
  .setInputCols("document", "token")
  .setOutputCol("embeddings")

val chunkEmb = new ChunkEmbeddings()
      .setInputCols("chunk", "embeddings")
      .setOutputCol("chunk_embeddings")

val snomedTrainingPipeline = new Pipeline().setStages(Array(
  document,
  chunk,
  token,
  embeddings,
  chunkEmb
))

val snomedTrainingModel = snomedTrainingPipeline.fit(data)

val snomedData = snomedTrainingModel.transform(data).cache()

Then the Resolver can be trained with

val snomedExtractor = new ChunkEntityResolverApproach()
  .setInputCols("token", "chunk_embeddings")
  .setOutputCol("recognized")
  .setNeighbours(1000)
  .setAlternatives(25)
  .setNormalizedCol("normalized_text")
  .setLabelCol("label")
  .setEnableWmd(true).setEnableTfidf(true).setEnableJaccard(true)
  .setEnableSorensenDice(true).setEnableJaroWinkler(true).setEnableLevenshtein(true)
  .setDistanceWeights(Array(1, 2, 2, 1, 1, 1))
  .setAllDistancesMetadata(true)
  .setPoolingStrategy("MAX")
  .setThreshold(1e32)
val model = snomedExtractor.fit(snomedData)
See also

ChunkEntityResolverModel

SentenceEntityResolverApproach for sentence level embeddings

Linear Supertypes
Licensed, HasCaseSensitiveProperties, ParamsAndFeaturesWritable, HasFeatures, ResolverParams, AnnotatorApproach[ChunkEntityResolverModel], CanBeLazy, DefaultParamsWritable, MLWritable, HasOutputAnnotatorType, HasOutputAnnotationCol, HasInputAnnotationCols, Estimator[ChunkEntityResolverModel], PipelineStage, Logging, Params, Serializable, Serializable, Identifiable, AnyRef, Any
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. ChunkEntityResolverApproach
  2. Licensed
  3. HasCaseSensitiveProperties
  4. ParamsAndFeaturesWritable
  5. HasFeatures
  6. ResolverParams
  7. AnnotatorApproach
  8. CanBeLazy
  9. DefaultParamsWritable
  10. MLWritable
  11. HasOutputAnnotatorType
  12. HasOutputAnnotationCol
  13. HasInputAnnotationCols
  14. Estimator
  15. PipelineStage
  16. Logging
  17. Params
  18. Serializable
  19. Serializable
  20. Identifiable
  21. AnyRef
  22. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ChunkEntityResolverApproach()
  2. new ChunkEntityResolverApproach(uid: String)

    uid

    a unique identifier for the instantiated AnnotatorModel

Type Members

  1. 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 _fit(dataset: Dataset[_], recursiveStages: Option[PipelineModel]): ChunkEntityResolverModel
    Attributes
    protected
    Definition Classes
    AnnotatorApproach
  10. val allDistancesMetadata: BooleanParam

    whether or not to return an all distance values in the metadata.

    whether or not to return an all distance values in the metadata. Default: False

    Definition Classes
    ResolverParams
  11. val alternatives: IntParam

    number of results to return in the metadata after sorting by last distance calculated

    number of results to return in the metadata after sorting by last distance calculated

    Definition Classes
    ResolverParams
  12. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  13. val auxLabelCol: Param[String]

    Optional column with one extra label per document.

    Optional column with one extra label per document. This extra label will be outputted later on in an additional column (Default: "aux_label".)

  14. val auxLabelMap: StructFeature[Map[String, String]]

    Map[String,String] where key=label and value=auxLabel from a dataset.

  15. def beforeTraining(spark: SparkSession): Unit
    Definition Classes
    AnnotatorApproach
  16. val caseSensitive: BooleanParam
    Definition Classes
    HasCaseSensitiveProperties
  17. final def checkSchema(schema: StructType, inputAnnotatorType: String): Boolean
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  18. final def clear(param: Param[_]): ChunkEntityResolverApproach.this.type
    Definition Classes
    Params
  19. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  20. val confidenceFunction: Param[String]

    what function to use to calculate confidence: INVERSE or SOFTMAX

    what function to use to calculate confidence: INVERSE or SOFTMAX

    Definition Classes
    ResolverParams
  21. final def copy(extra: ParamMap): Estimator[ChunkEntityResolverModel]
    Definition Classes
    AnnotatorApproach → Estimator → PipelineStage → Params
  22. def copyValues[T <: Params](to: T, extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  23. final def defaultCopy[T <: Params](extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  24. val description: String
    Definition Classes
    ChunkEntityResolverApproach → AnnotatorApproach
  25. val distanceFunction: Param[String]

    what distance function to use for KNN: 'EUCLIDEAN' or 'COSINE'

    what distance function to use for KNN: 'EUCLIDEAN' or 'COSINE'

    Definition Classes
    ResolverParams
  26. val distanceWeights: DoubleArrayParam

    distance weights to apply before pooling: [WMD, TFIDF, Jaccard, SorensenDice, JaroWinkler, Levenshtein]

    distance weights to apply before pooling: [WMD, TFIDF, Jaccard, SorensenDice, JaroWinkler, Levenshtein]

    Definition Classes
    ResolverParams
  27. lazy val embeddingsColumnName: String
  28. val enableJaccard: BooleanParam

    whether or not to use Jaccard token distance.

    whether or not to use Jaccard token distance. Default: True

    Definition Classes
    ResolverParams
  29. val enableJaroWinkler: BooleanParam

    whether or not to use Jaro-Winkler character distance.

    whether or not to use Jaro-Winkler character distance. Default: False

    Definition Classes
    ResolverParams
  30. val enableLevenshtein: BooleanParam

    whether or not to use Levenshtein character distance.

    whether or not to use Levenshtein character distance. Default: False

    Definition Classes
    ResolverParams
  31. val enableSorensenDice: BooleanParam

    whether or not to use Sorensen-Dice token distance.

    whether or not to use Sorensen-Dice token distance. Default: False

    Definition Classes
    ResolverParams
  32. val enableTfidf: BooleanParam

    whether or not to use TFIDF token distance.

    whether or not to use TFIDF token distance. Default: True

    Definition Classes
    ResolverParams
  33. val enableWmd: BooleanParam

    whether or not to use WMD token distance.

    whether or not to use WMD token distance. Default: True

    Definition Classes
    ResolverParams
  34. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  35. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  36. def explainParam(param: Param[_]): String
    Definition Classes
    Params
  37. def explainParams(): String
    Definition Classes
    Params
  38. def extractAuxLabelMap(dataset: Dataset[_]): Map[String, String]

    Extracts a Map[String,String] where key=label and value=auxLabel from a dataset.

    Extracts a Map[String,String] where key=label and value=auxLabel from a dataset. If either of one columns does not exist, it will return an empty map

    dataset

    from whichw e extract the column

    returns

    a Map[String,String]

  39. final def extractParamMap(): ParamMap
    Definition Classes
    Params
  40. final def extractParamMap(extra: ParamMap): ParamMap
    Definition Classes
    Params
  41. val extramassPenalty: DoubleParam

    penalty for extra words in the knowledge base match during WMD calculation

    penalty for extra words in the knowledge base match during WMD calculation

    Definition Classes
    ResolverParams
  42. val features: ArrayBuffer[Feature[_, _, _]]
    Definition Classes
    HasFeatures
  43. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  44. final def fit(dataset: Dataset[_]): ChunkEntityResolverModel
    Definition Classes
    AnnotatorApproach → Estimator
  45. def fit(dataset: Dataset[_], paramMaps: Array[ParamMap]): Seq[ChunkEntityResolverModel]
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" )
  46. def fit(dataset: Dataset[_], paramMap: ParamMap): ChunkEntityResolverModel
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" )
  47. def fit(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): ChunkEntityResolverModel
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" ) @varargs()
  48. def get[T](feature: StructFeature[T]): Option[T]
    Attributes
    protected
    Definition Classes
    HasFeatures
  49. def get[K, V](feature: MapFeature[K, V]): Option[Map[K, V]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  50. def get[T](feature: SetFeature[T]): Option[Set[T]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  51. def get[T](feature: ArrayFeature[T]): Option[Array[T]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  52. final def get[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  53. def getAllDistancesMetadata: Boolean
    Definition Classes
    ResolverParams
  54. def getAlternatives: Int
    Definition Classes
    ResolverParams
  55. def getAuxLabelCol(): String

    Optional column with one extra label per document.

    Optional column with one extra label per document. This extra label will be outputted later on in an additional column

  56. def getAuxLabelMap(): Map[String, String]

    Map[String,String] where key=label and value=auxLabel from a dataset

  57. def getCaseSensitive: Boolean
    Definition Classes
    HasCaseSensitiveProperties
  58. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  59. def getConfidenceFunction: String
    Definition Classes
    ResolverParams
  60. final def getDefault[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  61. def getDistanceFunction: String
    Definition Classes
    ResolverParams
  62. def getDistanceWeights: Array[Double]
    Definition Classes
    ResolverParams
  63. def getEnableJaccard: Boolean
    Definition Classes
    ResolverParams
  64. def getEnableJaroWinkler: Boolean
    Definition Classes
    ResolverParams
  65. def getEnableLevenshtein: Boolean
    Definition Classes
    ResolverParams
  66. def getEnableSorensenDice: Boolean
    Definition Classes
    ResolverParams
  67. def getEnableTfidf: Boolean
    Definition Classes
    ResolverParams
  68. def getEnableWmd: Boolean
    Definition Classes
    ResolverParams
  69. def getExtramassPenalty: Double
    Definition Classes
    ResolverParams
  70. def getInputCols: Array[String]
    Definition Classes
    HasInputAnnotationCols
  71. def getLabelCol: String

    Column name for the value we are trying to resolve

  72. def getLazyAnnotator: Boolean
    Definition Classes
    CanBeLazy
  73. def getMissAsEmpty: Boolean
    Definition Classes
    ResolverParams
  74. def getNeighbours: Int
    Definition Classes
    ResolverParams
  75. def getNormalizedCol: String

    column name for the original, normalized description

  76. final def getOrDefault[T](param: Param[T]): T
    Definition Classes
    Params
  77. final def getOutputCol: String
    Definition Classes
    HasOutputAnnotationCol
  78. def getParam(paramName: String): Param[Any]
    Definition Classes
    Params
  79. def getPoolingStrategy: String
    Definition Classes
    ResolverParams
  80. def getReturnAllKEmbeddings(): Boolean

    Whether to return all embeddings of all K candidates of the resolution.

    Whether to return all embeddings of all K candidates of the resolution. Embeddings will be in the metadata. Increase in RAM usage to be expected.

  81. def getReturnCosineDistances: Boolean

    Whether to calculate and return cosine distances between a chunk/token and the k closest candidates.

    Whether to calculate and return cosine distances between a chunk/token and the k closest candidates. Can improve accuracy but increases computation.

  82. def getThreshold: Double
    Definition Classes
    ResolverParams
  83. def getUseAuxLabel(): Boolean

    Whether to use Aux Label or not

  84. final def hasDefault[T](param: Param[T]): Boolean
    Definition Classes
    Params
  85. def hasParam(paramName: String): Boolean
    Definition Classes
    Params
  86. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  87. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  88. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  89. val inputAnnotatorTypes: Array[String]

    Input annotator Types: TOKEN, WORD_EMBEDDINGS

    Input annotator Types: TOKEN, WORD_EMBEDDINGS

    Definition Classes
    ChunkEntityResolverApproach → HasInputAnnotationCols
  90. final val inputCols: StringArrayParam
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  91. final def isDefined(param: Param[_]): Boolean
    Definition Classes
    Params
  92. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  93. final def isSet(param: Param[_]): Boolean
    Definition Classes
    Params
  94. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  95. val labelCol: Param[String]

    Column name for the value we are trying to resolve (Default: "code")

  96. lazy val labelColumnName: String
  97. val lazyAnnotator: BooleanParam
    Definition Classes
    CanBeLazy
  98. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  99. def logDebug(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  100. def logDebug(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  101. def logError(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  102. def logError(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  103. def logInfo(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  104. def logInfo(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  105. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  106. def logTrace(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  107. def logTrace(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  108. def logWarning(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  109. def logWarning(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  110. val missAsEmpty: BooleanParam

    whether or not to return an empty annotation on unmatched chunks

    whether or not to return an empty annotation on unmatched chunks

    Definition Classes
    ResolverParams
  111. def msgHelper(schema: StructType): String
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  112. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  113. val neighbours: IntParam

    number of neighbours to consider in the KNN query to calculate WMD

    number of neighbours to consider in the KNN query to calculate WMD

    Definition Classes
    ResolverParams
  114. val normalizedCol: Param[String]

    column name for the original, normalized description

  115. lazy val normalizedColumnName: String
  116. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  117. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  118. def onTrained(model: ChunkEntityResolverModel, spark: SparkSession): Unit
    Definition Classes
    AnnotatorApproach
  119. def onWrite(path: String, spark: SparkSession): Unit
    Attributes
    protected
    Definition Classes
    ParamsAndFeaturesWritable
  120. val outputAnnotatorType: AnnotatorType

    Output annotator Types: ENTITY

    Output annotator Types: ENTITY

    Definition Classes
    ChunkEntityResolverApproach → HasOutputAnnotatorType
  121. final val outputCol: Param[String]
    Attributes
    protected
    Definition Classes
    HasOutputAnnotationCol
  122. lazy val params: Array[Param[_]]
    Definition Classes
    Params
  123. val poolingStrategy: Param[String]

    pooling strategy to aggregate distances: AVERAGE or SUM

    pooling strategy to aggregate distances: AVERAGE or SUM

    Definition Classes
    ResolverParams
  124. val returnAllKEmbeddings: BooleanParam

    Whether to return all embeddings of all K candidates of the resolution.

    Whether to return all embeddings of all K candidates of the resolution. Embeddings will be in the metadata. Increase in RAM usage to be expected (Default: false)

  125. val returnCosineDistances: BooleanParam

    Whether to calculate and return cosine distances between a chunk/token and the k closest candidates.

    Whether to calculate and return cosine distances between a chunk/token and the k closest candidates. Can improve accuracy but increases computation (Default: true)

  126. def save(path: String): Unit
    Definition Classes
    MLWritable
    Annotations
    @Since( "1.6.0" ) @throws( ... )
  127. def set[T](feature: StructFeature[T], value: T): ChunkEntityResolverApproach.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  128. def set[K, V](feature: MapFeature[K, V], value: Map[K, V]): ChunkEntityResolverApproach.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  129. def set[T](feature: SetFeature[T], value: Set[T]): ChunkEntityResolverApproach.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  130. def set[T](feature: ArrayFeature[T], value: Array[T]): ChunkEntityResolverApproach.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  131. final def set(paramPair: ParamPair[_]): ChunkEntityResolverApproach.this.type
    Attributes
    protected
    Definition Classes
    Params
  132. final def set(param: String, value: Any): ChunkEntityResolverApproach.this.type
    Attributes
    protected
    Definition Classes
    Params
  133. final def set[T](param: Param[T], value: T): ChunkEntityResolverApproach.this.type
    Definition Classes
    Params
  134. def setAllDistancesMetadata(v: Boolean): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  135. def setAlternatives(a: Int): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  136. def setAuxLabelCol(c: String): ChunkEntityResolverApproach.this.type

    Optional column with one extra label per document.

    Optional column with one extra label per document. This extra label will be outputted later on in an additional column

  137. def setAuxLabelMap(m: Map[String, String]): ChunkEntityResolverApproach.this.type

    Map[String,String] where key=label and value=auxLabel from a dataset.

  138. def setCaseSensitive(value: Boolean): ChunkEntityResolverApproach.this.type
    Definition Classes
    HasCaseSensitiveProperties
  139. def setConfidenceFunction(v: String): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  140. def setDefault[T](feature: StructFeature[T], value: () ⇒ T): ChunkEntityResolverApproach.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  141. def setDefault[K, V](feature: MapFeature[K, V], value: () ⇒ Map[K, V]): ChunkEntityResolverApproach.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  142. def setDefault[T](feature: SetFeature[T], value: () ⇒ Set[T]): ChunkEntityResolverApproach.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  143. def setDefault[T](feature: ArrayFeature[T], value: () ⇒ Array[T]): ChunkEntityResolverApproach.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  144. final def setDefault(paramPairs: ParamPair[_]*): ChunkEntityResolverApproach.this.type
    Attributes
    protected
    Definition Classes
    Params
  145. final def setDefault[T](param: Param[T], value: T): ChunkEntityResolverApproach.this.type
    Attributes
    protected
    Definition Classes
    Params
  146. def setDistanceFunction(value: String): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  147. def setDistanceWeights(v: Array[Double]): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  148. def setEnableJaccard(v: Boolean): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  149. def setEnableJaroWinkler(v: Boolean): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  150. def setEnableLevenshtein(v: Boolean): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  151. def setEnableSorensenDice(v: Boolean): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  152. def setEnableTfidf(v: Boolean): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  153. def setEnableWmd(v: Boolean): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  154. def setExtramassPenalty(emp: Double): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  155. final def setInputCols(value: String*): ChunkEntityResolverApproach.this.type
    Definition Classes
    HasInputAnnotationCols
  156. final def setInputCols(value: Array[String]): ChunkEntityResolverApproach.this.type
    Definition Classes
    HasInputAnnotationCols
  157. def setLabelCol(value: String): ChunkEntityResolverApproach.this.type

    Column name for the value we are trying to resolve

  158. def setLazyAnnotator(value: Boolean): ChunkEntityResolverApproach.this.type
    Definition Classes
    CanBeLazy
  159. def setMissAsEmpty(v: Boolean): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  160. def setNeighbours(k: Int): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  161. def setNormalizedCol(value: String): ChunkEntityResolverApproach.this.type

    column name for the original, normalized description

  162. final def setOutputCol(value: String): ChunkEntityResolverApproach.this.type
    Definition Classes
    HasOutputAnnotationCol
  163. def setPoolingStrategy(value: String): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  164. def setReturnAllKEmbeddings(b: Boolean): ChunkEntityResolverApproach.this.type

  165. def setReturnCosineDistances(value: Boolean): ChunkEntityResolverApproach.this.type

    Whether to calculate and return cosine distances between a chunk/token and the k closest candidates.

    Whether to calculate and return cosine distances between a chunk/token and the k closest candidates. Can improve accuracy but increases computation.

  166. def setThreshold(dist: Double): ChunkEntityResolverApproach.this.type
    Definition Classes
    ResolverParams
  167. def setUseAuxLabel(b: Boolean): ChunkEntityResolverApproach.this.type

    Whether to use Aux Label or not

  168. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  169. val threshold: DoubleParam

    threshold value for the aggregated distance

    threshold value for the aggregated distance

    Definition Classes
    ResolverParams
  170. def toString(): String
    Definition Classes
    Identifiable → AnyRef → Any
  171. lazy val tokensColumnName: String
  172. def train(dataset: Dataset[_], recursivePipeline: Option[PipelineModel]): ChunkEntityResolverModel

    Returns the ChunkEntityResolverModel Transformer, that can be used to transform input datasets

    Returns the ChunkEntityResolverModel Transformer, that can be used to transform input datasets

    The dataset provided to the fit method should have one chunk per row and contain the following columns: ChunkTokens, ChunkEmbeddings, ResolverLabel, [ResolverNormalized]

    The cardinality of the dataset should not exceed 100.000 data points since searching in such a big KD-tree becomes impractical

    This method is called inside the AnnotatorApproach's fit method

    dataset

    a Dataset containing ChunkTokens, ChunkEmbeddings, ClassifierLabel, ResolverLabel, [ResolverNormalized]

    returns

    a trained ChunkEntityResolverModel

    Definition Classes
    ChunkEntityResolverApproach → AnnotatorApproach
  173. final def transformSchema(schema: StructType): StructType
    Definition Classes
    AnnotatorApproach → PipelineStage
  174. def transformSchema(schema: StructType, logging: Boolean): StructType
    Attributes
    protected
    Definition Classes
    PipelineStage
    Annotations
    @DeveloperApi()
  175. val uid: String
    Definition Classes
    ChunkEntityResolverApproach → Identifiable
  176. val useAuxLabel: BooleanParam

    Whether to use Aux Label or not (Default: false)

  177. def validate(schema: StructType): Boolean
    Attributes
    protected
    Definition Classes
    AnnotatorApproach
  178. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  179. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  180. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  181. def write: MLWriter
    Definition Classes
    ParamsAndFeaturesWritable → DefaultParamsWritable → MLWritable

Inherited from Licensed

Inherited from HasCaseSensitiveProperties

Inherited from ParamsAndFeaturesWritable

Inherited from HasFeatures

Inherited from ResolverParams

Inherited from AnnotatorApproach[ChunkEntityResolverModel]

Inherited from CanBeLazy

Inherited from DefaultParamsWritable

Inherited from MLWritable

Inherited from HasOutputAnnotatorType

Inherited from HasOutputAnnotationCol

Inherited from HasInputAnnotationCols

Inherited from Estimator[ChunkEntityResolverModel]

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