# egorandrik/gendescriptionhotel architecture

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

- Interactive diagram: https://gitdiagram.com/egorandrik/gendescriptionhotel
- Repository: https://github.com/egorandrik/gendescriptionhotel
- Video tour (about a minute): https://gitdiagram.com/egorandrik/gendescriptionhotel/video

## Overview

GenDescriptionHotel generates hotel marketing descriptions from a user-filled form, returning two alternatives enriched with nearby attractions and similar text. Users can choose an alternative and submit feedback; feedback is added to an in-memory similarity index. A separate parser collects hotel listings and reviews into Excel, while notebooks support data and model exploration. Runtime wiring is based on the sampled application, parser, and model code; notebook internals are not sampled.

Main entry points: [`web-app/app.py`](https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/app.py) (Flask routes), [`web-app/templates/index.html`](https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/templates/index.html) (Web form), [`web-app/data_knowledge.py`](https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/data_knowledge.py) (Similarity search), [`parser/main.py`](https://github.com/egorandrik/gendescriptionhotel/blob/main/parser/main.py) (Hotel review parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Description web app"]
  node_browser["Web form<br/>[index.html]"]
  node_flask["Flask routes<br/>[app.py]"]
  node_welcome["Welcome page<br/>[welcome.html]"]
  node_formjs["Form interactions<br/>[scripts.js]"]
  node_geo["Nearby attractions<br/>[get_geo.py]"]
  node_generator["Description generator<br/>[model.py]"]
  node_choice["Choice and feedback<br/>[app.py]"]
end

subgraph group_knowledge["Similarity knowledge"]
  node_knowledge["Similarity search<br/>[data_knowledge.py]"]
  node_faiss[("FAISS index<br/>[data_knowledge.py]")]
end

subgraph group_parser["Review collection"]
  node_parser["Hotel review parser<br/>[main.py]"]
  node_workbook["Reviews workbook<br/>[hotel_reviews.xlsx]"]
end

subgraph group_research["Model exploration"]
  node_notebooks["Data and model analysis"]
end

node_guest(("Hotel editor"))
node_maps["Google Maps APIs"]
node_qwen["Qwen language model"]
node_ostrovok["Ostrovok listings"]

node_guest -->|"fills form"| node_browser
node_browser -->|"submits inputs"| node_formjs
node_formjs -->|"POSTs generation"| node_flask
node_flask -->|"renders home"| node_welcome
node_flask -->|"renders form"| node_browser
node_flask -->|"looks up attractions"| node_geo
node_geo -.->|"queries places"| node_maps
node_flask -->|"retrieves examples"| node_knowledge
node_knowledge -->|"searches vectors"| node_faiss
node_flask -->|"generates alternatives"| node_generator
node_generator -.->|"runs inference"| node_qwen
node_flask -->|"returns alternatives"| node_browser
node_guest -->|"chooses or rates"| node_browser
node_browser -->|"posts choice or feedback"| node_flask
node_flask -->|"adds feedback text"| node_knowledge
node_parser -.->|"collects listings"| node_ostrovok
node_parser -->|"writes reviews"| node_workbook

click node_browser "https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/templates/index.html"
click node_flask "https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/app.py"
click node_welcome "https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/templates/welcome.html"
click node_formjs "https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/static/scripts/scripts.js"
click node_geo "https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/get_geo.py"
click node_generator "https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/model.py"
click node_knowledge "https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/data_knowledge.py"
click node_faiss "https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/data_knowledge.py"
click node_choice "https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/app.py"
click node_parser "https://github.com/egorandrik/gendescriptionhotel/blob/main/parser/main.py"
click node_workbook "https://github.com/egorandrik/gendescriptionhotel/blob/main/parser/hotel_reviews.xlsx"
click node_notebooks "https://github.com/egorandrik/gendescriptionhotel/tree/main/notebooks"

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_browser,node_flask,node_welcome,node_formjs,node_geo,node_generator,node_choice toneBlue
class node_knowledge,node_faiss toneAmber
class node_parser,node_workbook,node_maps toneMint
class node_notebooks toneRose
class node_guest,node_qwen,node_ostrovok toneIndigo
```

## Components

### Description web app

- [Web form](https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/templates/index.html): `web-app/templates/index.html`
- [Flask routes](https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/app.py): `web-app/app.py`
- [Welcome page](https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/templates/welcome.html): `web-app/templates/welcome.html`
- [Form interactions](https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/static/scripts/scripts.js): `web-app/static/scripts/scripts.js`
- [Nearby attractions](https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/get_geo.py): `web-app/get_geo.py`
- [Description generator](https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/model.py): `web-app/model.py`
- [Choice and feedback](https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/app.py): `web-app/app.py`

### Similarity knowledge

- [Similarity search](https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/data_knowledge.py): `web-app/data_knowledge.py`
- [FAISS index](https://github.com/egorandrik/gendescriptionhotel/blob/main/web-app/data_knowledge.py): `web-app/data_knowledge.py`

### Review collection

- [Hotel review parser](https://github.com/egorandrik/gendescriptionhotel/blob/main/parser/main.py): `parser/main.py`
- [Reviews workbook](https://github.com/egorandrik/gendescriptionhotel/blob/main/parser/hotel_reviews.xlsx): `parser/hotel_reviews.xlsx`

### Model exploration

- [Data and model analysis](https://github.com/egorandrik/gendescriptionhotel/tree/main/notebooks): `notebooks`

### Other components

- **Hotel editor**
- **Google Maps APIs**
- **Qwen language model**
- **Ostrovok listings**

## Connections

- Hotel editor → Web form: fills form
- Web form → Form interactions: submits inputs
- Form interactions → Flask routes: POSTs generation
- Flask routes → Welcome page: renders home
- Flask routes → Web form: renders form
- Flask routes → Nearby attractions: looks up attractions
- Nearby attractions → Google Maps APIs: queries places
- Flask routes → Similarity search: retrieves examples
- Similarity search → FAISS index: searches vectors
- Flask routes → Description generator: generates alternatives
- Description generator → Qwen language model: runs inference
- Flask routes → Web form: returns alternatives
- Hotel editor → Web form: chooses or rates
- Web form → Flask routes: posts choice or feedback
- Flask routes → Similarity search: adds feedback text
- Hotel review parser → Ostrovok listings: collects listings
- Hotel review parser → Reviews workbook: writes reviews
