Improving Text Recognition Accuracy for Serbian Legal Documents Using BERT
Source abstract
Abstract
Producing a new high-quality text corpus is a big challenge due to the required complexity and labor expenses. High-quality datasets, considered a prerequisite for many supervised machine learning algorithms, are often only available in very limited quantities. This in turn limits the capabilities of many advanced technologies when used in a specific field of research and development. This is also the case for the Serbian language, which is considered low-resourced in digitized language resources. In this paper, we address this issue for the Serbian language through a novel approach for generating high-quality text corpora by improving text recognition accuracy for scanned documents belonging to Serbian legal heritage. Our approach integrates three different components to provide high-quality results: a BERT-based large language model built specifically for Serbian legal texts, a high-quality open-source optical character recognition (OCR) model, and a word-level similarity measure for Serbian Cyrillic developed for this research and used for generating necessary correction suggestions. This approach was evaluated manually using scanned legal documents sampled from three different epochs between the years 1970 and 2002 with more than 14,500 test cases. We demonstrate that our approach can correct up to 88% of terms inaccurately extracted by the OCR model in the case of Serbian legal texts.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Topic Modeling · Natural Language Processing Techniques · Data Quality and Management
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
Faculty of Electronic Engineering, University of Nis, 18000 Nis, Serbia
Funding
Ministry of Science, Technological Development and Innovation of the Republic of Serbia
References (37)
Show source-provided references
1. Zhang, G., Nulty, P., and Lillis, D. (2022). Enhancing Legal Argument Mining with Domain Pre-training and Neural Networks. arXiv.10.46298/jdmdh.9147 ↗
2. Zhang, G., Lillis, D., and Nulty, P. (2021, January 16–19). Can Domain Pre-training Help Interdisciplinary Researchers from Data Annotation Poverty? A Case Study of Legal Argument Mining with BERT-based Transformers. Proceedings of the Workshop on Natural Language Processing for Digital Humanities (NLP4DH), Silchar, India.10.46298/jdmdh.9147 ↗
3. Ilić, V., Bajčetić, L., Petrović, S., and Španović, A. (2022, January 12–16). SCyDia–OCR for Serbian Cyrillic with Diacritics in Dictionaries and Society. Proceedings of the XX EURALEX International Congress, Mannheim, Germany.
4. An overview of information extraction techniques for legal document analysis and processing
5. Text retrieval in the legal world10.1007/BF00877694 ↗
6. Summarization of legal documents: Where are we now and the way forward10.1016/j.cosrev.2021.100388 ↗
7. Attentive deep neural networks for legal document retrieval10.1007/s10506-022-09341-8 ↗
8. Generating correction candidates for ocr errors using bert language model and fasttext subword embeddings10.1007/978-3-030-80119-9_69 ↗
9. Sfikas, G., and Retsinas, G. (2024). Confidence-Aware Document OCR Error Detection. Document Analysis Systems, Springer. DAS 2024. Lecture Notes in Computer Science.10.1007/978-3-031-70442-0 ↗
10. (2024, December 26). Official Gazette of the Republic of Serbia. Available online: https://op.europa.eu/en/web/forum/srbija-serbia.
11. Mikolov, T., Chen, K., Corrado, G., and Dean, J. (2013). Efficient estimation of word representations in vector space. arXiv.
12. Joulin, A., Grave, E., Bojanowski, P., Douze, M., Jegou, H., and Mikolov, T. (2016). Fasttext.zip: Compressing text classification models. arXiv.
13. Peters, M.E., Neumann, M., Iyyer, M., Gardner, M., Clark, C., Lee, K., and Zettlemoyer, L. (2018). Deep contextualized word representations. arXiv.10.18653/v1/N18-1202 ↗
14. Lin, Y., Liu, Z., Sun, M., Liu, Y., and Zhu, X. (2015, January 25–30). Learning entity and relation embeddings for knowledge graph completion. Proceedings of the AAAI Conference on Artificial Intelligence, Austin, TX, USA.10.1609/aaai.v29i1.9491 ↗
15. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., and Polosukhin, I. (2017, January 4–9). Attention is all you need. Proceedings of the Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems, Long Beach, CA, USA.
16. BERT: Pre-training of deep bidirectional transformers for language understanding
17. Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., and Sutskever, I. (2024, December 26). Language Models are Unsupervised Multitask Learners. OpenAI Blog 2019. Available online: https://paperswithcode.com/paper/language-models-are-unsupervised-multitask.
18. Lewis, M., Liu, Y., Goyal, N., Ghazvininejad, M., Mohamed, A., Levy, O., Stoyanov, V., and Zettlemoyer, L. (2020, January 5–10). BART: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online.10.18653/v1/2020.acl-main.703 ↗
19. Yang, Z., Dai, Z., Yang, Y., Carbonell, J., Salakhutdinov, R., and Le, Q.V. (2019). Xlnet: Generalized autoregressive pretraining for language understanding. arXiv.
20. Zhong, H., Zhang, Z., Liu, Z., and Sun, M. (2019). Open Chinese Language Pretrained Model Zoo, Tsinghua University. Technical Report.
21. Bogdanović, M., Kocić, J., and Stoimenov, L. (2024). SRBerta—A Transformer Language Model for Serbian Cyrillic Legal Texts. Information, 15.10.3390/info15020074 ↗
22. Optical character recognition by open source OCR tool tesseract: A case study
23. Performance comparison of OCR tools10.5121/iju.2015.6303 ↗
24. Bunke, H., and Spitz, A.L. (2006). The effects of OCR error on the extraction of private information. Document Analysis Systems VII, Springer. Lecture Notes in Computer Science.10.1007/11669487 ↗
25. Solihin, F., and Budi, I. (2018, January 27–28). Recording of law enforcement based on court decision document using rule-based information extraction. Proceedings of the International Conference on Advanced Computer Science and Information Systems, ICACSIS 2018, Yogyakarta, Indonesia.10.1109/ICACSIS.2018.8618187 ↗
26. Leitner, E., Rehm, G., and Moreno-Schneider, J. (2019, January 9–12). Fine-grained named entity recognition in legal documents. Proceedings of the Semantic Systems. The Power of AI and Knowledge Graphs, 15th International Conference, SEMANTiCS 2019, Karlsruhe, Germany.10.1007/978-3-030-33220-4_20 ↗
27. Kumar, V., Kaware, P., Singh, P., and Sonkusare, R. (2020, January 10–12). Extraction of information from bill receipts using optical character recognition. Proceedings of the International Conference on Smart Electronics and Communication, ICOSEC 2020, Trichy, India.10.1109/ICOSEC49089.2020.9215246 ↗
28. An adaptive thresholding algorithm-based optical character recognition system for information extraction in complex images10.3844/jcssp.2020.784.801 ↗
29. OCR accuracy improvement on document images through a novel preprocessing approach10.5121/sipij.2015.6401 ↗
30. Optical Character Recognition Engines Performance Comparison in Information Extraction
31. Krstev, C., Stankovic, R., and Vitas, D. (2018, January 28–29). Knowledge and rule-based diacritic restoration in Serbian. Proceedings of the Computational Linguistics in Bulgaria, Third International Conference (CLIB), Sofia, Bulgaria.
32. Bogdanović, M., and Kocić, J. (2024, December 26). Corpus of Legislation texts of Republic of Serbia 1.0, Slovenian Language Resource Repository CLARIN.SI, ISSN 2820-4042. Available online: http://hdl.handle.net/11356/1754.
33. (2024, December 26). OSCAR Project. Available online: https://oscar-project.org/.
34. (2024, December 26). Common Crawl. Available online: https://commoncrawl.org/.
35. Hugging Face (2024, June 03). Summary of the Tokenizers. Available online: https://huggingface.co/docs/transformers/tokenizer_summary#bytepairencoding.
36. Bogdanović, M., and Kocic, J. (2024, June 03). SRBerta. Available online: https://huggingface.co/JelenaTosic/SRBerta.
37. Hugging Face (2024, June 03). RoBERTa Model Documentation. Available online: https://huggingface.co/docs/transformers/model_doc/roberta.