spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

Code from Training Models documentation throws error

Open hermes-z opened this issue 7 years ago • 2 comments

Copying and pasting the following code from https://spacy.io/usage/training#basics:

git clone https://github.com/UniversalDependencies/UD_Spanish-AnCora
mkdir ancora-json
python -m spacy convert UD_Spanish-AnCora/es_ancora-ud-train.conllu ancora-json
python -m spacy convert UD_Spanish-AnCora/es_ancora-ud-dev.conllu ancora-json
mkdir models
python -m spacy train es models ancora-json/es_ancora-ud-train.json ancora-json/es_ancora-ud-dev.json

It throws the following error:

    corpus = GoldCorpus(train_path, dev_path, limit=n_examples)
  File "gold.pyx", line 112, in spacy.gold.GoldCorpus.__init__
  File "gold.pyx", line 125, in spacy.gold.GoldCorpus.write_msgpack
KeyError: 1

Spacy version: 2.1.3 Python version: 3.6.6 Platform: Darwin-17.7.0-x86_64-i386-64bit Running in a clean virtual environment

hermes-z avatar Apr 26 '19 08:04 hermes-z

Thanks for the report. This seems to be the same issue as #3523, which was already fixed on master. In the meantime, you can add explicitly -t json to the spacy convert command.

ines avatar Apr 26 '19 08:04 ines

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar May 26 '19 08:05 lock[bot]