Skip to content

Commit 4d2f31e

Browse files
voorhsSamoed
andauthored
Docs/update further (#159)
* add module-level docstring for `custom_types` * refactor `generation.intents` * refactor `generation` * refactor `generation` * refactor `metrics` * remove `attributes` section from decision modules * remove `attributes` section from the rest of modules' docstrings * fix `__init__` issue for decision modules docstrings * fix codestyle * fix `__init__` issue for the rest of modules * fix `__init__` issue for `generation` module * refactor node optimizer * move generation schemas definition * upd tests * Update autointent/generation/intents/_description_generation.py Co-authored-by: Roman Solomatin <[email protected]> --------- Co-authored-by: Roman Solomatin <[email protected]>
1 parent cc44a1e commit 4d2f31e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+282
-519
lines changed

autointent/custom_types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Types used throughout AutoIntent library."""
2+
13
from ._types import (
24
FloatFromZeroToOne,
35
LabelType,

autointent/generation/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Some generative methods for enriching training datasets."""
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"""Chat templates used throughout :py:mod:`autointent.generation` module."""
2+
3+
from ._abstract import AbstractEvolution
4+
from ._base_evolver import EvolutionChatTemplate
5+
from ._base_synthesizer import BaseSynthesizerTemplate
6+
from ._concrete import ConcreteEvolution
7+
from ._evolution_templates_schemas import Message, Role
8+
from ._formal import FormalEvolution
9+
from ._funny import FunnyEvolution
10+
from ._goofy import GoofyEvolution
11+
from ._informal import InformalEvolution
12+
from ._intent_descriptions import PromptDescription
13+
from ._reasoning import ReasoningEvolution
14+
from ._synthesizer_en import EnglishSynthesizerTemplate
15+
from ._synthesizer_ru import RussianSynthesizerTemplate
16+
17+
EVOLUTION_NAMES = [evolution.name for evolution in EvolutionChatTemplate.__subclasses__()]
18+
19+
EVOLUTION_MAPPING = {evolution.name: evolution() for evolution in EvolutionChatTemplate.__subclasses__()}
20+
21+
__all__ = [
22+
"EVOLUTION_MAPPING",
23+
"EVOLUTION_NAMES",
24+
"AbstractEvolution",
25+
"BaseSynthesizerTemplate",
26+
"ConcreteEvolution",
27+
"EnglishSynthesizerTemplate",
28+
"EvolutionChatTemplate",
29+
"FormalEvolution",
30+
"FunnyEvolution",
31+
"GoofyEvolution",
32+
"InformalEvolution",
33+
"Message",
34+
"PromptDescription",
35+
"ReasoningEvolution",
36+
"Role",
37+
"RussianSynthesizerTemplate",
38+
]

autointent/generation/utterances/evolution/chat_templates/abstract.py renamed to autointent/generation/chat_templates/_abstract.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
from typing import ClassVar
44

5-
from autointent.generation.utterances.schemas import Message, Role
6-
7-
from .base import EvolutionChatTemplate
5+
from ._base_evolver import EvolutionChatTemplate
6+
from ._evolution_templates_schemas import Message, Role
87

98

109
class AbstractEvolution(EvolutionChatTemplate):

autointent/generation/utterances/evolution/chat_templates/base.py renamed to autointent/generation/chat_templates/_base_evolver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
from typing import ClassVar
44

5-
from autointent.generation.utterances.schemas import Message, Role
65
from autointent.schemas import Intent
76

7+
from ._evolution_templates_schemas import Message, Role
8+
89

910
class EvolutionChatTemplate:
1011
"""Base class for chat templates for evolution augmentation."""

autointent/generation/utterances/basic/chat_templates/_base.py renamed to autointent/generation/chat_templates/_base_synthesizer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
from typing import ClassVar
77

88
from autointent import Dataset
9-
from autointent.generation.utterances.schemas import Message, Role
109
from autointent.schemas import Intent
1110

11+
from ._evolution_templates_schemas import Message, Role
12+
1213

1314
class BaseChatTemplate(ABC):
1415
"""Base class."""

autointent/generation/utterances/evolution/chat_templates/concrete.py renamed to autointent/generation/chat_templates/_concrete.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
from typing import ClassVar
44

5-
from autointent.generation.utterances.schemas import Message, Role
6-
7-
from .base import EvolutionChatTemplate
5+
from ._base_evolver import EvolutionChatTemplate
6+
from ._evolution_templates_schemas import Message, Role
87

98

109
class ConcreteEvolution(EvolutionChatTemplate):

autointent/generation/utterances/schemas.py renamed to autointent/generation/chat_templates/_evolution_templates_schemas.py

File renamed without changes.

autointent/generation/utterances/evolution/chat_templates/formal.py renamed to autointent/generation/chat_templates/_formal.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
from typing import ClassVar
44

5-
from autointent.generation.utterances.schemas import Message, Role
6-
7-
from .base import EvolutionChatTemplate
5+
from ._base_evolver import EvolutionChatTemplate
6+
from ._evolution_templates_schemas import Message, Role
87

98

109
class FormalEvolution(EvolutionChatTemplate):

autointent/generation/utterances/evolution/chat_templates/funny.py renamed to autointent/generation/chat_templates/_funny.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
from typing import ClassVar
44

5-
from autointent.generation.utterances.schemas import Message, Role
6-
7-
from .base import EvolutionChatTemplate
5+
from ._base_evolver import EvolutionChatTemplate
6+
from ._evolution_templates_schemas import Message, Role
87

98

109
class FunnyEvolution(EvolutionChatTemplate):

0 commit comments

Comments
 (0)