Unstructured:开源预处理非结构化文档,无结构数据处理的利器

최신 AI 도구9개월 전 업데이트 Sharenet.ai
1.2K 0
Trae

일반 소개

Unstructured-IO 提供了一系列开源组件,用于处理和预处理图像和文本文档,如 PDF、HTML、Word 文档等。其主要目标是简化和优化数据处理工作流程,特别是为大语言模型(LLM)应用提供支持。Unstructured-IO 的模块化功能和连接器形成了一个统一的系统,使数据的摄取和预处理变得高效且适应不同平台。

Unstructured:开源预处理非结构化文档,无结构数据处理的利器

 

 

기능 목록

  • 数据摄取和预处理
  • 支持多种文档类型(PDF、HTML、Word 等)
  • 模块化功能和连接器
  • 提供开源 API 和客户端库
  • 支持 Docker 容器化部署
  • 提供无服务器 API 以提高性能

 

 

도움말 사용

설치 프로세스

  1. 使用 Docker 容器运行库
    • 确保已安装 Docker。
    • 运行以下命令以下载并运行相应的 Docker 镜像:
      docker pull downloads.unstructured.io/unstructured-io/unstructured:latest
      docker run -it --rm downloads.unstructured.io/unstructured-io/unstructured:latest
      
  2. 从 PyPI 安装库
    • 使用 pip 安装:
      pip install unstructured
      
  3. 本地开发安装
    • 克隆 GitHub 仓库:
      git clone https://github.com/Unstructured-IO/unstructured.git
      cd unstructured
      pip install -e .
      

 

사용 가이드라인

  1. 数据摄取
    • 활용 unstructured 库摄取文档:
      from unstructured.partition.pdf import partition_pdf
      document = partition_pdf("example.pdf")
      
  2. 数据预处理
    • 清理和分块文档:
      from unstructured.cleaners.core import clean
      cleaned_document = clean(document)
      
  3. 连接到数据源和目标
    • 使用连接器将数据传输到目标位置:
      from unstructured.connectors import send_to_destination
      send_to_destination(cleaned_document, destination="s3://bucket-name")
      
  4. 无服务器 API
    • 注册并获取 API 密钥:
      • 인터뷰 Unstructured API 注册页面.
      • 获取 API 密钥并开始使用:
        import requests
        headers = {"Authorization": "Bearer YOUR_API_KEY"}
        response = requests.post("https://api.unstructured.io/process", headers=headers, json={"document": "example.pdf"})
        
© 저작권 정책
AiPPT

관련 문서

댓글 없음

없음
댓글 없음...