Jendope commited on
Commit
d00a49b
·
1 Parent(s): c82a1a7

Document OCR message-only setup

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. docs/DEPLOYMENT_README.md +10 -0
README.md CHANGED
@@ -176,7 +176,7 @@ When `response_language` is omitted or set to `auto`, the backend detects the me
176
  | `LLM_MODEL` | Text-analysis model, project example `qwen3.6-plus`; can be changed to another accessible DashScope model |
177
  | `LLM_ENABLE_THINKING` | Set `false` for faster short JSON replies |
178
  | `OCR_MODEL` | OCR model, default `qwen-vl-ocr` |
179
- | `OCR_EXTRACT_MESSAGE_ONLY` | Default `true`; removes screenshot UI noise so OCR returns the main message/notice body |
180
  | `VECTORSTORE_PATH` | Chroma DB path, default `knowledge_base/vectorstore` |
181
  | `EMBEDDINGS_PROVIDER` | `local`, `keyword`, or `hf_inference` |
182
  | `HF_EMBEDDING_MODEL` | Default `BAAI/bge-large-zh-v1.5` |
 
176
  | `LLM_MODEL` | Text-analysis model, project example `qwen3.6-plus`; can be changed to another accessible DashScope model |
177
  | `LLM_ENABLE_THINKING` | Set `false` for faster short JSON replies |
178
  | `OCR_MODEL` | OCR model, default `qwen-vl-ocr` |
179
+ | `OCR_EXTRACT_MESSAGE_ONLY` | Default `true`; removes screenshot UI noise so OCR returns the main message/notice body. Keep enabled for SMS/WhatsApp screenshots; it removes common headers, date separators, Meta business notices, input placeholders, and action buttons. |
180
  | `VECTORSTORE_PATH` | Chroma DB path, default `knowledge_base/vectorstore` |
181
  | `EMBEDDINGS_PROVIDER` | `local`, `keyword`, or `hf_inference` |
182
  | `HF_EMBEDDING_MODEL` | Default `BAAI/bge-large-zh-v1.5` |
docs/DEPLOYMENT_README.md CHANGED
@@ -21,6 +21,8 @@ RETRIEVAL_TOP_K=3
21
  RETRIEVAL_MIN_SIMILARITY=0.35
22
  ```
23
 
 
 
24
  `DASHSCOPE_REGION=international` uses Alibaba Cloud International endpoints. If your API key is from the Mainland China DashScope console, use `DASHSCOPE_REGION=china` instead.
25
 
26
  The text-analysis LLM uses the same Alibaba/DashScope key by default. Alibaba Model Studio also serves GLM-5.1, DeepSeek, and other available models through the same compatible API. For mainland GLM-5.1:
@@ -323,6 +325,14 @@ Check:
323
  - uploaded file is JPG, PNG, or WEBP
324
  - image is below the configured upload limit
325
 
 
 
 
 
 
 
 
 
326
  ### Analyze Returns 401 Invalid API Key
327
 
328
  This means the app reached the configured LLM provider successfully, but the provider rejected the key or the key does not match the configured endpoint.
 
21
  RETRIEVAL_MIN_SIMILARITY=0.35
22
  ```
23
 
24
+ Keep `OCR_EXTRACT_MESSAGE_ONLY=true` for normal installation and Hugging Face deployment. This makes screenshot OCR focus on the message body and ignore common phone UI text such as SMS/WhatsApp headers, date separators like `Tue, Mar 17 at 15:14`, Meta business notices, input placeholders, and standalone action buttons such as unsubscribe. The cleanup uses general patterns, so you do not need to list every possible date manually.
25
+
26
  `DASHSCOPE_REGION=international` uses Alibaba Cloud International endpoints. If your API key is from the Mainland China DashScope console, use `DASHSCOPE_REGION=china` instead.
27
 
28
  The text-analysis LLM uses the same Alibaba/DashScope key by default. Alibaba Model Studio also serves GLM-5.1, DeepSeek, and other available models through the same compatible API. For mainland GLM-5.1:
 
325
  - uploaded file is JPG, PNG, or WEBP
326
  - image is below the configured upload limit
327
 
328
+ ### OCR Includes Phone UI Text
329
+
330
+ Check:
331
+
332
+ - `OCR_EXTRACT_MESSAGE_ONLY=true` is set in Hugging Face Space Variables or local `.env`
333
+ - the backend was restarted or the Hugging Face Space finished rebuilding after changing variables
334
+ - if a new screenshot style still includes UI text, add one general cleanup pattern in `_is_probable_ocr_ui_line()` or `_is_ocr_date_separator()` instead of hard-coding every date
335
+
336
  ### Analyze Returns 401 Invalid API Key
337
 
338
  This means the app reached the configured LLM provider successfully, but the provider rejected the key or the key does not match the configured endpoint.