AttributeError: 'SparkSession' object has no attribute '_wrapped' when attempting CoNLL.readDataset()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 02:49 PM
I'm getting the error...
AttributeError: 'SparkSession' object has no attribute '_wrapped'
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<command-2311820097584616> in <cell line: 2>()
1 from sparknlp.training import CoNLL
----> 2 trainingData = CoNLL().readDataset(spark, 'dbfs:/FileStore/Users/tobiasc@slalom.com/HLS/nlp/data/coNLL_2003_eng.train')
3 trainingData.selectExpr(
4 "text",
5 "token.result as tokens",
/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/sparknlp/training/conll.py in readDataset(self, spark, path, read_as, partitions, storage_level)
141 jdf = self._java_obj.readDataset(jSession, path, read_as, partitions,
142 spark.sparkContext._getJavaStorageLevel(storage_level))
--> 143 return DataFrame(jdf, spark._wrapped)
144
When executing the following code...
from sparknlp.training import CoNLL
trainingData = CoNLL().readDataset(spark, 'dbfs:/FileStore/eng.train')
trainingData.selectExpr(
"text",
"token.result as tokens",
"pos.result as pos",
"label.result as label"
).show(3, False)
Can anyone help?
- Labels:
-
Object
-
Pyspark
-
Spark
-
Sparknlp
-
Sparksession
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2022 10:35 PM
this can happen in 10X version try to use 7.3 LTS and share your observation
and if it not working there try to create init script and load it to your databricks cluster so whenever your machine go up you can get advantage of that library because sometime due to network our library do not load in the cluster
Thanks
Aviral Bhardwaj

