JohnSnowLabs/spark-nlp-workshop

NER Demo notebooks fail on NerConverter

w2o-hbrashear opened this issue · 1 comments

When I run the some NER demo notebooks in CoLab, the code fails on NerConverter on setInputCols

Description

---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

[<ipython-input-24-af178ab2dc2d>](https://localhost:8080/#) in <module>
     21 
     22   ner_converter = NerConverter()\
---> 23       .setInputCols(['document', 'token', 'ner'])\
     24       .setOutputCol('ner_chunk')
     25 

1 frames

[/usr/local/lib/python3.7/dist-packages/sparknlp/common/annotator_properties.py](https://localhost:8080/#) in inputColsValidation(self, value)
     65             if actual_columns != expected_columns:
     66                 raise TypeError(
---> 67                     f"setInputCols in {self.uid} expecting {expected_columns} columns. "
     68                     f"Provided column amount: {actual_columns}. "
     69                     f"Which should be columns from the following annotators: {self.inputAnnotatorTypes}")

TypeError: setInputCols in NerConverter_b8ceba550877 expecting 0 columns. Provided column amount: 3. Which should be columns from the following annotators: []

Steps to Reproduce

Run the following demo notebooks in CoLab:

They are the first two NER options on https://nlp.johnsnowlabs.com/recognize_entitie

Not affected

Your Environment

  • Spark-NLP version: 4.2.3
  • Apache Spark version: 3.1.2
  • Operating System and version: CoLab
  • Deployment (Docker, Jupyter, Scala, pip, conda, etc.): CoLab

solved with 4.2.8 , and notebooks are updated