Packages

class RuleBasedMatcher extends AnnotatorApproach[RuleBasedMatcherModel] with RuleBasedMatcherParams

Rule-based token matcher over multiple Spark NLP annotation columns.

Patterns are supplied as JSON/JSONL rules. Each token pattern contains one or more attribute predicates, and attributes are read from configured annotation columns such as TOKEN, POS, NAMED_ENTITY, DEPENDENCY, or additional TOKEN columns like lemmas.

Linear Supertypes
RuleBasedMatcherParams, AnnotatorApproach[RuleBasedMatcherModel], CanBeLazy, DefaultParamsWritable, MLWritable, HasOutputAnnotatorType, HasOutputAnnotationCol, HasInputAnnotationCols, Estimator[RuleBasedMatcherModel], PipelineStage, Logging, Params, Serializable, Serializable, Identifiable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RuleBasedMatcher
  2. RuleBasedMatcherParams
  3. AnnotatorApproach
  4. CanBeLazy
  5. DefaultParamsWritable
  6. MLWritable
  7. HasOutputAnnotatorType
  8. HasOutputAnnotationCol
  9. HasInputAnnotationCols
  10. Estimator
  11. PipelineStage
  12. Logging
  13. Params
  14. Serializable
  15. Serializable
  16. Identifiable
  17. AnyRef
  18. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

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

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. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. def _fit(dataset: Dataset[_], recursiveStages: Option[PipelineModel]): RuleBasedMatcherModel
    Attributes
    protected
    Definition Classes
    AnnotatorApproach
  6. val alignmentMode: Param[String]
    Definition Classes
    RuleBasedMatcherParams
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. val attributeColumns: StringArrayParam
    Definition Classes
    RuleBasedMatcherParams
  9. def beforeTraining(spark: SparkSession): Unit
    Definition Classes
    AnnotatorApproach
  10. final def checkSchema(schema: StructType, inputAnnotatorType: String): Boolean
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  11. final def clear(param: Param[_]): RuleBasedMatcher.this.type
    Definition Classes
    Params
  12. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  13. def columnTypes(schema: StructType): Map[String, String]
    Attributes
    protected
    Definition Classes
    RuleBasedMatcherParams
  14. final def copy(extra: ParamMap): Estimator[RuleBasedMatcherModel]
    Definition Classes
    AnnotatorApproach → Estimator → PipelineStage → Params
  15. def copyValues[T <: Params](to: T, extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  16. final def defaultCopy[T <: Params](extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  17. val description: String
    Definition Classes
    RuleBasedMatcher → AnnotatorApproach
  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  20. def explainParam(param: Param[_]): String
    Definition Classes
    Params
  21. def explainParams(): String
    Definition Classes
    Params
  22. final val extraInputCols: StringArrayParam
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  23. final def extractParamMap(): ParamMap
    Definition Classes
    Params
  24. final def extractParamMap(extra: ParamMap): ParamMap
    Definition Classes
    Params
  25. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. final def fit(dataset: Dataset[_]): RuleBasedMatcherModel
    Definition Classes
    AnnotatorApproach → Estimator
  27. def fit(dataset: Dataset[_], paramMaps: Seq[ParamMap]): Seq[RuleBasedMatcherModel]
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" )
  28. def fit(dataset: Dataset[_], paramMap: ParamMap): RuleBasedMatcherModel
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" )
  29. def fit(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): RuleBasedMatcherModel
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" ) @varargs()
  30. final def get[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  31. def getAlignmentMode: String
    Definition Classes
    RuleBasedMatcherParams
  32. def getAttributeColumns: Map[String, String]
    Definition Classes
    RuleBasedMatcherParams
  33. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  34. final def getDefault[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  35. def getInputCols: Array[String]

    returns

    input annotations columns currently used

    Definition Classes
    HasInputAnnotationCols
  36. def getLazyAnnotator: Boolean
    Definition Classes
    CanBeLazy
  37. final def getOrDefault[T](param: Param[T]): T
    Definition Classes
    Params
  38. final def getOutputCol: String

    Gets annotation column name going to generate

    Gets annotation column name going to generate

    Definition Classes
    HasOutputAnnotationCol
  39. def getOverlapStrategy: String
    Definition Classes
    RuleBasedMatcherParams
  40. def getParam(paramName: String): Param[Any]
    Definition Classes
    Params
  41. final def hasDefault[T](param: Param[T]): Boolean
    Definition Classes
    Params
  42. def hasParam(paramName: String): Boolean
    Definition Classes
    Params
  43. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  44. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  45. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  46. val inputAnnotatorTypes: Array[AnnotatorType]

    Annotator reference id.

    Annotator reference id. Used to identify elements in metadata or to refer to this annotator type

    Definition Classes
    RuleBasedMatcher → HasInputAnnotationCols
  47. final val inputCols: StringArrayParam

    columns that contain annotations necessary to run this annotator AnnotatorType is used both as input and output columns if not specified

    columns that contain annotations necessary to run this annotator AnnotatorType is used both as input and output columns if not specified

    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  48. final def isDefined(param: Param[_]): Boolean
    Definition Classes
    Params
  49. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  50. final def isSet(param: Param[_]): Boolean
    Definition Classes
    Params
  51. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  52. val lazyAnnotator: BooleanParam
    Definition Classes
    CanBeLazy
  53. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  54. def logDebug(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  55. def logDebug(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  56. def logError(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  57. def logError(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  58. def logInfo(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  59. def logInfo(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  60. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  61. def logTrace(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  62. def logTrace(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  63. def logWarning(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  64. def logWarning(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  65. def msgHelper(schema: StructType): String
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  66. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  67. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  68. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  69. def onTrained(model: RuleBasedMatcherModel, spark: SparkSession): Unit
    Definition Classes
    AnnotatorApproach
  70. val optionalInputAnnotatorTypes: Array[String]
    Definition Classes
    HasInputAnnotationCols
  71. val outputAnnotatorType: AnnotatorType
  72. final val outputCol: Param[String]
    Attributes
    protected
    Definition Classes
    HasOutputAnnotationCol
  73. val overlapStrategy: Param[String]
    Definition Classes
    RuleBasedMatcherParams
  74. lazy val params: Array[Param[_]]
    Definition Classes
    Params
  75. def parseKeyValueEntries(entries: Array[String], paramName: String, normalizeKeys: Boolean = true): Map[String, String]
    Attributes
    protected
    Definition Classes
    RuleBasedMatcherParams
  76. val rules: Param[String]
  77. val rulesResource: ExternalResourceParam
  78. def save(path: String): Unit
    Definition Classes
    MLWritable
    Annotations
    @Since( "1.6.0" ) @throws( ... )
  79. final def set(paramPair: ParamPair[_]): RuleBasedMatcher.this.type
    Attributes
    protected
    Definition Classes
    Params
  80. final def set(param: String, value: Any): RuleBasedMatcher.this.type
    Attributes
    protected
    Definition Classes
    Params
  81. final def set[T](param: Param[T], value: T): RuleBasedMatcher.this.type
    Definition Classes
    Params
  82. def setAlignmentMode(value: String): RuleBasedMatcher.this.type
    Definition Classes
    RuleBasedMatcherParams
  83. def setAttributeColumns(value: Array[String]): RuleBasedMatcher.this.type
    Definition Classes
    RuleBasedMatcherParams
  84. def setAttributeColumns(value: Map[String, String]): RuleBasedMatcher.this.type
    Definition Classes
    RuleBasedMatcherParams
  85. final def setDefault(paramPairs: ParamPair[_]*): RuleBasedMatcher.this.type
    Attributes
    protected
    Definition Classes
    Params
  86. final def setDefault[T](param: Param[T], value: T): RuleBasedMatcher.this.type
    Attributes
    protected[org.apache.spark.ml]
    Definition Classes
    Params
  87. def setExtraInputCols(value: Array[String]): RuleBasedMatcher.this.type
    Definition Classes
    HasInputAnnotationCols
  88. def setInputCols(value: Array[String]): RuleBasedMatcher.this.type
    Definition Classes
    RuleBasedMatcherParams
  89. final def setInputCols(value: String*): RuleBasedMatcher.this.type
    Definition Classes
    HasInputAnnotationCols
  90. def setLazyAnnotator(value: Boolean): RuleBasedMatcher.this.type
    Definition Classes
    CanBeLazy
  91. final def setOutputCol(value: String): RuleBasedMatcher.this.type

    Overrides annotation column name when transforming

    Overrides annotation column name when transforming

    Definition Classes
    HasOutputAnnotationCol
  92. def setOverlapStrategy(value: String): RuleBasedMatcher.this.type
    Definition Classes
    RuleBasedMatcherParams
  93. def setRules(value: String): RuleBasedMatcher.this.type
  94. def setRulesResource(path: String, readAs: Format = ReadAs.TEXT, options: Map[String, String] = Map("format" -> "text")): RuleBasedMatcher.this.type
  95. def setRulesResource(value: ExternalResource): RuleBasedMatcher.this.type
  96. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  97. def toString(): String
    Definition Classes
    Identifiable → AnyRef → Any
  98. def train(dataset: Dataset[_], recursivePipeline: Option[PipelineModel]): RuleBasedMatcherModel
    Definition Classes
    RuleBasedMatcher → AnnotatorApproach
  99. final def transformSchema(schema: StructType): StructType

    requirement for pipeline transformation validation.

    requirement for pipeline transformation validation. It is called on fit()

    Definition Classes
    AnnotatorApproach → PipelineStage
  100. def transformSchema(schema: StructType, logging: Boolean): StructType
    Attributes
    protected
    Definition Classes
    PipelineStage
    Annotations
    @DeveloperApi()
  101. val uid: String
    Definition Classes
    RuleBasedMatcher → Identifiable
  102. def validate(schema: StructType): Boolean

    takes a Dataset and checks to see if all the required annotation types are present.

    takes a Dataset and checks to see if all the required annotation types are present.

    schema

    to be validated

    returns

    True if all the required types are present, else false

    Attributes
    protected
    Definition Classes
    RuleBasedMatcher → AnnotatorApproach
  103. def validateInputColumns(schema: StructType): Boolean
    Attributes
    protected
    Definition Classes
    RuleBasedMatcherParams
  104. def validateInputColumnsOrThrow(schema: StructType): Unit
    Attributes
    protected
    Definition Classes
    RuleBasedMatcherParams
  105. def validatePatternSafetyOrThrow(rules: Seq[MatcherRule]): Unit
    Attributes
    protected
    Definition Classes
    RuleBasedMatcherParams
  106. def validateRuleAttributesOrThrow(rules: Seq[MatcherRule], schema: StructType): Unit
    Attributes
    protected
    Definition Classes
    RuleBasedMatcherParams
  107. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  108. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  109. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  110. def write: MLWriter
    Definition Classes
    DefaultParamsWritable → MLWritable

Inherited from RuleBasedMatcherParams

Inherited from CanBeLazy

Inherited from DefaultParamsWritable

Inherited from MLWritable

Inherited from HasOutputAnnotatorType

Inherited from HasOutputAnnotationCol

Inherited from HasInputAnnotationCols

Inherited from Estimator[RuleBasedMatcherModel]

Inherited from PipelineStage

Inherited from Logging

Inherited from Params

Inherited from Serializable

Inherited from Serializable

Inherited from Identifiable

Inherited from AnyRef

Inherited from Any

Ungrouped