You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to train a NER model using the given .xlsx sheet. This was working well before when the Spacy version was lower than 2.1.0. However, after upgrading to Spacy 2.3.3, I'm getting the following error:
ValueError: [E103] Trying to set conflicting doc.ents: '(0, 2, 'ORG')' and '(0, 2, 'Runbook')'. A token can only be part of one entity, so make sure the entities you're setting don't overlap.
~\Anaconda3\envs\Env1\lib\site-packages\excelcy\excelcy.py in execute(cls, file_path)
38 if phase.enabled:
39 fno = getattr(excelcy, phase.fn)
---> 40 fno(**phase.args)
41
42 return excelcy
~\Anaconda3\envs\Env1\lib\site-packages\excelcy\excelcy.py in prepare(self)
190 # identify sentences
191 for _, train in self.storage.train.items.items():
--> 192 self._prepare_parse(train=train)
193 return self
194
~\Anaconda3\envs\Env1\lib\site-packages\excelcy\excelcy.py in _prepare_parse(self, train)
169 def prepare_parse(self, train: Train):
170 # parsing pre-identified Entity based on current data model
--> 171 doc = self.nlp(train.text)
172 for ent in doc.ents:
173 subtext, offset, label = ent.text, '%s,%s' % (ent.start_char, ent.end_char), ent.label
~\Anaconda3\envs\Env1\lib\site-packages\spacy\language.py in call(self, text, disable, component_cfg)
444 if not hasattr(proc, "call"):
445 raise ValueError(Errors.E003.format(component=type(proc), name=name))
--> 446 doc = proc(doc, **component_cfg.get(name, {}))
447 if doc is None:
448 raise ValueError(Errors.E005.format(name=name))
~\Anaconda3\envs\Env1\lib\site-packages\excelcy\pipe.py in call(self, doc)
75 # start add them into entities list
76 entity = (match_id, start, end)
---> 77 doc.ents += (entity,)
78
79 return doc
doc.pyx in spacy.tokens.doc.Doc.ents.set()
Any ideas how I can workaround or bypass this one? Or maybe am I erring to input correct values? Suggestions would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
I'm trying to train a NER model using the given .xlsx sheet. This was working well before when the Spacy version was lower than 2.1.0. However, after upgrading to Spacy 2.3.3, I'm getting the following error:
ValueError: [E103] Trying to set conflicting doc.ents: '(0, 2, 'ORG')' and '(0, 2, 'Runbook')'. A token can only be part of one entity, so make sure the entities you're setting don't overlap.
The entire Traceback is as follows:
ValueError Traceback (most recent call last)
in
----> 1 excelcy = ExcelCy.execute(file_path='C:/Train17.xlsx')
~\Anaconda3\envs\Env1\lib\site-packages\excelcy\excelcy.py in execute(cls, file_path)
38 if phase.enabled:
39 fno = getattr(excelcy, phase.fn)
---> 40 fno(**phase.args)
41
42 return excelcy
~\Anaconda3\envs\Env1\lib\site-packages\excelcy\excelcy.py in prepare(self)
190 # identify sentences
191 for _, train in self.storage.train.items.items():
--> 192 self._prepare_parse(train=train)
193 return self
194
~\Anaconda3\envs\Env1\lib\site-packages\excelcy\excelcy.py in _prepare_parse(self, train)
169 def prepare_parse(self, train: Train):
170 # parsing pre-identified Entity based on current data model
--> 171 doc = self.nlp(train.text)
172 for ent in doc.ents:
173 subtext, offset, label = ent.text, '%s,%s' % (ent.start_char, ent.end_char), ent.label
~\Anaconda3\envs\Env1\lib\site-packages\spacy\language.py in call(self, text, disable, component_cfg)
444 if not hasattr(proc, "call"):
445 raise ValueError(Errors.E003.format(component=type(proc), name=name))
--> 446 doc = proc(doc, **component_cfg.get(name, {}))
447 if doc is None:
448 raise ValueError(Errors.E005.format(name=name))
~\Anaconda3\envs\Env1\lib\site-packages\excelcy\pipe.py in call(self, doc)
75 # start add them into entities list
76 entity = (match_id, start, end)
---> 77 doc.ents += (entity,)
78
79 return doc
doc.pyx in spacy.tokens.doc.Doc.ents.set()
Any ideas how I can workaround or bypass this one? Or maybe am I erring to input correct values? Suggestions would be greatly appreciated.
The text was updated successfully, but these errors were encountered: