Skip to content

Commit

Permalink
Small fix: remove empty sentences from classification
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksei-ai committed Dec 22, 2017
1 parent c17ddac commit c02591b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c02591b

Please sign in to comment.