3

i am stuck on a problem and seeking help from you. i am trying to train multiple entity using spacy

Following is my Train Data

response =[
('java developer with java and html css javascript ',
{'entities': [(0, 14, 'jobtitle'),
(0 , 4, 'skills'),
(34,37,'skills'),
(38, 49, 'skills')
]
}),
('looking for software engineer with java python',
{
'entities': [
(12, 29, 'jobtitle'),
(40, 46, 'skills'),
(35,39,"skills")
]
})
]

here is train code i have issue

        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)

Error : ValueError: [E103] Trying to set conflicting doc.ents: '(0, 14, 'jobtitle')' and '(0, 4, 'skills')'. A token can only be part of one entity, so make sure the entities you're setting don't overlap.

1 Answer 1

3

As the error message explains, spacy's NER model does not support overlapping entity spans, so you can't train a model using these annotations.

1
  • 1
    Is there a plan for supporting them in the future? Commented Jun 15, 2021 at 16:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.