Update docstrings

This commit is contained in:
ines 2017-04-17 01:40:26 +02:00
parent e2299dc389
commit 8e83f8e2fa

View File

@ -188,6 +188,9 @@ class Language(object):
@classmethod @classmethod
def setup_directory(cls, path, **configs): def setup_directory(cls, path, **configs):
"""
Initialise a model directory.
"""
for name, config in configs.items(): for name, config in configs.items():
directory = path / name directory = path / name
if directory.exists(): if directory.exists():
@ -295,7 +298,7 @@ class Language(object):
and can contain arbtrary whitespace. Alignment into the original string and can contain arbtrary whitespace. Alignment into the original string
is preserved. is preserved.
Args: Argsuments:
text (unicode): The text to be processed. text (unicode): The text to be processed.
Returns: Returns:
@ -344,6 +347,12 @@ class Language(object):
yield doc yield doc
def save_to_directory(self, path): def save_to_directory(self, path):
"""
Save the Vocab, StringStore and pipeline to a directory.
Arguments:
path (string or pathlib path): Path to save the model.
"""
configs = { configs = {
'pos': self.tagger.cfg if self.tagger else {}, 'pos': self.tagger.cfg if self.tagger else {},
'deps': self.parser.cfg if self.parser else {}, 'deps': self.parser.cfg if self.parser else {},