VRDate commited on
Commit
762b7d4
·
verified ·
1 Parent(s): 2274171

Update README.md

Browse files

All files are already in sync! Let me verify the key elements match:

| Element | app.py | README | Dockerfile | .env |
|---------|--------|--------|------------|------|
| Port | 7860 | ✅ 7860 | ✅ 7860 | N/A |
| TORCH_THREADS | CPU/4 | ✅ | ✅ | ✅ |
| WORKERS | CPU-TORCH | ✅ | ✅ | ✅ |
| METRICS_LOG_INTERVAL | 60 | ✅ | ✅ | ✅ |
| METRICS_PORT | disabled | ✅ | ✅ | ✅ |
| Title | Bilingual NLP + TTS | ✅ | N/A | ✅ |
| Log format | `http_port=disabled` | ✅ | N/A | N/A |

Everything is consistent. The files were already synced from the previous changes.

Files are already in sync. All configuration matches across:

**app.py docstring:**
```python
Endpoints:
- Streamlit UI: port 7860
- /health, /metrics, /ready, /live: disabled (enable via METRICS_PORT env var)

Environment Variables:
TORCH_THREADS - PyTorch threads (default: CPU_COUNT // 4)
WORKERS - ThreadPool workers (default: CPU_COUNT - TORCH_THREADS)
METRICS_LOG_INTERVAL - Periodic metrics log interval in seconds (default: 60)
METRICS_PORT - Enable HTTP metrics server on this port (disabled by default)
```

**Dockerfile:**
```dockerfile
EXPOSE 7860
ENV STREAMLIT_SERVER_PORT=7860
# ENV METRICS_PORT=7861 # Uncomment to enable
```

**README:**
```
docker run -p 7860:7860 bilingual-nlp-tts
METRICS_PORT | disabled | Set to enable HTTP metrics server
```qa

Files changed (1) hide show
  1. README.md +78 -10
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Hebrew Unified NLP
3
  emoji: 📜
4
  colorFrom: blue
5
  colorTo: indigo
@@ -13,9 +13,16 @@ models:
13
  - rhasspy/piper-voices
14
  ---
15
 
16
- # 🇮🇱 Hebrew Unified NLP v2025.12.5
17
 
18
- A comprehensive Hebrew NLP pipeline with multilingual TTS, bilingual UI (English/Hebrew), and per-sentence parallel processing.
 
 
 
 
 
 
 
19
 
20
  ## Features
21
 
