Here I’m venturing past my skillset again, but someone here will tell me what’s possible.
I’m working with lots of handwritten documents, and handwritingocr.com seems to have decently accurate transcription, and it can be set to interact with webhooks to output JSON strings.
I still need to learn more about webhooks, but I was able to process one handwritten page-image and have the transcription results appear at my bespoke webhook URL as a JSON string. Cool!
I helped myself to the “paste JSON from clipboard” solution from this thread, and …
… needed to go do some edits in BBEdit to add outer square brackets, to assign “title” instead of “file_name” … remove some nested structure I don’t need… and rename “transcript” to “text”…
OK! Proof of concept worked: I got the transcript with various bits of metadata imported as a tiddler.
AND… I did climb a learning curve for custom deserializers before (coached along by saq back when I started a workflow that pulled things in from a moodle export, and again with bibtex import process). So I think I understand how I can clone a deserializer and convince it to treat the file_name key as the title field, and to parse the date fields which aren’t in tiddlywiki format…
BUT this JSON on my clipboard has a nested structure that buries what I’d like to see in text field within an additional layer. Does anyone know whether/how to tweak a deserializer so that it can “dig” into the nested key (called results), ignore its page_number value, and either just take the first “transcript” value, or (ideally) concatenate the value of all the transcript keys found within… ?
Is this the kind of thing that’s possible, and that folks can coach me through?
(I’ll save other webhook-related questions for another day.)
Many thanks in advance!