Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

main.py 1.5 KB

You have to be logged in to leave a comment. Sign In
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
  1. from sentimentAnalysis import logger
  2. from sentimentAnalysis.pipeline.stage_01_data_ingestion import (
  3. DataIngestionTrainingPipeline,
  4. )
  5. from sentimentAnalysis.pipeline.stage_02_data_validation import (
  6. DataValidationTrainingPipeline,
  7. )
  8. from sentimentAnalysis.pipeline.stage_03_data_transformation import (
  9. DataTransformationTrainingPipeline,
  10. )
  11. from sentimentAnalysis.pipeline.stage_04_model_training import (
  12. ModelTrainerTrainingPipeline,
  13. )
  14. from sentimentAnalysis.pipeline.stage_05_model_evaluation import (
  15. ModelEvaluationTrainingPipeline,
  16. )
  17. def run_pipeline(stage_name, pipeline_instance):
  18. """
  19. Run a specific stage of the sentiment analysis pipeline.
  20. Parameters:
  21. - stage_name: str
  22. Name of the pipeline stage.
  23. - pipeline_instance: object
  24. Instance of the pipeline stage to be executed.
  25. Returns:
  26. None
  27. """
  28. try:
  29. logger.info(f">>>>>> Stage {stage_name} started <<<<<<")
  30. pipeline_instance.main()
  31. logger.info(f">>>>>> Stage {stage_name} completed <<<<<<\n\nx==========x")
  32. except Exception as e:
  33. logger.exception(e)
  34. raise e
  35. if __name__ == "__main__":
  36. run_pipeline("Data Ingestion", DataIngestionTrainingPipeline())
  37. run_pipeline("Data Validation", DataValidationTrainingPipeline())
  38. run_pipeline("Data Transformation", DataTransformationTrainingPipeline())
  39. run_pipeline("Model Training", ModelTrainerTrainingPipeline())
  40. run_pipeline("Model Evaluation", ModelEvaluationTrainingPipeline())
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...