Packages

package windowed

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. class WindowedSentenceModel extends AnnotatorModel[WindowedSentenceModel] with CheckLicense with HasSimpleAnnotate[WindowedSentenceModel] with WindowedParams with HasFeatures with FilteringParams

    The WindowedSentenceModel class is used to combine a series of sentences based on specific window configurations.

    The WindowedSentenceModel class is used to combine a series of sentences based on specific window configurations. Returns the joined results after windowing its inputs

    Example

      val documentAssembler = new DocumentAssembler()
        .setInputCol("text")
        .setOutputCol("document")
      val sentenceDetector = new SentenceDetector()
        .setInputCols("document")
        .setOutputCol("sentence")
      val windowedSentence = new WindowedSentenceModel()
        .setWindowSize(1)
        .setInputCols("sentence")
        .setOutputCol("windowed")
        .setGlueString(":::")
      val flattener = new Flattener()
        .setInputCols("five")
    
      val pipeline = new Pipeline().setStages(Array(
          documentAssembler,
          sentenceDetector,
          windowedSentence,
          flattener))
          val text = "A 28-year-old female with a history of gestational diabetes mellitus diagnosed eight years. " +
                    "Two weeks prior to presentation respiratory tract infection . " +
                     "She was on for HTG . " +
                    "She had been of presentation ." +
                    "examination benign with no  or rigidity . "
      val data = spark.createDataFrame(Array(Tuple1(text))).toDF("text")
    
      val model = pipeline.fit(data).transform(data)
      model.show(false)
    +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+--------+----------------------+
     |windowed_result                                                                                                                                                                       |five_begin|five_end|five_metadata_sentence|
     +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+--------+----------------------+
     |A 28-year-old female with a history of gestational diabetes mellitus diagnosed eight years.:::Two weeks prior to presentation respiratory tract infection .                       |0         |152     |0                     |
     |A 28-year-old female with a history of gestational diabetes mellitus diagnosed eight years.:::Two weeks prior to presentation respiratory tract infection .:::She was on for HTG .|0         |173     |1                     |
     |Two weeks prior to presentation respiratory tract infection .:::She was on for HTG .:::She had been of presentation .                                                             |92        |204     |2                     |
     |She was on for HTG .:::She had been of presentation .:::examination benign with no  or rigidity .                                                                                 |154       |245     |3                     |
     |She had been of presentation .:::examination benign with no  or rigidity .                                                                                                        |175       |245     |4                     |
     +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+--------+----------------------+

Value Members

  1. object WindowedSentenceModel extends ParamsAndFeaturesReadable[WindowedSentenceModel] with Serializable

Ungrouped