import requests
import json
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
url = 'https://api.va.landing.ai/v1/ade/split'
# Prepare split classes
split_class = [
{
'name': 'split type name',
'description': 'description of split type',
'identifier': 'unique identifier field'
}
]
# Prepare files and data
files = {'markdown': open('markdown.md', 'rb')}
data = {
'split_class': json.dumps(split_class),
'model': 'split-latest'
}
# Run split classification
response = requests.post(url, files=files, data=data, headers=headers)
# Return the results
print(response.json())curl -X POST 'https://api.va.landing.ai/v1/ade/split' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'markdown=@markdown.md' \
-F 'split_class=[{"name": "split type name", "description": "description of split type", "identifier": "unique identifier field"}]' \
-F 'model=split-latest'const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const form = new FormData();
form.append('markdown', fs.createReadStream('markdown.md'));
const splitClass = [
{
name: 'split type name',
description: 'description of split type',
identifier: 'unique identifier field'
}
];
form.append('split_class', JSON.stringify(splitClass));
form.append('model', 'split-latest');
axios.post('https://api.va.landing.ai/v1/ade/split', form, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
...form.getHeaders()
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error));{
"splits": [
{
"classification": "<string>",
"identifier": "<string>",
"pages": [
123
],
"markdowns": [
"<string>"
]
}
],
"metadata": {
"filename": "<string>",
"page_count": 123,
"duration_ms": 123,
"credit_usage": 123,
"org_id": "<string>",
"job_id": "",
"version": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}ADE Split
Split classification for documents.
This endpoint classifies document sections based on markdown content and split options.
For EU users, use this endpoint:
https://api.va.eu-west-1.landing.ai/v1/ade/split.
import requests
import json
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
url = 'https://api.va.landing.ai/v1/ade/split'
# Prepare split classes
split_class = [
{
'name': 'split type name',
'description': 'description of split type',
'identifier': 'unique identifier field'
}
]
# Prepare files and data
files = {'markdown': open('markdown.md', 'rb')}
data = {
'split_class': json.dumps(split_class),
'model': 'split-latest'
}
# Run split classification
response = requests.post(url, files=files, data=data, headers=headers)
# Return the results
print(response.json())curl -X POST 'https://api.va.landing.ai/v1/ade/split' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'markdown=@markdown.md' \
-F 'split_class=[{"name": "split type name", "description": "description of split type", "identifier": "unique identifier field"}]' \
-F 'model=split-latest'const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const form = new FormData();
form.append('markdown', fs.createReadStream('markdown.md'));
const splitClass = [
{
name: 'split type name',
description: 'description of split type',
identifier: 'unique identifier field'
}
];
form.append('split_class', JSON.stringify(splitClass));
form.append('model', 'split-latest');
axios.post('https://api.va.landing.ai/v1/ade/split', form, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
...form.getHeaders()
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error));{
"splits": [
{
"classification": "<string>",
"identifier": "<string>",
"pages": [
123
],
"markdowns": [
"<string>"
]
}
],
"metadata": {
"filename": "<string>",
"page_count": 123,
"duration_ms": 123,
"credit_usage": 123,
"org_id": "<string>",
"job_id": "",
"version": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Your unique API key for authentication.
Get your API key here: https://va.landing.ai/settings/api-key.
If using the EU endpoint, get your API key here: https://va.eu-west-1.landing.ai/settings/api-key.
Body
Request model for split classification endpoint.
List of split classification options/configuration. Can be provided as JSON string in form data.
Show child attributes
Show child attributes
The Markdown file or Markdown content to split.
The URL to the Markdown file to split.
Model version to use for split classification. Defaults to the latest version.
Was this page helpful?