> ## Documentation Index
> Fetch the complete documentation index at: https://developer.qaip.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# データ抽出

> QAIPに取り込んだデータを検索し、任意のスキーマで抽出する

## 手順

1. サイドバーから「データ抽出」を選択
2. JSON Schemaを設定
3. 必要であればフィルターを設定
4. 「実行」をクリック

## フィルタリング

使用するデータソースをフィルターできます。<br />
詳しくは[こちら](/docs/playground/search#データソースのフィルタリング)をご参照ください。

## JSON Schema

JSON Schemaを指定することで、QAIPに取り込んだデータを任意のスキーマで抽出できます。<br />
詳細は[JSON Schemaのドキュメント](https://json-schema.org/draft/2020-12/json-schema-core)をご参照ください。

### 例：会社名と住所の抽出

下記のようにJSON Schemaを設定すると、チャンクから会社名 `company_name` と住所 `address` を抽出できます。

```json title="JSON Schemaの入力例" theme={null}
{
  "type": "object",
  "properties": {
    "companies": {
      "type": "array",
      "description": "A list of companies and their addresses found in the document",
      "items": {
        "type": "object",
        "properties": {
          "company_name": {
            "type": "string",
            "description": "The name of the company"
          },
          "address": {
            "type": "string",
            "description": "The address of the company"
          }
        },
        "required": ["company_name", "address"],
        "additionalProperties": false
      }
    }
  },
  "required": ["companies"],
  "additionalProperties": false
}
```

実行結果の例：

```json title="実行結果" theme={null}
{
  "companies": [
    {
      "company_name": "Qlonolink株式会社",
      "address": "〒103-0013　東京都中央区日本橋人形町一丁目４番地１号内山ビル 5階A号"
    }
  ]
}
```