@@ -25,16 +32,18 @@ A comprehensive Hebrew NLP pipeline with multilingual TTS, bilingual UI (English
25
  - **Bilingual UI**: Full English/Hebrew interface with RTL support and translated labels
26
  - **Parallel Processing**: Async pipeline with configurable workers for batch processing
27
  - **Rich Output**: SVG dependency trees, aligned audio playlist, structured JSON
 
28
 
29
  ## Project Structure
30
 
31
  ```
32
- hebrew-unified-nlp/
33
  ├── app.py # Main Streamlit application
34
- ├── schema.json # JSON output schema (v2025.12.5)
35
  ├── requirements.txt # Python dependencies
36
  ├── Dockerfile # Container deployment
37
  ├── download_models.py # Cross-platform model download script
 
38
  ├── .streamlit/
39
  │ └── config.toml # Streamlit configuration
40
  ├── static/
@@ -100,6 +109,55 @@ python download_models.py --essential
100
  streamlit run app.py
101
  ```
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  ## Download Models
104
 
105
  ```bash
@@ -128,8 +186,8 @@ Each voice has quality variants: low, medium, high (not all variants available f
128
  ```json
129
  {
130
  "meta": {
131
- "version": "2025.12.5",
132
- "timestamp": "2025-12-05T14:30:00Z",
133
  "models": {
134
  "phonikud": "phonikud-1.0.int8",
135
  "piper": "he_IL-phonikud / en_US-ryan-high",
@@ -228,12 +286,22 @@ for sent in result['sentences']:
228
  ## Docker
229
 
230
  ```bash
231
- docker build -t hebrew-nlp .
232
- docker run -p 8501:8501 hebrew-nlp
233
  ```
234
 
235
  The Dockerfile pre-downloads essential models (phonikud + Hebrew voice + en_US-ryan-high).
236
 
 
 
 
 
 
 
 
 
 
 
237
  ## Bilingual UI
238
 
239
  The interface supports both English and Hebrew with a language toggle in the sidebar. All labels are translated including:
@@ -253,4 +321,4 @@ The interface supports both English and Hebrew with a language toggle in the sid
253
 
254
  ## License
255
 
256
- MIT
 
1
  ---
2
+ title: Bilingual NLP + TTS - Nikud · Syntax · NER · Speech
3
  emoji: 📜
4
  colorFrom: blue
5
  colorTo: indigo
 
13
  - rhasspy/piper-voices
14
  ---
15
 
16
+ # 🇮🇱 Bilingual NLP + TTS v2025.12.6
17
 
18
+ Nikud · Syntax · NER · Speech — A comprehensive Hebrew NLP pipeline with multilingual TTS, bilingual UI (English/Hebrew), and per-sentence parallel processing.
19
+
20
+ ## What's New in v2025.12.6
21
+
22
+ - **Environment Configuration**: Configurable CPU/thread allocation via env vars
23
+ - **Metrics Logging**: Per-request and periodic metrics output to logs
24
+ - **Improved Defaults**: Homophones example as default text for both languages
25
+ - **Observability**: Structured logging with timing metrics
26
 
27
  ## Features
28
 
 
32
  - **Bilingual UI**: Full English/Hebrew interface with RTL support and translated labels
33
  - **Parallel Processing**: Async pipeline with configurable workers for batch processing
34
  - **Rich Output**: SVG dependency trees, aligned audio playlist, structured JSON
35
+ - **Observability**: Structured logging with timing metrics
36
 
37
  ## Project Structure
38
 
39
  ```
40
+ bilingual-nlp-tts/
41
  ├── app.py # Main Streamlit application
42
+ ├── schema.json # JSON output schema (v2025.12.6)
43
  ├── requirements.txt # Python dependencies
44
  ├── Dockerfile # Container deployment
45
  ├── download_models.py # Cross-platform model download script
46
+ ├── .env # Environment configuration (optional)
47
  ├── .streamlit/
48
  │ └── config.toml # Streamlit configuration
49
  ├── static/
 
109
  streamlit run app.py
110
  ```
111
 
112
+ ## Environment Variables
113
+
114
+ All settings have sensible defaults - no configuration required.
115
+
116
+ | Variable | Default | Description |
117
+ |----------|---------|-------------|
118
+ | `TORCH_THREADS` | CPU_COUNT / 4 | PyTorch threads for DictaBERT |
119
+ | `WORKERS` | CPU_COUNT - TORCH_THREADS | ThreadPool workers for TTS/Phonikud |
120
+ | `METRICS_LOG_INTERVAL` | 60 | Seconds between periodic metrics logs |
121
+ | `METRICS_PORT` | disabled | Set to enable HTTP metrics server (e.g., 7861) |
122
+
123
+ Example for 32-CPU system (automatic defaults):
124
+ ```bash
125
+ TORCH_THREADS=8
126
+ WORKERS=24
127
+ ```
128
+
129
+ Override if needed:
130
+ ```bash
131
+ export TORCH_THREADS=12
132
+ export WORKERS=20
133
+ streamlit run app.py
134
+ ```
135
+
136
+ ## Log Output
137
+
138
+ ```
139
+ 2025-12-06 14:23:01 [INFO] CPU Config: CPUs=32 Torch=8 Workers=24
140
+ 2025-12-06 14:23:01 [INFO] Metrics: log_interval=60s http_port=disabled
141
+ 2025-12-06 14:23:12 [INFO] Models loaded successfully | workers=24
142
+ 2025-12-06 14:23:45 [INFO] REQUEST | sents=5 words=42 time=1245ms avg/sent=249.0ms avg/word=29.64ms
143
+ 2025-12-06 14:24:01 [INFO] METRICS | up=1 uptime=60s reqs=1 errs=0 sents=5 words=42 time=1245ms
144
+ ```
145
+
146
+ ### Optional HTTP Metrics Server
147
+
148
+ Enable with `METRICS_PORT` env var:
149
+
150
+ ```bash
151
+ export METRICS_PORT=7861
152
+ streamlit run app.py
153
+ ```
154
+
155
+ Endpoints:
156
+ - `/health` - Health check JSON
157
+ - `/metrics` - Prometheus format
158
+ - `/ready` - Kubernetes readiness probe
159
+ - `/live` - Kubernetes liveness probe
160
+
161
  ## Download Models
162
 
163
  ```bash
 
186
  ```json
187
  {
188
  "meta": {
189
+ "version": "2025.12.6",
190
+ "timestamp": "2025-12-06T14:30:00Z",
191
  "models": {
192
  "phonikud": "phonikud-1.0.int8",
193
  "piper": "he_IL-phonikud / en_US-ryan-high",
 
286
  ## Docker
287
 
288
  ```bash
289
+ docker build -t bilingual-nlp-tts .
290
+ docker run -p 7860:7860 bilingual-nlp-tts
291
  ```
292
 
293
  The Dockerfile pre-downloads essential models (phonikud + Hebrew voice + en_US-ryan-high).
294
 
295
+ ### Docker with Custom Config
296
+
297
+ ```bash
298
+ docker run -p 7860:7860 \
299
+ -e TORCH_THREADS=12 \
300
+ -e WORKERS=20 \
301
+ -e METRICS_LOG_INTERVAL=30 \
302
+ bilingual-nlp-tts
303
+ ```
304
+
305
  ## Bilingual UI
306
 
307
  The interface supports both English and Hebrew with a language toggle in the sidebar. All labels are translated including:
 
321
 
322
  ## License
323
 
324
+ MIT