Spark-nlp: Multi-language model glove_840B_300 not found

Created on 30 Mar 2020  ·  10Comments  ·  Source: JohnSnowLabs/spark-nlp

I have problems using the multi-language models Glove glove_840B_300 because I want use it for the italian language.
I' m trying to execute the following Pyspark lines code from Google Colab but I receive the following error. It iseems the model It's no longer available.

Could you check and help me?
Outlook-qq2dnfsk

Thank you!
Have a nice day!

Steps to Reproduce


*Open Google colab Notebook

  • Install java
    ! apt-get install -y openjdk-8-jdk-headless -qq > /dev/null
    os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-8-openjdk-amd64"
    os.environ["PATH"] = os.environ["JAVA_HOME"] + "/bin:" + os.environ["PATH"]
    ! java -version

  • Install pyspark
    ! pip install --ignore-installed pyspark==2.4.4

  • Install Spark NLP
    ! pip install --ignore-installed spark-nlp==2.4.4

    ! pip install --ignore-installed "com.johnsnowlabs.nlp:spark-nlp-gpu_2.11"==2.4.4

  • Quick SparkSession start
    import sparknlp

    spark = sparknlp.start()

spark = sparknlp.start(gpu=True)
print("Spark NLP version")
sparknlp.version()
print("Apache Spark version")
spark.version

*Libraries
from sparknlp.base import *
from sparknlp.annotator import *
from sparknlp.pretrained import PretrainedPipeline

*Try to load the pretrained model
embeddings = WordEmbeddingsModel.pretrained('glove_840B_300', lang='it')
Error received: glove_840B_300 download started this may take some time.
Can not find the model to download please check the name!

Context


Expermients

Your Environment

  • Spark NLP version: 2.4.4
  • Apache NLP version: 2.4.4
  • Java version (java -version): Java 8
  • Setup and installation (Pypi, Conda, Maven, etc.): Pypi
  • Operating System and version: Google Colab
  • Link to your project (if any):
question

All 10 comments

Please update the template with the required information.

Have you now all the informations required?

Thanks, @marcodeleonardis I also need the full code to reproduce this. One thing that is wrong is that you forgot to mention the lang. If you look at this repo, they all have the language as well:

https://github.com/JohnSnowLabs/spark-nlp-models

name=glove_840B_300, lang='xx'

But the error doesn't make sense, so could you please provide the steps to reproduce this error?

Oh, I see now, the language is missing so it couldn't find it to download. Just add lang=xx after the name and it will be fine.

PS: Our examples just in case: https://github.com/JohnSnowLabs/spark-nlp-workshop

I follow your suggestion but It still doesn't work as you can see:

immagine

I also update the steps useful to reproduce the error.

There is no Italian language for that model. The language is in front of each model, which in this case is xx. That is glove with 840 billion tokens and all the languages. Please follow the table for each model/pipeline.

Ok so how can i download and use that model? My first code line was this but I receive error.
immagine

I mentioned above! I left an example:
name=“glove_840B_300”, lang='xx'

Please read the docs and look at the examples, I mentioned all the necessary references.

Ok. Now i understand e It's fine. Thanks for your support.

You are welcome

Was this page helpful?
0 / 5 - 0 ratings