Pipeline to get structured data from Supernote device note files.
Supernote devices are a pleasure to work on, easy on the eyes, low-powered, resilient devices. I'm betting the last longer in the field than a glass brick like an iPad. This repository contains an archaeological single-context recording sheet (sourced from BAJR) as a demo. The idea is that the underlying template, like an archaeological single-context recording sheet, conveys semantic information by the positioning and layout of its elements. You'd make notes on the supernote device, copy those over to your computer, run the scripts in this repo, and voilà, structured data.
- turn your pdf into a png file; upload it to
my_styleson your supernote device. Themake_template.pyscript will format for nomad or manta. - Make a new note. If you make it a real-time recognition note, the
rtr-parse.pyscript is what you'll want later on. Supernote's on-device ocr recognizes the sequence of pen strokes, apparently, and this leads to better quality than say an image-based ocr. - Set the png file as a template for the note; add data, pages as desired.
- Move the note to your computer.
- Make sure the parser script knows the area of the bounding boxes by using the
visualize-rois.pyscript. This will let you drag and drop the areas visually on the template; it will return the coordinates properly scaled for the device you use (manta or nomad). Copy that data into the parse scripts. parse_context_record.pylets you use ocrmac, rapidocr, or a vlm.parse_hybrid_record.pyretrieves the on-device OCR and the bounding boxes, then uses a VLM to 'correct' errors. This one currently gives the best results.
A work in progress. Developed on a mac m1. parse_hybrid_record.py uses mlx, so you'd have to faff about if you wanted a windows/linux solution; if you're on windows, the parse_context_record.py script should probably work for you. But the best idea would be to modify the strategy used by parse_hybrid_record.py to work on windows.
You could always plumb those scripts into a high-end vlm if you want; that should probably give you best results. Anyway, this general approach should work for any kind of form filling you might want to do on a Supernote.