Skip to content

REST API: Retrieving Text Metrics

aldrinleal edited this page Dec 20, 2012 · 2 revisions

Text Metrics are automatically created whenever you create new texts. In order to fetch the metrics, though, you need to use the /text/{id}/metrics/{metric}? method.

See https://www.mashape.com/ipeirotis/readability-metrics-1#endpoint-Get-Named-Metric

{
  "id": "o8m0zyetzixyml6g8buhv8vydpag3i:6e048c8dceff8f5591829c39900504e83e6b9179a092a09adb3e5212328c07fc",
  "metrics": {
    "ARI": 39.201,
    "CHARACTERS": 374,
    "COLEMAN_LIAU": 14.376,
    "COMPLEXWORDS": 19,
    "FLESCH_KINCAID": 36.48,
    "FLESCH_READING": -36.46,
    "GUNNING_FOG": 39.6,
    "SENTENCES": 1,
    "SMOG": 28.03,
    "SMOG_INDEX": 26.875,
    "SYLLABLES": 146,
    "WORDS": 73
  }
}

About the metrics

Here are the explanation about the metrics:

ARI

The Automated Readability Index is a readability test designed to gauge the understandability of a text. (...) It produces an approximate representation of the US grade level needed to comprehend the text.

CHARACTERS, SYLLABLES, WORDS, SENTENCES, COMPLEXWORDS

Raw count

COLEMAN_LIAU

The Coleman–Liau index is a readability test designed by Meri Coleman and T. L. Liau to gauge the understandability of a text. Like the Flesch–Kincaid Grade Level, Gunning fog index, SMOG index, and Automated Readability Index, its output approximates the U.S. grade level thought necessary to comprehend the text.

Like the ARI but unlike most of the other indices, Coleman–Liau relies on characters instead of syllables per word. Although opinion varies on its accuracy as compared to the syllable/word and complex word indices, characters are more readily and accurately counted by computer programs than are syllables.

The Coleman–Liau index was designed to be easily calculated mechanically from samples of hard-copy text. Unlike syllable-based readability indices, it does not require that the character content of words be analyzed, only their length in characters. Therefore, it could be used in conjunction with theoretically simple mechanical scanners that would only need to recognize character, word, and sentence boundaries, removing the need for full optical character recognition or manual keypunching.

Source

FLESCH_KINCAID, FLESCH_READING

The Flesch/Flesch–Kincaid readability tests are designed to indicate comprehension difficulty when reading a passage of contemporary academic English. There are two tests, the Flesch Reading Ease, and the Flesch–Kincaid Grade Level. Although they use the same core measures (word length and sentence length), they have different weighting factors. The results of the two tests correlate approximately inversely: a text with a comparatively high score on the Reading Ease test should have a lower score on the Grade Level test. Both systems were devised by Rudolf Flesch. The latter was developed by J. Peter Kincaid for the United States Navy. Such readability tests suggest that many Wikipedia articles may be "too sophisticated" for their readers

GUNNING_FOG

In linguistics, the Gunning fog index measures the readability of English writing. The index estimates the years of formal education needed to understand the text on a first reading. A fog index of 12 requires the reading level of a U.S. high school senior (around 18 years old). The test was developed by Robert Gunning, an American businessman, in 1952. The fog index is commonly used to confirm that text can be read easily by the intended audience. Texts for a wide audience generally need a fog index less than 12. Texts requiring near-universal understanding generally need an index less than 8.

SMOG, SMOG_INDEX

The SMOG grade is a measure of readability that estimates the years of education needed to understand a piece of writing. It is widely used, particularly for checking health messages. The SMOG grade yields a 0.985 correlation with a standard error of 1.5159 grades with the grades of readers who had 100% comprehension of test materials.

The formula for calculating the SMOG grade was developed by G. Harry McLaughlin as a more accurate and more easily calculated substitute for the Gunning fog index and published in 1969. To make calculating a text's readability as simple as possible an approximate formula was also given — count the words of three or more syllables in three 10-sentence samples, estimate the count's square root (from the nearest perfect square), and add 3.

Clone this wiki locally