Datalab が 9B オープンウェイトビジョンモデル「lift」をリリース:スキーマを用いた PDF から構造化 JSON を抽出
本文の状態
日本語全文を表示中
詳細モードで約18分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
MarkTechPost
Datalab は、PDF や画像からスキーマに基づいて構造化 JSON を抽出する専用ビジョンモデル「lift」を公開した。この 9B パラメータのオープンウェイトモデルは、225 ドキュメントのベンチマークでフィールド精度 90.2% を達成している。
Continue in AI NEW LAB
このニュースを、実務の判断につなげる
AI NEW LABで、試したことや先に確認したい条件を共有できます。まずはログインなしで読めます。
AI NEW LABで論点を見るSource Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
Datalab は、構造化データ抽出専用の 9B パラメータ規模のオープンウェイトビジョンモデル「lift」をリリースしました。ユーザーは JSON スキーマを入力として与えるだけで、そのスキーマに合致する JSON オブジェクトが返されます。このモデルは PDF や画像を直接読み込み、指定されたスキーマに基づいてデータをデコードします。
これは Datalab が抽出タスクのためにゼロから構築した最初のモデルです。同チームはすでに chandra、marker、surya といったオープンソースの OCR ツールを提供しており、「lift」はその成果をスキーマ駆動型のフィールド抽出へと拡張するものです。
Datalab が作成した 225 ドキュメントからなるベンチマークでは、lift はフィールド精度で 90.2% を記録しました。研究チームはこれを「テストした中で最も強力な、小規模かつセルフホスト可能なモデル」と評価しています。1 ドキュメントあたりの処理時間は中央値で 9.5 秒です。
Datalab lift とは?
lift は構造化抽出を目的とした 9B パラメータのビジョンモデルです。標準的な JSON Schema を入力として受け取り、その形状に合致する有効な JSON オブジェクトを出力します。
このモデルは、複数ページにわたるドキュメントも単一のパスで処理できます。ページを跨ぐ値の読み込みにも対応しており、ドキュメント全体を一括して入力し、ページ単位での逐次処理は行いません。
パッケージには 2 つの推論モードが用意されています。ローカル環境での推論は HuggingFace を経由して実行可能ですが、本番環境では vLLM サーバーを経由するリモート推論を Datalab は推奨しています。
コードライセンスは Apache 2.0 です。モデルウェイトには、改変された OpenRAIL-M ライセンスが適用されています。
lift は、オープンな抽出モデルという小さくも成長中の分野に参入しました。この分野には、NuExtract ファミリーのように目的別に設計されたものもあれば、Qwen3.5-9B のように汎用的なビジョン・ランゲージモデルを抽出タスクに応用した例もあります。lift はビジョン・ランゲージベースモデルと、スキーマ制約付きのデコーディング、そして学習済みの拒否機能(アブステインション)を組み合わせています。Datalab のベンチマークでは、このオープングループの中でフィールド精度において首位を走っています。
スキーマ制約付きデコーディング:中核となる仕組み
lift の設計における最大の決断は、スキーマ制約付きデコーディングの採用です。lift は出力を直接ユーザーのスキーマに対してデコードします。その結果、常に正しい形状を持つ有効な JSON が生成されます。
内部ではどのような処理が行われているのか見てみましょう。まず lift は、JSON Schema を Pydantic モデルに変換します。その後、これを厳格な JSON Schema として正規化し、vLLM サーバーに response_format 制約として渡します。
生成プロセス中、サーバーはこのスキーマを文法(グラマー)へとコンパイルします。各ステップでモデルは、次に出現する可能性のあるすべてのトークンに対して確率を割り当てます。ここで定義された文法が、どのトークンが続行可能かを決定します。スキーマを破綻させるようなトークンはマスクされ、モデルがサンプリングできるのは残されたものだけになります。
これが、常に正しい形状の有効な JSON が出力される理由です。構造は生成後にチェックするのではなく、トークン単位で強制されているのです。
この保証には明確な限界があります。制約付きデコーディングは構造と型を制御するものであり、意味そのものまで保証するものではありません。フィールドが数値型として定義されていれば、そこには必ず数値が入ります。ただし、それが正しい数値かどうかは別の問題です。モデルは有効な値を出力しても、それが事実上間違っている可能性があります。有効性と正しさは別物だからです。
lift はすべてのフィールドに null を許容するよう拡張されています。コンパイルされたスキーマ内の各スカラーリーフ(終端要素)は、定義された型か null のいずれかを許可します。これにより、モデルは構造を壊すことなく任意のフィールドで値を出力しない(Abstention)ことが可能になります。これは訓練された挙動であると同時に、制約そのものが持つ性質でもあります。
ユーザーは標準的な JSON Schema を記述するだけで済みます。サポートされている型には、文字列、数値、整数、ブール値、それらの配列、オブジェクトの配列、ネストされたオブジェクトが含まれます。フィールド名が曖昧な場合、そのフィールドの説明がモデルを誘導します。
ここには静かな失敗モードも存在します。enum、anyOf/oneOf、$ref、additionalProperties といった一部の構文はコンパイルできません。lift がスキーマのコンパイルに失敗しても処理は停止せず、警告ログを出力した上で制約なしで生成を行います。その実行では構造保証が失われるため、ハードエラーにはなりませんが、出力結果がスキーマと全く一致しない可能性も生じます。
実務上のルールはシンプルです。スキーマはサポートされるサブセット内に収めてください。取得した JSON は後工程でスキーマに対して検証してください。API が正常に返答しただけで、有効な出力が得られるとは限りません。
以下に簡単な請求書(インボイス)のスキーマ例を示します:
Copy CodeCopiedUse a different Browser
lift: スキーマを活用し PDF から構造化 JSON を抽出する 9B パラメータのオープンウェイトビジョンモデル
Datalab は、PDF ドキュメントからスキーマに基づいて構造化された JSON データを抽出できる「lift」という 90 億パラメータ規模のオープンウェイトビジョンモデルを発表しました。
基本方針:デフォルトは abstention(猶予)
実際のデータ抽出が難しいのには、意外な理由があります。単に存在するフィールドを読み取るだけでなく、「存在しないフィールドを無理やり作り出さないこと」こそが真の課題なのです。
税番号のような情報をでっち上げてしまうモデルよりも、何も返さなかった方がマシです。前者は後工程で検知が難しく、静かにエラーを引き起こすからです。lift は、本当に欠落しているフィールドについては null として扱うように訓練されています。
必須項目とされるのは、文書に必ず含まれるべき場合のみです。ドキュメントに含まれていないフィールドは、null として返されます。これにより、「値が存在しないこと」を報告できる、信頼性の高い抽出器が実現します。
ベンチマーク結果
Datalab は、225 ドキュメントからなる抽出ベンチマークで lift を評価しました。各ドキュメントは 6 ページから 64 ページまであり、スコアリング対象のフィールド数は約 11,000 に及びます。テストセットには意図的に困難なケース(敵対的ケース)も含まれています。
具体的には、ページを跨ぐ値や、網羅的なリスト、あるいは null として扱うべきフィールド、そして見落としやすいダミーデータなどが用意されています。さらに、複数の情報源からデータを統合するケースのテストも行われました。
すべてのモデルは同じレンダリングされたページ画像を受け取り、各文書は単一のパスで抽出されました。スコアリングは、数値の許容範囲と正規化された文字列を考慮した上で、正解データとの完全一致(exact-match)に基づいて決定論的に行われました。
| モデル | サイズ | フィールド精度 | 全文書精度 | メディアンレイテンシ* | 特徴 |
|---|---|---|---|---|---|
| Datalab API | - | 95.9% | 44.4% | 30.8s | 引用元 + 検証機能 |
| Gemini Flash 3.5 | - | 91.3% | 40.0% | 28.1s | - |
| lift | 9B | 90.2% | 20.9% | 9.5s | - |
| Azure Content Understanding | - | 83.4% | 22.2% | 73.7s | 引用元 |
| NuExtract | 34B | 81.5% | 8.4% | 8.3s | - |
| Qwen3.5-9B | 9B | 76.32% | 24.0% | 16.8s | - |
*文書あたり、並列リクエスト数 8。ローカルモデル(lift, Qwen3.5-9B, NuExtract)は単一 GPU で vLLM を使用して提供されました。Gemini、Datalab、Azure は API を経由して実行されました。レイテンシはハードウェアや負荷によって変動するため、相対的な比較として捉えてください。
ここで重要なのは 2 つの精度指標の違いです。「フィールド精度」とは、個々の抽出項目が正しく取得された割合を指します。一方、「全文書精度」は、文書内のすべての項目が正確に抽出された文書の割合を表します。
フィールド精度において、lift はセルフホスト可能なモデルの中で首位に立ちます。これは NuExtract や Qwen3.5-9B のベースモデルよりも優れています。また、表にある高精度なモデルの中では最も高速です。
メディアンレイテンシが 9.5 秒の lift は、Gemini Flash 3.5 よりも約 3 倍速いです。フィールド精度ではそのモデルとほぼ同レベル(1 ポイント差以内)を維持しています。一方、全文書精度はより厳しい指標です。すべての項目が正確でなければなりません。この指標では lift は 20.9% を記録し、NuExtract に次ぐ成績です。ホスト型 API の方が上位にあり、それぞれ 44.4% と 40.0% を達成しています。
これらの数値を読む際の注意点として、これは Datalab 独自のベンチマークであるため、ベンダー発表のデータとして捉える必要があります。この評価は「結果を保留する(アブステイン)」ように調整されたモデルに有利な設計になっており、Lift はまさにその対象です。すべてのモデルで文書全体の抽出精度が低いのは当然で、最高でも 44.4% に留まります。これは、長文ドキュメントに対して単一パスで抽出を行うことがいかに難しいかを示しています。また、この数値はあくまで一時点のスナップショットであり、モデルの性能は日々変化します。
こうした現実を踏まえると、難易度の高いドキュメントに対する「単一パス・単一モデル」での抽出において、Lift がどこに位置するかが見えてきます。Lift は、人間のレビューや集計分析に活用するためのフィールドレベルの抽出においては極めて優秀です。しかし、すべてのフィールドで完璧な精度が求められるゼロタッチの完全自動化をそのまま置き換えるものとしては、まだ段階にあります。その最終的な課題解決には、Datalab のホスト型 API が役立ちます。同じアプローチに基づきながら、フィールドごとの検証、出典の明示、信頼度スコアの付加といった機能を追加しています。
実務者のワークフロー:スキーマからレビュー済みデータへ
3 つのユースケースが、この技術の実像を浮き彫りにします。
- 請求書処理:
invoice_number(請求番号)、total(合計額)、line_items(明細)といった項目を定義し、tax_id(税番)が存在しない場合はnullを返すように設定します。 - 契約レビュー:2 ページにわたる契約書の場合、値がページを跨いで記載されていることがありますが、単一パスの抽出でこれを繋ぎ合わせます。
- ドキュメントパイプライン:売掛金処理のキューでは、期限日が存在しない場合に
nullを返すことを前提として信頼しており、見落としによるサイレントエラーを防ぎます。
以下に、その一端をエンドツーエンドのワークフローとして示します。目指すべきはモデルの生出力ではなく、クリーンでレビュー済みのデータセットです。
- スキーマの定義:フィールド名が自明でないものには説明を追加し、本当に必須の項目のみを「必須(required)」としてマークアップしてください。
- 抽出を実行する
lift にスキーマとファイルを渡して抽出を行います。引数には辞書形式のスキーマ、ファイルパス、または保存済みのスキーマ名を指定できます。
- 結果に応じて分岐させる
呼び出しが失敗した場合や、抽出結果が null の場合はレビューフローへ送ってください。また、必須項目の値が存在しない場合も、null は「エラー」ではなく「未回答(アブステイン)」とみなされるため、同様にレビュー対象とします。
- 信頼する前に検証を行う
返された JSON をスキーマに照合して検証してください。これにより、スキーマがコンパイルできなかった際に発生する、目に見えないフォールバックを検出できます。
from lift import extract
schema = {
"type": "object",
"properties": {
"invoice_number": {"type": "string", "description": "Invoice identifier"},
"total": {"type": "number", "description": "Total amount due"},
"due_date": {"type": "string", "description": "Payment due date, ISO 8601"},
"line_items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {"type": "string"},
"amount": {"type": "number"}
}
}
}
},
"required": ["invoice_number", "total"]
}
result = extract("invoice.pdf", schema)エラーが発生した場合や抽出結果が取得できない場合は、"invoice.pdf" をレビューキューに追加し、理由として "extraction_failed" を記録します。正常に抽出できた場合は、そのデータを保存する前に必須フィールドのチェックを行います。例えば「total」フィールドが null の場合でも、それはシステムクラッシュではなく、データが存在しないことを意味するため、同様にレビューキューへ送ります。
実務で役立つスキーマ設計のポイントはいくつかあります。まず、曖昧なフィールドには説明文を記述してください。これが精度向上の最大の要因となります。また、スキーマはサポートされている範囲内に収め、出力結果は後段で検証するようにしましょう。深いネスト構造よりも、フラットで浅いスキーマを好む傾向があります。深すぎる階層構造は、信頼性のある抽出が難しくなるためです。
必須フィールドの指定は控えめにし、真に欠落しているデータについては null を返せるようにしておきます。長い PDF ファイルを処理する際は、CLI では"–page-range"、Python コードでは"page_range"パラメータを使用して対象ページを制限しましょう。また、モデル負荷を分散させるため、複数の呼び出しで 1 つの InferenceManager を再利用することが推奨されます。
セルフホストとホスト版の違いについて
lift はオープンウェイトとして提供されており、Datalab は同じアプローチに基づくホスト型 API も運用しています。どちらを選ぶかは、技術的な優劣ではなく、制約条件による判断です。
選択の基準:
- セルフホスト版(オープンウェイト)を選択すべきケース:データ所在地やオンプレミス規制が適用される場合、大量処理におけるコスト制御が必要、自社の GPU でレイテンシを最適化したい、オフライン環境での稼働が必須な場合。
- Datalab ホスト API を選択すべきケース:フィールドごとの検証、出典の明示、信頼度スコアの取得が必要な場合、最高レベルの精度を求める場合、インフラ管理の手間を避けたい場合、処理量が低いかバースト型である場合。
セルフホストを利用する際の注意点として、商用利用には改変された OpenRAIL-M ライセンスに基づくライセンスが必要です。ただし、研究目的や個人利用、資金調達額または収益が 500 ドル未満のスタートアップ企業にとっては無料で利用可能です。また、Datalab の API と競合する用途での使用は禁止されています。
使い始めには、CLI(コマンドラインインターフェース)を使うのが最も手っ取り早い方法です。lift-pdf を使うには Python 3.12 以降が必要です。
pip install lift-pdf
vLLM でモデルをサーブする(推奨)
lift_vllm
スキーマを使って抽出を行う
lift_extract input.pdf ./output --schema schema.json
各ファイルからは 2 つの出力が生成されます。.json ファイルにはスキーマに合致した抽出結果が格納され、_metadata.json にはデバッグ用のページ数やトークン数、エラー情報が含まれています。
Python API も非常にシンプルです。
from lift import extract
スキーマは辞書、パス、インライン JSON 文字列、またはライブラリ名を指定できます
result = extract("document.pdf", "schema.json")
if result.extraction is not None:
data = result.extraction # スキーマに合致した辞書
result.extraction を確認して、スキーマに合致する辞書を取得してください。抽出結果が null の場合は失敗を意味しており、その内容を調査できます。HuggingFace バックエンドを利用するには --method hf を指定し、pip install lift-pdf[hf] で追加インストールが必要です。
Schema Studio は Streamlit アプリとして提供されています。これを使えば、独自のドキュメントに対してスキーマの作成、保存、テストが可能になります。pip install lift-pdf[app] でインストール後、lift_app を実行してください。
本番環境向けに、lift_vllm は GPU の性能に合わせてバッチサイズを自動調整する Docker コンテナを起動します。対応している GPU は以下の通りです。
h100, a100-80, a100/a100-40, l40s, a10, l4, 4090, 3090, t4
インタラクティブな解説ツール
主なポイント
lift は Datalab が開発した、パラメータ数 9B のオープンウェイト型ビジョンモデルです。PDF や画像からスキーマに合致する JSON データを抽出します。
スキーマ制約付きのデコーディングにより、常に構造的に正しい出力が保証されます。また、学習済みの「拒否機能」によって、存在しないフィールドについては無理やり生成(ハルシネーション)するのではなく、null を返すことができます。
ただし、この構造上の保証は「形状」のみのものであり、「意味」の正しさまでは保証しません。出力結果の検証と、信頼度が低い項目の確認は必須です。
自己ホスト可能なモデルの中で最も高いフィールド精度(90.2%)を記録しており、1 ドキュメントあたりの処理時間は中央値で 9.5 秒です。
ドキュメント全体の正確率は 20.9% です。これは、クラウド API を利用する競合他社に次ぐ成績であり、NuExtract3 に匹敵するレベルです。
コードライセンスは Apache 2.0 です。モデルの重み(ウェイト)は、OpenRAIL-M の修正版として公開されています。研究目的や個人利用はもちろん、資金調達額または収益が 500 万ドル以下のスタートアップ企業でも無料で利用可能です。
実際に試すためのリンクはこちらです:
GitHub · HuggingFace · Playground · Hosted API & docs
※本記事は Datalab チームの先駆的な取り組みへの感謝を込めて作成されました。Datalab チームがプロモーションの一環としてこのコンテンツをサポートしています。
(記事元:MarkTechPost)
原文を表示
Datalab has released lift, a 9B open-weights vision model for structured extraction. You pass it a JSON schema, and it returns a JSON object that matches. The model reads PDFs and images directly, then decodes against your schema.
This is Datalab’s first model built purely for extraction. The team already ships open-source OCR tools: chandra, marker, and surya. lift extends that work into schema-driven field extraction.
lift scores 90.2% field accuracy on Datalab’s 225-document benchmark. The research team reports it as the strongest small self-hostable model they tested. It runs at a median of 9.5 seconds per document.
What is Datalab lift?
lift is a 9B-parameter vision model for structured extraction. It accepts standard JSON Schema as input. It returns valid JSON of that shape as output.
The model handles multi-page documents in a single pass. It can read values that span across pages. Whole documents go in at once, not page by page.
Two inference modes ship with the package. Local inference runs through HuggingFace. Remote inference runs through a vLLM server, which Datalab recommends for production.
The code is Apache 2.0. The weights use a modified OpenRAIL-M license.
lift enters a small but growing field of open extraction models. Some are purpose-built, like the NuExtract family. Others are general vision-language models pressed into extraction, like Qwen3.5-9B. It pairs a vision-language base with schema-constrained decoding and trained abstention. On Datalab’s benchmark, it leads that open group on field accuracy.
Schema-Constrained Decoding: The Core Mechanism
The main design choice is schema-constrained decoding. lift decodes its output directly against your schema. The result is always valid JSON of the correct shape.
Here is what happens under the hood. lift first turns your JSON Schema into a Pydantic model. It then normalizes that into a strict JSON Schema. The schema is passed to the vLLM server as a response_format constraint.
During generation, the server compiles the schema into a grammar. At each step, the model assigns a probability to every possible next token. The grammar defines which tokens are valid continuations. Tokens that would break the schema are masked out. The model can only sample from what remains.
This is why the output is always valid JSON of the right shape. The structure is enforced token by token, not checked afterward.
There is a sharp limit to this guarantee. Constrained decoding governs structure and types, not meaning. A field typed as number will hold a number. Whether it holds the correct number is a separate question. The model can emit a valid value that is simply wrong. Validity is not correctness.
lift also widens every field to allow null. Each scalar leaf in the compiled schema accepts its type or null. So the model can abstain on any field without breaking the structure. Abstention is both trained behavior and a property of the constraint.
You write standard JSON Schema. Supported types include string, number, integer, boolean, arrays of those, arrays of objects, and nested objects. A field description guides the model when a name is ambiguous.
This is also where a quiet failure mode lives. Some constructs cannot be compiled: enum, anyOf/oneOf, $ref, and additionalProperties. When lift cannot compile your schema, it does not stop. It logs a warning and generates without the constraint. The structural guarantee is gone for that run, with no hard error. Output may then fail to match your schema at all.
The practical rule is simple. Keep schemas inside the supported subset. Validate the returned JSON against your schema downstream. Do not assume valid output just because the call returned.
Here is a simple invoice schema:
Copy CodeCopiedUse a different Browser
{
"type": "object",
"properties": {
"invoice_number": {"type": "string", "description": "Invoice identifier"},
"total": {"type": "number", "description": "Total amount due"},
"line_items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {"type": "string"},
"amount": {"type": "number"}
}
}
}
},
"required": ["invoice_number", "total"]
}
Abstention by Default
Real extraction is hard for a non-obvious reason. Beyond reading fields that exist, the real challenge is not inventing fields that are absent.
A model that hallucinates a tax ID is worse than one returning nothing. The error is silent and hard to catch downstream. lift is trained to leave genuinely missing fields null.
Mark a field required only when it must appear. Fields absent from a document come back null. This gives you an extractor that can report a value is not present.
Benchmark
Datalab evaluated lift on a 225-document extraction benchmark. Documents ran 6 to 64 pages each, with roughly 11,000 scored fields. Adversarial cases were planted throughout the set.
Those cases include cross-page values and exhaustive lists. They also include fields that must be left null and near-miss distractors. Multi-source aggregation was tested as well.
Every model received the same rendered page images. Each extracted every document in a single pass. Scoring was a deterministic exact-match against ground truth, with numeric tolerance and normalized strings.
ModelSizeField accuracyFull-document accuracyMedian latency*Features
Datalab API—95.9%44.4%30.8sCitations + Verification
Gemini Flash 3.5—91.3%40.0%28.1s
lift9B90.2%20.9%9.5s
Azure Content Understanding—83.4%22.2%73.7sCitations
NuExtract34B81.5%8.4%8.3s
Qwen3.5-9B9B76.32%24.0%16.8s
- Per document, 8 concurrent requests. Local models (lift, Qwen3.5-9B, NuExtract3) were served with vLLM on a single GPU. Gemini, Datalab, and Azure ran via API. Latency varies with hardware and load; treat it as relative.
Two details matter here. Field accuracy is the fraction of individual fields extracted correctly. Full-document accuracy is the fraction of documents where every field is correct.
On field accuracy, lift leads the self-hostable models. It sits ahead of NuExtract3 and the Qwen3.5-9B base. It is also the fastest of the accurate models in the table.
At 9.5s median, lift is roughly 3x faster than Gemini Flash 3.5. It stays within about a point of that model’s field accuracy. Full-document accuracy is a harder metric: every field must be correct. Here lift scores 20.9%, ahead of only NuExtract3. The hosted APIs lead, at 44.4% and 40.0%.
A note on reading these numbers. This is Datalab’s own benchmark, so treat it as a vendor result. Its adversarial design rewards models tuned to abstain, which lift is. Full-document accuracy is low for every model, topping out at 44.4%. That reflects how hard single-pass extraction is on long documents. The numbers are also a snapshot; models change.
This is the reality of single-pass, single-model extraction on hard documents. It tells you where lift fits. It is excellent for field-level extraction that feeds a human-in-the-loop review or aggregate analytics. It is not yet a drop-in for zero-touch, every-field-must-be-perfect automation. For that last mile, Datalab’s hosted API adds per-field verification, citations, and confidence scores on the same approach.
A Practitioner Workflow: From Schema to Reviewed Data
Three use cases show the shape of the work. Invoice processing: define invoice_number, total, and line_items, and a missing tax_id returns null. Contract review: a two-page agreement carries a value across pages, which single-pass extraction stitches together. Document pipelines: an accounts-payable queue trusts that absent due dates return null, avoiding silent errors.
Here is one of them as an end-to-end workflow. The goal is a clean, reviewed dataset, not raw model output.
- Define the schema. Add a description to any field whose name is not obvious. Mark only truly mandatory fields as required.
- Run extraction. Pass the schema and the file to lift. Use a dict, a file path, or a saved schema name.
- Branch on the result. A failed call or a null extraction goes to review. A missing required value also goes to review, since null is abstention, not an error.
- Validate before you trust. Check the returned JSON against your schema. This catches the silent fallback when a schema could not be compiled.
Copy CodeCopiedUse a different Browser
from lift import extract
schema = {
"type": "object",
"properties": {
"invoice_number": {"type": "string", "description": "Invoice identifier"},
"total": {"type": "number", "description": "Total amount due"},
"due_date": {"type": "string", "description": "Payment due date, ISO 8601"},
"line_items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {"type": "string"},
"amount": {"type": "number"}
}
}
}
},
"required": ["invoice_number", "total"]
}
result = extract("invoice.pdf", schema)
if result.error or result.extraction is None:
queue_for_review("invoice.pdf", reason="extraction_failed")
else:
data = result.extraction
# A required field can still be null. That is abstention, not a crash.
if data.get("total") is None:
queue_for_review("invoice.pdf", reason="missing_total")
else:
save(data)
A few schema-design tips that pay off in practice:
Write a description for ambiguous fields; it is your main lever on accuracy.
Keep schemas inside the supported subset, and validate output downstream.
Prefer flat, shallow schemas; deep nesting is harder to extract reliably.
Mark fields required sparingly, so genuine gaps can return null.
Use –page-range (CLI) or page_range (Python) to limit long PDFs.
Reuse one InferenceManager across calls to amortize model load.
Self-Host vs. Hosted: Which to Use
lift ships as open weights, and Datalab runs a hosted API on the same approach. The choice is about constraints, not prestige.
ChooseWhen
Self-hosted lift (open weights)Data residency or on-prem rules apply; you need cost control at high volume; you want latency control on your own GPUs; runs must work offline.
Hosted Datalab APIYou need per-field verification, citations, and confidence scores; you want the highest accuracy; you would rather not manage infrastructure; volume is low or bursty.
One caveat for self-hosting. Commercial use needs a license under the modified OpenRAIL-M terms. It is free for research, personal use, and startups under $5M in funding or revenue, and not for use in competition with Datalab’s API.
Getting Started
The fastest path is the CLI. lift-pdf requires Python 3.12 or newer.
Copy CodeCopiedUse a different Browser
pip install lift-pdf
Serve the model with vLLM (recommended)
lift_vllm
Extract against a schema
lift_extract input.pdf ./output --schema schema.json
Each file produces two outputs. <filename>.json holds the extraction matching your schema. <filename>_metadata.json holds page count, token count, and error info for debugging.
The Python API is equally small:
Copy CodeCopiedUse a different Browser
from lift import extract
schema: a dict, a path, an inline JSON string, or a library name
result = extract("document.pdf", "schema.json")
if result.extraction is not None:
data = result.extraction # dict matching the schema
Check result.extraction for the dict matching your schema. A null extraction signals a failure you can inspect. The HuggingFace backend uses –method hf and needs pip install lift-pdf[hf].
Schema Studio ships as a Streamlit app. It lets you build, save, and test schemas against your own documents. Install it with pip install lift-pdf[app], then run lift_app.
For production, lift_vllm launches a Docker container with batch size scaled to your GPU. Supported GPUs are: h100, a100-80, a100/a100-40, l40s, a10, l4, 4090, 3090, t4.
Interactive Explainer
Key Takeaways
lift is Datalab’s 9B open-weights vision model that extracts schema-matching JSON from PDFs and images.
Schema-constrained decoding guarantees valid structure; trained abstention returns null instead of hallucinating absent fields.
The structural guarantee covers shape, not meaning, so validate output and review low-confidence fields.
It posts the highest field accuracy among self-hostable models tested (90.2%), at 9.5s median per document.
Full-document accuracy is 20.9% — ahead of only NuExtract3 — where the hosted APIs lead.
Code is Apache 2.0; weights are modified OpenRAIL-M (free for research, personal use, and startups under $5M in funding or revenue).
The links to try it:
GitHub · HuggingFace · Playground · Hosted API & docs
Note:Thanks to the Datalab team for the thought leadership/ Resources for this article. Datalab team has supported this content/article for promotion.
The post Datalab Releases lift: A 9B Open-Weights Vision Model That Extracts Structured JSON From PDFs Using Schemas appeared first on MarkTechPost.
関連記事
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み