python-3.xjupyter-notebookpytorchtensorboardseq2seq

OSError: [E050] Can't find model 'de'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory


So I am trying to make a seq to seq model for translating german to english using pytorch on online notebook like kaggle notebook and google colab

import torch
import torch.nn as nn
import torch.optim as optim
from torchtext.datasets import Multi30k
from torchtext.data import Field, BucketIterator
import numpy as np
import spacy
import random
from torch.utils.tensorboard import SummaryWriter  # to print to tensorboard

Libraries imported, when i load dataset using the function with spacy, as below,

spacy_ger = spacy.load("de")
spacy_eng = spacy.load("en")

This error comes. : OSError: [E050] Can't find model 'de'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

Everywhere, an explanation is given for 'en', but not for 'de'. If anyone could help with this.

Specification:

Package : Version

Thanks in advance for helping.


Solution

  • so after whole one month, trying on other things and exploring issues and questions related to this topic, I found a way to do so,

      import spacy.cli 
      spacy.cli.download("en_core_web_md")
    

    With this method, you can use and import any spacy model, whether medium-sized or larger size datasets also, which always gives an error if you try to import the dataset using spacy.load because it is not effective for loading datasets other then sm or smallest size datasets in Google colab or Kaggle notebook or any other online notebook.