Skip to content

CH06 문서 로더(Document Loader)-12. UpstageLayoutAnalysisLoader 문서 모듈명 에러 #22

Description

@YS-2357

12. UpstageLayoutAnalysisLoade에 소개된 것 처럼 문서의 내용은 다음과 같은데, 업데이트로 인한 에러가 생겼습니다.

# 기존
from langchain_upstage import UpstageLayoutAnalysisLoader

# 파일 경로
file_path = "./data/SPRI_AI_Brief_2023년12월호_F.pdf"

# 문서 로더 설정
loader = UpstageLayoutAnalysisLoader(
    file_path,
    output_type="text",
    split="page",
    use_ocr=True,
    exclude=["header", "footer"],
)

# 문서 로드
docs = loader.load()

# 결과 출력
for doc in docs[:3]:
    print(doc)

아래와 같은 모듈명(from langchain_upstage.document_parse import UpstageDocumentParseLoader)으로 업데이트한 경우 잘 실행됩니다.

from langchain_upstage.document_parse import UpstageDocumentParseLoader

# 파일 경로
file_path = "./data/SPRI_AI_Brief_2023년12월호_F.pdf"

# 문서 로더 설정
loader = UpstageDocumentParseLoader(
    file_path,
    split="element",
)

# 문서 로드
docs = loader.load()

# 결과 출력
for doc in docs[:3]:
    print(doc)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions