# jithincheriyan/offense-detection-in-se-communities architecture

> Architecture diagram of the GitHub repository jithincheriyan/offense-detection-in-se-communities, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jithincheriyan/offense-detection-in-se-communities
- Repository: https://github.com/jithincheriyan/offense-detection-in-se-communities

## Overview

This is thesis code for detecting politeness-norm violations in online software-engineering communities and generating reduced-violation alternatives. The apparent user-facing workflow is comment input through the Streamlit app, then analysis and paraphrase generation; the app and main pipeline were not sampled, so their wiring is uncertain. The sampled paraphrasing module shows relevance checking, violation-word masking, and suggestion evaluation, while the separate BERT script trains and tests a classifier. Major components are retained, but edges are limited to documented calls and data operations.

Main entry points: [`Thesis documents/Paraphrase_module.py`](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Paraphrase_module.py) (Paraphrase orchestration), [`Transformer_BERT.py`](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Transformer_BERT.py) (BERT training and test), [`Streamlit_App.py`](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Streamlit_App.py) (Streamlit app), [`Thesis documents/Total_pipeline.py`](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Total_pipeline.py) (Thesis pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_streamlit["Streamlit app<br/>[Streamlit_App.py]"]
  node_pipeline["Thesis pipeline<br/>[Total_pipeline.py]"]
end

subgraph group_paraphrase["Paraphrase workflow"]
  node_paraphrase["Paraphrase orchestration"]
  node_relevance["SE relevance check"]
  node_masking["Violation masking"]
  node_generation["Suggestion generation"]
  node_evaluation["Suggestion evaluation"]
end

subgraph group_models["Model development"]
  node_bert["BERT training and test"]
  node_model_outputs["Classifier predictions"]
end

subgraph group_data["Research data"]
  node_thesaurus["SE thesaurus"]
  node_regex["Violation patterns<br/>[Regex_Updated.csv]"]
  node_annotations["Community annotations"]
end

node_user(("Comment author"))
node_wandb["Weights &amp; Biases"]

node_user -.->|"submits comment"| node_streamlit
node_streamlit -.->|"routes workflow"| node_pipeline
node_pipeline -.->|"invokes"| node_paraphrase
node_paraphrase -->|"checks relevance"| node_relevance
node_relevance -->|"reads terms"| node_thesaurus
node_paraphrase -->|"selects words"| node_masking
node_masking -->|"filters patterns"| node_regex
node_paraphrase -->|"requests suggestions"| node_generation
node_paraphrase -->|"scores suggestions"| node_evaluation
node_bert -->|"configures tracking"| node_wandb
node_bert -->|"writes predictions"| node_model_outputs
node_annotations -.->|"training data"| node_bert

click node_streamlit "https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Streamlit_App.py"
click node_pipeline "https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Total_pipeline.py"
click node_paraphrase "https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Paraphrase_module.py"
click node_relevance "https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Paraphrase_module.py"
click node_masking "https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Paraphrase_module.py"
click node_generation "https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Paraphrase_module.py"
click node_evaluation "https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Paraphrase_module.py"
click node_thesaurus "https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/SE_Thesaurus_New_v2.json"
click node_regex "https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Regex_Updated.csv"
click node_bert "https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Transformer_BERT.py"
click node_annotations "https://github.com/jithincheriyan/offense-detection-in-se-communities/tree/main/Annotated%20CSVs"
click node_model_outputs "https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Transformer_BERT.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_streamlit,node_pipeline toneBlue
class node_paraphrase,node_relevance,node_masking,node_generation,node_evaluation toneAmber
class node_bert,node_model_outputs toneMint
class node_thesaurus,node_regex,node_annotations toneRose
class node_user,node_wandb toneIndigo
```

## Components

### User interface

- [Streamlit app](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Streamlit_App.py): `Streamlit_App.py`
- [Thesis pipeline](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Total_pipeline.py): `Thesis documents/Total_pipeline.py`

### Paraphrase workflow

- [Paraphrase orchestration](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Paraphrase_module.py): `Thesis documents/Paraphrase_module.py`
- [SE relevance check](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Paraphrase_module.py): `Thesis documents/Paraphrase_module.py`
- [Violation masking](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Paraphrase_module.py): `Thesis documents/Paraphrase_module.py`
- [Suggestion generation](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Paraphrase_module.py): `Thesis documents/Paraphrase_module.py`
- [Suggestion evaluation](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Paraphrase_module.py): `Thesis documents/Paraphrase_module.py`

### Model development

- [BERT training and test](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Transformer_BERT.py): `Transformer_BERT.py`
- [Classifier predictions](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Transformer_BERT.py): `Transformer_BERT.py`

### Research data

- [SE thesaurus](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/SE_Thesaurus_New_v2.json): `Thesis documents/SE_Thesaurus_New_v2.json`
- [Violation patterns](https://github.com/jithincheriyan/offense-detection-in-se-communities/blob/main/Thesis%20documents/Regex_Updated.csv): `Thesis documents/Regex_Updated.csv`
- [Community annotations](https://github.com/jithincheriyan/offense-detection-in-se-communities/tree/main/Annotated%20CSVs): `Annotated CSVs`

### Other components

- **Comment author**
- **Weights & Biases**

## Connections

- Comment author → Streamlit app: submits comment
- Streamlit app → Thesis pipeline: routes workflow
- Thesis pipeline → Paraphrase orchestration: invokes
- Paraphrase orchestration → SE relevance check: checks relevance (evidence: `Thesis documents/Paraphrase_module.py`)
- SE relevance check → SE thesaurus: reads terms (evidence: `Thesis documents/Paraphrase_module.py`)
- Paraphrase orchestration → Violation masking: selects words (evidence: `Thesis documents/Paraphrase_module.py`)
- Violation masking → Violation patterns: filters patterns (evidence: `Thesis documents/Paraphrase_module.py`)
- Paraphrase orchestration → Suggestion generation: requests suggestions (evidence: `Thesis documents/Paraphrase_module.py`)
- Paraphrase orchestration → Suggestion evaluation: scores suggestions (evidence: `Thesis documents/Paraphrase_module.py`)
- BERT training and test → Weights & Biases: configures tracking (evidence: `Transformer_BERT.py`)
- BERT training and test → Classifier predictions: writes predictions (evidence: `Transformer_BERT.py`)
- Community annotations → BERT training and test: training data
