Thank you for your answer, I tried it but failed to some extend: I had to save the results to a json and use db-in to feed textcat.train. There were still some things missing, so I added "options":["MY_LABEL1", ...] and "accept":["MY_LABEL1", "MY_LABEL2"] like in texcat output files. The training successfully worked. However, when using ner.teach, I get a quite long error message:
Traceback (most recent call last):
File "/usr/lib/python3.5/pickle.py", line 268, in _getattribute
obj = getattr(obj, subpath)
AttributeError: module 'thinc.linear.linear' has no attribute 'lambda1'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/pickle.py", line 911, in save_global
obj2, parent = _getattribute(module, name)
File "/usr/lib/python3.5/pickle.py", line 271, in _getattribute
.format(name, obj))
AttributeError: Can't get attribute 'lambda1' on <module 'thinc.linear.linear' from '/usr/local/lib/python3.5/dist-packages/thinc/linear/linear.cpython-35m-x86_64-linux-gnu.so'>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.5/dist-packages/prodigy/__main__.py", line 380, in <module>
controller = recipe(*args, use_plac=True)
File "cython_src/prodigy/core.pyx", line 212, in prodigy.core.recipe.recipe_decorator.recipe_proxy
File "/usr/local/lib/python3.5/dist-packages/plac_core.py", line 328, in call
cmd, result = parser.consume(arglist)
File "/usr/local/lib/python3.5/dist-packages/plac_core.py", line 207, in consume
return cmd, self.func(*(args + varargs + extraopts), **kwargs)
File "/usr/local/lib/python3.5/dist-packages/prodigy/recipes/ner.py", line 122, in teach
model = EntityRecognizer(nlp, label=label)
File "cython_src/prodigy/models/ner.pyx", line 178, in prodigy.models.ner.EntityRecognizer.__init__
File "/usr/lib/python3.5/copy.py", line 182, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib/python3.5/copy.py", line 297, in _reconstruct
state = deepcopy(state, memo)
File "/usr/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.5/copy.py", line 243, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.5/copy.py", line 218, in _deepcopy_list
y.append(deepcopy(a, memo))
File "/usr/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.5/copy.py", line 223, in _deepcopy_tuple
y = [deepcopy(a, memo) for a in x]
File "/usr/lib/python3.5/copy.py", line 223, in <listcomp>
y = [deepcopy(a, memo) for a in x]
File "/usr/lib/python3.5/copy.py", line 182, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib/python3.5/copy.py", line 297, in _reconstruct
state = deepcopy(state, memo)
File "/usr/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.5/copy.py", line 243, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.5/copy.py", line 174, in deepcopy
rv = reductor(4)
File "/usr/local/lib/python3.5/dist-packages/thinc/neural/_classes/model.py", line 96, in __getstate__
return srsly.pickle_dumps(self.__dict__)
File "/usr/local/lib/python3.5/dist-packages/srsly/_pickle_api.py", line 14, in pickle_dumps
return cloudpickle.dumps(data, protocol=protocol)
File "/usr/local/lib/python3.5/dist-packages/srsly/cloudpickle/cloudpickle.py", line 954, in dumps
cp.dump(obj)
File "/usr/local/lib/python3.5/dist-packages/srsly/cloudpickle/cloudpickle.py", line 284, in dump
return Pickler.dump(self, obj)
File "/usr/lib/python3.5/pickle.py", line 408, in dump
self.save(obj)
File "/usr/lib/python3.5/pickle.py", line 475, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python3.5/pickle.py", line 814, in save_dict
self._batch_setitems(obj.items())
File "/usr/lib/python3.5/pickle.py", line 840, in _batch_setitems
save(v)
File "/usr/lib/python3.5/pickle.py", line 475, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python3.5/pickle.py", line 774, in save_list
self._batch_appends(obj)
File "/usr/lib/python3.5/pickle.py", line 798, in _batch_appends
save(x)
File "/usr/lib/python3.5/pickle.py", line 495, in save
rv = reduce(self.proto)
File "/usr/local/lib/python3.5/dist-packages/thinc/neural/_classes/model.py", line 96, in __getstate__
return srsly.pickle_dumps(self.__dict__)
File "/usr/local/lib/python3.5/dist-packages/srsly/_pickle_api.py", line 14, in pickle_dumps
return cloudpickle.dumps(data, protocol=protocol)
File "/usr/local/lib/python3.5/dist-packages/srsly/cloudpickle/cloudpickle.py", line 954, in dumps
cp.dump(obj)
File "/usr/local/lib/python3.5/dist-packages/srsly/cloudpickle/cloudpickle.py", line 284, in dump
return Pickler.dump(self, obj)
File "/usr/lib/python3.5/pickle.py", line 408, in dump
self.save(obj)
File "/usr/lib/python3.5/pickle.py", line 475, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python3.5/pickle.py", line 814, in save_dict
self._batch_setitems(obj.items())
File "/usr/lib/python3.5/pickle.py", line 840, in _batch_setitems
save(v)
File "/usr/lib/python3.5/pickle.py", line 475, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python3.5/pickle.py", line 774, in save_list
self._batch_appends(obj)
File "/usr/lib/python3.5/pickle.py", line 798, in _batch_appends
save(x)
File "/usr/lib/python3.5/pickle.py", line 495, in save
rv = reduce(self.proto)
File "/usr/local/lib/python3.5/dist-packages/thinc/neural/_classes/model.py", line 96, in __getstate__
return srsly.pickle_dumps(self.__dict__)
File "/usr/local/lib/python3.5/dist-packages/srsly/_pickle_api.py", line 14, in pickle_dumps
return cloudpickle.dumps(data, protocol=protocol)
File "/usr/local/lib/python3.5/dist-packages/srsly/cloudpickle/cloudpickle.py", line 954, in dumps
cp.dump(obj)
File "/usr/local/lib/python3.5/dist-packages/srsly/cloudpickle/cloudpickle.py", line 284, in dump
return Pickler.dump(self, obj)
File "/usr/lib/python3.5/pickle.py", line 408, in dump
self.save(obj)
File "/usr/lib/python3.5/pickle.py", line 475, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python3.5/pickle.py", line 814, in save_dict
self._batch_setitems(obj.items())
File "/usr/lib/python3.5/pickle.py", line 840, in _batch_setitems
save(v)
File "/usr/lib/python3.5/pickle.py", line 475, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python3.5/pickle.py", line 774, in save_list
self._batch_appends(obj)
File "/usr/lib/python3.5/pickle.py", line 798, in _batch_appends
save(x)
File "/usr/lib/python3.5/pickle.py", line 495, in save
rv = reduce(self.proto)
File "/usr/local/lib/python3.5/dist-packages/thinc/neural/_classes/model.py", line 96, in __getstate__
return srsly.pickle_dumps(self.__dict__)
File "/usr/local/lib/python3.5/dist-packages/srsly/_pickle_api.py", line 14, in pickle_dumps
return cloudpickle.dumps(data, protocol=protocol)
File "/usr/local/lib/python3.5/dist-packages/srsly/cloudpickle/cloudpickle.py", line 954, in dumps
cp.dump(obj)
File "/usr/local/lib/python3.5/dist-packages/srsly/cloudpickle/cloudpickle.py", line 284, in dump
return Pickler.dump(self, obj)
File "/usr/lib/python3.5/pickle.py", line 408, in dump
self.save(obj)
File "/usr/lib/python3.5/pickle.py", line 475, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python3.5/pickle.py", line 814, in save_dict
self._batch_setitems(obj.items())
File "/usr/lib/python3.5/pickle.py", line 840, in _batch_setitems
save(v)
File "/usr/lib/python3.5/pickle.py", line 475, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python3.5/pickle.py", line 774, in save_list
self._batch_appends(obj)
File "/usr/lib/python3.5/pickle.py", line 801, in _batch_appends
save(tmp[0])
File "/usr/lib/python3.5/pickle.py", line 495, in save
rv = reduce(self.proto)
File "/usr/local/lib/python3.5/dist-packages/thinc/neural/_classes/model.py", line 96, in __getstate__
return srsly.pickle_dumps(self.__dict__)
File "/usr/local/lib/python3.5/dist-packages/srsly/_pickle_api.py", line 14, in pickle_dumps
return cloudpickle.dumps(data, protocol=protocol)
File "/usr/local/lib/python3.5/dist-packages/srsly/cloudpickle/cloudpickle.py", line 954, in dumps
cp.dump(obj)
File "/usr/local/lib/python3.5/dist-packages/srsly/cloudpickle/cloudpickle.py", line 284, in dump
return Pickler.dump(self, obj)
File "/usr/lib/python3.5/pickle.py", line 408, in dump
self.save(obj)
File "/usr/lib/python3.5/pickle.py", line 475, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python3.5/pickle.py", line 814, in save_dict
self._batch_setitems(obj.items())
File "/usr/lib/python3.5/pickle.py", line 840, in _batch_setitems
save(v)
File "/usr/lib/python3.5/pickle.py", line 475, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python3.5/pickle.py", line 774, in save_list
self._batch_appends(obj)
File "/usr/lib/python3.5/pickle.py", line 798, in _batch_appends
save(x)
File "/usr/lib/python3.5/pickle.py", line 495, in save
rv = reduce(self.proto)
File "/usr/local/lib/python3.5/dist-packages/thinc/neural/_classes/model.py", line 96, in __getstate__
return srsly.pickle_dumps(self.__dict__)
File "/usr/local/lib/python3.5/dist-packages/srsly/_pickle_api.py", line 14, in pickle_dumps
return cloudpickle.dumps(data, protocol=protocol)
File "/usr/local/lib/python3.5/dist-packages/srsly/cloudpickle/cloudpickle.py", line 954, in dumps
cp.dump(obj)
File "/usr/local/lib/python3.5/dist-packages/srsly/cloudpickle/cloudpickle.py", line 284, in dump
return Pickler.dump(self, obj)
File "/usr/lib/python3.5/pickle.py", line 408, in dump
self.save(obj)
File "/usr/lib/python3.5/pickle.py", line 475, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python3.5/pickle.py", line 814, in save_dict
self._batch_setitems(obj.items())
File "/usr/lib/python3.5/pickle.py", line 840, in _batch_setitems
save(v)
File "/usr/lib/python3.5/pickle.py", line 475, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python3.5/pickle.py", line 814, in save_dict
self._batch_setitems(obj.items())
File "/usr/lib/python3.5/pickle.py", line 840, in _batch_setitems
save(v)
File "/usr/lib/python3.5/pickle.py", line 520, in save
self.save_reduce(obj=obj, *rv)
File "/usr/lib/python3.5/pickle.py", line 627, in save_reduce
save(state)
File "/usr/lib/python3.5/pickle.py", line 475, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/lib/python3.5/pickle.py", line 814, in save_dict
self._batch_setitems(obj.items())
File "/usr/lib/python3.5/pickle.py", line 840, in _batch_setitems
save(v)
File "/usr/lib/python3.5/pickle.py", line 506, in save
self.save_global(obj, rv)
File "/usr/local/lib/python3.5/dist-packages/srsly/cloudpickle/cloudpickle.py", line 704, in save_global
return Pickler.save_global(self, obj, name=name)
File "/usr/lib/python3.5/pickle.py", line 915, in save_global
(obj, module_name, name))
_pickle.PicklingError: Can't pickle <cyfunction LinearModel.<lambda> at 0x7fa56f166048>: it's not found as thinc.linear.linear.lambda1