Description
This model detects and corrects spelling errors of drugs in your input text based on Norvig’s approach.
Predicted Entities
How to use
documentAssembler = DocumentAssembler()\
.setInputCol("text")\
.setOutputCol("document")
tokenizer = Tokenizer()\
.setInputCols("document")\
.setOutputCol("token")
spell = NorvigSweetingModel.pretrained("spellcheck_drug_norvig", "en", "clinical/models")\
.setInputCols("token")\
.setOutputCol("spell")\
pipeline = Pipeline(
stages = [
documentAssembler,
tokenizer,
spell])
model = pipeline.fit(spark.createDataFrame([['']]).toDF('text'))
lp = LightPipeline(model)
result = lp.annotate("You have to take Neutrcare and colfosrinum and a bit of Fluorometholne & Ribotril")
val documentAssembler = new DocumentAssembler()
.setInputCol("text")
.setOutputCol("document")
val tokenizer = new Tokenizer()
.setInputCols("document")
.setOutputCol("token")
val spell = new NorvigSweetingModel.pretrained("spellcheck_drug_norvig", "en", "clinical/models")
.setInputCols("token")
.setOutputCol("spell")
val pipeline = new Pipeline().setStages(Array(documentAssembler,tokenizer,spell))
val model = pipeline.fit(spark.createDataFrame([['']]).toDF('text'))
val lp = new LightPipeline(model)
val result = lp.annotate("You have to take Neutrcare and colfosrinum and a bit of Fluorometholne & Ribotril")
import nlu
nlu.load("en.spell.drug_norvig").predict("""You have to take Neutrcare and colfosrinum and a bit of Fluorometholne & Ribotril""")
Results
Original text : You have to take Neutrcare and colfosrinum and a bit of fluorometholne & Ribotril
Corrected text : You have to take Neutracare and colforsinum and a bit of fluorometholone & Rivotril
Model Information
Model Name: | spellcheck_drug_norvig |
Compatibility: | Healthcare NLP 3.2.2+ |
License: | Licensed |
Edition: | Official |
Input Labels: | [token] |
Output Labels: | [spell] |
Language: | en |
Case sensitive: | true |