pe.data.text.text_csv module
- class pe.data.text.text_csv.TextCSV(csv_path, label_columns=[], text_column='text', num_samples=None)[source]
Bases:
Data
The text dataset in CSV format.
- __init__(csv_path, label_columns=[], text_column='text', num_samples=None)[source]
Constructor.
- Parameters:
csv_path (str) – The path to the CSV file
label_columns (list, optional) – The names of the columns that contain the labels, defaults to []
text_column (str, optional) – The name of the column that contains the text data, defaults to “text”
num_samples (int, optional) – The number of samples to load from the CSV file. If None, load all samples. Defaults to None
- Raises:
ValueError – If the label columns or text column does not exist in the CSV file