-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
55 lines (41 loc) · 1.96 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
from src.newsaggregator import logger
from src.newsaggregator.pipeline.data_ingestion_pipeline import DataIngestionTrainingPipeline
from src.newsaggregator.pipeline.data_cleaning_pipeline import DataCleaningTrainingPipeline
from src.newsaggregator.pipeline.data_labelling_pipeline import DataLabellingTrainingPipeline
from src.newsaggregator.pipeline.data_categorizing_pipeline import DataCategorizingTrainingPipeline
STAGE_NAME ="Data Ingestion stage"
try:
logger.info(f">>>>>>Stage {STAGE_NAME} Started <<<<<<<<")
pipeline = DataIngestionTrainingPipeline()
pipeline.initiate_data_ingestion()
logger.info(f">>>>>>>>>>>>>>>{STAGE_NAME} completed <<<<<<<<<<<<")
except Exception as e:
logger.error(f"Error occurred in {STAGE_NAME} stage: {str(e)}")
raise e
STAGE_NAME ="Data categorizing stage"
try:
logger.info(f">>>>>>Stage {STAGE_NAME} Started <<<<<<<<")
pipeline = DataCategorizingTrainingPipeline()
pipeline.initiate_data_categorizing()
logger.info(f">>>>>>>>>>>>>>>{STAGE_NAME} completed <<<<<<<<<<<<")
except Exception as e:
logger.error(f"Error occurred in {STAGE_NAME} stage: {str(e)}")
raise e
STAGE_NAME ="Data Labelling stage"
try:
logger.info(f">>>>>>Stage {STAGE_NAME} Started <<<<<<<<")
pipeline = DataLabellingTrainingPipeline()
pipeline.initiate_data_labelling()
logger.info(f">>>>>>>>>>>>>>>{STAGE_NAME} completed <<<<<<<<<<<<")
except Exception as e:
logger.error(f"Error occurred in {STAGE_NAME} stage: {str(e)}")
raise e
STAGE_NAME = "Data Cleaning Stage"
try:
logger.info(f">>>>>> Stage {STAGE_NAME} Started <<<<<<<<")
pipeline = DataCleaningTrainingPipeline()
pipeline.initiate_data_cleaning() # Fixed method name here
logger.info(f">>>>>>>>>>>>>>> {STAGE_NAME} completed <<<<<<<<<<<<")
except Exception as e:
logger.error(f"Error occurred in {STAGE_NAME} stage: {str(e)}")
raise e