Dataset Viewer
Auto-converted to Parquet Duplicate
image
imagewidth (px)
184
5.03k
image_path
stringlengths
41
47
text
stringlengths
1
97
text_norm
stringlengths
1
96
script
stringclasses
2 values
source
stringclasses
2 values
orig_id
stringlengths
7
10
width
int32
184
5.03k
height
int32
65
1.11k
iam_line/images/train/iam_line_train_000000.png
put down a resolution on the subject
put down a resolution on the subject
latin
iam_line
train/0
2,467
128
iam_line/images/train/iam_line_train_000001.png
and he is to be backed by Mr. Will
and he is to be backed by Mr. Will
latin
iam_line
train/1
2,667
128
iam_line/images/train/iam_line_train_000010.png
any more Labour life Peers is to be made at a
any more Labour life Peers is to be made at a
latin
iam_line
train/10
1,371
128
iam_line/images/train/iam_line_train_000100.png
to be demonstrations . " Yesterday Sir Roy's
to be demonstrations . " Yesterday Sir Roy's
latin
iam_line
train/100
1,619
128
iam_line/images/train/iam_line_train_001000.png
and Kings , Prince Edward Island .
and Kings , Prince Edward Island .
latin
iam_line
train/1000
1,680
128
iam_line/images/train/iam_line_train_001001.png
in the four federal by-elections last October the party
in the four federal by-elections last October the party
latin
iam_line
train/1001
2,297
128
iam_line/images/train/iam_line_train_001002.png
elections , one at Esquimalt Saanich , British Columbia ,
elections , one at Esquimalt Saanich , British Columbia ,
latin
iam_line
train/1002
1,833
128
iam_line/images/train/iam_line_train_001003.png
fared badly . They are now faced with four other by-
fared badly . They are now faced with four other by-
latin
iam_line
train/1003
1,799
128
iam_line/images/train/iam_line_train_001004.png
All four were Conservative strongholds . Last September
All four were Conservative strongholds . Last September
latin
iam_line
train/1004
2,130
128
iam_line/images/train/iam_line_train_001005.png
held last autumn , 38 per cent for the
held last autumn , 38 per cent for the
latin
iam_line
train/1005
1,849
128
iam_line/images/train/iam_line_train_001006.png
the Administration came to power in 1957 the
the Administration came to power in 1957 the
latin
iam_line
train/1006
2,169
128
iam_line/images/train/iam_line_train_001007.png
Liberals were ahead ( 43 per cent were in favour
Liberals were ahead ( 43 per cent were in favour
latin
iam_line
train/1007
2,506
128
iam_line/images/train/iam_line_train_001008.png
a public poll showed that for the first time since
a public poll showed that for the first time since
latin
iam_line
train/1008
1,988
128
iam_line/images/train/iam_line_train_001009.png
Conservatives and 12 per cent for the C.C.F. ) .
Conservatives and 12 per cent for the C.C.F. ) .
latin
iam_line
train/1009
1,928
128
iam_line/images/train/iam_line_train_000101.png
future . Said Mr. Nkumbula last night :
future . Said Mr. Nkumbula last night :
latin
iam_line
train/101
1,947
128
iam_line/images/train/iam_line_train_001010.png
of " The Grits " if a federal election had been
of " The Grits " if a federal election had been
latin
iam_line
train/1010
1,722
128
iam_line/images/train/iam_line_train_001011.png
Diefenbaker was still ahead in terms of
Diefenbaker was still ahead in terms of
latin
iam_line
train/1011
1,647
128
iam_line/images/train/iam_line_train_001012.png
popularity as an individual leader ( for
popularity as an individual leader ( for
latin
iam_line
train/1012
1,624
128
iam_line/images/train/iam_line_train_001013.png
However , a separate poll revealed that Mr.
However , a separate poll revealed that Mr.
latin
iam_line
train/1013
1,704
128
iam_line/images/train/iam_line_train_001014.png
Pearson 34 per cent ) . How far is Mr.
Pearson 34 per cent ) . How far is Mr.
latin
iam_line
train/1014
1,444
128
iam_line/images/train/iam_line_train_001015.png
of Canada as a Prime Minister ? Many
of Canada as a Prime Minister ? Many
latin
iam_line
train/1015
1,234
128
iam_line/images/train/iam_line_train_001016.png
observers at the national rally will be
observers at the national rally will be
latin
iam_line
train/1016
1,312
128
iam_line/images/train/iam_line_train_001017.png
seeking an answer .
seeking an answer .
latin
iam_line
train/1017
812
128
iam_line/images/train/iam_line_train_001018.png
Mr. Diefenbaker 36 per cent , for Mr.
Mr. Diefenbaker 36 per cent , for Mr.
latin
iam_line
train/1018
1,466
128
iam_line/images/train/iam_line_train_001019.png
Lester Pearson acceptable to the people
Lester Pearson acceptable to the people
latin
iam_line
train/1019
1,296
128
iam_line/images/train/iam_line_train_000102.png
Mr. Macmillan at Chequers .
Mr. Macmillan at Chequers .
latin
iam_line
train/102
1,112
128
iam_line/images/train/iam_line_train_001020.png
in Algoma East .
in Algoma East .
latin
iam_line
train/1020
776
128
iam_line/images/train/iam_line_train_001021.png
baker was in the last two campaigns . The
baker was in the last two campaigns . The
latin
iam_line
train/1021
2,074
128
iam_line/images/train/iam_line_train_001022.png
It is difficult for many to see Mr. Pearson
It is difficult for many to see Mr. Pearson
latin
iam_line
train/1022
1,953
128
iam_line/images/train/iam_line_train_001023.png
in the chancery , or the corridors of the United
in the chancery , or the corridors of the United
latin
iam_line
train/1023
1,799
128
iam_line/images/train/iam_line_train_001024.png
impression remains that the Liberal leader
impression remains that the Liberal leader
latin
iam_line
train/1024
2,011
128
iam_line/images/train/iam_line_train_001025.png
Nations , not the father figure , so necessary
Nations , not the father figure , so necessary
latin
iam_line
train/1025
1,994
128
iam_line/images/train/iam_line_train_001026.png
hustings , the spellbinder that Mr. Diefen-
hustings , the spellbinder that Mr. Diefen-
latin
iam_line
train/1026
1,557
128
iam_line/images/train/iam_line_train_001027.png
politician , able to talk about sewage problems
politician , able to talk about sewage problems
latin
iam_line
train/1027
2,039
128
iam_line/images/train/iam_line_train_001028.png
is still the diplomatist , more at home
is still the diplomatist , more at home
latin
iam_line
train/1028
1,767
128
iam_line/images/train/iam_line_train_001029.png
in Canadian leadership , or the practical
in Canadian leadership , or the practical
latin
iam_line
train/1029
1,981
128
iam_line/images/train/iam_line_train_000103.png
" We want to discuss what to do if the
" We want to discuss what to do if the
latin
iam_line
train/103
1,706
128
iam_line/images/train/iam_line_train_001030.png
in the role of a popular orator at the
in the role of a popular orator at the
latin
iam_line
train/1030
1,738
128
iam_line/images/train/iam_line_train_001031.png
still regard him " as some sort of cross
still regard him " as some sort of cross
latin
iam_line
train/1031
2,988
128
iam_line/images/train/iam_line_train_001032.png
correct that image . The bow tie has
correct that image . The bow tie has
latin
iam_line
train/1032
3,281
128
iam_line/images/train/iam_line_train_001033.png
by speech experts .
by speech experts .
latin
iam_line
train/1033
1,470
128
iam_line/images/train/iam_line_train_001034.png
On the other hand , Mr. Pearson excels
On the other hand , Mr. Pearson excels
latin
iam_line
train/1034
2,393
128
iam_line/images/train/iam_line_train_001035.png
television techniques and is being coached
television techniques and is being coached
latin
iam_line
train/1035
3,041
128
iam_line/images/train/iam_line_train_001036.png
His party advisers are now trying to
His party advisers are now trying to
latin
iam_line
train/1036
2,424
128
iam_line/images/train/iam_line_train_001037.png
between an egghead and a missionary " .
between an egghead and a missionary " .
latin
iam_line
train/1037
3,141
128
iam_line/images/train/iam_line_train_001038.png
in meeting people informally , but many
in meeting people informally , but many
latin
iam_line
train/1038
2,516
128
iam_line/images/train/iam_line_train_001039.png
gone ; he is having lessons on
gone ; he is having lessons on
latin
iam_line
train/1039
2,356
128
iam_line/images/train/iam_line_train_000104.png
Sir Roy's United Federal Party is boycotting
Sir Roy's United Federal Party is boycotting
latin
iam_line
train/104
2,180
128
iam_line/images/train/iam_line_train_001040.png
baker in the House in those early
baker in the House in those early
latin
iam_line
train/1040
1,261
128
iam_line/images/train/iam_line_train_001041.png
leading the Opposition with skill and
leading the Opposition with skill and
latin
iam_line
train/1041
1,457
128
iam_line/images/train/iam_line_train_001042.png
ammunition given him by the Gov-
ammunition given him by the Gov-
latin
iam_line
train/1042
1,595
128
iam_line/images/train/iam_line_train_001043.png
Everything is being done to promote
Everything is being done to promote
latin
iam_line
train/1043
1,376
128
iam_line/images/train/iam_line_train_001044.png
ernment in recent sessions , he is
ernment in recent sessions , he is
latin
iam_line
train/1044
2,143
128
iam_line/images/train/iam_line_train_001045.png
much lessly trounced by Mr. Diefen-
much lessly trounced by Mr. Diefen-
latin
iam_line
train/1045
1,449
128
iam_line/images/train/iam_line_train_001046.png
a new image . Certainly , he is now a
a new image . Certainly , he is now a
latin
iam_line
train/1046
1,529
128
iam_line/images/train/iam_line_train_001047.png
assurance and is a match for the
assurance and is a match for the
latin
iam_line
train/1047
1,779
128
iam_line/images/train/iam_line_train_001048.png
Prime Minister across the floor .
Prime Minister across the floor .
latin
iam_line
train/1048
1,309
128
iam_line/images/train/iam_line_train_001049.png
but now , with plenty of political
but now , with plenty of political
latin
iam_line
train/1049
1,157
128
iam_line/images/train/iam_line_train_000105.png
the London talks on the Protectorate's
the London talks on the Protectorate's
latin
iam_line
train/105
2,794
128
iam_line/images/train/iam_line_train_001050.png
days . It has been a hard road back
days . It has been a hard road back
latin
iam_line
train/1050
1,546
128
iam_line/images/train/iam_line_train_001051.png
will go . The main topic under review is
will go . The main topic under review is
latin
iam_line
train/1051
1,785
128
iam_line/images/train/iam_line_train_001052.png
provinces . However , be this election
provinces . However , be this election
latin
iam_line
train/1052
1,646
128
iam_line/images/train/iam_line_train_001053.png
year or not , Mr. Pearson , with his party
year or not , Mr. Pearson , with his party
latin
iam_line
train/1053
1,618
128
iam_line/images/train/iam_line_train_001054.png
committees examining subjects
committees examining subjects
latin
iam_line
train/1054
1,253
128
iam_line/images/train/iam_line_train_001055.png
increasingly confident of return to power ,
increasingly confident of return to power ,
latin
iam_line
train/1055
2,227
128
iam_line/images/train/iam_line_train_001056.png
ranging from foreign investment in
ranging from foreign investment in
latin
iam_line
train/1056
1,340
128
iam_line/images/train/iam_line_train_001057.png
new and dynamic liberalism " and this
new and dynamic liberalism " and this
latin
iam_line
train/1057
1,726
128
iam_line/images/train/iam_line_train_001058.png
Mr. Pearson is now talking about " his
Mr. Pearson is now talking about " his
latin
iam_line
train/1058
1,477
128
iam_line/images/train/iam_line_train_001059.png
Canada to the problems of the Atlantic
Canada to the problems of the Atlantic
latin
iam_line
train/1059
1,432
128
iam_line/images/train/iam_line_train_000106.png
British Government gives in to Sir Roy and
British Government gives in to Sir Roy and
latin
iam_line
train/106
1,866
128
iam_line/images/train/iam_line_train_001060.png
week will # show perhaps how far " Mike
week will # show perhaps how far " Mike
latin
iam_line
train/1060
1,494
128
iam_line/images/train/iam_line_train_001061.png
Sentence Database
Sentence Database
latin
iam_line
train/1061
1,168
128
iam_line/images/train/iam_line_train_001062.png
unemployment , but there will be 21
unemployment , but there will be 21
latin
iam_line
train/1062
1,476
128
iam_line/images/train/iam_line_train_001063.png
as a military project ; or that the European space satellite
as a military project ; or that the European space satellite
latin
iam_line
train/1063
2,243
128
iam_line/images/train/iam_line_train_001064.png
Stated more bluntly , they are still unconvinced that
Stated more bluntly , they are still unconvinced that
latin
iam_line
train/1064
2,191
128
iam_line/images/train/iam_line_train_001065.png
interested in the principle of space research , but rather
interested in the principle of space research , but rather
latin
iam_line
train/1065
2,357
128
iam_line/images/train/iam_line_train_001066.png
this is not primarily an effort on Britain's part to
this is not primarily an effort on Britain's part to
latin
iam_line
train/1066
1,774
128
iam_line/images/train/iam_line_train_001067.png
Mr. Thorneycroft , the Minister of Aviation , who arrives in
Mr. Thorneycroft , the Minister of Aviation , who arrives in
latin
iam_line
train/1067
2,374
128
iam_line/images/train/iam_line_train_001068.png
is indeed to be purely scientific in character .
is indeed to be purely scientific in character .
latin
iam_line
train/1068
1,518
128
iam_line/images/train/iam_line_train_001069.png
Sentence Database
Sentence Database
latin
iam_line
train/1069
1,302
128
iam_line/images/train/iam_line_train_000107.png
boycotting the London talks on the
boycotting the London talks on the
latin
iam_line
train/107
1,905
128
iam_line/images/train/iam_line_train_001070.png
Bonn tomorrow for talks with the Federal Government on a
Bonn tomorrow for talks with the Federal Government on a
latin
iam_line
train/1070
2,686
128
iam_line/images/train/iam_line_train_001071.png
salve Blue Streak , which was abandoned last summer
salve Blue Streak , which was abandoned last summer
latin
iam_line
train/1071
2,771
128
iam_line/images/train/iam_line_train_001072.png
sceptical about British plans for organizing it .
sceptical about British plans for organizing it .
latin
iam_line
train/1072
1,882
128
iam_line/images/train/iam_line_train_001073.png
European space satellite project , will find the Germans
European space satellite project , will find the Germans
latin
iam_line
train/1073
2,106
128
iam_line/images/train/iam_line_train_001074.png
involved is really worth while , at a time when
involved is really worth while , at a time when
latin
iam_line
train/1074
1,871
128
iam_line/images/train/iam_line_train_001075.png
any increase in budgetary commitments
any increase in budgetary commitments
latin
iam_line
train/1075
1,595
128
iam_line/images/train/iam_line_train_001076.png
remove these doubts , and to persuade the
remove these doubts , and to persuade the
latin
iam_line
train/1076
1,693
128
iam_line/images/train/iam_line_train_001077.png
Mr. Thorneycroft's main purpose will be to
Mr. Thorneycroft's main purpose will be to
latin
iam_line
train/1077
1,666
128
iam_line/images/train/iam_line_train_001078.png
rise in taxation - something no one is prepared
rise in taxation - something no one is prepared
latin
iam_line
train/1078
1,672
128
iam_line/images/train/iam_line_train_001079.png
would almost certainly involve a corresponding
would almost certainly involve a corresponding
latin
iam_line
train/1079
1,631
128
iam_line/images/train/iam_line_train_000108.png
do if the British demonstrations . "
do if the British demonstrations . "
latin
iam_line
train/108
2,734
128
iam_line/images/train/iam_line_train_001080.png
to contemplate in an election year .
to contemplate in an election year .
latin
iam_line
train/1080
1,466
128
iam_line/images/train/iam_line_train_001081.png
Federal Government that the financial burden
Federal Government that the financial burden
latin
iam_line
train/1081
1,812
128
iam_line/images/train/iam_line_train_001082.png
efforts , as Die Welt suggests today in
efforts , as Die Welt suggests today in
latin
iam_line
train/1082
2,316
128
iam_line/images/train/iam_line_train_001083.png
convinced , on the basis of the information
convinced , on the basis of the information
latin
iam_line
train/1083
2,781
128
iam_line/images/train/iam_line_train_001084.png
believe that the Federal Government is not
believe that the Federal Government is not
latin
iam_line
train/1084
3,968
128
iam_line/images/train/iam_line_train_001085.png
But , at the same time , there is reason to
But , at the same time , there is reason to
latin
iam_line
train/1085
3,435
128
iam_line/images/train/iam_line_train_001086.png
be justified from a scientific point of view ;
be justified from a scientific point of view ;
latin
iam_line
train/1086
2,779
128
iam_line/images/train/iam_line_train_001087.png
a highly critical editorial article .
a highly critical editorial article .
latin
iam_line
train/1087
1,539
128
End of preview. Expand in Data Studio

