a9d3a35dd7
chore: optimize prompt
2026-03-10 21:36:35 +08:00
liuyuanchuang
30d2c2f45b
fix: remove padding from GLMOCREndToEndService and clean up ruff violations
...
- Drop image padding in GLMOCREndToEndService.recognize(); use raw image directly
- Fix F821 undefined `padded` references replaced with `image`
- Fix F601 duplicate dict key "≠" in converter
- Fix F841 unused `image_cls_ids` variable in layout_postprocess
- Fix E702 semicolon-separated statements in layout_postprocess
- Fix UP031 percent-format replaced with f-string in logging_config
- Auto-fix 44 additional ruff violations (import order, UP035/UP045/UP006, F401, F541)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-10 19:52:22 +08:00
liuyuanchuang
f8173f7c0a
feat: optimize padding and formula fallback
2026-03-10 09:54:54 +08:00
liuyuanchuang
cff14904bf
fix: layout detection & format conversion robustness
...
Three targeted fixes for layout processing issues:
1. formula_number type mapping (layout_detector.py)
- Changed formula_number region type from "formula" to "text"
- Ensures Text Recognition prompt, preventing $$-wrapped output
- Prevents malformed \tag{$$...\n$$} in merged formulas
2. Reading order (ocr_service.py)
- Sort layout regions by (y1, x1) after detection
- Ensures top-to-bottom, left-to-right processing order
- Fixes paragraph ordering issues in output
3. Formula number cleaning (glm_postprocess.py)
- clean_formula_number() now strips $$, $, \[...\] delimiters
- Handles edge case where vLLM still returns math-mode wrapped content
- Prevents delimiter leakage into \tag{} placeholders
Also adds logging:
- Warning when empty formula content is skipped
- Warning when region crop is too small (< 10×10 px)
- Warning when vLLM parallel call fails
- Warning when format conversion fails
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com >
2026-03-09 17:57:05 +08:00
liuyuanchuang
6dfaf9668b
feat add glm-ocr core
2026-03-09 17:13:19 +08:00
liuyuanchuang
fd91819af0
feat: no padding image
2026-02-25 09:52:45 +08:00
liuyuanchuang
a568149164
fix: update paddle-ocr url
2026-02-09 22:26:31 +08:00
liuyuanchuang
f64bf25f67
fix: image variable not defined
2026-02-09 22:23:52 +08:00
liuyuanchuang
7799e39298
fix: image as element
2026-02-09 22:18:30 +08:00
liuyuanchuang
5504bbbf1e
fix:glm max tokens
2026-02-07 21:38:41 +08:00
liuyuanchuang
1a4d54ce34
fix: post hanlde for ocr
2026-02-07 21:28:46 +08:00
liuyuanchuang
f514f98142
feat: add padding
2026-02-07 16:53:09 +08:00
liuyuanchuang
d86107976a
feat: update threshold
2026-02-07 13:26:57 +08:00
liuyuanchuang
fa10d8194a
fix: downgrade threshold
2026-02-07 09:34:15 +08:00
liuyuanchuang
23e2160668
fix: get setting param
2026-02-07 09:11:43 +08:00
liuyuanchuang
f0ad0a4c77
feat: add glm ocr
2026-02-06 15:06:50 +08:00
liuyuanchuang
c372a4afbe
fix: update port in dockerfile
2026-02-05 22:20:01 +08:00
liuyuanchuang
36172ba4ff
fix: update port
2026-02-05 22:08:04 +08:00
liuyuanchuang
a3ca04856f
fix: rm space
2026-02-05 21:50:12 +08:00
liuyuanchuang
eb68843e2c
feat: update model name
2026-02-05 21:26:23 +08:00
liuyuanchuang
c93eba2839
refact: add log
2026-02-05 20:50:04 +08:00
liuyuanchuang
15986c8966
feat: update paddleocr-vl port
2026-02-05 20:43:24 +08:00
liuyuanchuang
4de9aefa68
feat: add paddleocr-vl
2026-02-05 20:33:43 +08:00
liuyuanchuang
83e9bf0fb1
feat: add rm fake title
2026-02-05 17:59:54 +08:00
liuyuanchuang
cee93ab616
feat: rm space in markdown
2026-02-05 13:32:13 +08:00
liuyuanchuang
280a8cdaeb
fix: markdown post handel
2026-02-05 13:18:55 +08:00
liuyuanchuang
cd790231ec
fix: rm other attr
2026-02-04 16:56:20 +08:00
liuyuanchuang
f1229483bf
fix: rm other attr in mathml
2026-02-04 16:12:22 +08:00
liuyuanchuang
35419b2102
fix: mineru post handel
2026-02-04 16:07:04 +08:00
liuyuanchuang
61fd5441b7
fix: add post markdown
2026-02-04 16:04:18 +08:00
liuyuanchuang
720cd05add
fix: handle mathml preprocess
2026-02-04 15:52:04 +08:00
liuyuanchuang
56a02eb6da
fix: update mathml
2026-02-04 15:49:13 +08:00
liuyuanchuang
e31017cfe7
fix: add preprocess
2026-02-04 12:45:34 +08:00
liuyuanchuang
526c1f3a0d
feat: optimize the format convert
2026-02-04 12:00:06 +08:00
10dbd59161
fix: matrix not rendor in docx
2026-01-14 14:18:00 +08:00
df2b664af4
fix: add image padding for mineru
2026-01-05 21:37:51 +08:00
6ea37c9380
feat: add mineru model
2026-01-05 17:30:54 +08:00
3870c108b2
fix: image alpha error
2026-01-01 23:38:52 +08:00
35928c2484
fix: refact logic
2025-12-31 17:38:32 +08:00
liuyuanchuang
f97791ca18
fix: add package
2025-12-29 20:02:07 +08:00
liuyuanchuang
874fd383cc
init repo
2025-12-29 17:34:58 +08:00