Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def learn(self, corpus):
"""further train the project using documents from a metadata source"""
corpus.set_subject_index(self.subjects)
if isinstance(
self.backend,
annif.backend.backend.AnnifLearningBackend):
self.backend.learn(corpus, project=self)
else:
raise NotSupportedException("Learning not supported by backend",
project_id=self.project_id)
def default_params(self):
params = backend.AnnifBackend.DEFAULT_PARAMS.copy()
params.update(mixins.ChunkingBackend.DEFAULT_PARAMS)
params.update(self.DEFAULT_PARAMS)
return params
def default_params(self):
return backend.AnnifBackend.DEFAULT_PARAMS