t

com.johnsnowlabs.nlp.annotators.deid

LightDeIdentificationParams

trait LightDeIdentificationParams extends Params

A trait that contains params that LightDeIdentification has.

Self Type
LightDeIdentificationParams with HasFeatures
See also

LightDeIdentification

Linear Supertypes
Params, Serializable, Serializable, Identifiable, AnyRef, Any
Known Subclasses
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. LightDeIdentificationParams
  2. Params
  3. Serializable
  4. Serializable
  5. Identifiable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def copy(extra: ParamMap): Params
    Definition Classes
    Params
  2. abstract val uid: String
    Definition Classes
    Identifiable

Concrete 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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. final def clear(param: Param[_]): LightDeIdentificationParams.this
    Definition Classes
    Params
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. def copyValues[T <: Params](to: T, extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  9. val customFakers: MapFeature[String, Array[String]]

    The dictionary of custom fakers to specify the obfuscation terms for the entities.

    The dictionary of custom fakers to specify the obfuscation terms for the entities. You can specify the entity and the terms to be used for obfuscation.

  10. val dateEntities: StringArrayParam

    List of date entities.

    List of date entities. Default: Array("DATE", "DOB", "DOD")

  11. final def defaultCopy[T <: Params](extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  14. def explainParam(param: Param[_]): String
    Definition Classes
    Params
  15. def explainParams(): String
    Definition Classes
    Params
  16. final def extractParamMap(): ParamMap
    Definition Classes
    Params
  17. final def extractParamMap(extra: ParamMap): ParamMap
    Definition Classes
    Params
  18. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. val fixedMaskLength: IntParam

    Select the fixed mask length: this is the length of the masking sequence that will be used when the 'fixed_length_chars' masking policy is selected.

  20. final def get[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  21. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. def getCustomFakers: Map[String, Array[String]]

    Gets customFakers param.

    Gets customFakers param.

    Attributes
    protected
  23. def getDateEntities: Array[String]

    Gets dateEntities param.

  24. final def getDefault[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  25. def getFixedMaskLength: Int

    Gets fixedMaskLength param.

  26. def getMaskingPolicy: String

    Gets maskingPolicy param.

  27. def getMode: String

    Gets mode param.

  28. def getObfuscateDate: Boolean

    Gets obfuscateDate param

  29. final def getOrDefault[T](param: Param[T]): T
    Definition Classes
    Params
  30. def getParam(paramName: String): Param[Any]
    Definition Classes
    Params
  31. def getRegion: String

    Gets region param.

  32. def getSelectiveObfuscationModes: Option[Map[String, Array[String]]]

    Gets selectiveObfuscationModes param.

  33. def getUnnormalizedDateMode: String

    Gets unnormalizedDateMode param.

  34. def getUseShiftDays: Boolean

    Gets useShiftDays param.

  35. final def hasDefault[T](param: Param[T]): Boolean
    Definition Classes
    Params
  36. def hasParam(paramName: String): Boolean
    Definition Classes
    Params
  37. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  38. final def isDefined(param: Param[_]): Boolean
    Definition Classes
    Params
  39. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  40. final def isSet(param: Param[_]): Boolean
    Definition Classes
    Params
  41. val maskingPolicy: Param[String]

    Select the masking policy:

    Select the masking policy:

    • 'entity_labels': Replace the values with the entity value.
    • 'same_length_chars': Replace the name with the asterix with same length minus two plus brackets on both end.If the entity is less than 3 chars (like Jo, or 5), we can just use asterix without brackets.
    • 'fixed_length_chars': Replace the obfuscated entity with a masking sequence composed of a fixed number of asterisk.
    • Default: 'entity_labels'
  42. val mode: Param[String]

    Mode for Anonymizer ['mask' or 'obfuscate'].

    Mode for Anonymizer ['mask' or 'obfuscate']. Default: 'mask'

    • Mask mode: The entities will be replaced by their entity types.
    • Obfuscate mode: The entity is replaced by an obfuscator's term.
    Example:
    1. Given the following text: "David Hale visited EEUU a couple of years ago"

      • Mask mode: "<PERSON> visited <COUNTRY> a couple of years ago"
      • Obfuscate mode: "Bryan Johnson visited Japan a couple of years ago"
  43. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  44. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  45. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  46. val obfuscateDate: BooleanParam

    When mode=="obfuscate" whether to obfuscate dates or not.

    When mode=="obfuscate" whether to obfuscate dates or not. This param helps in consistency to make dateFormats more visible. When setting to true, make sure dateFormats param fits the needs. If the value is true and obfuscation is failed, then unnormalizedDateMode will be activated. When setting to 'false', then the date will be masked to <DATE>. Default: false

  47. lazy val params: Array[Param[_]]
    Definition Classes
    Params
  48. val region: Param[String]

    With this property, you can select particular dateFormats.

    With this property, you can select particular dateFormats. This property is especially used when obfuscating dates. You can decide whether the first part of 11/11/2023 is a day or the second part is a day when obfuscating dates.

    • The values are following:
    • 'eu' for European Union
    • 'us' for USA
  49. val selectiveObfuscationModes: StructFeature[Map[String, Array[String]]]

    The dictionary of modes to enable multi-mode deidentification.

    The dictionary of modes to enable multi-mode deidentification.

    • 'obfuscate': Replace the values with random values.
    • 'mask_same_length_chars': Replace the name with the asterix with same length minus two plus brackets on both end.
    • 'entity_labels': Replace the values with the entity value.
    • 'mask_fixed_length_chars': Replace the name with the asterix with fixed length. You can also invoke "setFixedMaskLength()"
    • 'skip': Skip the entities (intact)

    The entities which have not been given in dictionary will deidentify according to setMode()

  50. final def set(paramPair: ParamPair[_]): LightDeIdentificationParams.this
    Attributes
    protected
    Definition Classes
    Params
  51. final def set(param: String, value: Any): LightDeIdentificationParams.this
    Attributes
    protected
    Definition Classes
    Params
  52. final def set[T](param: Param[T], value: T): LightDeIdentificationParams.this
    Definition Classes
    Params
  53. def setCustomFakers(value: HashMap[String, List[String]]): LightDeIdentificationParams.this
  54. def setCustomFakers(value: Map[String, Array[String]]): LightDeIdentificationParams.this

    Sets the value of customFakers.

    Sets the value of customFakers. The dictionary of custom fakers to specify the obfuscation terms for the entities. You can specify the entity and the terms to be used for obfuscation.

    Example:

    new LightDeIdentification()
     .setInputCols(Array("ner_chunk", "sentence")).setOutputCol("dei")
     .setMode("obfuscate")
     .setObfuscateRefSource("custom")
     .setCustomFakers(Map(
         "NAME" -> Array("George", "Taylor"),
         "SCHOOL" -> Array("Oxford", "Harvard"),
         "city" -> Array("ROMA")
     ))
  55. def setDateEntities(value: Array[String]): LightDeIdentificationParams.this

    Sets the value of dateEntities.

    Sets the value of dateEntities. Default: Array("DATE", "DOB", "DOD")

  56. final def setDefault(paramPairs: ParamPair[_]*): LightDeIdentificationParams.this
    Attributes
    protected
    Definition Classes
    Params
  57. final def setDefault[T](param: Param[T], value: T): LightDeIdentificationParams.this
    Attributes
    protected[org.apache.spark.ml]
    Definition Classes
    Params
  58. def setFixedMaskLength(value: Int): LightDeIdentificationParams.this

    Sets the value of fixedMaskLength.

    Sets the value of fixedMaskLength. This is the length of the masking sequence that will be used when the 'fixed_length_chars' masking policy is selected.

  59. def setMaskingPolicy(value: String): LightDeIdentificationParams.this

    Select the masking policy:

    Select the masking policy:

    • 'entity_labels': Replace the values with the entity value.
    • 'same_length_chars': Replace the name with the asterix with same length minus two plus brackets on both end.If the entity is less than 3 chars (like Jo, or 5), we can just use asterix without brackets.
    • 'fixed_length_chars': Replace the obfuscated entity with a masking sequence composed of a fixed number of asterisk.
    • Default: 'entity_labels'
  60. def setMode(m: String): LightDeIdentificationParams.this

    Mode for Anonymizer ['mask'|'obfuscate'].

    Mode for Anonymizer ['mask'|'obfuscate']. Default: 'mask'

    • Mask mode: The entities will be replaced by their entity types.
    • Obfuscate mode: The entity is replaced by an obfuscator's term.
    Example:
    1. Given the following text: "David Hale visited EEUU a couple of years ago"

      • Mask mode: "<PERSON> visited <COUNTRY> a couple of years ago"
      • Obfuscate mode: "Bryan Johnson visited Japan a couple of years ago"
  61. def setObfuscateDate(s: Boolean): LightDeIdentificationParams.this

    When mode=="obfuscate" whether to obfuscate dates or not.

    When mode=="obfuscate" whether to obfuscate dates or not. This param helps in consistency to make dateFormats more visible. When setting to true, make sure dateFormats param fits the needs. If the value is true and obfuscation is failed, then unnormalizedDateMode will be activated. When setting to 'false' then the date will be masked to <DATE> . Default: false

  62. def setRegion(s: String): LightDeIdentificationParams.this

    With this property, you can select particular dateFormats.

    With this property, you can select particular dateFormats. This property is especially used when obfuscating dates. You can decide whether the first part of 11/11/2023 is a day or the second part is a day when obfuscating dates. The values are following:

    • 'eu' for European Union
    • 'us' for USA
  63. def setSelectiveObfuscationModes(value: HashMap[String, List[String]]): LightDeIdentificationParams.this
  64. def setSelectiveObfuscationModes(value: Map[String, Array[String]]): LightDeIdentificationParams.this

    Sets the value of selectiveObfuscationModes.

    Sets the value of selectiveObfuscationModes. The dictionary of modes to enable multi-mode deidentification.

    • 'obfuscate': Replace the values with random values.
    • 'mask_same_length_chars': Replace the name with the asterix with same length minus two plus brackets on both end.
    • 'entity_labels': Replace the values with the entity value.
    • 'mask_fixed_length_chars': Replace the name with the asterix with fixed length. You should also invoke "setFixedMaskLength()"
    • 'skip': Skip the entities (intact)

    The entities which have not been given in dictionary will deidentify according to setMode()

    Example:

    val deIdentification = new LightDeIdentification()
     .setInputCols(Array("ner_chunk", "sentence")).setOutputCol("dei")
     .setMode("mask")
     .setSelectiveObfuscationModes(Map(
         "OBFUSCATE" -> Array("PHONE", "email"),
         "mask_entity_labels" -> Array("NAME", "CITY"),
         "skip" -> Array("id", "idnum"),
         "mask_same_length_chars" -> Array("fax"),
         "mask_fixed_length_chars" -> Array("zip")
     ))
     .setFixedMaskLength(4)
  65. def setUnnormalizedDateMode(mode: String): LightDeIdentificationParams.this

    The mode to use if the date is not formatted.

    The mode to use if the date is not formatted. Options: [mask, obfuscate, skip] Default: obfuscate

  66. def setUseShiftDays(s: Boolean): LightDeIdentificationParams.this

    Sets the value of useShiftDays.

    Sets the value of useShiftDays. Whether to use the random shift day when the document has this in its metadata. DocumentHashCoder can create 'dateshift' based on the document. Default: false

  67. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  68. def toString(): String
    Definition Classes
    Identifiable → AnyRef → Any
  69. val unnormalizedDateMode: Param[String]

    The mode to use if the date is not formatted.

    The mode to use if the date is not formatted. Options: [mask, obfuscate, skip] Default: obfuscate

  70. val useShiftDays: BooleanParam

    Whether to use the random shift day when the document has this in its metadata.

    Whether to use the random shift day when the document has this in its metadata. DocumentHashCoder can create 'dateshift' based on the document. Default: false

  71. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  72. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  73. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Params

Inherited from Serializable

Inherited from Serializable

Inherited from Identifiable

Inherited from AnyRef

Inherited from Any

Parameters

Parameter setters

Parameter getters

Ungrouped