Skip to content
 
 

Repository files navigation

pydurma

Table of contents

Project descriptionWho this project is forProject dependenciesInstructions for useContributing guidelinesAdditional documentationHow to get helpTerms of use


Project description

pydurma creates a clean e-text version of a Tibetan work from multiple flawed sources.

Benefits include:

  • Automatic proofreading of Tibetan e-texts
  • Creating high-quality e-texts from low-quality sources
  • Doesn't require a spell checker (which doesn't exist yet for Tibetan language)

pydurma uses a weighted majority algorithm that compares versions of the work syllable-by-syllable and chooses the most common character from among the versions in each position of the text. Since mistakes—whether made during the woodblock carving, hand copying, digital text inputting, or OCRing process—are unlikely to be the same in the majority of the versions, they are unlikely to outrank the correct characters in any given position of the text. The result is a new clean version called a "vulgate edition."

Uncritical editions or vulgates

vulgate (noun) /ˈvəl-ˌgāt/ or /ˈvʌlɡeɪt/: 2. a commonly accepted text or reading.

Medieval Latin vulgata, from Late Latin vulgata editio: edition in general circulation.

“Vulgate.” Merriam-Webster.com Dictionary, Merriam-Webster, https://www.merriam-webster.com/dictionary/vulgate. Accessed 23 Dec. 2022.

This less common sense of the term vulgate represents the objective of this project.

Who this project is for

This project is intended for:

  • Publishers who need clean copies of texts to publish books
  • Developers who need clean data to train AI models
  • Anyone who needs to proofread a Tibetan text and has access to multiple versions, such as in the BDRC library.

Dependencies

Before you start, ensure you've installed:

  • python >= 3.7
  • openpecha
  • regex
  • fast-diff-match-patch

Requirements

To create a vulgate edition, you'll need:

  • A reference pecha in the OPF format
  • Several witness pechas in the OPF format (a witness is a version of a text)

Note To convert files into the OPF format, use OpenPecha Tools.

You can also convert scanned texts in the BDRC library to the OPF format with the OCR Pipeline.

To test pydurma, you can also use the OPF files in the text folder in this repo.

Instructions for use

Configure pydurma

Assuming you've installed the software above and have OPF files:

  1. Clone this repo.
  2. Add witnesses in the OPF format into your cloned repo.
  3. Open vulgatizer_op_ocr.py in a code editor.
  4. Update the paths to the actual witness folders in this code block:
def test_merger():
	op_output = OpenPechaFS("ITEST.opf")
	vulgatizer = VulgatizerOPTibOCR(op_output)
	vulgatizer.add_op_witness(OpenPechaFS("./test/opfs/I001/I001.opf"))
	vulgatizer.add_op_witness(OpenPechaFS("./test/opfs/I002/I002.opf"))
	vulgatizer.add_op_witness(OpenPechaFS("./test/opfs/I003/I003.opf"))
	vulgatizer.create_vulgate()

Run pydurma

  • Run vulgatizer_op_ocr.py

The vulgate edition OPF will be saved in ./data/opfs/generic_editions.

Limitations

pydurma workflow

pydurma creates vulgate editions in three steps:

  • Preprocessing
  • Alignment
  • Vulgatization

Here is that process:

Preprocessing

image

Alignment

image

Vulgatization

image

Previous work:

text alignment

OCR merging

  • ocromore
  • This was also done by Oliver Hellwig apparently, research to be one

See also

Contributing guidelines

If you'd like to help out, check out our contributing guidelines.

Need help?

  • File an issue.
  • Join our Discord and ask us there.
  • Email us at openpecha[at]gmail[dot]com.

Terms of use

pydurma is licensed under the MIT license.

About

Fast text collator in Python

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages