Automatically categorize parts of a piece of writing Suppose I had a piece of writing. The document contains aspects like questions, assertions, examples, and explanations. Is it possible to use Natural Language Processing to categorize each sentence of the writing into such aspects, thus creating a code like 1.1:assertion, 1.2:explanation, for instance, meaning paragraph 1, sentence 1 assertion, and paragraph 1, sentence 2, explanation?

If that is possible, I would appreciate if someone would share their knowledge about known algorithms for performing this task.
As far as I know there's no specific task for this, it's general text classification.  It's also related to text segmentation. There are certainly existing systems for similar tasks, but probably specific to a certain type of data.

In general this would be a supervised process, you would need a sample containing many documents in which the parts are pre-annotated. I think sequence labeling algorithms would be the standard approach.