Add document table extraction (PDF/DOCX/PPTX) and integrate with CLI & Web UI#40
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13207286f4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (inputType !== 'excel') { | ||
| appState.detectedInputType = 'csv'; | ||
| if (UI.sheetSelect) UI.sheetSelect.innerHTML = '<option value="">CSV는 시트 선택이 필요 없습니다.</option>'; | ||
| const fileBase64 = await readFileAsBase64(file); |
There was a problem hiding this comment.
Skip base64 conversion for non-binary file selection
fetchSheetsForFile now base64-encodes every selected file before checking inputType, but the CSV path never uses that value. For large CSV uploads this does an unnecessary full-file copy plus base64 expansion on each file-change/refresh action, which can noticeably freeze the UI or hit browser memory limits even though no sheet/table lookup is needed.
Useful? React with 👍 / 👎.
Motivation
confidence)를 계산해 사용자가 직접 테이블을 선택하도록 지원해야 합니다.Description
bitnet_tools/document_extract.py를 추가해pdf/docx/pptx에 대한 통합 표 추출 인터페이스와ExtractedTable/DocumentExtractResult타입을 구현했습니다.row_count,column_count,header_inferred,missing_ratio,confidence를 계산해 반환합니다.analyze흐름을 확장해 문서 입력을 허용하고--list-tables로 목록 확인,--table-index로 특정 테이블을 선택해 기존build_analysis_payload파이프라인으로 전달하도록 연결했습니다./api/document/extract엔드포인트를 추가하고/api/analyze에input_type=document+table_index처리를 추가했으며 내부 함수_coerce_csv_text_from_file_payload가 문서 페이로드를 CSV 텍스트로 정규화하도록 통합했습니다.document옵션 추가, 파일 선택 시 문서의 표 목록과 신뢰도 표시 및 선택된 인덱스를 서버로 전달하도록app.js/index.html을 업데이트했고 멀티파일 업로드에서도 문서 처리를 지원합니다.tests/test_document_extract.py), 웹의 문서 페이로드 정규화 테스트와 CLI 문서 명령 테스트를 포함해 관련 테스트를 추가/수정했습니다.Testing
python -m py_compile bitnet_tools/web.py bitnet_tools/cli.py bitnet_tools/document_extract.py실행(성공).pytest -q tests/test_document_extract.py tests/test_web.py tests/test_cli.py실행 결과 성공(해당 모듈 테스트들 통과).pytest -q실행 결과 전체 테스트 통과 (35 passed).python -m bitnet_tools.cli ui) 및 Playwright로 페이지 렌더링/스크린샷 캡처 확인(성공).Codex Task