doccano / doccano/doccano-transformer

No module named spacy.gold

Open
#35 14 comments 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
108
Forks
34
PR merge metrics
No merged PRs in 30d

Description

Environment
---------

* Operating System: Windows
* Python Version Used: 3.9.13
* Spacy Version Used: 3.4
* doccano-transformer Version: module 'doccano_transformer' has no attribute '__version__'

When importing `from doccano_transformer.datasets import NERDataset` I receive an error

ModuleNotFoundError Traceback (most recent call last)
Cell In [8], line 1
----> 1 from doccano_transformer.datasets import NERDataset
2 from doccano_transformer.utils import read_jsonl

File c:\Users\yana.stamenova\work-data\RnD_Models\venv_new\lib\site-packages\doccano_transformer\datasets.py:5
2 import json
3 from typing import Any, Callable, Iterable, Iterator, List, Optional, TextIO
----> 5 from doccano_transformer.examples import Example, NERExample
8 class Dataset:
9 def __init__(
10 self,
11 filepath: str,
12 encoding: Optional[str] = 'utf-8',
13 transformation_func: Optional[Callable[[TextIO], Iterable[Any]]] = None
14 ) -> None:

File c:\Users\yana.stamenova\work-data\RnD_Models\venv_new\lib\site-packages\doccano_transformer\examples.py:4
1 from collections import defaultdict
2 from typing import Callable, Iterator, List, Optional
----> 4 from spacy.gold import biluo_tags_from_offsets
6 from doccano_transformer import utils
9 class Example:

**ModuleNotFoundError: No module named 'spacy.gold'**

**gold** is part of 2.x versions of spacy. After 3.0 it is renamed to **training**

I have proposed an edit to examples.py

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.