

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 時間序列資料的端點請求
<a name="clarify-processing-job-data-format-time-series-request-jsonlines"></a>

SageMaker Clarify 處理任務會將資料序列化為任意 JSON 結構 (具有 MIME 類型：`application/json`)。若要這麼做，您必須為分析組態 `content_template` 參數提供範本字串。這是由 SageMaker Clarify 處理任務用來建構提供給您模型的 JSON 查詢。`content_template` 包含來自您資料集的一筆記錄或多筆記錄。您也必須提供 `record_template` 的範本字串，用來建構每筆記錄的 JSON 結構。這些記錄接著會插入至 `content_template`。如需 `content_type` 或 `dataset_type` 的詳細資訊，請參閱 [分析組態檔案](clarify-processing-job-configure-analysis.md)。

**注意**  
因為 `content_template` 和 `record_template` 是字串參數，所以屬於 JSON 序列化結構的任何雙引號字元 (") 都應該在組態中註記為逸出字元。例如，如果您想要在 Python 中逸出雙引號，您可以為 `content_template` 輸入以下值：  

```
'$record'
```

下表顯示序列化 JSON 請求承載的範例，以及建構它們所需的對應 `content_template` 和 `record_template` 參數。


| 使用案例 | 端點請求有效負載 (字串表示) | content\_template | record\_template | 
| --- | --- | --- | --- | 
| 一次單筆記錄 | `{"target": [1, 2, 3],"start": "2024-01-01 01:00:00"}` | `'$record'` | `'{"start": $start_time, "target": $target_time_series}'` | 
| 具有 `$related_time_series` 和 `$static_covariates` 的單一記錄 | `{"target": [1, 2, 3],"start": "2024-01-01 01:00:00","dynamic_feat": [[1.0, 2.0, 3.0],[1.0, 2.0, 3.0],"cat": [0,1]}` | `'$record'` | `'{"start": $start_time, "target": $target_time_series, "dynamic_feat": $related_time_series, "cat": $static_covariates}'` | 
| 多重記錄 | `{"instances": [{"target": [1, 2, 3],"start": "2024-01-01 01:00:00"}, {"target": [1, 2, 3],"start": "2024-01-01 02:00:00"}]}` | `'{"instances": $records}'` | `'{"start": $start_time, "target": $target_time_series}'` | 
| 具有 `$related_time_series` 和 `$static_covariates` 的多筆記錄 | `{"instances": [{"target": [1, 2, 3],"start": "2024-01-01 01:00:00","dynamic_feat": [[1.0, 2.0, 3.0],[1.0, 2.0, 3.0],"cat": [0,1]}, {"target": [1, 2, 3],"start": "2024-01-01 02:00:00","dynamic_feat": [[1.0, 2.0, 3.0],[1.0, 2.0, 3.0],"cat": [0,1]}]}` | `'{"instances": $records}'` | `''{"start": $start_time, "target": $target_time_series, "dynamic_feat": $related_time_series, "cat": $static_covariates}'` | 