Created
March 4, 2020 07:31
-
-
Save pramodbiligiri/bf19014a933ccc9184fd3c789351f3b0 to your computer and use it in GitHub Desktop.
Test code to load BertEmbedding in Scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on: https://gist.github.com/nlittlepoole/476242b479eb3bd70f6f3d44b2349322#file-custom_pipeline-py | |
val embeddings = BertEmbeddings.pretrained("bert_base_cased", "en", | |
"public/models"). | |
setInputCols("document", "token"). | |
setOutputCol("embeddings") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Exception in thread "main" java.lang.IllegalArgumentException: requirement failed: Can not find the resource to download please check the name!
at scala.Predef$.require(Predef.scala:224)
at com.johnsnowlabs.nlp.pretrained.ResourceDownloader$.downloadResource(ResourceDownloader.scala:316)
at com.johnsnowlabs.nlp.pretrained.ResourceDownloader$.downloadModel(ResourceDownloader.scala:355)
at com.johnsnowlabs.nlp.pretrained.ResourceDownloader$.downloadModel(ResourceDownloader.scala:350)
at com.johnsnowlabs.nlp.HasPretrained$class.pretrained(HasPretrained.scala:27)