package normalizer

  1. Alphabetic
  1. Public
  2. All

Type Members

  1. class DateNormalizer extends AnnotatorModel[DateNormalizer] with HasSimpleAnnotate[DateNormalizer]

    Try to normalize dates in chunks annotations.

    Try to normalize dates in chunks annotations. The expected format for the date will be YYYY/MM/DD. If the date is normalized then field normalized in metadata will be true else will be false.


    Define a pipeline with 2 different NER models with a ChunkMergeApproach at the end

    val df = Seq(("08/02/2018"),("11/2018"),("11/01/2018"),("next monday"),("today"),("next week")).toDF("text")
    val documentAssembler = new DocumentAssembler().setInputCol("text").setOutputCol("document")
    val chunksDF = documentAssembler
                                                              (aa:Seq[Annotation]) =>
                                                       ann => ann.copy(annotatorType = CHUNK)
    val dateNormalizerModel = new DateNormalizer()
    val dateDf = dateNormalizerModel.transform(chunksDF)

    Show results"chunk_date.result","text").show()
      |       result|       text|
      | [08/02/2018]| 08/02/2018|
      |    [11/2018]|    11/2018|
      | [11/01/2018]| 11/01/2018|
      |[next monday]|next monday|
      |      [today]|      today|
      |  [next week]|  next week|
  2. case class MyCalendar(year: Try[Int], month: Try[Int], day: Try[Int]) extends Product with Serializable

Value Members

  1. object DateHelper