MCPcopy
hub / github.com/JaidedAI/EasyOCR / norm

Method norm

trainer/utils.py:27–31  ·  view source on GitHub ↗

length-normalise LM score

(self)

Source from the content-addressed store, hash-verified

25 self.entries = {}
26
27 def norm(self):
28 "length-normalise LM score"
29 for (k, _) in self.entries.items():
30 labelingLen = len(self.entries[k].labeling)
31 self.entries[k].prText = self.entries[k].prText ** (1.0 / (labelingLen if labelingLen else 1.0))
32
33 def sort(self):
34 "return beam-labelings, sorted by probability"

Callers 7

ctcBeamSearchFunction · 0.95
_build_inv_delta_CMethod · 0.45
_build_P_hatMethod · 0.45
getDetBoxes_coreFunction · 0.45
getPoly_coreFunction · 0.45
crop_image_by_bboxMethod · 0.45
cal_angleMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected