-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
56 lines (51 loc) · 2.03 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from textSummarizer.pipeline.stage01_data_ingestion import DataIngestionTrainingPipeline
from textSummarizer.pipeline.stage02_data_validation import DataValidationTrainingPipeline
from textSummarizer.pipeline.stage03_data_transformation import DataTransformationTrainingPipeline
from textSummarizer.pipeline.stage04_model_training import ModelTrainerTrainingPipeline
from textSummarizer.pipeline.stage05_model_evaluation import ModelEvaluationTrainingPipeline
from textSummarizer.logging import logger
STAGE_NAME = "Data Ingestion Stage"
try:
logger.info(f">>>>>> {STAGE_NAME} started <<<<<<")
data_ingestion = DataIngestionTrainingPipeline()
data_ingestion.main()
logger.info(f">>>>>> {STAGE_NAME} completed <<<<<<\n\nx============x")
except Exception as e:
logger.exception(e)
raise e
STAGE_NAME = "Data Validation Stage"
try:
logger.info(f">>>>>> {STAGE_NAME} started <<<<<<")
data_validation = DataValidationTrainingPipeline()
data_validation.main()
logger.info(f">>>>>> {STAGE_NAME} completed <<<<<<\n\nx============x")
except Exception as e:
logger.exception(e)
raise e
STAGE_NAME = "Data Transformation Stage"
try:
logger.info(f">>>>>> {STAGE_NAME} started <<<<<<")
data_transformation = DataTransformationTrainingPipeline()
data_transformation.main()
logger.info(f">>>>>> {STAGE_NAME} completed <<<<<<\n\nx============x")
except Exception as e:
logger.exception(e)
raise e
STAGE_NAME = "Model Training Stage"
try:
logger.info(f">>>>>> {STAGE_NAME} started <<<<<<")
model_trainer = ModelTrainerTrainingPipeline()
model_trainer.main()
logger.info(f">>>>>> {STAGE_NAME} completed <<<<<<\n\nx============x")
except Exception as e:
logger.exception(e)
raise e
STAGE_NAME = "Model Evaluation Stage"
try:
logger.info(f">>>>>> {STAGE_NAME} started <<<<<<")
model_evaluator = ModelEvaluationTrainingPipeline()
model_evaluator.main()
logger.info(f">>>>>> {STAGE_NAME} completed <<<<<<\n\nx============x")
except Exception as e:
logger.exception(e)
raise e