resolve_base_data
Resolve input to a list of text strings.
Supports HuggingFace dataset ID, pandas DataFrame, CSV path, or list of strings.
Data is shuffled with seed before applying max_size to avoid bias from
ordered sources (e.g. chronological, single-author).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Union[str, DataFrame, List[str]]
|
HF dataset ID (str), CSV path (str ending in .csv or path exists), pandas DataFrame, or List[str]. |
required |
text_column
|
str
|
Column name for text (default "text"). Ignored for List[str]. |
'text'
|
max_size
|
Optional[int]
|
Cap on number of items (applied after shuffle). None = no cap. |
None
|
split
|
str
|
Dataset split for HF (default "train"). |
'train'
|
seed
|
int
|
Random seed for shuffle. |
42
|
hf_config
|
Optional[str]
|
HuggingFace dataset config/subset (e.g. "20220301.en" for wikipedia). Only used when source is an HF dataset ID. |
None
|
trust_remote_code
|
Optional[bool]
|
Optional value passed to load_dataset when loading from HF. None means do not pass the keyword. |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
List of strings (texts). |