Giter Site home page Giter Site logo

aiemail's Introduction

Multi-Label Email Classification System

This repository contains the code for a multi-label email classification system. The system is designed to classify emails based on multiple dependent variables (labels) such as Type 2, Type 3, and Type 4. It provides a modular and extensible architecture that allows for easy modification and addition of preprocessing steps, machine learning models, and evaluation metrics.

Features

  • Separation of concerns (SoC) architecture with components for preprocessing, embeddings, modeling, etc.
  • Supports two design decisions for multi-label classification:
    1. Chained Multi-outputs Approach: Trains a single model instance on chained labels (e.g., Type 2, Type 2+3, Type 2+3+4)
    2. Hierarchical Modeling Approach: Trains multiple model instances on filtered data based on the classes of preceding labels
  • Encapsulates input data using a Data class for consistent access across models
  • Implements multiple machine learning models with a consistent interface for training, prediction, and evaluation
  • Provides a main controller (main.py) for orchestrating the preprocessing, embedding, modeling, and evaluation steps

Repository Structure

  • main.py: Main controller script for running the email classification system
  • preprocess.py: Contains functions for data preprocessing, including de-duplication, noise removal, and translation
  • embeddings.py: Implements functions for generating embeddings from text data (e.g., TF-IDF)
  • modelling/: Directory containing modules related to modeling
    • modelling.py: Defines functions for model training, prediction, and evaluation
    • data_model.py: Implements the Data class for encapsulating input data
  • model/: Directory containing implementations of various machine learning models
    • base.py: Defines the abstract base class for all models
    • randomforest.py: Implements the Random Forest model
    • sgd.py: Implements the Stochastic Gradient Descent (SGD) model
    • adaboost.py: Implements the AdaBoost model
    • voting.py: Implements the Voting Classifier model
    • hist_gb.py: Implements the Histogram-based Gradient Boosting model
    • random_trees_ensembling.py: Implements the Random Trees Embedding model
  • data/: Directory containing the input data files
    • AppGallery.csv: Input data file for the AppGallery domain
    • Purchasing.csv: Input data file for the Purchasing domain
  • Config.py: Configuration file for storing constants and settings

Usage

  1. Install the required dependencies (TODO: Create requirements.txt file).
  2. Place the input data files (AppGallery.csv and Purchasing.csv) in the data/ directory.
  3. Modify the Config.py file to adjust any configuration settings if needed.
  4. Run the main.py script to execute the email classification system.

Contributing

Contributions to this project are welcome. If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

aiemail's People

Contributors

dimitrios-vasileiou-kalfas avatar codemeasandwich avatar

Stargazers

 avatar

Watchers

 avatar  avatar

aiemail's Issues

To-Do

  • Create a requirements.txt file with the list of required dependencies.
  • Implement cross-validation logic for more robust model evaluation.
  • Explore and integrate multi-label classification metrics (e.g., micro/macro averaged F1-score) for performance evaluation.
  • Optimize the hierarchical modeling approach by parallelizing the training of multiple model instances.
  • Refactor the Data class to separate the chained and hierarchical label logic into a dedicated MultiLabelData class.
  • Enhance the preprocessing module with additional techniques for text normalization and feature extraction.
  • Conduct extensive testing and debugging to ensure the stability and reliability of the system.
  • Improve code documentation and add inline comments for better maintainability.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.