Gemma OCR Lines (IAM + KHATT)

Line-level image/text pairs for training a CTC OCR recognizer. Every row is one cropped text line with its transcript: handwriting from IAM (English) and KHATT (Arabic), normalized into a single Latin+Arabic character vocabulary.

This is the frozen training corpus for the embedding-ocr CTC recognizer. It exists so training never has to download the upstream datasets, re-filter rows, or write tens of thousands of PNGs again. The corpus was packed once from artifacts/lines produced by scripts/prepare_line_datasets.py.

At a glance

Task Line-level text recognition (image → text)
Rows 16,031
Splits train 10,428 · val 1,786 · test 3,817
Characters 115 (blank reserved at index 0)
Image format PNG bytes embedded in Parquet
Labels text (raw) and text_norm (training label)
Packed 2026-11-18T01:33:00.313164+00:00 from git f519ee94fc6556d611cef8d74e79d88b3049173e

Per source:

source train val test total
iam_line 6,481 976 2,912 10,369
khatt 3,947 810 905 5,662
total 10,428 1,786 3,817 16,031

Repository layout

README.md            this card (the YAML header declares the features/splits)
data/                sharded Parquet, one directory for every split
  train-00000-of-0000N.parquet
  val-00000-of-0000N.parquet
  test-00000-of-0000N.parquet
