Skip to content

No module named spacy.gold #35

Description

@YanaSSS

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions