Skip to content

[Feature Request] Ship precomputed distance map / sample training data #11

Description

@flolep2607

Great project.

The main friction for new users is the cold-start: learn_from() requires labelled (ocr_string, ground_truth) pairs that most people don't have.
Would it be possible to ship a precomputed substitution_costs JSON trained on a public OCR dataset (e.g. OCR-D, Tesseract UNLV)? Something like:

from ocr_stringdist import WeightedLevenshtein, PRETRAINED_COSTS

wl = WeightedLevenshtein(substitution_costs=PRETRAINED_COSTS)

OR

from ocr_stringdist import WeightedLevenshtein

wl = WeightedLevenshtein() # it used default pretrained costs

Since the model is just a dict[tuple[str, str], float], it'd be trivial to bundle as a JSON file or release asset.
Even a training script + dataset pointer would help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions