-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No module named spacy.gold #35
Comments
Hello, I have exactly the same problem as you. |
just uncomment spacy.gold under lib/python3.8/site-packages/doccano_transformer/examples.py and you should be good. |
I have got the same issue. |
I Just replace from spacy.gold import biluo_tags_from_offsets with from spacy.training import offsets_to_biluo_tags in the doccano_transformer/examples.py |
can you please tell me how to do this? |
you can check the log file to see the specific path of the local file that caused the error. Once you have identified the file, you can edit the import sentence in that file to correct the issue. |
got it.. but if there's a code to this- it would be helpful (I am new to changing modules on the terminal- and i do not want to mess up any paths) |
Can you provide a screenshot of your error? I am not able to reproduce the error again.. |
I used |
This suggestion updates the `spacy` methods in order to use latest package version available. According to [this documentation](https://spacy.io/usage/v3), `spacy.gold` was replaced by `spacy.training` with different method signatures. This issue was already mentioned [here](doccano#35)
Hello, i added a suggestion PR that updates the code while fixing the mentioned error in this issue. Could you please evaluate? |
Thank you Henrique for your solution on the PR. It produces two generator objects. But no JSON file... Is it normal?! |
Hello @AkimParis , the readme isn't much clear about the execution, but i guess it's the expected behavior. You can loop through the generator to get all samples: for sample in NERDataset.to_conll2003():
#...
#or
samples = [*NERDataset.to_conll2003()] |
Thx, I was expecting direct output files. I tried to help with your PR. The Doccano team seems very busy. |
Environment
When importing
from doccano_transformer.datasets import NERDataset
I receive an errorModuleNotFoundError 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
The text was updated successfully, but these errors were encountered: