Comments (9)
Hello, thanks for reporting the issue. I am taking a look at this issue, however I can't seem to reproduce it on my end. I just copy and pasted your code (and correcting the val data line...)
Although I agree documentation should be updated, and I also think the default corpus should be used when not provided, I get:
scala> pipeline.fit(data).transform(data).show()
java.lang.Exception: Empty corpus for POS
at com.johnsnowlabs.nlp.annotators.pos.perceptron.PerceptronApproach$.retrievePOSCorpus(PerceptronApproach.scala:249)
at com.johnsnowlabs.nlp.annotators.pos.perceptron.PerceptronApproach.train(PerceptronApproach.scala:84)
at com.johnsnowlabs.nlp.annotators.pos.perceptron.PerceptronApproach.train(PerceptronApproach.scala:22)
at com.johnsnowlabs.nlp.AnnotatorApproach.fit(AnnotatorApproach.scala:28)
at org.apache.spark.ml.Pipeline$$anonfun$fit$2.apply(Pipeline.scala:153)
at org.apache.spark.ml.Pipeline$$anonfun$fit$2.apply(Pipeline.scala:149)
at scala.collection.Iterator$class.foreach(Iterator.scala:893)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
at scala.collection.IterableViewLike$Transformed$class.foreach(IterableViewLike.scala:44)
at scala.collection.SeqViewLike$AbstractTransformed.foreach(SeqViewLike.scala:37)
at org.apache.spark.ml.Pipeline.fit(Pipeline.scala:149)
... 54 elided
from spark-nlp.
The problem seems to be related to resources not reading directory file names outside our test environment. We expect the list of file names inside a directory.
scala> import scala.io.Source
scala> val s = getClass.getResourceAsStream("/anc-pos-corpus")
scala> val t = Source.fromInputStream(s)("UTF-8")
scala> t.isEmpty
res4: Boolean = true
where pointing to /anc-pos-corpus/1400.txt would lead correctly.
A workaround is for now, manually pointing to src/main/resources/anc-pos-corpus using setCorpusPath() but this should definetly work out by default
Will keep investigating
from spark-nlp.
This fix will resolve reading defaults from provided resources
from spark-nlp.
Hi @saifjsl,
Is your merged commits included in version 1.2.3 on Maven? Cause in the latest version I have to copy anc-pos-corpus
directory to my resources and manually pointed to what you mentioned here.
Many thanks.
from spark-nlp.
hey @maziyarpanahi thanks,
No, we did not make any release since that issue. We are quite busy on December but will retake activity soon :)
from spark-nlp.
No problem at all mate! I was just making sure I’m not missing something :)
Thank you and have a great day.
from spark-nlp.
The changes are in master, so I'm closing this issue.
from spark-nlp.
Works for me, I haven't had the time to retest this yet. Thanks for fixing!
from spark-nlp.
Thanks for including this in your next release, defaulting to standard Corpus a huge plus.
from spark-nlp.
Related Issues (20)
- SparkNLP Embeddings inference 3X slower than with pandas_udf HOT 3
- EntityRuler fails two basic tests HOT 3
- Show an error of 'GLIBC_2.27 not found' when pretrained model download in AWS EMR HOT 2
- Onnx models fail when saving transformer
- Hardcoded column name in DocumentSimilarityRanker annotator
- ERROR TorrentBroadcast: Store broadcast broadcast_5 fail, remove all pieces of the broadcast HOT 7
- Scala 2.13 support HOT 1
- org.apache.spark.SparkException: [FAILED_EXECUTE_UDF] HOT 3
- DependencyParserApproach throws "IllegalArgumentException: For input string: "_"" when training with CONLLU dataset HOT 5
- When Attempting to loadSavedModel, I Encountered 'java.lang.Exception: Could Not Retrieve the SavedModelBundle + () HOT 15
- Importing models into Spark NLP in TensorFlow and ONNX formats
- MultiClassifierDLApproach not transforming every row of my dataset HOT 1
- An error occurred while calling z:com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.downloadModel. : java.lang.UnsatisfiedLinkError: no jnitensorflow in java.library.path: /Users/alexc./Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:. HOT 1
- KMeans throws “Column features must be of type equal to one of the following types” HOT 1
- Cache mechanism is not working related to metadata.json in s3 HOT 3
- XLMRoberta embeddings not differentiating between different sentences
- It seems the model is downloaded every time the program starts - any way to cache? HOT 1
- NerDLModel don't load a pretrained NerDLAproach HOT 2
- BartTransformer - Import to SparkNLP HOT 1
- Can not find the model to download bge-m3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spark-nlp.