# muradbaghirli/sentenceboundarydetection architecture

> Architecture diagram of the GitHub repository muradbaghirli/sentenceboundarydetection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/muradbaghirli/sentenceboundarydetection
- Repository: https://github.com/muradbaghirli/sentenceboundarydetection

## Overview

This repository provides Azerbaijani sentence-boundary detection: it trains and evaluates character-feature models, and serves sentence segmentation through a FastAPI endpoint that preprocesses candidate boundaries, calls NVIDIA Triton, and turns predictions into sentences. The README also documents separate Triton model hosting and standalone inference paths. Edges reflect shown API/service calls, indexed module references, or README statements; some library internals and deployment wiring were not sampled, so uncertain links are omitted.

Main entry points: [`app/api.py`](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/app/api.py) (API and probes), [`azcharboundary/segmenter.py`](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/segmenter.py) (Text segmenter), [`azcharboundary/utils/features.py`](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/utils/features.py) (Character features), [`azcharboundary/utils/encoders.py`](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/utils/encoders.py) (Character encoding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_routes["API and probes<br/>[api.py]"]
  node_schemas["Request schemas<br/>[models.py]"]
  node_settings["Service settings<br/>[config.py]"]
end

subgraph group_inference["Serving and Inference"]
  node_api_service["Inference service<br/>[services.py]"]
  node_api_preprocess["Request preprocessing<br/>[services.py]"]
  node_api_postprocess["Sentence assembly<br/>[services.py]"]
  node_triton["Triton server"]
  node_model_repo["Triton model repository"]
  node_triton_client["Standalone Triton inference"]
  node_local_inference["Local inference<br/>[inference.py]"]
end

subgraph group_library["Segmentation Library"]
  node_segmenter["Text segmenter<br/>[segmenter.py]"]
  node_features["Character features<br/>[features.py]"]
  node_encoder["Character encoding<br/>[encoders.py]"]
  node_rules["Language rules<br/>[constants.py]"]
  node_model_impl["Model implementations<br/>[models.py]"]
end

subgraph group_training["Training and Evaluation"]
  node_train["Training entry point<br/>[train.py]"]
  node_evaluation["Model evaluation<br/>[evaluation.py]"]
  node_prep["Text preprocessing<br/>[preprocessing.py]"]
end

node_caller(("API caller"))

node_caller -->|"submits text"| node_routes
node_routes -->|"validates payload"| node_schemas
node_routes -->|"uses service"| node_api_service
node_routes -->|"reads settings"| node_settings
node_routes -->|"preprocesses text"| node_api_preprocess
node_routes -->|"sends inference"| node_triton
node_routes -->|"assembles sentences"| node_api_postprocess
node_api_service -->|"uses settings"| node_settings
node_api_preprocess -->|"extracts features"| node_features
node_features -->|"encodes characters"| node_encoder
node_encoder -->|"uses character sets"| node_rules
node_features -->|"applies text rules"| node_rules
node_model_repo -->|"hosts model"| node_triton
node_train -->|"uses segmenter"| node_segmenter
node_segmenter -->|"extracts features"| node_features
node_segmenter -->|"uses encoder"| node_encoder
node_segmenter -->|"creates model"| node_model_impl
node_segmenter -->|"delegates evaluation"| node_evaluation
node_evaluation -->|"extracts evaluation features"| node_features
node_local_inference -->|"uses segmenter"| node_segmenter
node_triton_client -->|"extracts features"| node_features
node_triton_client -->|"sends inference"| node_triton
node_prep -->|"uses constants"| node_rules

click node_routes "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/app/api.py"
click node_schemas "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/app/models.py"
click node_settings "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/app/config.py"
click node_api_service "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/app/services.py"
click node_api_preprocess "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/app/services.py"
click node_api_postprocess "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/app/services.py"
click node_model_repo "https://github.com/muradbaghirli/sentenceboundarydetection/tree/main/triton_inference_server/model"
click node_triton_client "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/inference/triton_inference.py"
click node_local_inference "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/inference/inference.py"
click node_segmenter "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/segmenter.py"
click node_features "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/utils/features.py"
click node_encoder "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/utils/encoders.py"
click node_rules "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/utils/constants.py"
click node_model_impl "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/utils/models.py"
click node_train "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/train.py"
click node_evaluation "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/utils/evaluation.py"
click node_prep "https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/preprocessing.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_routes,node_schemas,node_settings toneBlue
class node_api_service,node_api_preprocess,node_api_postprocess,node_triton,node_model_repo,node_triton_client,node_local_inference toneAmber
class node_segmenter,node_features,node_encoder,node_rules,node_model_impl,node_caller toneMint
class node_train,node_evaluation,node_prep toneRose
```

## Components

### HTTP API

- [API and probes](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/app/api.py): `app/api.py`
- [Request schemas](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/app/models.py): `app/models.py`
- [Service settings](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/app/config.py): `app/config.py`

### Serving and Inference

- [Inference service](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/app/services.py): `app/services.py`
- [Request preprocessing](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/app/services.py): `app/services.py`
- [Sentence assembly](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/app/services.py): `app/services.py`
- **Triton server**
- [Triton model repository](https://github.com/muradbaghirli/sentenceboundarydetection/tree/main/triton_inference_server/model): `triton_inference_server/model`
- [Standalone Triton inference](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/inference/triton_inference.py): `inference/triton_inference.py`
- [Local inference](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/inference/inference.py): `inference/inference.py`

### Segmentation Library

- [Text segmenter](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/segmenter.py): `azcharboundary/segmenter.py`
- [Character features](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/utils/features.py): `azcharboundary/utils/features.py`
- [Character encoding](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/utils/encoders.py): `azcharboundary/utils/encoders.py`
- [Language rules](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/utils/constants.py): `azcharboundary/utils/constants.py`
- [Model implementations](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/utils/models.py): `azcharboundary/utils/models.py`

### Training and Evaluation

- [Training entry point](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/train.py): `azcharboundary/train.py`
- [Model evaluation](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/utils/evaluation.py): `azcharboundary/utils/evaluation.py`
- [Text preprocessing](https://github.com/muradbaghirli/sentenceboundarydetection/blob/main/azcharboundary/preprocessing.py): `azcharboundary/preprocessing.py`

### Other components

- **API caller**

## Connections

- API caller → API and probes: submits text (evidence: `README.md`)
- API and probes → Request schemas: validates payload (evidence: `app/api.py`)
- API and probes → Inference service: uses service (evidence: `app/api.py`)
- API and probes → Service settings: reads settings (evidence: `app/api.py`)
- API and probes → Request preprocessing: preprocesses text (evidence: `app/api.py`)
- API and probes → Triton server: sends inference (evidence: `app/api.py`)
- API and probes → Sentence assembly: assembles sentences (evidence: `app/api.py`)
- Inference service → Service settings: uses settings (evidence: `app/services.py`)
- Request preprocessing → Character features: extracts features (evidence: `app/services.py`)
- Character features → Character encoding: encodes characters (evidence: `azcharboundary/utils/features.py`)
- Character encoding → Language rules: uses character sets (evidence: `azcharboundary/utils/encoders.py`)
- Character features → Language rules: applies text rules (evidence: `azcharboundary/utils/features.py`)
- Triton model repository → Triton server: hosts model (evidence: `README.md`)
- Training entry point → Text segmenter: uses segmenter (evidence: `azcharboundary/train.py`)
- Text segmenter → Character features: extracts features (evidence: `azcharboundary/segmenter.py`)
- Text segmenter → Character encoding: uses encoder (evidence: `azcharboundary/segmenter.py`)
- Text segmenter → Model implementations: creates model (evidence: `azcharboundary/segmenter.py`)
- Text segmenter → Model evaluation: delegates evaluation (evidence: `azcharboundary/segmenter.py`)
- Model evaluation → Character features: extracts evaluation features (evidence: `azcharboundary/utils/evaluation.py`)
- Local inference → Text segmenter: uses segmenter (evidence: `inference/inference.py`)
- Standalone Triton inference → Character features: extracts features (evidence: `inference/triton_inference.py`)
- Standalone Triton inference → Triton server: sends inference (evidence: `inference/triton_inference.py`)
- Text preprocessing → Language rules: uses constants (evidence: `azcharboundary/preprocessing.py`)
