Unverified Commit 7d40115c authored by icecraft's avatar icecraft Committed by GitHub
Browse files

feat: tune docs (#948)


Co-authored-by: default avatarxu rui <xurui1@pjlab.org.cn>
parent 927fc6ca
...@@ -87,6 +87,8 @@ Read Examples ...@@ -87,6 +87,8 @@ Read Examples
.. code:: python .. code:: python
from magic_pdf.data.data_reader_writer import *
# file based related # file based related
file_based_reader1 = FileBasedDataReader('') file_based_reader1 = FileBasedDataReader('')
...@@ -142,6 +144,8 @@ Write Examples ...@@ -142,6 +144,8 @@ Write Examples
.. code:: python .. code:: python
from magic_pdf.data.data_reader_writer import *
# file based related # file based related
file_based_writer1 = FileBasedDataWriter('') file_based_writer1 = FileBasedDataWriter('')
......
...@@ -18,6 +18,8 @@ Read the contet from jsonl which may located on local machine or remote s3. if y ...@@ -18,6 +18,8 @@ Read the contet from jsonl which may located on local machine or remote s3. if y
.. code:: python .. code:: python
from magic_pdf.data.io.read_api import *
# read jsonl from local machine # read jsonl from local machine
datasets = read_jsonl("tt.jsonl", None) datasets = read_jsonl("tt.jsonl", None)
...@@ -33,6 +35,8 @@ Read pdf from path or directory. ...@@ -33,6 +35,8 @@ Read pdf from path or directory.
.. code:: python .. code:: python
from magic_pdf.data.io.read_api import *
# read pdf path # read pdf path
datasets = read_local_pdfs("tt.pdf") datasets = read_local_pdfs("tt.pdf")
...@@ -47,10 +51,11 @@ Read images from path or directory ...@@ -47,10 +51,11 @@ Read images from path or directory
.. code:: python .. code:: python
from magic_pdf.data.io.read_api import *
# read from image path # read from image path
datasets = read_local_images("tt.png") datasets = read_local_images("tt.png")
# read files from directory that endswith suffix in suffixes array # read files from directory that endswith suffix in suffixes array
datasets = read_local_images("images/", suffixes=["png", "jpg"]) datasets = read_local_images("images/", suffixes=["png", "jpg"])
......
...@@ -73,6 +73,8 @@ S3DataReader 基于 MultiBucketS3DataReader 构建,但仅支持单个桶。S3D ...@@ -73,6 +73,8 @@ S3DataReader 基于 MultiBucketS3DataReader 构建,但仅支持单个桶。S3D
--------- ---------
.. code:: python .. code:: python
from magic_pdf.data.data_reader_writer import *
# 文件相关的 # 文件相关的
file_based_reader1 = FileBasedDataReader('') file_based_reader1 = FileBasedDataReader('')
...@@ -126,6 +128,8 @@ S3DataReader 基于 MultiBucketS3DataReader 构建,但仅支持单个桶。S3D ...@@ -126,6 +128,8 @@ S3DataReader 基于 MultiBucketS3DataReader 构建,但仅支持单个桶。S3D
---------- ----------
.. code:: python .. code:: python
from magic_pdf.data.data_reader_writer import *
# 文件相关的 # 文件相关的
file_based_writer1 = FileBasedDataWriter('') file_based_writer1 = FileBasedDataWriter('')
......
...@@ -15,6 +15,8 @@ read_jsonl ...@@ -15,6 +15,8 @@ read_jsonl
.. code:: python .. code:: python
from magic_pdf.data.io.read_api import *
# 从本地机器读取 JSONL # 从本地机器读取 JSONL
datasets = read_jsonl("tt.jsonl", None) datasets = read_jsonl("tt.jsonl", None)
...@@ -28,6 +30,8 @@ read_local_pdfs ...@@ -28,6 +30,8 @@ read_local_pdfs
.. code:: python .. code:: python
from magic_pdf.data.io.read_api import *
# 读取 PDF 路径 # 读取 PDF 路径
datasets = read_local_pdfs("tt.pdf") datasets = read_local_pdfs("tt.pdf")
...@@ -41,6 +45,8 @@ read_local_images ...@@ -41,6 +45,8 @@ read_local_images
.. code:: python .. code:: python
from magic_pdf.data.io.read_api import *
# 从图像路径读取 # 从图像路径读取
datasets = read_local_images("tt.png") datasets = read_local_images("tt.png")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment