graph LR
Application_Orchestrators["Application Orchestrators"]
Configuration_Handler["Configuration Handler"]
Data_Management["Data Management"]
Training_Manager["Training Manager"]
Evaluation_Manager["Evaluation Manager"]
Application_Orchestrators -- "calls" --> Configuration_Handler
Application_Orchestrators -- "calls" --> Data_Management
Application_Orchestrators -- "calls" --> Training_Manager
Application_Orchestrators -- "calls" --> Evaluation_Manager
Data_Management -- "provides data to" --> Training_Manager
Data_Management -- "provides data to" --> Evaluation_Manager
Configuration_Handler -- "configures" --> Training_Manager
Configuration_Handler -- "configures" --> Evaluation_Manager
Training_Manager -- "produces" --> Trained_Models
Evaluation_Manager -- "evaluates" --> Trained_Models
The TextBrewer system is structured around a set of Application Orchestrators that define specific NLP tasks like CMRC2018 distillation, CoNLL2003 NER, and MNLI distillation. These orchestrators coordinate the entire workflow by interacting with core architectural components. The Configuration Handler is responsible for setting up the operational parameters for both training and distillation processes. Data Management prepares and supplies the necessary datasets, ensuring data is correctly formatted and batched for model consumption. The Training Manager oversees the model training, including the intricate distillation process between teacher and student models. Finally, the Evaluation Manager assesses the performance of the trained models, providing critical feedback on their effectiveness. This modular design allows for flexible task-specific pipelines while centralizing key functionalities.
These components are the specific entry points for different tasks (e.g., CMRC2018 distillation, CoNLL2003 NER, MNLI distillation). They encapsulate the high-level workflow for each application, coordinating calls to other components to perform configuration, data handling, training, and evaluation. They represent distinct, task-specific pipelines.
Related Classes/Methods:
examples.cmrc2018_example.main.distill.main:47-206examples.conll2003_example.run_ner.main:301-528examples.mnli_example.main.distill.main:49-196
Responsible for loading, parsing, and managing application-wide and task-specific configurations. This includes parameters for training, distillation, model paths, and dataset settings. It ensures that the application orchestrators have access to all necessary parameters.
Related Classes/Methods:
Handles the loading, preprocessing, and batching of datasets for both training and evaluation. It abstracts away the complexities of data handling, providing a consistent interface for the models and training loops.
Related Classes/Methods:
Manages the core training loop, including forward and backward passes, optimization, and loss calculation. In distillation scenarios, it orchestrates the interaction between teacher and student models.
Related Classes/Methods:
Responsible for evaluating the performance of trained models on validation or test datasets, particularly within the distillation context. It calculates and reports relevant metrics specific to the NLP task (e.g., F1 score for NER, accuracy for classification) by comparing teacher and student model outputs.
Related Classes/Methods: