Differences with torchtext.datasets.CoNLL2000Chunking
[](https://gitee.com/mindspore/docs/blob/master/docs/mindspore/source_en/note/api_mapping/pytorch_diff/CoNLL2000Chunking.md)
Differences with torchtext.datasets.CoNLL2000Chunking
torchtext.datasets.CoNLL2000Chunking
class torchtext.datasets.CoNLL2000Chunking(
root: str = '.data',
split: Union[List[str], str] = ('train', 'test'))
For more information, see torchtext.datasets.CoNLL2000Chunking.
mindspore.dataset.CoNLL2000Dataset
class mindspore.dataset.CoNLL2000Dataset(
dataset_dir,
usage=None,
num_samples=None,
num_parallel_workers=None,
shuffle=Shuffle.GLOBAL,
num_shards=None,
shard_id=None,
cache=None)
For more information, see mindspore.dataset.CoNLL2000Dataset.
Differences
PyTorch: Read the CoNLL2000 dataset.
MindSpore: Read the CoNLL2000 dataset. Downloading dataset from web is not supported.
| Categories | Subcategories | PyTorch | MindSpore | Difference |
|---|---|---|---|---|
| Parameter | Parameter1 | root | dataset_dir | - |
| Parameter2 | split | usage | - | |
| Parameter3 | - | num_samples | The number of images to be included in the dataset | |
| Parameter4 | - | num_parallel_workers | Number of worker threads to read the data | |
| Parameter5 | - | shuffle | Whether to perform shuffle on the dataset | |
| Parameter6 | - | num_shards | Number of shards that the dataset will be divided into | |
| Parameter7 | - | shard_id | The shard ID within num_shards | |
| Parameter8 | - | cache | Use tensor caching service to speed up dataset processing |
Code Example
# PyTorch
import torchtext.datasets as datasets
from torch.utils.data import DataLoader
root = "/path/to/dataset_directory/"
dataset = datasets.CoNLL2000Chunking(root, split=('train', 'test'))
dataloader = DataLoader(dataset)
# MindSpore
import mindspore.dataset as ds
# Download CoNLL2000 dataset files, unzip into the following structure
# .
# └── /path/to/dataset_directory/
# ├── train.txt
# ├── test.txt
# ├── readme.txt
root = "/path/to/dataset_directory/"
ms_dataloader = ds.CoNLL2000Dataset(root, usage='all')
Related Documents
基于命题分块以增强RAG
命题分块技术(Proposition Chunking)——这是一种通过将文档分解为原子级事实陈述来实现更精准检索的先进方法。与传统仅按字符数分割文本的分块方式不同,命题分块能保持单个事实的语义完整性。
TileMap Chunk Manager
**Category:** Performance - 2D Rendering & Memory Management
🤖 n8n AI Agent Mastery Course 2025
Welcome to the most comprehensive n8n AI Agent course! Build powerful automation workflows and intelligent AI agents using n8n's visual workflow builder.
Document Chunking/Splitting in Langroid
Langroid's [`ParsingConfig`][langroid.parsing.parser.ParsingConfig]