Datasets:

Modalities:
Text
Formats:
parquet
Languages:
English
ArXiv:
Libraries:
Datasets
Dask
License:
Qingyun commited on
Commit
fcc3454
1 Parent(s): 3a65cac

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +139 -3
README.md CHANGED
@@ -1,3 +1,139 @@
1
- ---
2
- license: cc-by-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - image-to-text
5
+ - visual-question-answering
6
+ language:
7
+ - en
8
+ size_categories:
9
+ - 100M<n<1B
10
+ ---
11
+
12
+ # OmniCorpus-CC
13
+
14
+ This is the repository of OmniCorpus-CC, which contains 988 million image-text interleaved documents collected from [Common Crawl](https://commoncrawl.org/).
15
+
16
+ - Repository: https://github.com/OpenGVLab/OmniCorpus
17
+ - Paper: https://arxiv.org/abs/2406.08418
18
+
19
+ OmniCorpus dataset is a large-scale image-text interleaved dataset, which pushes the boundaries of scale and diversity by encompassing **8.6 billion images** interleaved with **1,696 text tokens** from diverse sources, significantly surpassing previous datasets.
20
+ This dataset demonstrates several advantages over its counterparts:
21
+
22
+ 1. **Larger data scale:** Our dataset is 1.7 times larger in images and 12.5 times larger in texts compared to the previously largest multimodal dataset, LAION-5B, while maintaining excellent data quality.
23
+ 2. **Richer data diversity:** Drawing from a broader range of data sources, our dataset is more diverse than other image-text interleaved datasets. It includes bilingual multimodal data in both Chinese and English, and encompasses text-centric and vision-centric documents extracted from common websites and video platforms.
24
+ 3. **More flexible format:** The streaming data format of our dataset offers exceptional flexibility, allowing adaptation to various data structures, including pure text corpora, image-text pairs, and interleaved data formats.
25
+
26
+ <img width="578" alt="image" src="https://github.com/OpenGVLab/OmniCorpus/assets/47669167/641a6427-ba50-41e6-8634-8810113fd803">
27
+
28
+ The OmniCorpus contains three sections:
29
+
30
+ - **OmniCorpus-CC**: processed from dumps in Common Crawl from 2013 to Nov./Dec. 2023.
31
+ - **OmniCorpus-CW**: sourced from Chinese internet resources, will be availiable in [OpenDataLab](https://opendatalab.com/) platform.
32
+ - **OmniCorpus-YT**: samples Youtube video frames as images and collects subtitles as texts.
33
+
34
+ Code for pre-training, evaluating, main body extracting, and filtering have been released in the official [repository](https://github.com/OpenGVLab/OmniCorpus). A pre-trained model is availiable [here](). We are processing and uploading the rest data sections as soon as possible.
35
+
36
+ ### Update (2024-10-16):
37
+ We are uploading the natural arrangement version of the OmniCorpus-CC documents.
38
+
39
+ Coming soon:
40
+ - Documents with Similarities: Documents with split at the sentence level, resulting in minor differences of text content.
41
+
42
+ # Data Pipeline
43
+
44
+ Our data pipeline consists of five key stages: main body extraction, preliminary text filtering, document deduplication, image downloading \& filtering, and detailed text filtering. Each stage efficiently reduces the dataset to retain only high-quality data.
45
+ Please refer to our paper for more details about the data pipeline.
46
+
47
+ <img width="723" alt="image" src="https://github.com/OpenGVLab/OmniCorpus/assets/47669167/a6de8928-58fb-4ff4-8ef9-4bd90e9ada5f">
48
+
49
+ # Usages
50
+
51
+ The image-text interleaved documents are recommanded for the following usages:
52
+ - Pre-training multimodal large language model (MLLM): Recent MLLMs (such as Flamingo series, EMU series, IDEFICS series, MM1, Cambrian-1, and xGen-MM) have shown that image-text interleaved data aids multimodal in-context learning and maintains the capabilities of large language models during multimodal fine-tuning.
53
+ - Long text-image retrieval: We provide image-text similarities calculated with CLIP, which can convert the documents to image-text retrieval dataset with longer text. A retrieval model pre-trained on such data can retrieval images based on longer text, which can be used for multimodal RAG, converting pure text to multimodal sample, etc.
54
+ - Source for futher dataset research: Our data is large-scale, which can serve as the source for researches for data curation strategies. We provide many useful attributes as metadata for each document, which can enrich the filtering strategy and reduce the cost.
55
+ - ......
56
+
57
+ # Data Format
58
+
59
+ Following common practices, the data is organized into Parquet file format.
60
+ You might encounter errors when using `pandas.read_parquet` (because the data structure contains nested elements). We recommend using fastparquet to load the parquet files.
61
+ ```Python
62
+ import fastparquet
63
+ df = fastparquet.ParquetFile(parquet_file_path).to_pandas()
64
+
65
+ # You can also use iter_batches
66
+ parquet_file = pq.ParquetFile(filepath)
67
+ for batch in parquet_file.iter_batches():
68
+ df = batch.to_pandas()
69
+ ```
70
+
71
+ You can convert the i-th document and convert it into a dictionary.
72
+ ```Python
73
+ doc_dict = df.iloc[i].to_dict()
74
+ ```
75
+
76
+ The document format is as follow:
77
+ ```json
78
+ {
79
+ 'images': [
80
+ <str: image_1_url>,
81
+ None,
82
+ <str: image_2_url>,
83
+ None,
84
+ ],
85
+ 'texts': [
86
+ None,
87
+ <str: text_paragraph_1_content>
88
+ None,
89
+ <str: text_paragraph_2_content>,
90
+ ]
91
+ 'metadata': [
92
+ <dict: image_1_metadata>,
93
+ None,
94
+ <dict: image_2_metadata>,
95
+ None
96
+ ],
97
+ 'general_metadata': {
98
+ "url": <str: document url>,
99
+ "id": <str: document id>,
100
+ "domain": <list[str]: domains extracted from document url>,
101
+ "fluency_prob": <float: the probability of fluency>,
102
+ "non_advertisement_prob": <float: the probability of non-advertisement>,
103
+ "porn_prob": <float: the probability of porn content>,
104
+ "politics_prob": <float: the probability of politics content>,
105
+ "toxic_prob": <float: the probability of toxic content>,
106
+ }
107
+ }
108
+ ```
109
+ Each image metadata is as follow:
110
+ ```json
111
+ {
112
+ "img_url_sha": <str: sha code of image url>,
113
+ "width": <int: image width>,
114
+ "height": <int: image height>,
115
+ "bytes": <int: byte number of the image file>,
116
+ "d_hash": <str: d_hash code of the image, used for image deduplication>,
117
+ "p_hash": <str: p_hash code of the image, used for image deduplication>,
118
+ "d_hash_dup_count": <int: duplicated times detected by d_hash code>,
119
+ "p_hash_dup_count": <int: duplicated times detected by p_hash code>,
120
+ "aesthetic prob": <float: aesthetic probility>,
121
+ "unsafe prob": <float: NSFW probility>,
122
+ }
123
+ ```
124
+
125
+ # License
126
+
127
+ OmniCorpus is released under a [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/deed.en) license, with the primary intent of supporting research activities.
128
+
129
+ # Citation
130
+
131
+ ```
132
+ @article{li2024omnicorpus,
133
+ title={OmniCorpus: A Unified Multimodal Corpus of 10 Billion-Level Images Interleaved with Text},
134
+ author={Li, Qingyun and Chen, Zhe and Wang, Weiyun and Wang, Wenhai and Ye, Shenglong and Jin, Zhenjiang and others},
135
+ journal={arXiv preprint arXiv:2406.08418},
136
+ year={2024}
137
+ }
138
+ ```
139
+