charset.json         ordered vocabulary; index i maps to logit i + 1
stats.json           upstream filtering/dedupe statistics + publication info
dataset_info.json    format version, row counts, charset hash, git hash
manifest.jsonl       provenance manifest (relative image paths)

Each Parquet row has: image (encoded PNG), image_path (original relative path), text (raw upstream transcript), text_norm (normalized training label), script, source, orig_id, width, height.

Usage

Plain datasets:

from datasets import load_dataset

train = load_dataset("MohamedEmam2/gemma-ocr-lines", split="train")
row = train[0]
row["image"]          # PIL image, decoded on access
row["text_norm"]      # training label

This project (downloads the snapshot once, then serves it from the Hub cache):

from embedding_ocr.training.hub_lines import load_hub_line_corpus

corpus = load_hub_line_corpus("MohamedEmam2/gemma-ocr-lines")
rows = corpus.select(("train",))
print(len(rows), corpus.charset.size)

Training:

uv run --no-sync python scripts/train_ctc_ocr.py --config configs/ctc_line.yaml

configs/ctc_line.yaml points data.hf_repo at this repository, so the trainer loads it directly. Pass --local to fall back to a manifest on disk, or --local-files-only to train from an already cached snapshot without network.

Label normalization

  • NFKC, which folds Arabic presentation forms to base letters.
  • Zero-width/bidi controls removed; whitespace collapsed.
  • Arabic harakat/Quranic marks and tatweel stripped; alef variants folded to ا.
  • Latin case is preserved. CER is reported case-sensitive with a case-insensitive secondary number.
  • The charset is built from the train split only. Val/test rows containing out-of-vocabulary characters were dropped upstream and counted in stats.json, never silently remapped.

