Skip to content

Instantly share code, notes, and snippets.

@mikegerber
Created April 15, 2021 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikegerber/237999165a0fdb397b20812ad8ce2bfe to your computer and use it in GitHub Desktop.
Save mikegerber/237999165a0fdb397b20812ad8ce2bfe to your computer and use it in GitHub Desktop.
Extract metrics from dinglehopper JSON exports
import glob
import json
FIELDS = ["gt", "ocr", "cer", "wer", "n_characters", "n_words"]
FILES = glob.glob("*.json")
print("file;" + ";".join(FIELDS))
for f in FILES:
print(f, end="")
j = json.load(open(f))
for field in FIELDS:
value = j[field]
print(";" + str(value), end="")
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment