Draft
Conversation
- 문서 DB용 폴더 database_document 추가 - DB 설계도 schema.sql 추가 - DB 연결 파이썬 파일 database.py 추가 - backend_OCR 내 requirements.txt에 sqlalchemy, pymysql 추가 - ocr_server.py MySQL DB 연동 추가 현재 OCR 동작 과정 1. S3 연동: 프론트엔드가 S3에 이미지를 올리고 백엔드(OCR 서버)로 파일명을 보냅니다. 백엔드는 S3에서 그 파일을 임시로 다운로드합니다. 2. OCR 분석: 다운받은 이미지에서 텍스트를 추출합니다. 3. DB 저장: 파일명, 확장자, S3 주소, 그리고 추출된 텍스트를 묶어 docsinfos 테이블에 INSERT 합니다. 이 때 MySQL이 고유 번호(id)를 자동으로 발급해 줍니다. 4. 프론트엔드 반환: 방금 발급받은 id와 추출된 text를 프론트엔드로 반환합니다.
- 최근 문서 목록에 docsinfos에 저장된 문서들을 표시 & 새 문서 업로드 시 목록 갱신 - 사용자가 최근 문서 목록에서 문서를 클릭하면 docsinfos에 저장되어있는 그 문서의 추출된 텍스트를 불러옴
- ocr 서버 최초 실행 시 데이터베이스에 docsinfos 테이블이 없다면 자동으로 생성 - extracted_text 문자형 text ➡️ LONGTEXT로 변경 (더 긴 문서의 내용을 저장할 경우 대비)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.