Filtering

Rows were kept only when the CTC alignment is satisfiable at 32 px height with a width stride of 2: resized_width // 2 >= 2 * len(label) - 1. Rows are also rejected for empty/too-long labels, extreme aspect ratio, tiny crops, and exact image duplicates (SHA-256). Counts per split and per rejection reason are in stats.json.

Note: the handwriting corpora reuse common phrases, so some texts appear in more than one split. Images are hash-deduplicated; text overlap is reported in stats.json rather than removed, so test scores stay honest.

Licensing and use

The frontmatter says license: other deliberately: this is a derived redistribution of two research corpora, so the upstream terms apply.

  • IAM-line (Teklia/IAM-line): the Hugging Face mirror declares MIT. The original IAM database has its own terms; see the IAM database page.
  • KHATT (Teklia/KHATT_v1.0): the Hugging Face mirror declares no license (its card is empty). KHATT is distributed for research use; see the KHATT page.

Check both upstream licenses before commercial or redistributive use. If you are a rights holder and want a subset removed, open an issue on the repo.

Limitations

  • Two scripts only: Latin (English handwriting) and Arabic. Printed fonts and photographed documents are not represented.
  • Line crops, not full pages: detection is a separate stage.
  • Long lines were dropped when the CTC time axis could not cover the label, so very long Arabic lines are under-represented.
  • Arabic normalization intentionally loses diacritics; do not use this corpus to train a diacritized model.
Downloads last month
-