title: spark-nlp 'JavaPackage' object is not callable
body: <p>I am using jupyter lab to run spark-nlp text analysis. At the moment I am just running the sample code:</p>
  <pre><code>import sparknlp
  from pyspark.sql import SparkSession
  from sparknlp.pretrained import PretrainedPipeline
  #create or get Spark Session
  #spark = sparknlp.start()
  spark = SparkSession.builder \
      .appName(&quot;ner&quot;)\
      .master(&quot;local[4]&quot;)\
      .config(&quot;spark.driver.memory&quot;,&quot;8G&quot;)\
      .config(&quot;spark.driver.maxResultSize&quot;, &quot;2G&quot;) \
      .config(&quot;spark.jars.packages&quot;, &quot;com.johnsnowlabs.nlp:spark-nlp_2.11:2.6.5&quot;)\
      .config(&quot;spark.kryoserializer.buffer.max&quot;, &quot;500m&quot;)\
      .getOrCreate()
  print(&quot;sparknlp version&quot;, sparknlp.version(), &quot;sparkversion&quot;, spark.version)
  
  #download, load, and annotate a text by pre-trained pipeline
  pipeline = PretrainedPipeline('recognize_entities_dl', 'en')
  result = pipeline.annotate('Harry Potter is a great movie')
  </code></pre>
  <p>I get the following error:</p>
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-4-bfd6884be04c&gt; in &lt;module&gt;
       15 
       16 #download, load, and annotate a text by pre-trained pipeline
  ---&gt; 17 pipeline = PretrainedPipeline('recognize_entities_dl', 'en')
       18 result = pipeline.annotate('Harry Potter is a great movie')
  
  ~/.pyenv/versions/3.7.9/lib/python3.7/site-packages/sparknlp/pretrained.py in __init__(self, name, lang, remote_loc, parse_embeddings, disk_location)
       89     def __init__(self, name, lang='en', remote_loc=None, parse_embeddings=False, disk_location=None):
       90         if not disk_location:
  ---&gt; 91             self.model = ResourceDownloader().downloadPipeline(name, lang, remote_loc)
       92         else:
       93             self.model = PipelineModel.load(disk_location)
  
  ~/.pyenv/versions/3.7.9/lib/python3.7/site-packages/sparknlp/pretrained.py in downloadPipeline(name, language, remote_loc)
       49     def downloadPipeline(name, language, remote_loc=None):
       50         print(name + &quot; download started this may take some time.&quot;)
  ---&gt; 51         file_size = _internal._GetResourceSize(name, language, remote_loc).apply()
       52         if file_size == &quot;-1&quot;:
       53             print(&quot;Can not find the model to download please check the name!&quot;)
  
  ~/.pyenv/versions/3.7.9/lib/python3.7/site-packages/sparknlp/internal.py in __init__(self, name, language, remote_loc)
      190     def __init__(self, name, language, remote_loc):
      191         super(_GetResourceSize, self).__init__(
  --&gt; 192             &quot;com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.getDownloadSize&quot;, name, language, remote_loc)
      193 
      194 
  
  ~/.pyenv/versions/3.7.9/lib/python3.7/site-packages/sparknlp/internal.py in __init__(self, java_obj, *args)
      127         super(ExtendedJavaWrapper, self).__init__(java_obj)
      128         self.sc = SparkContext._active_spark_context
  --&gt; 129         self._java_obj = self.new_java_obj(java_obj, *args)
      130         self.java_obj = self._java_obj
      131 
  
  ~/.pyenv/versions/3.7.9/lib/python3.7/site-packages/sparknlp/internal.py in new_java_obj(self, java_class, *args)
      137 
      138     def new_java_obj(self, java_class, *args):
  --&gt; 139         return self._new_java_obj(java_class, *args)
      140 
      141     def new_java_array(self, pylist, java_class):
  
  ~/.pyenv/versions/3.7.9/lib/python3.7/site-packages/pyspark/ml/wrapper.py in _new_java_obj(java_class, *args)
       67             java_obj = getattr(java_obj, name)
       68         java_args = [_py2java(sc, arg) for arg in args]
  ---&gt; 69         return java_obj(*java_args)
       70 
       71     @staticmethod
  
  TypeError: 'JavaPackage' object is not callable
  </code></pre>
  <p>I read a few of the github issues developers raised in spark-nlp repo, but the fixes are not working for me. I am wondering if the use of pyenv is causing problems, but it works for everything else.
  My jupyter lab is launched like so:
  <code>/home/myuser/.pyenv/shims/jupyter lab --no-browser --allow-root --notebook-dir /home/myuser/workdir/notebooks</code></p>
  <p><strong>My env configuration:</strong></p>
  <p>ubuntu: <code>20.10</code>
  Apache Spark: <code>3.0.1</code>
  pyspark: <code>2.4.4</code>
  spark-nlp: <code>2.6.5</code>
  pyenv: <code>1.2.21</code></p>
  <p>Java:</p>
  <pre><code>openjdk 11.0.9 2020-10-20
  OpenJDK Runtime Environment (build 11.0.9+10-post-Ubuntu-0ubuntu1)
  OpenJDK 64-Bit Server VM (build 11.0.9+10-post-Ubuntu-0ubuntu1, mixed mode, sharing)
  </code></pre>
  <p>jupyter:</p>
  <pre><code>jupyter core     : 4.7.0
  jupyter-notebook : 6.1.5
  qtconsole        : 5.0.1
  ipython          : 7.19.0
  ipykernel        : 5.4.2
  jupyter client   : 6.1.7
  jupyter lab      : 2.2.9
  nbconvert        : 6.0.7
  ipywidgets       : 7.5.1
  nbformat         : 5.0.8
  traitlets        : 5.0.5
  </code></pre>
  <p>I appreciate your help .. thank you</p>