Skip to main content

Analysis

The Analysis endpoints compute syntactic information about the input text. Outputs include:

  • Adverbs and other parts of speech of tokens;
  • Whether input sentences are in passive or active voice;
  • Whether input sentences are hard to read (hard) or very hard to read (very_hard);
  • Phrases that can be simplified (e.g., utilize -> use);

Analysis POST​

Request Parameters​

https://api.sapling.ai/api/v1/analysis_h1

HTTP method: POST

The analysis_h1 API POST endpoint takes JSON parameters documented below:

key: String
32-character API key. Can also be supplied via the Authorization header as a bearer token; if both are provided, the key parameter takes precedence.

text: String
Text to compute analysis for.

session_id: Optional String
Unique name or UUID of document or portion of text that is being processed. If not provided, defaults to current date in YYYYMMDD format.

Response Parameters​

The analysis_h1 POST endpoint returns JSON of the following format:

{
"adverbs": [ // Adverbs with word indices
["really", 9],
["so", 17],
...
],
"hard_to_read": [
{
"difficulty": "hard",
"sentence": "A long sentence that is hard to read..."
},
...
],
"simplifications": [
{
"start": 373, // Character index
"end": 382,
"original": "utilize",
"replacements": [
"use"
]
},
...
],
"voice": [
{
"sentence": "The ball was caught",
"voice": "passive"
},
...
]
}