toolbox/toolbox/modules/__init__.py

17 lines
454 B
Python
Raw Normal View History

2022-12-17 21:52:34 +01:00
import typing as t
class BaseModule:
'''Base module class.'''
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()
def generator(self) -> t.Generator[list[str], None, None]:
2022-12-17 21:52:34 +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