code: def tag_named_entities(self):
          
          if not self.is_tagged(LABEL):
              self.tag_labels()
          nes = []
          word_start = -1
          labels = self.labels + ['O'] # last is sentinel
          words = self.words
          label = 'O'
          for i, l in enumerate(labels):
              if l.startswith('B-') or l == 'O':
                  if word_start != -1:
                      nes.append({START: words[word_start][START],
                                  END: words[i-1][END],
                                  LABEL: label})
                  if l.startswith('B-'):
                      word_start = i
                      label = l[2:]
                  else:
                      word_start = -1
          self[NAMED_ENTITIES] = nes
          return self
docs: Tag ``named_entities`` layer.
  
          This automatically performs morphological analysis along with all dependencies.