Datasets:
metadata
license: apache-2.0
language:
- en
- zh
PIN-10M
A mini version of "PIN: A Knowledge-Intensive Dataset for Paired and Interleaved Multimodal Documents"
This dataset contains 10M samples with PIN format.
0 Usage
解压缩
cat data.tar.part* > data.tar
tar -xvf data.tar
1 Dataset statistics
Total: 1, 693, 639
chinese markdown: 168, 323
DocLayNet: 68, 757
leetcode: 2, 360
linux-cn: 9, 564
OBELICS:
- 00000 290, 406
- 00001 287, 384
- 00002 285, 965
- 00003 290, 865
- 00004 290, 015
2 Data Structure
2.1 Folder Structure
example_dataset/
│
├── content_image/ - 包含内容里面的图片。
├── overall_image/ - 包含每一个多模态文档的整体概览的图片。
└── example_dataset.jsonl - 包含数据集元数据的JSON Lines文件。
值得注意的是,单个文件夹下的文件数量最好不要超过 100,000个(10万)。假如是分part的话,我们可以考虑多个文件夹,如下:
example_dataset/
│
├── part00/
│ ├── content_image/
│ ├── overall_image/
│ └── part00.jsonl - 包含第一部分数据集元数据的JSON Lines文件。
│
├── part01/ - 数据集的第二部分,结构与part00相同。
│ ├── content_image/
│ ├── overall_image/
│ └── part01.jsonl
│
... - 更多类似的部分。
2.2 JSON Lines Format
该名称我们可以根据情况不同而进行讨论确定。不过我个人倾向于与父文件夹保持一致。
其中一条数据:
该名称我们可以根据情况不同而进行讨论确定。不过我个人倾向于与父文件夹保持一致。
其中一条数据:
{
"id": 0,
"meta": {
"language": "en",
"doc_id": "NYSE_F_2004.pdf",
"oi_exist": true,
"ori_meta": null,
"date_download": "2024-03-16",
"source_dataset": "DocLayNet",
"page_id": "72"
},
"quality_signals": null,
"license": "https://cdla.io/permissive-1-0/",
"overall_image": "overall_image/c6effb847ae7e4a80431696984fa90c98bb08c266481b9a03842422459c43bdd.png",
"md": "markdown file"
"content_image": [
"content_image/13.jpg",
"content_image/14.jpg"
]
}
解释:
- id: 每一个条数据的唯一id。
- meta: 每条数据(多模态文档)的meta信息。
- language: 语言,中文(zh),英文(en)等。
- source_dataset: 假如该文档是转换而来的,则在此标注出原始的数据集名称,如不是则为None。
- doc_id: 一个唯一的document id,标识该文档的名称信息等。
- page_id: 一个唯一的page id,标识该文档所在页码位置。如只有一个页码,那就为None,只有多文档的时候才会有page_id,一般从1开始。
- date_download: date (download), 下载日期。
- ori_meta: 原始的数据集也许会包含meta信息,所以在此保留了,假如无则为None。
- oi_exist: 是否存在overall image。True or False。假如是True,则意味着overall image来自于数据集本身,假如为False则是通过我们的代码的编译结果。
- ...
- quality_signals: 质量信号,参考了redpajama v2的设计。
- doc_length: 文档长度。
- ...
- content_image: 存放该文档内提到的images的列表,如无则为None。有的话,[image1, image2, image3, ...]。
- overall_image: 存放对应的overall image的路径。
- md:存放markdown内容本身。
- license:存放license。
2.3 content_image 文件夹
存放各个文档里面用到的图片。
注:需要全部都转换成png格式。文件名只要是文件夹内唯一即可。
content_image/
│
├── 1.png
├── 2.png
...
2.4 overall_image 文件夹
存放各个文档对应的overall图片。
注:需要全部都转换成png格式。文件名只要是文件夹内唯一即可。
overall_image/
│
├── 1.png
├── 2.png
...
2.5 Examples of jsonl files
考虑到文章的长度有限,所以我们特地选择了比较短的markdown文件的样例。
An example of DocLynet:
{
"id": 0,
"meta": {
"language": "en",
"oi_exist": true,
"source_dateset": "DocLayNet",
"ori_meta": null,
"doc_id": "NYSE_F_2004.pdf",
"page_id": "0",
"date_download": "2024-3-24"
},
"quality_signals": null,
"license": "https://cdla.io/permissive-1-0/",
"content_image": [
"content_image/34102.jpg"
],
"overall_image": "overall_image/3562e47265520f7a72f3eac73aadfe19a78531698c3b50d7670b8ad9b214106b.png",
"md": "<img src='/datasets/m-a-p/PIN-14M/resolve/main/content_image/34102.jpg'>\n\n# Ford Motor Company / 2004 Annual Report \n\n# R W A R D F O R W A R D \n\n"
}
An example of OBELICS:
{
"id": 466502,
"meta": {
"language": "en",
"oi_exist": true,
"source_dateset": "OBELICS",
"ori_meta": {
"document_url": "https://www.donegaldaily.com/2022/02/21/watch-incredible-storm-surge-at-portsalon-golf-club/",
"unformatted_src": "https://www.donegaldaily.com/wp-content/uploads/2022/02/Screenshot-2022-02-21-at-17.54.30.jpg",
"src": "https://www.donegaldaily.com/wp-content/uploads/2022/02/Screenshot-2022-02-21-at-17.54.30.jpg",
"formatted_filename": "Screenshot at",
"rendered_width": 817,
"rendered_height": 419,
"original_width": 817,
"original_height": 419,
"format": "jpeg",
"general_meta": {
"url": "https://www.donegaldaily.com/2022/02/21/watch-incredible-storm-surge-at-portsalon-golf-club/",
"warc_filename": "crawl-data/CC-MAIN-2022-27/segments/1656103271864.14/warc/CC-MAIN-20220626192142-20220626222142-00308.warc.gz",
"warc_record_offset": 795020636,
"warc_record_length": 31271
}
},
"doc_id": 98496,
"page_id": 0,
"date_download": "2024-4-22"
},
"md": "<img src='/datasets/m-a-p/PIN-14M/resolve/main/content_image/98496-0.png'>\n\nThe golf course at Portsalon Golf Club took a battering today as a result of Storm Franklin.\n\nDonegal had been left battered and bruised overnight after Storm Franklin ripped across the county.\n\nThere were trees down on the approach roads to Donegal Town and in Gartan.\n\nThere were also trees down in Inishowen while there is also heavy water reported along the sides of roads with motorists asked to slow down and not put themselves in danger.\n\nDonegal’s coastline took a huge impact with massive waves reported along the coastline around the county.\n\nThe video, taken by Johnny Shields was taken from the tee box of the third hole.",
"license": "CC-BY-4.0",
"quality_signals": null,
"content_image": [
"content_image/98496-0.png"
],
"overall_image": "overall_image/98496-0.png"
}
An example of chinese-markdown:
{
"id": 7,
"meta": {
"language": "zh",
"oi_exist": true,
"source_dateset": "chinese-markdown",
"ori_meta": null,
"doc_id": 7,
"page_id": null,
"date_download": "2024-04-30"
},
"md": "---\ntitle: 常见问题 QA\ncategory: 其它\norder: 1\n---\n\n> 持续更新中...\n> 如有问题可以到 <https://github.com/alibaba/ice/issues/new> 反馈\n\n## ICE 的浏览器兼容策略是什么\n\n由于 ICE 优先使用 React 16+,其需要的最低 IE 版本为 11,如果您需要在以下的版本使用,您可能需要引入一些 polyfill 来支持 `Map`, `Set` 等特性。参考[React 官网说明](https://reactjs.org/blog/2017/09/26/react-v16.0.html#javascript-environment-requirements)。\n\n以下代码可以帮助你在低版本 IE 下自动跳转到我们提供的提示浏览器升级页面。当然您也可以使用自定义的浏览器升级页面。\n\n```\n<!--[if lt IE 11]>\n<script>location.href = \"//www.taobao.com/markets/tbhome/ali-page-updater\"; </script>\n<![endif]-->\n```\n\n添加如上代码后,如果使用 IE11 及以下浏览器访问页面,则会自动跳转到统一引导升级浏览器的页面。\n\n## WebStorm/IDEA 编辑器卡顿现象\n\n由于项目在安装依赖后,产生文件夹 `node_modules` 含有较多的碎小文件,编辑器在索引文件引起的卡顿。\nWebStorm 中尤为明显,可通过 exclude `node_modules` 目录,不需要检索该文件夹下的内容。\n\n## 如何设置网页在浏览器 Tab 上面的 Icon (favicon)\n\n细心的同学可能会看到页面在浏览器 Tab 上面会有自定义的 Icon:\n\n![](//img.alicdn.com/tfs/TB1ct6bPpXXXXXYXFXXXXXXXXXX-484-82.png)\n\n如果你想要在自己站点上面加上这个 Icon 可以按照如下步骤添加:\n\n1. 准备一个 Icon,文件格式可以为 `.png` 或者 `.ico`,正方形,分辨率可以是 32x32px 或者 64x64px 文件体积要求尽可能小。\n2. 上传 CDN 拿到一个 url 或者在自己服务器配置静态资源服务\n3. 在 HTML 页面 `<head>` 标签里面添加如下代码:`<link rel=\"shortcut icon\" href=\"your-icon-url\">`\n ![](//img.alicdn.com/tfs/TB1IC53PpXXXXbmXVXXXXXXXXXX-1834-774.png)\n\n这样就添加成功啦!\n\n## 如何在页面显示原始的 HTML 内容\n\n出于安全方面的考虑,React 默认会将节点中 html 代码进行转义,比如:\n\n```jsx\nclass Demo extends Component {\n render() {\n const content = 'hello <span>world</span>';\n return <div>{content}</div>;\n }\n}\n\n// 输出 hello <span>world</span>\n```\n\n如上,`<span>` 标签并不会在页面上被解析,而是被当成字符串输出了。React 提供了 `dangerouslySetInnerHTML` 属性帮助我们进行类似 `innerHTML` 的操作:\n\n```jsx\nclass Demo extends Component {\n render() {\n const content = 'hello <span>world</span>';\n return <div dangerouslySetInnerHTML={{ __html: content }} />;\n }\n}\n\n// 输出 hello world\n```\n\n更多内容请参考 [Dangerously Set innerHTML](https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml)\n\n## 之前创建的项目,遇到如下报错怎么办\n\n![截图](content_image/7-0.png)\n\n这是由于 ES6 Modules 的标准在物料中不兼容导致的。您可以把 `src/navs.js` 中最后一行修改为:\n\n```js\nexport const headerNavs = transform([\n ...autoGenHeaderNavs,\n ...customHeaderNavs,\n]);\n\nexport const asideNavs = transform([...autoGenAsideNavs, ...customAsideNavs]);\n```",
"license": "MIT",
"quality_signals": null,
"content_image": [
"content_image/7-0.png"
],
"overall_image": "overall_image/7.png"
}
An example of leetcode:
{
"id": 1,
"meta": {
"language": "en",
"doc_id": 1,
"page_id": null,
"oi_exist": true,
"source_dataset": "leetcode",
"date_download": "2024-05-05",
"ori_meta": {
"slug": "two-sum",
"difficulty": "Easy"
}
},
"quality_signals": null,
"license": "MIT",
"content_image": null,
"md": "# Two Sum\n\n- slug: two-sum\n- difficulty: Easy\n\nGiven an array of integers `nums` and an integer `target`, return _indices of the two numbers such that they add up to `target`_.\n\nYou may assume that each input would have **_exactly_ one solution**, and you may not use the _same_ element twice.\n\nYou can return the answer in any order.\n\n**Example 1:**\n\n**Input:** nums = \\[2,7,11,15\\], target = 9\n**Output:** \\[0,1\\]\n**Explanation:** Because nums\\[0\\] + nums\\[1\\] == 9, we return \\[0, 1\\].\n\n**Example 2:**\n\n**Input:** nums = \\[3,2,4\\], target = 6\n**Output:** \\[1,2\\]\n\n**Example 3:**\n\n**Input:** nums = \\[3,3\\], target = 6\n**Output:** \\[0,1\\]\n\n**Constraints:**\n\n* `2 <= nums.length <= 104`\n* `-109 <= nums[i] <= 109`\n* `-109 <= target <= 109`\n* **Only one valid answer exists.**\n\n**Follow-up:** Can you come up with an algorithm that is less than `O(n2)` time complexity?\n\n## A solution in Java\n\n```java\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic int[] twoSum(int[] nums, int target) {\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n int complement = target - nums[i];\n if (map.containsKey(complement)) {\n return new int[]{map.get(complement), i};\n }\n map.put(nums[i], i);\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n}\n```\nThe algorithm leverages a hash map (unordered_map in C++, HashMap in Java, dictionary in Python, and Map in JavaScript). It iterates through the given 'nums' array and calculates the complementary value (target - current value). If the complementary value is already in the hash map, it means that we found a solution, and we return those indices. If the complement is not in the hash map, we store the current element in the hash map with its index. If the algorithm doesn't find the solution, it returns an empty array or throws an exception (in Java).\n\nThis approach has a time complexity of O(n) and a space complexity of O(n) as well.\n \n\n## A solution in C++\n\n```cpp\n#include <vector>\n#include <unordered_map>\n\nstd::vector<int> twoSum(std::vector<int>& nums, int target) {\n std::unordered_map<int, int> map;\n for (int i = 0; i < nums.size(); i++) {\n int complement = target - nums[i];\n if (map.find(complement) != map.end()) {\n return {map[complement], i};\n }\n map[nums[i]] = i;\n }\n return {};\n}\n```\nThe algorithm leverages a hash map (unordered_map in C++, HashMap in Java, dictionary in Python, and Map in JavaScript). It iterates through the given 'nums' array and calculates the complementary value (target - current value). If the complementary value is already in the hash map, it means that we found a solution, and we return those indices. If the complement is not in the hash map, we store the current element in the hash map with its index. If the algorithm doesn't find the solution, it returns an empty array or throws an exception (in Java).\n\nThis approach has a time complexity of O(n) and a space complexity of O(n) as well.\n \n\n## A solution in Python\n\n```python\ndef twoSum(nums, target):\n map = {}\n for i, num in enumerate(nums):\n complement = target - num\n if complement in map:\n return [map[complement], i]\n map[num] = i\n return []\n```\nThe algorithm leverages a hash map (unordered_map in C++, HashMap in Java, dictionary in Python, and Map in JavaScript). It iterates through the given 'nums' array and calculates the complementary value (target - current value). If the complementary value is already in the hash map, it means that we found a solution, and we return those indices. If the complement is not in the hash map, we store the current element in the hash map with its index. If the algorithm doesn't find the solution, it returns an empty array or throws an exception (in Java).\n\nThis approach has a time complexity of O(n) and a space complexity of O(n) as well.\n \n\n## A solution in Javascript\n\n```javascript\nfunction twoSum(nums, target) {\n const map = new Map();\n for (let i = 0; i < nums.length; i++) {\n const complement = target - nums[i];\n if (map.has(complement)) {\n return [map.get(complement), i];\n }\n map.set(nums[i], i);\n }\n return [];\n}\n```\nThe algorithm leverages a hash map (unordered_map in C++, HashMap in Java, dictionary in Python, and Map in JavaScript). It iterates through the given 'nums' array and calculates the complementary value (target - current value). If the complementary value is already in the hash map, it means that we found a solution, and we return those indices. If the complement is not in the hash map, we store the current element in the hash map with its index. If the algorithm doesn't find the solution, it returns an empty array or throws an exception (in Java).\n\nThis approach has a time complexity of O(n) and a space complexity of O(n) as well.\n \n",
"overall_image": "overall_image/1.png"
}
An example of linux-cn:
{
"id": 8,
"meta": {
"language": "zh",
"doc_id": 134,
"page_id": null,
"oi_exist": true,
"source_dataset": "linux-cn",
"date_download": "2024-05-06",
"ori_meta": {
"title": "Ubuntu 11.04正式发布!",
"author": "",
"fromurl": "",
"summary": "刚才接到的消息,Ubuntu 11.04已经正式发布!\r\n\r\n超快!易用!免费!\r\nUbuntu操作系统为世界上数以百万计的电脑、上网本和服务器提供了动力!\r\nUbuntu可以为你完成各种工作,管理你的文件、打印机、摄像头和MP3!并且它 ...",
"pic": "/data/attachment/album/201104/28/193933lnqqwwwn8l64wbn1.jpg.thumb.jpg",
"largepic": "/data/attachment/album/201104/28/193933lnqqwwwn8l64wbn1.jpg",
"titlepic": false,
"thumb": false,
"islctt": false,
"selector": "",
"translator": "",
"reviewer": "",
"editorchoice": false,
"tags": [
"Ubuntu 11.04",
"发布"
],
"category": "新闻",
"count": {
"commentnum": 0,
"favtimes": 0,
"likes": 0,
"sharetimes": 1,
"viewnum": 6165
},
"comments_data": [
],
"related": [
],
"excerpt": "刚才接到的消息,Ubuntu 11.04已经正式发布!\r\n\r\n超快!易用!免费!\r\nUbuntu操作系统为世界上数以百万计的电脑、上网本和服务器提供了动力!\r\nUbuntu可以为你完成各种工作,管理你的文件、打印机、摄像头和MP3!并且它 ...",
"date": "2011-05-09 13:24:00",
"updated": "2011-05-09 13:24:00",
"id": 134,
"permalink": "/article-134-1.html"
}
},
"quality_signals": null,
"license": "CC-BY-NC-4.0",
"content_image": [
"content_image/album_201104_28_193933lnqqwwwn8l64wbn1.jpg",
"content_image/album_201104_28_193935sy4l3bh4bh1ycbbc.jpg",
"content_image/album_201104_28_193936lyvc36fwv91l1359.jpg",
"content_image/album_201104_28_19393800rpr8pf0s8p8w0s.jpg"
],
"md": "# Ubuntu 11.04正式发布!\n\n刚才接到的消息,Ubuntu 11.04已经正式发布! \n \n 超快!易用!免费! \n Ubuntu操作系统为世界上数以百万计的电脑、上网本和服务器提供了动力! \n Ubuntu可以为你完成各种工作,管理你的文件、打印机、摄像头和MP3!并且它还带有数千个免费程序。 \n \n <img src=\"content_image/album_201104_28_193933lnqqwwwn8l64wbn1.jpg\" alt=\"\" title=\"\"> \n **数千个免费程序** \n \n <img src=\"content_image/album_201104_28_193935sy4l3bh4bh1ycbbc.jpg\" alt=\"\" title=\"\"> \n **终生免费升级** \n \n <img src=\"content_image/album_201104_28_193936lyvc36fwv91l1359.jpg\" alt=\"\" title=\"\"> \n **内建的病毒防护** \n \n <img src=\"content_image/album_201104_28_19393800rpr8pf0s8p8w0s.jpg\" alt=\"\" title=\"\"> \n **云中的音乐** \n \n 下载地址:\n\n\n\n\n> 列表: \n> <http://releases.ubuntu.com/11.04/> \n> 桌面版: \n> <http://www.ubuntu.com/download/ubuntu/download> \n> 服务器版: \n> <http://www.ubuntu.com/download/server/download>\n\n\n\n \n BT种子地址:\n\n\n\n\n> \n> * [ubuntu-11.04-alternate-amd64.iso.torrent](http://releases.ubuntu.com/11.04/ubuntu-11.04-alternate-amd64.iso.torrent)\n> * [ubuntu-11.04-alternate-i386.iso.torrent](http://releases.ubuntu.com/11.04/ubuntu-11.04-alternate-i386.iso.torrent)\n> * [ubuntu-11.04-desktop-amd64.iso.torrent](http://releases.ubuntu.com/11.04/ubuntu-11.04-desktop-amd64.iso.torrent)\n> * [ubuntu-11.04-desktop-i386.iso.torrent](http://releases.ubuntu.com/11.04/ubuntu-11.04-desktop-i386.iso.torrent)\n> * [ubuntu-11.04-netbook-i386.iso.torrent](http://releases.ubuntu.com/11.04/ubuntu-11.04-netbook-i386.iso.torrent)\n> * [ubuntu-11.04-server-amd64.iso.torrent](http://releases.ubuntu.com/11.04/ubuntu-11.04-server-amd64.iso.torrent)\n> * [ubuntu-11.04-server-i386.iso.torrent](http://releases.ubuntu.com/11.04/ubuntu-11.04-server-i386.iso.torrent)\n> \n> \n> \n\n\n\n \n 当前尚无DVD版本出现 \n \n \n \n 该贴已经同步到 [wxy的微博](http://api.t.sina.com.cn/1747813575/statuses/9786340397) \n \n \n \n\n\n \n\n\n*[本文内容由 wxy 提供](thread-7135-1-1.html)*\n \n\n\n\n 已同步至 [wxy的微博](http://api.t.sina.com.cn/1747813575/statuses/10347235925)",
"overall_image": "overall_image/134.png"
}
TODO
License
混合License。
如,该数据来自我们的工作,请遵循Apache 2.0 License。如,该数据来自第三方,请遵循该第三方的License。