          if self.entity:
              self.entity.model.end_training()
              self.entity.model.dump(str(path / 'ner' / 'model'))
  
          strings_loc = path / 'vocab' / 'strings.json'
          with strings_loc.open('w', encoding='utf8') as file_:
              self.vocab.strings.dump(file_)
          self.vocab.dump(path / 'vocab' / 'lexemes.bin')
  
          if self.tagger:
              tagger_freqs = list(self.tagger.freqs[TAG].items())
          else:
              tagger_freqs = []
          if self.parser:
 
</s> remove             self.entity.model.end_training()
 </s> add  </s> remove             self.parser.model.end_training()
 </s> add  </s> remove             self.tagger.model.end_training()
 </s> add  </s> remove     @contextmanager
    def train(cls, path, gold_tuples, *configs):
        if isinstance(path, basestring):
            path = pathlib.Path(path)
        tagger_cfg, parser_cfg, entity_cfg = configs
        dep_model_dir = path / 'deps'
        ner_model_dir = path / 'ner'
        pos_model_dir = path / 'pos'
        if dep_model_dir.exists():
            shutil.rmtree(str(dep_model_dir))
        if ner_model_dir.exists():
            shutil.rmtree(str(ner_model_dir))
        if pos_model_dir.exists():
            shutil.rmtree(str(pos_model_dir))
        dep_model_dir.mkdir()
        ner_model_dir.mkdir()
        pos_model_dir.mkdir()
 </s> add     def setup_directory(cls, path, **configs):
        for name, config in configs.items():
            directory = path / name
            if directory.exists():
                shutil.rmtree(str(directory))
            directory.mkdir()
            with (directory / 'config.json').open('wb') as file_:
                data = ujson.dumps(config, indent=2)
                if isinstance(data, unicode):
                    data = data.encode('utf8')
                file_.write(data)
        if not (path / 'vocab').exists():
            (path / 'vocab').mkdir()
    def end_training(self, path=None):
          if self.entity:
              self.entity.model.end_training()
              self.entity.model.dump(str(path / 'ner' / 'model'))
  
    def end_training(self, path=None):
    def end_training(self, path=None):
    def end_training(self, path=None):
    def end_training(self, path=None):
    def end_training(self, path=None):
          if self.tagger:
              tagger_freqs = list(self.tagger.freqs[TAG].items())
          else:
              tagger_freqs = []
          if self.parser:
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Refactor Language.end_training, making new save_to_directory method 
spacy/language.py