SyntacticModel
- class mowl.base_models.SyntacticModel(*args, corpus_filepath=None, **kwargs)[source]
Bases:
Model
Base class for syntactic methods. By syntactic, we mean methods that use the syntax of the ontology to generate the corpus.
- Parameters:
corpus_filepath (str) – the filepath where the corpus is saved. If None, the corpus file is saved in a temporary file.
Attributes Summary
Corpus generated from the ontology.
Path for saving the corpus.
Methods Summary
generate_corpus
([save, with_annotations])Generates the corpus of the training ontology.
Loads the corpus from the corpus filepath.
train
()Abstract method for training the model.
Attributes Documentation
Methods Documentation
- generate_corpus(save=True, with_annotations=False)[source]
Generates the corpus of the training ontology. It uses the Manchester OWL Syntax.
- Parameters:
save (bool, optional) – if True, the corpus is saved into the model filepath, otherwise, the corpus is returned as a list of sentences. Default is True.
with_annotations (bool, optional) – if True, the corpus is generated with the annotations, otherwise, the corpus is generated only with the axioms. Default is False.