Skip to content

Conversation

@inoray
Copy link
Collaborator

@inoray inoray commented Nov 18, 2025

Checklist:

  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

@inoray inoray linked an issue Nov 18, 2025 that may be closed by this pull request
@gemini-code-assist
Copy link

Summary of Changes

Hello @inoray, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 문서에서 created_date를 추출하는 정확도를 향상시키는 데 중점을 둡니다. 이를 위해 메타데이터 추출 로직이 문서의 더 많은 초기 페이지(2페이지에서 4페이지로 확장)를 분석하고, 파일명과 같은 추가적인 컨텍스트 정보를 활용하도록 개선되었습니다. 또한, 불필요한 이미지 태그를 제거하여 AI 모델이 더 깨끗한 텍스트를 기반으로 메타데이터를 분석할 수 있도록 하였습니다. 이러한 변경사항은 문서 처리 파이프라인 전반에 걸쳐 kwargs 인자 전달을 통합하여 유연성을 높였습니다.

Highlights

  • 메타데이터 추출 범위 확장: 문서의 created_date 추출 정확도를 높이기 위해 메타데이터 추출 시 분석하는 텍스트 범위가 기존 처음 2페이지에서 처음 4페이지로 확장되었습니다.
  • 파일명 정보 활용: _extract_document_metadata_date 함수가 **kwargs를 통해 파일명(org_filename)을 추가 정보로 받아 메타데이터 추출에 활용하도록 개선되었습니다.
  • 불필요한 태그 제거: 메타데이터 추출 전 <!-- image -->와 같은 불필요한 태그를 문서 내용에서 제거하여 AI 모델이 더 깨끗한 텍스트를 기반으로 분석할 수 있도록 하였습니다.
  • kwargs 매개변수 전파: apply_metadata_enrichmentenrich_document 함수에 **kwargs 매개변수가 추가되어, 상위 호출자로부터 받은 추가 인자를 메타데이터 추출 로직까지 유연하게 전달할 수 있게 되었습니다.
  • 프로세서 통합 및 테스트 업데이트: 여러 genon/preprocessor/facade 모듈의 enrichment 메서드에서 enrich_document 함수 호출 시 **kwargs를 일관되게 전달하도록 수정되었으며, test.py 파일에 org_filenamekwargs로 전달하는 테스트 로직이 추가되었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이번 PR은 created_date 추출 정확도를 높이기 위해 파일명과 문서의 처음 4페이지 텍스트를 활용하도록 수정한 점이 인상적입니다. 전체적으로 **kwargs를 통해 필요한 정보를 하위 함수로 잘 전달하고 있습니다. 코드 가독성 및 유지보수성 향상을 위해 타입 힌트 수정 및 코드 간소화에 대한 몇 가지 제안 사항을 남겼으니 확인 부탁드립니다.

return 0

def apply_metadata_enrichment(self, document: DoclingDocument) -> bool:
def apply_metadata_enrichment(self, document: DoclingDocument, **kwargs: dict) -> bool:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

**kwargs: dict 타입 힌트는 kwargs의 각 값(value)이 dict 타입이어야 함을 의미합니다. 하지만 이 함수에서는 org_filename과 같은 문자열 값을 전달받을 수 있습니다. **kwargs의 타입 힌트는 일반적으로 Any를 사용하여 다양한 타입의 키워드 인수를 받을 수 있도록 하는 것이 좋습니다.

Suggested change
def apply_metadata_enrichment(self, document: DoclingDocument, **kwargs: dict) -> bool:
def apply_metadata_enrichment(self, document: DoclingDocument, **kwargs: Any) -> bool:



def _extract_document_metadata_date(self, document_content):
def _extract_document_metadata_date(self, document_content, **kwargs):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

_extract_document_metadata_date 함수에 타입 힌트가 누락되었습니다. 코드 가독성과 유지보수성을 높이기 위해 주변의 다른 함수들처럼 타입 힌트를 추가하는 것이 좋습니다.

Suggested change
def _extract_document_metadata_date(self, document_content, **kwargs):
def _extract_document_metadata_date(self, document_content: str, **kwargs: Any) -> Dict[str, Any]:

custom_user = self.enrichment_options.metadata_user_prompt

# 불필요한 태그 제거 (이미지 정보를 나타내는 태그 제거)
document_content = document_content.replace("<!-- image -->", "").strip()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

911행의 .strip() 호출은 917행에서 다시 호출되므로 중복됩니다. 불필요한 호출을 제거하여 코드를 더 간결하게 만들 수 있습니다.

Suggested change
document_content = document_content.replace("<!-- image -->", "").strip()
document_content = document_content.replace("<!-- image -->", "")


# 간단한 함수형 API
def enrich_document(document: DoclingDocument, enrichment_options: DataEnrichmentOptions) -> DoclingDocument:
def enrich_document(document: DoclingDocument, enrichment_options: DataEnrichmentOptions, **kwargs: dict) -> DoclingDocument:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

**kwargs: dict 타입 힌트는 kwargs의 각 값(value)이 dict 타입이어야 함을 의미합니다. 하지만 이 함수에서는 org_filename과 같은 문자열 값을 전달받을 수 있습니다. **kwargs의 타입 힌트는 일반적으로 Any를 사용하여 다양한 타입의 키워드 인수를 받을 수 있도록 하는 것이 좋습니다.

Suggested change
def enrich_document(document: DoclingDocument, enrichment_options: DataEnrichmentOptions, **kwargs: dict) -> DoclingDocument:
def enrich_document(document: DoclingDocument, enrichment_options: DataEnrichmentOptions, **kwargs: Any) -> DoclingDocument:

@inoray inoray requested review from JaeseungYang and yspaik and removed request for yspaik November 18, 2025 06:50
@inoray inoray merged commit deb1693 into develop Nov 19, 2025
2 checks passed
@inoray inoray deleted the bug/115-created_date-추출-실패 branch November 19, 2025 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

created_date 추출 실패

3 participants