diff --git a/src/main/scala/com/johnsnowlabs/nlp/annotators/sda/vivekn/ViveknSentimentModel.scala b/src/main/scala/com/johnsnowlabs/nlp/annotators/sda/vivekn/ViveknSentimentModel.scala index b5dd23c6ec216a..213f8e9017a1e0 100644 --- a/src/main/scala/com/johnsnowlabs/nlp/annotators/sda/vivekn/ViveknSentimentModel.scala +++ b/src/main/scala/com/johnsnowlabs/nlp/annotators/sda/vivekn/ViveknSentimentModel.scala @@ -66,7 +66,7 @@ class ViveknSentimentModel(override val uid: String) extends AnnotatorModel[Vive override def annotate(annotations: Seq[Annotation]): Seq[Annotation] = { val sentences = Tokenized.unpack(annotations) - sentences.map(sentence => { + sentences.filter(s => s.indexedTokens.nonEmpty).map(sentence => { Annotation( annotatorType, sentence.indexedTokens.map(t => t.begin).min,