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