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 getKeepMonth: Boolean

    Gets keepMonth param

  27. def getKeepYear: Boolean

    Gets keepYear param

  28. def getMaskingPolicy: String

    Gets maskingPolicy param.

  29. def getMode: String

    Gets mode param.

  30. def getObfuscateDate: Boolean

    Gets obfuscateDate param

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

    Gets region param.

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

    Gets selectiveObfuscationModes param.

  35. def getUnnormalizedDateMode: String

    Gets unnormalizedDateMode param.

  36. def getUseShiftDays: Boolean

    Gets useShiftDays param.

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

    Whether to keep the month intact when obfuscating date entities.

    Whether to keep the month intact when obfuscating date entities. If true, the month will remain unchanged during the obfuscation process. If false, the month will be modified along with the year and day. Default: false.

  44. val keepYear: BooleanParam

    Whether to keep the year intact when obfuscating date entities.

    Whether to keep the year intact when obfuscating date entities. If true, the year will remain unchanged during the obfuscation process. If false, the year will be modified along with the month and day. Default: false.

  45. 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'
  46. 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"
  47. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  48. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  49. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  50. 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

  51. lazy val params: Array[Param[_]]
    Definition Classes
    Params
  52. 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
  53. 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()

  54. final def set(paramPair: ParamPair[_]): LightDeIdentificationParams.this
    Attributes
    protected
    Definition Classes
    Params
  55. final def set(param: String, value: Any): LightDeIdentificationParams.this
    Attributes
    protected
    Definition Classes
    Params
  56. final def set[T](param: Param[T], value: T): LightDeIdentificationParams.this
    Definition Classes
    Params
  57. def setCustomFakers(value: HashMap[String, List[String]]): LightDeIdentificationParams.this
  58. 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")
     ))
  59. def setDateEntities(value: Array[String]): LightDeIdentificationParams.this

    Sets the value of dateEntities.

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

  60. final def setDefault(paramPairs: ParamPair[_]*): LightDeIdentificationParams.this
    Attributes
    protected
    Definition Classes
    Params
  61. final def setDefault[T](param: Param[T], value: T): LightDeIdentificationParams.this
    Attributes
    protected[org.apache.spark.ml]
    Definition Classes
    Params
  62. 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.

  63. def setKeepMonth(value: Boolean): LightDeIdentificationParams.this

    Sets whether to keep the month intact when obfuscating date entities.

    Sets whether to keep the month intact when obfuscating date entities. If true, the month will remain unchanged during the obfuscation process. If false, the month will be modified along with the year and day. Default: false.

  64. def setKeepYear(value: Boolean): LightDeIdentificationParams.this

    Sets whether to keep the year intact when obfuscating date entities.

    Sets whether to keep the year intact when obfuscating date entities. If true, the year will remain unchanged during the obfuscation process. If false, the year will be modified along with the month and day. Default: false.

  65. 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'
  66. 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"
  67. 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

  68. 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
  69. def setSelectiveObfuscationModes(value: HashMap[String, List[String]]): LightDeIdentificationParams.this
  70. 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)
  71. 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

  72. 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

  73. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  74. def toString(): String
    Definition Classes
    Identifiable → AnyRef → Any
  75. 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

  76. 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

  77. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  78. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  79. 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