mirror of
https://github.com/allenai/olmocr.git
synced 2025-11-15 18:08:41 +00:00
Minor fixes
This commit is contained in:
parent
361ed2a038
commit
1148b475e9
@ -134,7 +134,7 @@ def compare_votes_for_file(base_pdf_file: str, base_pdf_page: int, base_text: st
|
|||||||
diff_entry = {
|
diff_entry = {
|
||||||
"base": b_sentence,
|
"base": b_sentence,
|
||||||
"variants": Counter(variant_votes),
|
"variants": Counter(variant_votes),
|
||||||
"vote_count": len(variant_votes)
|
"vote_count": len(variant_votes),
|
||||||
}
|
}
|
||||||
diffs.append(diff_entry)
|
diffs.append(diff_entry)
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ def main():
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--max-diffs",
|
"--max-diffs",
|
||||||
type=int,
|
type=int,
|
||||||
default=4,
|
default=5,
|
||||||
help="Maximum number of diffs to display per file."
|
help="Maximum number of diffs to display per file."
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
@ -228,7 +228,6 @@ def main():
|
|||||||
|
|
||||||
# Output test candidates for review after each file, in case there are errors
|
# Output test candidates for review after each file, in case there are errors
|
||||||
save_tests(all_tests, args.output)
|
save_tests(all_tests, args.output)
|
||||||
break
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
@ -42,6 +42,8 @@ class BasePDFTest:
|
|||||||
checked: Optional[TestChecked] = None
|
checked: Optional[TestChecked] = None
|
||||||
|
|
||||||
def __post_init__(self):
|
def __post_init__(self):
|
||||||
|
self.threshold = float(self.threshold)
|
||||||
|
|
||||||
if not self.pdf:
|
if not self.pdf:
|
||||||
raise ValidationError("PDF filename cannot be empty")
|
raise ValidationError("PDF filename cannot be empty")
|
||||||
if not self.id:
|
if not self.id:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user