jeanflop commited on
Commit
b0339d7
·
verified ·
1 Parent(s): 76cd473

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +60 -0
README.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - fr
4
+ license: apache-2.0
5
+ size_categories:
6
+ - 1M<n<10M
7
+ task_categories:
8
+ - text2text-generation
9
+ tags:
10
+ - postocr
11
+ - ocr
12
+ dataset_info:
13
+ features:
14
+ - name: input
15
+ dtype: string
16
+ - name: output
17
+ dtype: string
18
+ splits:
19
+ - name: train
20
+ num_bytes: 8945325563
21
+ num_examples: 2101890
22
+ download_size: 4113768600
23
+ dataset_size: 8945325563
24
+ configs:
25
+ - config_name: default
26
+ data_files:
27
+ - split: train
28
+ path: data/train-*
29
+ ---
30
+ # Synthetic OCR Correction Dataset <700 input length
31
+ This dataset is a synthetic dataset generated for post-OCR correction tasks. It contains over 1,000,000 rows of French text pairs and follows the Croissant format. It is designed to train small language models (LLMs) for text correction.
32
+
33
+ ## Description
34
+ To ensure the dataset closely resembles OCR-malformed texts, we applied various transformations randomly. This approach helps avoid the LLM identifying specific patterns and encourages it to select the correct word based on the surrounding context. Below are some of the transformations applied:
35
+
36
+ ```bash
37
+ alterations = [
38
+ lambda x: re.sub(r'[aeiouAEIOU]', '', x), # Remove vowels
39
+ lambda x: re.sub(r'\s+', ' ', x), # Replace multiple spaces with a single space
40
+ lambda x: re.sub(r'\b\w\b', '', x), # Remove single letters
41
+ lambda x: re.sub(r'[^\w\s]', '', x), # Remove punctuation
42
+ lambda x: ''.join(random.choice((char, '')) for char in x), # Randomly drop characters
43
+ lambda x: ' '.join([
44
+ ''.join(random.sample(word, len(word))) if random.random() < X else word # Scramble words with X% probability
45
+ for word in x.split()
46
+ ]) # Randomly scramble words
47
+ ]
48
+ ```
49
+
50
+ In addition to the transformations listed above, we also modify punctuation, add words, and create repetitions. Feel free to customize these transformations as needed.
51
+
52
+ ## Recipe
53
+ Each word in the text has a 60% chance of being selected for alteration.
54
+ A random number of alterations is applied to the selected words.
55
+ In this release, between 30% and 60% of the words in each text can be altered.
56
+ We welcome community feedback to improve this dataset further. Please feel free to share your thoughts or suggestions!
57
+
58
+
59
+
60
+