mari-pdf-corpus / README.md
OneAdder's picture
Update README.md
3392157 verified
---
dataset_info:
features:
- name: text
dtype: string
- name: lang
dtype: string
- name: name
dtype: string
- name: category
dtype: string
- name: year
dtype: int64
splits:
- name: train
num_bytes: 412136435
num_examples: 878
download_size: 209656175
dataset_size: 412136435
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
language:
- chm
- mhr
- mrj
license: cc-by-4.0
---
# Mari Press and School Books Corpus
## Description
This is a text corpus of [Meadow Mari](https://en.wikipedia.org/wiki/Meadow_Mari_language)
and [Hill Mari](https://en.wikipedia.org/wiki/Hill_Mari_language) languages.
The dataset is plain text without any additional annotations except for basic meta data.
Please note, that the texts have been extracted from PDFs, so they are quite dirty.
## Source
The corpus is based on texts from [Mari Lab](https://mari-lab.ru/index.php/Mari-Lab) PDFs
of magazines and school books.
## Composition
The first part of the corpus includes the following magazines:
| name | names_in_corpus | years | languages |
| ---------------- | ---------------- | --------- | ------------------------------------------------------- |
| У вий | U_Viy_* | 1926–1936 | **Meadow Mari** with _rare_ presence of Hill Mari |
| Пиалан илыш | пиалан_илыш_* | 1926–1936 | **Meadow Mari** |
| Родина верч | родина_верч_* | 1942–1945 | **Meadow Mari** |
| Марий альманах | марий_альманах_\*| 1946–1949 | **Meadow Mari** |
| Ончыко | ончыко_* | 1954-2022 | **Meadow Mari** with _occasional_ presence of Hill Mari |
| Марий сандылак | марий_сандалык_* | 2008-2018 | **Meadow Mari** with _occasional_ presence of Hill Mari |
| У сэм | у_сэм_* | 1930-1934 | **Hill Mari** |
| Йакшар знамӹ | йакшар_знамӹ_* | 1935-1936 | **Hill Mari** |
| У сем | у_сем_* | 1990-2018 | **Hill Mari** |
Note 1: _У вий_, _Пиалан илыш_, _Родина верч_, _Марий альманах_ and _Ончыко_ are names of the same magazine
in different years.
Note 2: writing system had minor changes in 1938, if only modern writing is needed, filter by `year` field.
The second part includes school books on geography, mathematics and other subjects from
between 1933-1951.
## Preprocessing
Due to the fact that those are PDFs, a huge amount of preprocessing has been done to convert them to PDFs.
At the beggining the texts have been split into four categories:
* `clean`: clean PDFs that have a text layer in UTF-8
* `ocr`: OCR PDFs have an automatically recognized text layer in UTF-8
* `fix`: broken encoding PDFs that have inconsistent ASCII encoding
* `remap`: slightly broken PDFs that have a text layer in UTF-8 but some charachters are incorrect
PDFs from first and second categories have been used as-is.
PDFs from the third categories have been assumed to be in `cp1251` and converted to UTF-8.
For the third and fourth categories, the incorrect symbols have been remapped to the correct ones.
## Filtering
Sometimes Mari magazines contain sections in Russian language. I have
[trained](https://github.com/OneAdder/mari-llm/blob/master/mari_vs_russian_classifier.py)
a logistic regression classifier on [Meadow-Mari-Russian parallel corpus](https://huggingface.co/datasets/AigizK/mari-russian-parallel-corpora).
It yields zero if a sentence is in Mari and 1 if in Russian. Then I classified each line in sections of PDF texts (separated be two line breaks)
and calculated mean score for each section. Sections that are definitely Russian (>0.8) have been removed.
## Metrics
| | Total | Hill Mari only | Meadow Mari only | No OCR | Modern Writing |
| -------- | ---------- | -------------- | ---------------- | --------- | -------------- |
| texts | 878 | 176 | 563 | 166 | 701 |
| tokens* | 45 576 320 | 5 081 705 | 32 426 529 | 8 192 294 | 41 520 480 |
_\*nltk.tokenize.casual.TweetTokenizer not very reliable as there is a lot of rubbish from PDF_
## Cite
```bibtex
@online{mari_press_and_school_books_corpus,
author = {Andrei Chemyshev and Michael Voronov},
title = {Mari Press and School Books Corpus},
year = 2025,
url = {https://huggingface.co/datasets/OneAdder/mari-pdf-corpus},
urldate = {2025-07-17}
}
```