# singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification architecture

> Architecture diagram of the GitHub repository singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification
- Repository: https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification

## Overview

##### Main Components
- Input Data Source: Both approaches start with a key Excel file (kitni_m.xlsx) that supplies dialogue data.
- External Tools & Libraries:
– ISC Tokenizer (shared by both approaches)
– For Approach 2, additional tools such as ISC Tagger, language detection (langid.py), and translation (googletrans) are used.
– Python 3.6 environment (Anaconda: Spyder) with libraries such as openpyxl and xlwt for reading/writing Excel files.
- Processing Pipelines:
– Approach 1:
▫ A simpler pipeline that reads the input file, applies tokenization, processes the dialogue data, and outputs results in an Excel and a Word document (RESULT.docx).
▫ Files like “m_kitni_info_asked.py” and “m_kitni_info_provided.py” indicate distinct modules for handling “asked” vs. “provided” information.
– Approach 2:
▫ A more extensive pipeline that, in addition to tokenization, includes feature extraction, language detection, translation, and classification.
▫ Multiple Python scripts progressing through tokenization, extracting bag-of-words features (bag_of_words_3.xlsx), and building the model (SVM via files like first_30_data_svm_6.py, svm_whole_dataset_5.py, and testing.py).
▫ It also uses additional Excel files to stage data (e.g., dataset_eng_1.xlsx, dataset_hin.xlsx, feature_extracted_2.xlsx).
- Output Files: Each approach creates different output files (excel, docx, test results printed to console) that need to be represented.

##### Relationships and Interactions
– The Input (kitni_m.xlsx) feeds the processing pipelines.
– For both approaches, a common shared external dependency (ISC Tokenizer) is involved early in the pipeline.
– In Approach 2, after initial tokenization, the data flows into sequential modules: feature extraction, language detection and translation, followed by machine learning classification (SVM).
– For Approach 1, data is processed, tokenized, and then output as a spreadsheet and documented in a Word file with the results.

##### Architectural Patterns and Design Principles
- Separation of Concerns: Notice that the project is divided into two independent “approaches” or pipelines that each encapsulate a specific method of data processing.
- Data Transformation Pipeline: Both pipelines follow a sequential set of transformation steps (read input → tokenize → process features → output) that are characteristic of data processing pipelines.
- Reusability: The external libraries (like ISC Tokenizer) are shared, which can be highlighted as a reusable middleware component.

##### Relevant Technologies and Frameworks
- Programming language: Python 3.6 on the Anaconda distribution (Spyder IDE).
- External dependencies: ISC Tokenizer, ISC Tagger, langid.py, and googletrans.
- Libraries for file operations: openpyxl and xlwt.
- Machine Learning Elements: SVM classifier components in Approach 2.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Approach 1 Pipeline Subgraph
    subgraph "Approach 1 Pipeline"
        A1["Input Data (kitni_m.xlsx)"]:::input
        A2["ISC Tokenizer (Common Preprocessing)"]:::common
        A3["m_kitni_info_asked.py"]:::script
        A4["m_kitni_info_provided.py"]:::script
        A5["Output Generation"]:::output
        A6["info_asked_kitni_m.xls"]:::file
        A7["info_provided_kitni_m.xls"]:::file
        A8["RESULT.docx"]:::file

        A1 --> A2
        A2 --> A3
        A2 --> A4
        A3 --> A5
        A4 --> A5
        A5 --> A6
        A5 --> A7
        A5 --> A8
    end

    %% Approach 2 Pipeline Subgraph
    subgraph "Approach 2 Pipeline"
        B1["Input Data (kitni_m.xlsx)"]:::input
        B2["ISC Tokenizer (Common Preprocessing)"]:::common
        B3["Initial Tokenization & Processing"]:::process
        B3a["tokenized_the_training_dataset_4.py"]:::script
        B3b["approach2_eng_code_1.py"]:::script
        B4["Feature Extraction"]:::process
        B4a["feature_extractor_2.py"]:::script
        B4b["features_3.py"]:::script
        B4c["features_tokens_4.xlsx"]:::file
        B4d["feature_extracted_2.xlsx"]:::file
        B5["Dataset Preparation"]:::process
        B5a["dataset_eng_1.xlsx"]:::file
        B5b["dataset_hin.xlsx"]:::file
        B5c["bag_of_words_3.xlsx"]:::file
        B6["SVM Model Training & Testing"]:::process
        B6a["first_30_data_svm_6.py"]:::script
        B6b["svm_whole_dataset_5.py"]:::script
        B6c["testing.py"]:::script
        B7["External Tools<br/>(ISC Tagger, langid.py, googletrans)"]:::external

        B1 --> B2
        B2 --> B3
        B3 --> B3a
        B3a --> B3b
        B3b --> B4
        B4 --> B4a
        B4a --> B4b
        B4b --> B4c
        B4c --> B4d
        B4d --> B7
        B7 --> B5
        B5 --> B5a
        B5a --> B5b
        B5b --> B5c
        B5c --> B6
        B6 --> B6a
        B6a --> B6b
        B6b --> B6c
    end

    %% Click Events for Approach 1 Components
    click A1 "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_1/kitni_m.xlsx"
    click A3 "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_1/m_kitni_info_asked.py"
    click A4 "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_1/m_kitni_info_provided.py"
    click A6 "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_1/info_asked_kitni_m.xls"
    click A7 "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_1/info_provided_kitni_m.xls"
    click A8 "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_1/RESULT.docx"

    %% Click Events for Approach 2 Components
    click B1 "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_2/kitni_m.xlsx"
    click B3a "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_2/tokenized_the_training_dataset_4.py"
    click B3b "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_2/approach2_eng_code_1.py"
    click B4a "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_2/feature_extractor_2.py"
    click B4b "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_2/features_3.py"
    click B4c "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_2/features_tokens_4.xlsx"
    click B4d "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_2/feature_extracted_2.xlsx"
    click B5a "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_2/dataset_eng_1.xlsx"
    click B5b "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_2/dataset_hin.xlsx"
    click B5c "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_2/bag_of_words_3.xlsx"
    click B6a "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_2/first_30_data_svm_6.py"
    click B6b "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_2/svm_whole_dataset_5.py"
    click B6c "https://github.com/singhv04/library-codemix-dialogue-dataset-generation-and-dialogue-act-classification/blob/master/approach_2/testing.py"

    %% Class Definitions for styling
    classDef input fill:#B3E5FC,stroke:#039BE5,stroke-width:2px;
    classDef common fill:#C8E6C9,stroke:#388E3C,stroke-width:2px;
    classDef script fill:#FFF9C4,stroke:#FBC02D,stroke-width:2px;
    classDef file fill:#FFCDD2,stroke:#E91E63,stroke-width:2px;
    classDef process fill:#E1BEE7,stroke:#9C27B0,stroke-width:2px;
    classDef external fill:#D1C4E9,stroke:#673AB7,stroke-width:2px;
    classDef output fill:#FFE0B2,stroke:#FF9800,stroke-width:2px;
```
