2022-12-17 21:52:34 +01:00
|
|
|
import typing as t
|
|
|
|
|
|
|
|
|
|
|
|
class BaseModule:
|
|
|
|
'''Base module class.'''
|
|
|
|
|
2022-12-18 01:31:41 +01:00
|
|
|
def __iter__(self) -> t.Generator[str, None, None]:
|
2022-12-17 21:52:34 +01:00
|
|
|
'''Implements the basic iterator interface.'''
|
|
|
|
return self.generator()
|
|
|
|
|
|
|
|
def generator(self) -> t.Generator[str, None, None]:
|
|
|
|
'''
|
|
|
|
Should yield strings that will be used in the model's training /
|
|
|
|
validation / test splits.
|
|
|
|
'''
|
|
|
|
raise NotImplementedError
|