liveBook · Manning

Average number of words per sentence

As explained in Learn AI-Assisted Python Programming, Second Edition

Average number of words per sentence is the mean count of words contained in the sentences of a text.

Average number of words per sentence measures sentence length by dividing a text’s total words by its total sentences. It can serve as a sentence-structure feature in an author signature. section 11.1 section 11.3.1

Calculating the average

For the passage beginning “The same day there arrived through the post,” count 32 words across two sentences. Treat “card-board” as one word, then calculate 32 ÷ 2 = 16 words per sentence. section 11.3.1

How Learn AI-Assisted Python Programming, Second Edition covers it

How deep it goes
Defines and demonstrates the division of total words by total sentences, without detailing sentence-tokenization implementation.
Examples
Calculates 32 words divided by two sentences in a passage, producing an average of 16.
What you can do after
Apply the metric to characterize writing and include it in a signature for comparing authors.
How it connects
Ties to authorship identification, machine learning, supervised learning, author signatures, and average sentence complexity.

This explainer was generated by Manning's knowledge graph from the text of Learn AI-Assisted Python Programming, Second Edition. The section links point to the parts of the book it draws on.