pymovements.datasets.UCL#
- class pymovements.datasets.UCL(name: str = 'UCL', has_files: dict[str, bool] = <factory>, mirrors: dict[str, tuple[str, ...]] = <factory>, resources: dict[str, tuple[dict[str, str], ...]] = <factory>, experiment: Experiment | None = None, extract: dict[str, bool] = <factory>, filename_format: dict[str, str] = <factory>, filename_format_schema_overrides: dict[str, dict[str, type]] = <factory>, custom_read_kwargs: dict[str, Any] = <factory>, column_map: dict[str, str] = <factory>, trial_columns: list[str] = <factory>, time_column: str | None = None, time_unit: str | None = 'ms', pixel_columns: list[str] = <factory>, position_columns: list[str] | None = None, velocity_columns: list[str] | None = None, acceleration_columns: list[str] | None = None, distance_column: str | None = None)#
UCL dataset [Frank et al., 2013].
UCL is a dataset of word-by-word reading times collected through self-paced reading and eye-tracking experiments to evaluate computational psycholinguistic models of English sentence comprehension. 361 sentences from narrative sources, ensuring they were understandable without context, and recorded reading times from participants using both methods.
For more details check out the original paper [Frank et al., 2013].
- name#
The name of the dataset.
- Type:
str
- has_files#
Indicate whether the dataset contains ‘gaze’, ‘precomputed_events’, and ‘precomputed_reading_measures’.
- Type:
dict[str, bool]
- mirrors#
A tuple of mirrors of the dataset. Each entry must be of type str and end with a ‘/’.
- Type:
dict[str, tuple[str, …]]
- resources#
A tuple of dataset gaze_resources. Each list entry must be a dictionary with the following keys: - resource: The url suffix of the resource. This will be concatenated with the mirror. - filename: The filename under which the file is saved as. - md5: The MD5 checksum of the respective file.
- Type:
dict[str, tuple[dict[str, str], …]]
- extract#
Decide whether to extract the data.
- Type:
dict[str, bool]
- filename_format#
Regular expression which will be matched before trying to load the file. Namedgroups will appear in the fileinfo dataframe.
- Type:
dict[str, str]
- filename_format_schema_overrides#
If named groups are present in the filename_format, this makes it possible to cast specific named groups to a particular datatype.
- Type:
dict[str, dict[str, type]]
- trial_columns#
The name of the trial columns in the input data frame. If the list is empty or None, the input data frame is assumed to contain only one trial. If the list is not empty, the input data frame is assumed to contain multiple trials and the transformation methods will be applied to each trial separately.
- Type:
list[str]
- pixel_columns#
The name of the pixel position columns in the input data frame. These columns will be nested into the column
pixel. If the list is empty or None, the nestedpixelcolumn will not be created.- Type:
list[str]
- column_map#
The keys are the columns to read, the values are the names to which they should be renamed.
- Type:
dict[str, str]
- custom_read_kwargs#
If specified, these keyword arguments will be passed to the file reading function.
- Type:
dict[str, Any]
Examples
Initialize your
Datasetobject with theUCLdefinition:>>> import pymovements as pm >>> >>> dataset = pm.Dataset("UCL", path='data/UCL')
Download the dataset resources:
>>> dataset.download()
Load the data into memory:
>>> dataset.load()
- __init__(name: str = 'UCL', has_files: dict[str, bool] = <factory>, mirrors: dict[str, tuple[str, ...]] = <factory>, resources: dict[str, tuple[dict[str, str], ...]] = <factory>, experiment: Experiment | None = None, extract: dict[str, bool] = <factory>, filename_format: dict[str, str] = <factory>, filename_format_schema_overrides: dict[str, dict[str, type]] = <factory>, custom_read_kwargs: dict[str, Any] = <factory>, column_map: dict[str, str] = <factory>, trial_columns: list[str] = <factory>, time_column: str | None = None, time_unit: str | None = 'ms', pixel_columns: list[str] = <factory>, position_columns: list[str] | None = None, velocity_columns: list[str] | None = None, acceleration_columns: list[str] | None = None, distance_column: str | None = None) None
Methods
__init__([name, has_files, mirrors, ...])Attributes
acceleration_columnsdistance_columnexperimentposition_columnstime_columntime_unitvelocity_columns