human
I am working on the file "DocumentClassificationNLMStudent.ipynb".
The first task is:
Document Markup and Classification
We are going to be doing a lot behind the scenes here. We've got some code that is going to take our lexical and domain definitions, markup our documents according to these definitions and use pyConTextNLP to assign relationships between the concepts for each sentence int he document. Finally, we take a schema that defines how we are going to classify our documents, based on the sentence level markup. The schema we are going to use here is an ordinal schema where we account for existence, uncertainty, and acuity. The document classification is basically a maximum function: the document is assigned the maximum score of any sentence in the document.
We now need to apply our schema to the reports. Since our data is in a Pandas data frame, the easiest way to process our reports is with the DataFrame apply method.

We use lambda to create an anonymous function which basically just applies analyze_report to the "impression" column with the modifiers, targets, etc. that we have read in separately.
analyze_report returns a dictionary with keys as any identified targets defined in the "targets" file and values as a tuple with values:
The schema value that was selected for the document
The node (evidence) that was used for selecting that schema value
Can you write Python program for it?
assistant
#Here is the Python program you requested.

data["pe rslt"] = \
    data.apply(lambda x: analyze_report(x["impression"], 
                                         kb["modifiers"], 
                                         kb["targets"],
                                         kb["rules"],
                                         kb["schema"]), axis=1)
data.head()

def view_markup(reports, colors):
    @interact(i=widgets.IntSlider(min=0, max=len(reports)-1))
    def _view_markup(i):
        markup = reports["pe rslt"][i]
        rview.markup_to_pydot(markup)
        display(Image("tmp.png"))
        mt = rview.markup_to_html(markup, color_map=colors)

        display(HTML(mt))

view_markup(data, colors)