# ainniy/hotel_review_multilabel_classification architecture

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

- Interactive diagram: https://gitdiagram.com/ainniy/hotel_review_multilabel_classification
- Repository: https://github.com/ainniy/hotel_review_multilabel_classification

## Overview

This repository documents a multilingual, 20-topic hotel-review classifier. The principal workflow prepares and augments labeled data, trains an XLM-RoBERTa multi-label model, tunes per-label thresholds, then applies the model and thresholds to reviews for submission. The README also describes semantic review headers, stratified splitting, and class-weighted loss. Relationships are based on the README; no notebook source excerpts were provided, so notebook internals and unconfirmed data-flow details are not expanded.

Main entry points: [`preprocessing.ipynb`](https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/preprocessing.ipynb) (Prepare and augment), [`model.ipynb`](https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/model.ipynb) (Fine-tune classifier), [`inference.ipynb`](https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/inference.ipynb) (Predict and submit), [`train_data.csv`](https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/train_data.csv) (Training data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_preprocessing["Prepare and augment"]
  node_train_data["Training data<br/>[train_data.csv]"]
  node_val_data["Validation data<br/>[val_data.csv]"]
end

subgraph group_training["Model training"]
  node_trainer["Fine-tune classifier<br/>[model.ipynb]"]
  node_thresholds["Label thresholds"]
end

subgraph group_prediction["Prediction"]
  node_inference["Predict and submit<br/>[inference.ipynb]"]
end

node_review_data(("Review data"))
node_translator["Back-translation service"]
node_predictions["Topic predictions"]

node_review_data -->|"prepares"| node_preprocessing
node_preprocessing -->|"back-translates"| node_translator
node_preprocessing -->|"creates"| node_train_data
node_preprocessing -->|"creates"| node_val_data
node_trainer -->|"trains on"| node_train_data
node_trainer -->|"validates on"| node_val_data
node_trainer -->|"optimizes"| node_thresholds
node_review_data -->|"submits reviews"| node_inference
node_inference -->|"uses"| node_thresholds
node_inference -->|"produces"| node_predictions

click node_preprocessing "https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/preprocessing.ipynb"
click node_train_data "https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/train_data.csv"
click node_val_data "https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/val_data.csv"
click node_trainer "https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/model.ipynb"
click node_thresholds "https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/best_thresholds.npy"
click node_inference "https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/inference.ipynb"

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_preprocessing,node_train_data,node_val_data,node_review_data toneBlue
class node_trainer,node_thresholds toneAmber
class node_inference toneMint
class node_translator,node_predictions toneIndigo
```

## Components

### Data preparation

- [Prepare and augment](https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/preprocessing.ipynb): `preprocessing.ipynb`
- [Training data](https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/train_data.csv): `train_data.csv`
- [Validation data](https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/val_data.csv): `val_data.csv`

### Model training

- [Fine-tune classifier](https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/model.ipynb): `model.ipynb`
- [Label thresholds](https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/best_thresholds.npy): `best_thresholds.npy`

### Prediction

- [Predict and submit](https://github.com/ainniy/hotel_review_multilabel_classification/blob/main/inference.ipynb): `inference.ipynb`

### Other components

- **Review data**
- **Back-translation service**
- **Topic predictions**

## Connections

- Review data → Prepare and augment: prepares (evidence: `README.md`)
- Prepare and augment → Back-translation service: back-translates (evidence: `README.md`)
- Prepare and augment → Training data: creates (evidence: `README.md`)
- Prepare and augment → Validation data: creates (evidence: `README.md`)
- Fine-tune classifier → Training data: trains on (evidence: `README.md`)
- Fine-tune classifier → Validation data: validates on (evidence: `README.md`)
- Fine-tune classifier → Label thresholds: optimizes (evidence: `README.md`)
- Review data → Predict and submit: submits reviews (evidence: `README.md`)
- Predict and submit → Label thresholds: uses (evidence: `README.md`)
- Predict and submit → Topic predictions: produces (evidence: `README.md`)
