def view_single_sentence_graph(sentence, modifiers, targets): context = markup_context_document(sentence, modifiers, targets) class_result = classrslts(context_document=context, exam_type="Chest X-Ray", report_text=sentence, classification_result='N/A') rview.markup_to_pydot(class_result) display(Image("tmp.png")) print(sentence)
def marking_false_negatives(current_false_negatives, modifiers, targets): fn_report_results = [] print('Marking up False Negatives') for anno_doc in current_false_negatives.values(): report_context = markup_context_document(anno_doc.text, modifiers, targets) # package this up into a class that the RadNLP utilities can use results = classrslts(context_document=report_context, exam_type="Chest X-Ray", report_text=anno_doc.text, classification_result='N/A') fn_report_results.append(results) return fn_report_results
def analyze_report(report, modifiers, targets, rules, schema): """ given an individual radiology report, creates a pyConTextGraph object that contains the context markup report: a text string containing the radiology reports """ markup = utils.mark_report(split.get_sentences(report), modifiers, targets) clssfy = classifier.classify_document_targets(markup, rules[0], rules[1], rules[2], schema) return classrslts(context_document=markup, exam_type="ctpa", report_text=report, classification_result=clssfy)