0

I am using the SentimentDetector annotator on dataframe df which has a column text but I keep getting the following error

java.lang.IllegalArgumentException: requirement failed: Wrong or missing inputCols annotators in SentimentDetectorModel_c51007285c65

sentiment_detector =  SentimentDetectorModel().setInputCols(["text"]).setOutputCol("sentiment")
sentiment_detector.transform(df)

+----------------+---+-------------------+--------------------+--------------------+
id|len|       date|            id2|                text|
+----------------+---+-------------------+--------------------+--------------------+
|  20151|  8|2015-12-01 05:01:00|     08600|Adding Jobs ...|
|  20151|  9|2015-12-01 05:01:01|G1085,|Go Scripts S...|
+----------------+---+-------------------+--------------------+--------------------+
  • 1
    Looks like you need to supply the Tokens as well as the Sentence/Document. See the [docs](https://nlp.johnsnowlabs.com/docs/en/annotators#sentimentdetector) – CPak Apr 24 '20 at 03:34
  • 1
    Documentation is where I started but its sparse nature threw me off. Your comment inspired me to go over it again. Seems to be working. – nthobservation Apr 24 '20 at 23:23

0 Answers0