🔎 Exploration#
- class text_machina.src.exploration.base.Explorer(dataset)[source]#
Bases:
ABC
Base class for explorers that run an interactive CLI to visualize generated datasets.
- get_next_position_or_exit(position, max_position)[source]#
Handles user input to cycle through a dataset.
- abstract get_panels(example)[source]#
Builds the list of panels for the elements (prompts, texts, etc.) to be printed. This method should be implemented by each task-specific explorer.
- Parameters:
example (Dict[str, Any]) – an example from the dataset.
- Returns:
lists of panels to be printed in the desired order.
- Return type:
List[Panel]
- abstract get_title(idx, example)[source]#
Builds a printable title based on an example from the dataset. This method should be implemented by each task-specific explorer.
- step()[source]#
Steps through a generated dataset, handling user input and showing the texts in a command line UI.
- Return type:
- __abstractmethods__ = frozenset({'get_panels', 'get_title'})#
- __dict__ = mappingproxy({'__module__': 'text_machina.src.exploration.base', '__doc__': '\n Base class for explorers that run an interactive\n CLI to visualize generated datasets.\n ', '__init__': <function Explorer.__init__>, 'command_panel': <property object>, 'step': <function Explorer.step>, 'get_next_position_or_exit': <function Explorer.get_next_position_or_exit>, 'show_example': <function Explorer.show_example>, 'get_panels': <function Explorer.get_panels>, 'get_title': <function Explorer.get_title>, '__dict__': <attribute '__dict__' of 'Explorer' objects>, '__weakref__': <attribute '__weakref__' of 'Explorer' objects>, '__abstractmethods__': frozenset({'get_title', 'get_panels'}), '_abc_impl': <_abc_data object>, '__annotations__': {}})#
- __module__ = 'text_machina.src.exploration.base'#
- __weakref__#
list of weak references to the object (if defined)
- _abc_impl = <_abc_data object>#
- property command_panel: Panel#
Command panel to help the users with commands. :returns: panel showing the commands and action keys. :rtype: Panel
- class text_machina.src.exploration.detection.DetectionExplorer(dataset)[source]#
Bases:
Explorer
Explorer for detection tasks.
- get_panels(example)[source]#
Builds the list of panels for the elements (prompts, texts, etc.) to be printed. This method should be implemented by each task-specific explorer.
- Parameters:
example (Dict[str, Any]) – an example from the dataset.
- Returns:
lists of panels to be printed in the desired order.
- Return type:
List[Panel]
- class text_machina.src.exploration.attribution.AttributionExplorer(dataset)[source]#
Bases:
Explorer
Explorer for attribution tasks.
- get_panels(example)[source]#
Builds the list of panels for the elements (prompts, texts, etc.) to be printed. This method should be implemented by each task-specific explorer.
- Parameters:
example (Dict[str, Any]) – an example from the dataset.
- Returns:
lists of panels to be printed in the desired order.
- Return type:
List[Panel]
- class text_machina.src.exploration.boundary.BoundaryExplorer(dataset)[source]#
Bases:
Explorer
Explorer for boundary tasks.
- get_panels(example)[source]#
Builds the list of panels for the elements (prompts, texts, etc.) to be printed. This method should be implemented by each task-specific explorer.
- Parameters:
example (Dict[str, Any]) – an example from the dataset.
- Returns:
lists of panels to be printed in the desired order.
- Return type:
List[Panel]
- class text_machina.src.exploration.mixcase.MixCaseExplorer(dataset)[source]#
Bases:
Explorer
Explorer for mixcase tasks.
- get_panels(example)[source]#
Builds the list of panels for the elements (prompts, texts, etc.) to be printed. This method should be implemented by each task-specific explorer.
- Parameters:
example (Dict[str, Any]) – an example from the dataset.
- Returns:
lists of panels to be printed in the desired order.
- Return type:
List[Panel]