Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import spacy
- import random
- nlp=spacy.load('en')
- TRAIN_DATA = [(u"Uber blew through $1 million a week", {"entities": [(0, 4, "ORG")]}),(u"Google rebrands its business apps", {"entities": [(0, 6, "ORG")]})]
- nlp = spacy.blank('en')
- optimizer = nlp.begin_training()
- for i in range(20):
- random.shuffle(TRAIN_DATA)
- for text, annotations in TRAIN_DATA:
- nlp.update([text], [annotations], sgd=optimizer)
- nlp.to_disk("/model")
- Warning: Unnamed vectors -- this won't allow multiple vectors models to be loaded. (Shape: (0, 0))
- Traceback (most recent call last):
- File "ss1.py", line 15, in <module>
- nlp.to_disk("/model")
- File "/Users/shailysaigal/anaconda3/lib/python3.7/site-packages/spacy/language.py", line 621, in to_disk
- util.to_disk(path, serializers, {p: False for p in disable})
- File "/Users/shailysaigal/anaconda3/lib/python3.7/site-packages/spacy/util.py", line 500, in to_disk
- path.mkdir()
- File "/Users/shailysaigal/anaconda3/lib/python3.7/pathlib.py", line 1241, in mkdir
- self._accessor.mkdir(self, mode)
- PermissionError: [Errno 13] Permission denied: '/model'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement