@@ -122,16 +122,22 @@ def get_boxes(mmif):
122122def prep_annotations (mmif , viz_id ):
123123 """Prepare annotations from the views, and return a list of pairs of tabname
124124 and tab content. The first tab is alway the full MMIF pretty print."""
125- tabs = [("Info" , "<pre>" + create_info (mmif ) + "</pre>" ),
126- ("MMIF" , "<pre>" + mmif .serialize (pretty = True ) + "</pre>" ),
127- ("Annotations" , create_annotation_tables (mmif )),
128- ("Tree" , render_interactive_mmif (mmif ))]
125+ tabs = []
126+ tabs .append (("Info" , "<pre>" + create_info (mmif ) + "</pre>" ))
127+ app .logger .debug (f"Prepared INFO Tab: { tabs [- 1 ][0 ]} " )
128+ # tabs.append(("MMIF", "<pre>" + mmif.serialize(pretty=True) + "</pre>"))
129+ # app.logger.debug(f"Prepared RAW Tab: {tabs[-1][0]}")
130+ tabs .append (("Annotations" , create_annotation_tables (mmif )))
131+ app .logger .debug (f"Prepared SUMMARY Tab: { tabs [- 1 ][0 ]} " )
132+ tabs .append (("Tree" , render_interactive_mmif (mmif )))
133+ app .logger .debug (f"Prepared JSTREE Tab: { tabs [- 1 ][0 ]} " )
129134 # TODO: since this uses the same tab-name this will only show the same
130135 # stuff; it does a loop but for now we assume there is just one file with
131136 # alignments (generated by Kaldi)
132137 for fa_view in get_alignment_views (mmif ):
133138 vtt_file = asr_alignments_to_vtt (fa_view , viz_id )
134139 tabs .append (("WebVTT" , '<pre>' + open (vtt_file ).read () + '</pre>' ))
140+ app .logger .debug (f"Prepared a VTT Tab: { tabs [- 1 ][0 ]} " )
135141 ner_views = get_ner_views (mmif )
136142 use_id = True if len (ner_views ) > 1 else False
137143 for ner_view in ner_views :
@@ -140,6 +146,7 @@ def prep_annotations(mmif, viz_id):
140146 visualization = create_ner_visualization (mmif , ner_view )
141147 tabname = "Entities-%s" % ner_view .id if use_id else "Entities"
142148 tabs .append ((tabname , visualization ))
149+ app .logger .debug (f"Prepared a displaCy Tab: { tabs [- 1 ][0 ]} " )
143150 # TODO: somewhat hackish
144151 ocr_views = get_ocr_views (mmif )
145152 use_id = True if len (ocr_views ) > 1 else False
@@ -149,6 +156,7 @@ def prep_annotations(mmif, viz_id):
149156 tabname = "Thumbnails-%s" % ocr_view .id
150157 visualization = render_template ("pre-ocr.html" , view_id = ocr_view .id , tabname = tabname , mmif_id = viz_id )
151158 tabs .append ((tabname , visualization ))
159+ app .logger .debug (f"Prepared a Thumbnails Tab: { tabs [- 1 ][0 ]} " )
152160 return tabs
153161
154162
0 commit comments