Dataset Viewer
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code: StreamingRowsError
Exception: CastError
Message: Couldn't cast
created_at: timestamp[s]
status: string
db_path: string
table: string
model_path: string
range_start_id: int64
range_end_id: int64
shard_id: int64
shard_count: int64
valid_rows: int64
written_rows: int64
embedding_dim: int64
storage_dtype: string
timing_seconds: struct<total: double, rows_per_second: double>
child 0, total: double
child 1, rows_per_second: double
output_files: struct<embeddings: string, ids: string, pubno: string>
child 0, embeddings: string
child 1, ids: string
child 2, pubno: string
gpu_list: string
min_batch_size: int64
id_max: int64
sql_fetch_batch: int64
fallback_gpu_list: string
valid_count: int64
detach: int64
batch_size: int64
output_root: string
retry_sleep_seconds: int64
run_tag: string
id_min: int64
flush_rows: int64
attn_impl: string
max_retries: int64
max_length: int64
to
{'created_at': Value('timestamp[s]'), 'db_path': Value('string'), 'table': Value('string'), 'model_path': Value('string'), 'output_root': Value('string'), 'run_tag': Value('string'), 'gpu_list': Value('string'), 'fallback_gpu_list': Value('string'), 'shard_count': Value('int64'), 'id_min': Value('int64'), 'id_max': Value('int64'), 'valid_count': Value('int64'), 'batch_size': Value('int64'), 'min_batch_size': Value('int64'), 'max_length': Value('int64'), 'sql_fetch_batch': Value('int64'), 'flush_rows': Value('int64'), 'retry_sleep_seconds': Value('int64'), 'max_retries': Value('int64'), 'attn_impl': Value('string'), 'detach': Value('int64'), 'storage_dtype': Value('string')}
because column names don't match
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/utils.py", line 99, in get_rows_or_raise
return get_rows(
^^^^^^^^^
File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/src/services/worker/src/worker/utils.py", line 77, in get_rows
rows_plus_one = list(itertools.islice(ds, rows_max_number + 1))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2690, in __iter__
for key, example in ex_iterable:
^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2227, in __iter__
for key, pa_table in self._iter_arrow():
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2251, in _iter_arrow
for key, pa_table in self.ex_iterable._iter_arrow():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 494, in _iter_arrow
for key, pa_table in iterator:
^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 384, in _iter_arrow
for key, pa_table in self.generate_tables_fn(**gen_kwags):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 289, in _generate_tables
self._cast_table(pa_table, json_field_paths=json_field_paths),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 124, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2272, in table_cast
return cast_table_to_schema(table, schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2218, in cast_table_to_schema
raise CastError(
datasets.table.CastError: Couldn't cast
created_at: timestamp[s]
status: string
db_path: string
table: string
model_path: string
range_start_id: int64
range_end_id: int64
shard_id: int64
shard_count: int64
valid_rows: int64
written_rows: int64
embedding_dim: int64
storage_dtype: string
timing_seconds: struct<total: double, rows_per_second: double>
child 0, total: double
child 1, rows_per_second: double
output_files: struct<embeddings: string, ids: string, pubno: string>
child 0, embeddings: string
child 1, ids: string
child 2, pubno: string
gpu_list: string
min_batch_size: int64
id_max: int64
sql_fetch_batch: int64
fallback_gpu_list: string
valid_count: int64
detach: int64
batch_size: int64
output_root: string
retry_sleep_seconds: int64
run_tag: string
id_min: int64
flush_rows: int64
attn_impl: string
max_retries: int64
max_length: int64
to
{'created_at': Value('timestamp[s]'), 'db_path': Value('string'), 'table': Value('string'), 'model_path': Value('string'), 'output_root': Value('string'), 'run_tag': Value('string'), 'gpu_list': Value('string'), 'fallback_gpu_list': Value('string'), 'shard_count': Value('int64'), 'id_min': Value('int64'), 'id_max': Value('int64'), 'valid_count': Value('int64'), 'batch_size': Value('int64'), 'min_batch_size': Value('int64'), 'max_length': Value('int64'), 'sql_fetch_batch': Value('int64'), 'flush_rows': Value('int64'), 'retry_sleep_seconds': Value('int64'), 'max_retries': Value('int64'), 'attn_impl': Value('string'), 'detach': Value('int64'), 'storage_dtype': Value('string')}
because column names don't matchNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
Qwen3-4B Patent Embeddings (专利特征向量数据集)
📌 简介 (Introduction)
本数据集包含了海量专利文本的特征向量(Embeddings)。所有特征向量均使用强大的 Qwen3-embedding-4B 模型提取。
- 数据领域: 专利 (Patents)
- 特征提取模型: Qwen3-embedding-4B
- 数据格式:
.mmap(Memory-mapped file, numpy-compatible) +.tsv - 数据精度:
float16
📂 数据结构 (Data Structure)
由于数据量庞大,在生成时使用了 4 张 GPU 进行分布式计算,因此数据被划分为 4 个分片(Shards):shard_0 到 shard_3。
每个 Shard 目录下包含以下核心文件:
embeddings.float16.mmap: 核心的特征向量矩阵(float16)。ids.int64.mmap: 与特征向量一一对应的专利内部 ID(int64)。pubno.tsv: 专利的公开号(Publication Number)映射表。meta.json: 记录了该分片的数据维度、行数等元数据信息。progress.json: 原始生成的进度记录。
🚀 如何读取与使用 (How to Use)
由于本数据集采用了极低内存占用的 .mmap 格式存储,请不要使用 datasets.load_dataset,而是使用 huggingface_hub 下载后通过 numpy 映射到内存。
1. 安装依赖
pip install huggingface_hub numpy
2. 下载并加载数据的 Python 示例
以下代码展示了如何高速拉取数据,并读取其中一个 shard 的内容:
import os
import json
import numpy as np
from huggingface_hub import snapshot_download
# 1. 开启高速下载模式 (推荐)
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
# 如果在国内服务器,请取消下面这行的注释
# os.environ["HF_ENDPOINT"] = "[https://hf-mirror.com](https://hf-mirror.com)"
# 2. 将整个数据集缓存到本地
repo_id = "TMSDMAP/patent_dataset" # 替换为你的真实仓库名
print("正在下载数据集...")
local_dir = snapshot_download(repo_id=repo_id, repo_type="dataset")
# 3. 选取你要读取的 shard (例如 shard_3)
shard_dir = os.path.join(local_dir, "shard_3")
# 4. 从 meta.json 动态读取 shape
with open(os.path.join(shard_dir, "meta.json"), "r") as f:
meta = json.load(f)
# 请根据你实际的 meta.json 键值名修改这里的 "num_rows" 和 "dim"
num_rows = meta.get("num_rows", 0)
dim = meta.get("dim", 4096)
# 5. 使用 numpy memmap 加载 (极快,且不占内存)
embeddings = np.memmap(
os.path.join(shard_dir, "embeddings.float16.mmap"),
dtype='float16',
mode='r',
shape=(num_rows, dim)
)
ids = np.memmap(
os.path.join(shard_dir, "ids.int64.mmap"),
dtype='int64',
mode='r',
shape=(num_rows,)
)
print(f"成功加载 Shard_3, 包含 {num_rows} 条数据。")
print(f"第一条数据的向量维度前 5 项: {embeddings[0][:5]}")
⚙️ 硬件与计算信息 (Compute Information)
- 计算集群: [1x Ubuntu Server]
- GPU: 4x [Nvidia A800]
- 并行框架: [None]
- Downloads last month
- 16