{"id":22700050,"url":"https://github.com/ub-mannheim/betrial","last_synced_at":"2026-03-19T23:27:16.652Z","repository":{"id":81010197,"uuid":"189023068","full_name":"UB-Mannheim/BeTrial","owner":"UB-Mannheim","description":"Bernoulli trial generator to validate OCR results","archived":false,"fork":false,"pushed_at":"2019-10-30T09:35:22.000Z","size":521,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-04T19:46:10.832Z","etag":null,"topics":["aktienfuehrer","bernoulli-trial","csv","dfg","html","ocr","validation"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UB-Mannheim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-28T12:22:29.000Z","updated_at":"2023-04-14T08:25:40.000Z","dependencies_parsed_at":"2023-10-18T06:15:06.693Z","dependency_job_id":null,"html_url":"https://github.com/UB-Mannheim/BeTrial","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UB-Mannheim%2FBeTrial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UB-Mannheim%2FBeTrial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UB-Mannheim%2FBeTrial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UB-Mannheim%2FBeTrial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UB-Mannheim","download_url":"https://codeload.github.com/UB-Mannheim/BeTrial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246230542,"owners_count":20744349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aktienfuehrer","bernoulli-trial","csv","dfg","html","ocr","validation"],"created_at":"2024-12-10T06:09:39.856Z","updated_at":"2026-01-07T14:54:18.722Z","avatar_url":"https://github.com/UB-Mannheim.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"![betrial-logo](docs/img/BeTrial.png)\n\n-------------------------------------\n[![Build Status](https://travis-ci.org/UB-Mannheim/BeTrial.svg?branch=master)](https://travis-ci.org/JKamlah/BeTrial)\n![Python 2.7](https://img.shields.io/badge/python-2.7-yellow.svg)\n![license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)\n\n## Overview\n**Bernoulli trial generator tool for OCR result validation**\n\nThis repo is part of the [Aktienführer-Datenarchiv][akf-link] DFG project.\nThe DFG recommends the Bernoulli trial to validate OCR results.\nTo reduce the amount of effort to perform the test, a \"Bernoulli Trial HTML Generator\" was designed.\nThis generator work with Abbyy-XML-Files (*\\*.xml*)  or hocr-Files (*\\*.hocr*) and their JPG-image pendant (*\\*.jpg*).\n\n\n## Installation\n\nThis installation is tested with Ubuntu and we expect that it should\nwork for other similar environments similarly.\n\n### 1. Requirements\n- Python 2.7\n\n### 2. Copy this repository\n```\ngit clone https://github.com/UB-Mannheim/BeTrial.git\ncd BeTrial\n```\n\n### 3. Dependencies can be installed into a Python Virtual Environment:\n\n    $ virtualenv betrial_venv/\n    $ source betrial_venv/bin/activate\n    $ pip install -r requirements.txt\n\n## Process steps\n\nThe whole projects has four major steps:\n\n### Loading files from web\n\nLoad the files from the web (\"filegetter.py\").\n\n    $ python ./filegetter.py (+ parameters)\n\n### Creating a dataset\nCreate a set of files for the Bernoulli-Trials (\"betrialgen.py\")\n\n    $ python ./betrialgen.py -p /input/dir/*.xml or *.hocr (+ parameters)\n\n\n### Creating a html page with csv export\nCreate an interactive Bernoulli-Trial html (\"betrial.py\").\n\n    $ python ./betrial.py /betrial/input/dir/*.png (+ parameters)\n\n### Evaluating the results\nThe betrial_eval html page helps to evaluate our results.\n\n```bash\n\u003e firefox betrial_eval.html\n```\n\nTestcase\n--------\n\nCreating a dataset\n\n    $ python ./betrialgen.py\n\nCreating the html-page\n\n    $ python ./betrial.py ./test/BeTrial/input/*.png\n\nThe validation page can be opened with firefox\n\n```bash\n\u003e firefox out.html\n```\n\n![example-page](docs/img/example_page.png)\n\nYou see the images of all the text lines from the dataset and\nbelow each line there is the recognized text.\nOne of the character is marked with a red rectangle.\nThis character should be manually validated.\nTherefore you can select one of the radio buttons below.\nFor example above you should check the letter `j` in the word `just`.\nWhich is `Ok`.\n\nThe button `Counts` displays an overview, about the current validation status.\n\n![example-count](docs/img/example_count.png)\n\nThe results can be stored with  `Export Gesamtergebnis` and `Export Einzelergenisse`\nin `csv` files.\n\nTo evaluate the results, open the `betrial_evals.html` file:\n\n```bash\n\u003e firefox betrial_eval.html\n```\n\nThis page helps to calculate the cumulative distribution function (cdf).\n\n![example-count](docs/img/example_cdf.png)\n\nAnd the necessary amount of successful events to proof the predicted accuracy\nconsidering a certain error-probability.\n\n![example-count](docs/img/example_signalpha.png)\n\nCopyright and License\n--------\n\nCopyright (c) 2019 Universitätsbibliothek Mannheim\n\nAuthor:\n * [Jan Kamlah](https://github.com/jkamlah)\n\n**BeTrial** is Free Software. You may use it under the terms of the Apache 2.0 License.\nSee [LICENSE](./LICENSE) for details.\n\n\nAcknowledgements\n-------\n\nThe tools are depending on some third party libraries:\n * [ocropy][ocropy-link] is a collection of document analysis programs.\n One of them is [ocropus-gtedit][gtedit-link] which builds the basis of the \"betrial.py\" source code.\n ocropus-gtedit produces an editable html-page,\n where you can see the images of all the text lines and below each line the recognized text.\n The recognized text can be updated to produce ground truth data.\n * [Export2CSV][exportcsv-link] export the data to csv.\n * [Calculating Binom][binom-link] the calculation in the evaluation page are based on the implementation of Terry Ritter.\n\n[akf-link]:  https://github.com/UB-Mannheim/Aktienfuehrer-Datenarchiv-Tools \"Aktienfuehrer-Datenarchiv-Tools\"\n[dataarchive-link]: https://digi.bib.uni-mannheim.de/aktienfuehrer/ \"Aktienfuehrer-Datenarchiv\"\n[ocropy-link]:  https://github.com/tmbdev/ocropy\"\n[exportcsv-link]: https://medium.com/@danny.pule/export-json-to-csv-file-using-javascript-a0b7bc5b00d2\n[gtedit-link]: https://github.com/tmbdev/ocropy/wiki/Working-with-Ground-Truth\n[binom-link]: http://www.ciphersbyritter.com/JAVASCRP/BINOMPOI.HTM\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fub-mannheim%2Fbetrial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fub-mannheim%2Fbetrial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fub-mannheim%2Fbetrial/lists"}