はじめに
Unstructured-IOは、画像やPDF、HTML、Word文書などのテキスト文書を処理・前処理するためのさまざまなオープンソースコンポーネントを提供します。主な目的は、データ処理ワークフロー、特に大規模言語モデル(LLM)アプリケーションの簡素化と最適化です。Unstructured-IOのモジュラー機能とコネクターは、データの取り込みと前処理を効率化し、さまざまなプラットフォームに適応できる統合システムを形成します。
機能一覧
- データの取り込みと前処理
- 複数のドキュメントタイプに対応(PDF、HTML、Wordなど)
- モジュラー機能とコネクター
- オープンソースのAPIとクライアントライブラリを提供
- Dockerコンテナによるデプロイをサポート
- パフォーマンスを向上させるサーバーレスAPIの提供
ヘルプの使用
設置プロセス
- Dockerコンテナ・ランタイム・ライブラリの使用
- Dockerがインストールされていることを確認する。
- 以下のコマンドを実行し、適切なDockerイメージをダウンロードして実行する:
docker pull downloads.unstructured.io/unstructured-io/unstructured:latest docker run -it --rm downloads.unstructured.io/unstructured-io/unstructured:latest
- PyPIからライブラリをインストールする
- インストールにはpipを使う:
pip install unstructured
- インストールにはpipを使う:
- 地域開発インストール
- GitHubリポジトリをクローンする:
git clone https://github.com/Unstructured-IO/unstructured.git cd unstructured pip install -e .
- GitHubリポジトリをクローンする:
使用ガイドライン
- データの取り込み
- 利用する
unstructured
ライブラリーは文書を取り込む:from unstructured.partition.pdf import partition_pdf document = partition_pdf("example.pdf")
- 利用する
- データ前処理
- 書類を整理して塊にする:
from unstructured.cleaners.core import clean cleaned_document = clean(document)
- 書類を整理して塊にする:
- データソースとターゲットへの接続
- コネクタを使用して、データをターゲット・ロケーションに転送する:
from unstructured.connectors import send_to_destination send_to_destination(cleaned_document, destination="s3://bucket-name")
- コネクタを使用して、データをターゲット・ロケーションに転送する:
- サーバーレスAPI
- 登録し、APIキーを取得します:
- インタビュー 非構造化API登録ページ.
- APIキーを取得し、使用を開始する:
import requests headers = {"Authorization": "Bearer YOUR_API_KEY"} response = requests.post("https://api.unstructured.io/process", headers=headers, json={"document": "example.pdf"})
- 登録し、APIキーを取得します: