package logreg
- Alphabetic
- Public
- All
Type Members
-
class
AssertionLogRegApproach extends AnnotatorApproach[AssertionLogRegModel] with Windowing with CheckLicense
This is a classification method, which uses LogisticRegression algorithm Contains all the methods for training a AssertionLogRegModel, together with trainWithChunk, trainWithStartEnd.
This is a classification method, which uses LogisticRegression algorithm Contains all the methods for training a AssertionLogRegModel, together with trainWithChunk, trainWithStartEnd.
Example
Training with Glove Embeddings
First define pipeline stages to extract embeddings and text chunks
val documentAssembler = new DocumentAssembler() .setInputCol("text") .setOutputCol("document") val tokenizer = new Tokenizer() .setInputCols("document") .setOutputCol("token") val glove = WordEmbeddingsModel.pretrained("embeddings_clinical", "en", "clinical/models") .setInputCols("document", "token") .setOutputCol("word_embeddings") .setCaseSensitive(false) val chunkAssembler = new Doc2Chunk() .setInputCols("document") .setChunkCol("target") .setOutputCol("chunk")
Then the AssertionLogRegApproach model is defined. Label column is needed in the dataset for training.
val assertion = new AssertionLogRegApproach() .setLabelCol("label") .setInputCols("document", "chunk", "word_embeddings") .setOutputCol("assertion") .setReg(0.01) .setBefore(11) .setAfter(13) .setStartCol("start") .setEndCol("end") val assertionPipeline = new Pipeline().setStages(Array( documentAssembler, sentenceDetector, tokenizer, embeddings, nerModel, nerConverter, assertion )) val assertionModel = assertionPipeline.fit(dataset)
-
class
AssertionLogRegModel extends Model[AssertionLogRegModel] with RawAnnotator[AssertionLogRegModel] with Windowing with HasStorageRef with CanBeLazy with CheckLicense
This is a main class in AssertionLogReg family.
This is a main class in AssertionLogReg family. Logarithmic Regression is used to extract Assertion Status from extracted entities and text. AssertionLogRegModel requires DOCUMENT, CHUNK and WORD_EMBEDDINGS type annotator inputs, which can be obtained by e.g a DocumentAssembler, NerConverter and WordEmbeddingsModel. The result is an assertion status annotation for each recognized entity. Possible values are
"Negated", "Affirmed" and "Historical"
.Unlike the DL Model, this class does not extend AnnotatorModel. Instead it extends the RawAnnotator, that's why the main point of interest is method transform().
At the moment there are no pretrained models available for this class. Please refer to AssertionLogRegApproach to train your own model.
- See also
AssertionLogRegApproach to train a custom model
AssertionDLModel for deep learning extraction
- case class Datapoint(sentence: String, target: String, label: String, start: Int, end: Int) extends Product with Serializable
-
class
NegexDatasetReader extends Serializable
Reader for this dataset, https://github.com/mongoose54/negex/blob/master/genConText/rsAnnotations-1-120-random.txt
- trait ReadablePretrainedAssertionLogReg extends ParamsAndFeaturesReadable[AssertionLogRegModel] with HasPretrained[AssertionLogRegModel]
-
trait
Windowing extends Serializable
Created by jose on 24/11/17.
Value Members
- object AssertionLogRegApproach extends DefaultParamsReadable[AssertionLogRegApproach] with Serializable
- object AssertionLogRegModel extends ReadablePretrainedAssertionLogReg with Serializable