Skip to content

constants

Constants used throughout the project.

Accelerators

Bases: StrEnum

Enum for accelerator types.

Attributes:

Name Type Description
AUTO str

Represents the automatic selection of accelerator based on availability.

CPU str

Represents the Central Processing Unit as the accelerator.

GPU str

Represents the Graphics Processing Unit as the accelerator.

Source code in src/configs/constants.py
176
177
178
179
180
181
182
183
184
185
186
187
188
class Accelerators(StrEnum):
    """
    Enum for accelerator types.

    Attributes:
        AUTO (str): Represents the automatic selection of accelerator based on availability.
        CPU (str): Represents the Central Processing Unit as the accelerator.
        GPU (str): Represents the Graphics Processing Unit as the accelerator.
    """

    AUTO = 'auto'
    CPU = 'cpu'
    GPU = 'gpu'

BackboneNames

Bases: StrEnum

Enum for backbone names.

Attributes:

Name Type Description
ROBERTA_BASE str

Represents the base version of the RoBERTa model.

ROBERTA_LARGE str

Represents the large version of the RoBERTa model.

ROBERTA_RACE str

Represents the fine-tuned-on-RACE RoBERTa model.

Source code in src/configs/constants.py
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
class BackboneNames(StrEnum):
    """
    Enum for backbone names.

    Attributes:
        ROBERTA_BASE (str): Represents the base version of the RoBERTa model.
        ROBERTA_LARGE (str): Represents the large version of the RoBERTa model.
        ROBERTA_RACE (str): Represents the fine-tuned-on-RACE RoBERTa model.
    """

    ROBERTA_BASE = 'roberta-base'
    ROBERTA_LARGE = 'roberta-large'
    ROBERTA_RACE = 'LIAMF-USP/roberta-large-finetuned-race'
    XLM_ROBERTA_BASE = 'FacebookAI/xlm-roberta-base'
    XLM_ROBERTA_LARGE = 'FacebookAI/xlm-roberta-large'

ConfigName

Bases: StrEnum

Enum for config names.

Attributes:

Name Type Description
DATA str

Represents the data config.

TRAINER str

Represents the trainer config.

MODEL str

Represents the model config.

Source code in src/configs/constants.py
399
400
401
402
403
404
405
406
407
408
409
410
411
class ConfigName(StrEnum):
    """
    Enum for config names.

    Attributes:
        DATA (str): Represents the data config.
        TRAINER (str): Represents the trainer config.
        MODEL (str): Represents the model config.
    """

    DATA = 'data'
    TRAINER = 'trainer'
    MODEL = 'model'

DLModelNames

Bases: StrEnum

Enum for model names.

Attributes:

Name Type Description
MAG_MODEL str

Represents the name of the MAG model.

ROBERTEYE_MODEL str

Represents the name of the Eye BERT model.

AHN_CNN_MODEL str

Represents the name of the AHN CNN model.

AHN_RNN_MODEL str

Represents the name of the AHN RNN model.

BEYELSTM_MODEL str

Represents the name of the BEYELSTM model.

POSTFUSION_MODEL str

Represents the name of the PostFusion model.

PLMAS_MODEL str

Represents the name of the PLMAS model.

PLMASF_MODEL str

Represents the name of the PLMASF model.

Source code in src/configs/constants.py
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
class DLModelNames(StrEnum):
    """
    Enum for model names.

    Attributes:
        MAG_MODEL (str): Represents the name of the MAG model.
        ROBERTEYE_MODEL (str): Represents the name of the Eye BERT model.
        AHN_CNN_MODEL (str): Represents the name of the AHN CNN model.
        AHN_RNN_MODEL (str): Represents the name of the AHN RNN model.
        BEYELSTM_MODEL (str): Represents the name of the BEYELSTM model.
        POSTFUSION_MODEL (str): Represents the name of the PostFusion model.
        PLMAS_MODEL (str): Represents the name of the PLMAS model.
        PLMASF_MODEL (str): Represents the name of the PLMASF model.
    """

    ROBERTEYE_MODEL = 'Roberteye'
    POSTFUSION_MODEL = 'PostFusionModel'
    PLMAS_MODEL = 'PLMASModel'
    PLMASF_MODEL = 'PLMASFModel'
    MAG_MODEL = 'MAGModel'
    AHN_CNN_MODEL = 'AhnCNNModel'
    AHN_RNN_MODEL = 'AhnRNNModel'
    BEYELSTM_MODEL = 'BEyeLSTMModel'

DataSets

Bases: StrEnum

DataSets is an enumeration that represents different datasets used in the application.

Attributes:

Name Type Description
ONESTOP str

Represents the OneStop dataset.

COPCO str

Represents the CopCo dataset.

POTEC str

Represents the PoTeC dataset.

SBSAT str

Represents the SBSAT dataset.

HALLUCINATION str

Represents the IITBHGC dataset.

MECO_L2 str

Represents the MECO L2 dataset.

MECO_L2W1 str

Represents the MECO L2W1 dataset.

MECO_L2W2 str

Represents the MECO L2W2 dataset.

Source code in src/configs/constants.py
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
class DataSets(StrEnum):
    """
    DataSets is an enumeration that represents different datasets used in the application.

    Attributes:
        ONESTOP (str): Represents the OneStop dataset.
        COPCO (str): Represents the CopCo dataset.
        POTEC (str): Represents the PoTeC dataset.
        SBSAT (str): Represents the SBSAT dataset.
        HALLUCINATION (str): Represents the IITBHGC dataset.
        MECO_L2 (str): Represents the MECO L2 dataset.
        MECO_L2W1 (str): Represents the MECO L2W1 dataset.
        MECO_L2W2 (str): Represents the MECO L2W2 dataset.
    """

    ONESTOP = 'OneStop'
    COPCO = 'CopCo'
    POTEC = 'PoTeC'
    SBSAT = 'SBSAT'
    HALLUCINATION = 'IITBHGC'
    MECO_L2 = 'MECOL2'
    MECO_L2W1 = 'MECOL2W1'
    MECO_L2W2 = 'MECOL2W2'

DataType

Bases: StrEnum

DataType is an enumeration that represents different types of data used in the application.

Attributes:

Name Type Description
IA str

Represents interest area data.

FIXATIONS str

Represents fixation data.

RAW str

Represents raw eye-tracking data.

TRIAL_LEVEL str

Represents trial-level aggregated data.

METADATA str

Represents metadata.

Source code in src/configs/constants.py
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
class DataType(StrEnum):
    """
    DataType is an enumeration that represents different types of data used in the application.

    Attributes:
        IA (str): Represents interest area data.
        FIXATIONS (str): Represents fixation data.
        RAW (str): Represents raw eye-tracking data.
        TRIAL_LEVEL (str): Represents trial-level aggregated data.
        METADATA (str): Represents metadata.
    """

    IA = 'ia'
    FIXATIONS = 'fixations'
    RAW = 'raw'
    TRIAL_LEVEL = 'trial_level'
    METADATA = 'metadata'

DatasetLanguage

Bases: StrEnum

Enum for dataset languages.

Attributes:

Name Type Description
ENGLISH str

Represents English language datasets.

GERMAN str

Represents German language datasets.

DANISH str

Represents Danish language datasets.

Source code in src/configs/constants.py
131
132
133
134
135
136
137
138
139
140
141
142
143
class DatasetLanguage(StrEnum):
    """
    Enum for dataset languages.

    Attributes:
        ENGLISH (str): Represents English language datasets.
        GERMAN (str): Represents German language datasets.
        DANISH (str): Represents Danish language datasets.
    """

    ENGLISH = 'English'
    GERMAN = 'German'
    DANISH = 'Danish'

FeatureMode

Bases: StrEnum

Enum for feature modes.

Attributes:

Name Type Description
EYES str

Represents the eyes feature mode.

WORDS str

Represents the words feature mode.

EYES_WORDS str

Represents the combined eyes and words feature mode.

Source code in src/configs/constants.py
414
415
416
417
418
419
420
421
422
423
424
425
426
class FeatureMode(StrEnum):
    """
    Enum for feature modes.

    Attributes:
        EYES (str): Represents the eyes feature mode.
        WORDS (str): Represents the words feature mode.
        EYES_WORDS (str): Represents the combined eyes and words feature mode.
    """

    EYES = 'eyes'
    WORDS = 'words'
    EYES_WORDS = 'eyes_words'

Fields

Bases: StrEnum

Enum for field names in the data.

Attributes:

Name Type Description
BATCH str

Represents the article_batch.

PARAGRAPH_ID str

Represents the paragraph_id.

UNIQUE_PARAGRAPH_ID str

Represents the unique_paragraph_id.

ARTICLE_ID str

Represents the article_id.

ARTICLE_IND str

Represents the article_index.

QUESTION str

Represents the question.

LEVEL str

Represents the difficulty_level.

LIST str

Represents the list_number.

PARAGRAPH str

Represents the paragraph.

HAS_PREVIEW str

Represents the question_preview.

SUBJECT_ID str

Represents the participant_id.

FINAL_ANSWER str

Represents the selected_answer_position.

REREAD str

Represents the repeated_reading_trial.

IA_DATA_IA_ID_COL_NAME str

Represents the IA_ID.

FIXATION_REPORT_IA_ID_COL_NAME str

Represents the CURRENT_FIX_INTEREST_AREA_INDEX.

IS_CORRECT str

Represents the is_correct.

PRACTICE str

Represents the practice_trial.

Source code in src/configs/constants.py
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
class Fields(StrEnum):
    """
    Enum for field names in the data.

    Attributes:
        BATCH (str): Represents the article_batch.
        PARAGRAPH_ID (str): Represents the paragraph_id.
        UNIQUE_PARAGRAPH_ID (str): Represents the unique_paragraph_id.
        ARTICLE_ID (str): Represents the article_id.
        ARTICLE_IND (str): Represents the article_index.
        QUESTION (str): Represents the question.
        LEVEL (str): Represents the difficulty_level.
        LIST (str): Represents the list_number.
        PARAGRAPH (str): Represents the paragraph.
        HAS_PREVIEW (str): Represents the question_preview.
        SUBJECT_ID (str): Represents the participant_id.
        FINAL_ANSWER (str): Represents the selected_answer_position.
        REREAD (str): Represents the repeated_reading_trial.
        IA_DATA_IA_ID_COL_NAME (str): Represents the IA_ID.
        FIXATION_REPORT_IA_ID_COL_NAME (str): Represents the CURRENT_FIX_INTEREST_AREA_INDEX.
        IS_CORRECT (str): Represents the is_correct.
        PRACTICE (str): Represents the practice_trial.
    """

    UNIQUE_TRIAL_ID = 'unique_trial_id'
    BATCH = 'article_batch'
    PARAGRAPH_ID = 'paragraph_id'
    UNIQUE_PARAGRAPH_ID = 'unique_paragraph_id'
    ARTICLE_ID = 'article_id'
    LEVEL = 'difficulty_level'
    LIST = 'list_number'
    PARAGRAPH = 'paragraph'
    HAS_PREVIEW = 'question_preview'
    SUBJECT_ID = 'participant_id'
    REREAD = 'repeated_reading_trial'
    IA_DATA_IA_ID_COL_NAME = 'IA_ID'
    FIXATION_REPORT_IA_ID_COL_NAME = 'CURRENT_FIX_INTEREST_AREA_INDEX'
    IS_CORRECT = 'is_correct'
    PRACTICE = 'practice_trial'
    QUESTION = 'question'

ItemLevelFeaturesModes

Bases: StrEnum

Enum for item-level feature modes.

Attributes:

Source code in src/configs/constants.py
233
234
235
236
237
238
239
240
241
242
243
244
class ItemLevelFeaturesModes(StrEnum):
    """
    Enum for item-level feature modes.

    Attributes:
    """

    RF = 'RF'
    BEYELSTM = 'BEYELSTM'
    SVM = 'SVM'
    LOGISTIC = 'LOGISTIC'
    READING_SPEED = 'READING_SPEED'

MLModelNames

Bases: StrEnum

Enum for ML model names.

Attributes:

Name Type Description
LOGISTIC_REGRESSION str

Represents the logistic regression model.

SVM str

Represents the support vector machine model.

RANDOM_FOREST str

Represents the random forest model.

DUMMY_CLASSIFIER str

Represents the dummy classifier model.

XGBOOST str

Represents the XGBoost model.

LOGISTIC_REGRESSION_REG str

Represents the logistic regression regressor.

SVM_REG str

Represents the support vector regressor.

RANDOM_FOREST_REG str

Represents the random forest regressor.

DUMMY_REGRESSOR str

Represents the dummy regressor.

XGBOOST_REG str

Represents the XGBoost regressor.

Source code in src/configs/constants.py
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
class MLModelNames(StrEnum):
    """
    Enum for ML model names.

    Attributes:
        LOGISTIC_REGRESSION (str): Represents the logistic regression model.
        SVM (str): Represents the support vector machine model.
        RANDOM_FOREST (str): Represents the random forest model.
        DUMMY_CLASSIFIER (str): Represents the dummy classifier model.
        XGBOOST (str): Represents the XGBoost model.
        LOGISTIC_REGRESSION_REG (str): Represents the logistic regression regressor.
        SVM_REG (str): Represents the support vector regressor.
        RANDOM_FOREST_REG (str): Represents the random forest regressor.
        DUMMY_REGRESSOR (str): Represents the dummy regressor.
        XGBOOST_REG (str): Represents the XGBoost regressor.
    """

    LOGISTIC_REGRESSION = 'LogisticRegressionMLModel'
    SVM = 'SupportVectorMachineMLModel'
    RANDOM_FOREST = 'RandomForestMLModel'
    DUMMY_CLASSIFIER = 'DummyClassifierMLModel'
    XGBOOST = 'XGBoostMLModel'
    LINEAR_REG = 'LinearRegressionRegressorMLModel'
    SVM_REG = 'SupportVectorRegressorMLModel'
    RANDOM_FOREST_REG = 'RandomForestRegressorMLModel'
    DUMMY_REGRESSOR = 'DummyRegressorMLModel'
    XGBOOST_REG = 'XGBoostRegressorMLModel'

MatmulPrecisionLevel

Bases: StrEnum

Enum for matrix multiplication precision levels.

Attributes:

Name Type Description
HIGHEST str

Corresponds to "highest".

HIGH str

Corresponds to "high".

MEDIUM str

Corresponds to "medium".

Source code in src/configs/constants.py
368
369
370
371
372
373
374
375
376
377
378
379
380
class MatmulPrecisionLevel(StrEnum):
    """
    Enum for matrix multiplication precision levels.

    Attributes:
        HIGHEST (str): Corresponds to "highest".
        HIGH (str): Corresponds to "high".
        MEDIUM (str): Corresponds to "medium".
    """

    HIGHEST = 'highest'
    HIGH = 'high'
    MEDIUM = 'medium'

NormalizationModes

Bases: StrEnum

Enum for normalization modes.

Attributes:

Name Type Description
ALL str

Represents the mode where data is normalized based on all trials.

TRIAL str

Represents the mode where data is normalized based on a trial level.

NONE str

Represents the mode where no data is normalized.

Source code in src/configs/constants.py
146
147
148
149
150
151
152
153
154
155
156
157
158
class NormalizationModes(StrEnum):
    """
    Enum for normalization modes.

    Attributes:
        ALL (str): Represents the mode where data is normalized based on all trials.
        TRIAL (str): Represents the mode where data is normalized based on a trial level.
        NONE (str): Represents the mode where no data is normalized.
    """

    ALL = 'all'
    TRIAL = 'trial'
    NONE = 'none'

Precision

Bases: StrEnum

Enum for precision types.

Attributes:

Name Type Description
SIXTEEN_MIXED str

Corresponds to "16-mixed".

THIRTY_TWO_TRUE str

Corresponds to "32-true".

Source code in src/configs/constants.py
355
356
357
358
359
360
361
362
363
364
365
class Precision(StrEnum):
    """
    Enum for precision types.

    Attributes:
        SIXTEEN_MIXED (str): Corresponds to "16-mixed".
        THIRTY_TWO_TRUE (str): Corresponds to "32-true".
    """

    SIXTEEN_MIXED = '16-mixed'
    THIRTY_TWO_TRUE = '32-true'

PredMode

Bases: StrEnum

Enum for prediction modes.

Source code in src/configs/constants.py
331
332
333
334
335
336
337
338
339
340
341
342
class PredMode(StrEnum):
    """
    Enum for prediction modes.
    """

    RCS = 'RCS'  # Reading Comprehension Skill
    RC = 'RC'  # Reading Comprehension
    STD = 'STD'  # Subjective Text Difficulty
    TYP = 'TYP'  # Typicality
    CV = 'CV'  # Claim Verification
    LEX = 'LEX'  # Vocabulary Knowledge
    DE = 'DE'  # Domain Expertise

RunModes

Bases: StrEnum

Enum for run modes.

Attributes:

Name Type Description
DEBUG str

Represents the debug mode used for debugging the code.

FAST_DEV_RUN str

Represents the fast development run mode used for quick testing.

TRAIN str

Represents the train mode used for training the model.

Source code in src/configs/constants.py
161
162
163
164
165
166
167
168
169
170
171
172
173
class RunModes(StrEnum):
    """
    Enum for run modes.

    Attributes:
        DEBUG (str): Represents the debug mode used for debugging the code.
        FAST_DEV_RUN (str): Represents the fast development run mode used for quick testing.
        TRAIN (str): Represents the train mode used for training the model.
    """

    DEBUG = 'debug'
    FAST_DEV_RUN = 'fast_dev_run'
    TRAIN = 'train'

Scaler

Bases: Enum

Enum for scaler types. Each scaler type is associated with a corresponding scaler class from sklearn.preprocessing.

Attributes:

Name Type Description
MIN_MAX_SCALER type

Corresponds to sklearn.preprocessing.MinMaxScaler.

ROBUST_SCALER type

Corresponds to sklearn.preprocessing.RobustScaler.

STANDARD_SCALER type

Corresponds to sklearn.preprocessing.StandardScaler.

Source code in src/configs/constants.py
383
384
385
386
387
388
389
390
391
392
393
394
395
396
class Scaler(Enum):
    """
    Enum for scaler types. Each scaler type is associated with a
        corresponding scaler class from sklearn.preprocessing.

    Attributes:
        MIN_MAX_SCALER (type): Corresponds to sklearn.preprocessing.MinMaxScaler.
        ROBUST_SCALER (type): Corresponds to sklearn.preprocessing.RobustScaler.
        STANDARD_SCALER (type): Corresponds to sklearn.preprocessing.StandardScaler.
    """

    MIN_MAX_SCALER = MinMaxScaler
    ROBUST_SCALER = RobustScaler
    STANDARD_SCALER = StandardScaler

SetNames

Bases: StrEnum

Enum for set names.

Attributes:

Name Type Description
TRAIN str

Represents the training set.

VAL str

Represents the validation set.

TEST str

Represents the test set.

SEEN_SUBJECT_UNSEEN_ITEM str

Represents the seen subject unseen item set.

UNSEEN_SUBJECT_SEEN_ITEM str

Represents the unseen subject seen item set.

UNSEEN_SUBJECT_UNSEEN_ITEM str

Represents the unseen subject unseen item set.

Source code in src/configs/constants.py
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
class SetNames(StrEnum):
    """
    Enum for set names.

    Attributes:
        TRAIN (str): Represents the training set.
        VAL (str): Represents the validation set.
        TEST (str): Represents the test set.
        SEEN_SUBJECT_UNSEEN_ITEM (str): Represents the seen subject unseen item set.
        UNSEEN_SUBJECT_SEEN_ITEM (str): Represents the unseen subject seen item set.
        UNSEEN_SUBJECT_UNSEEN_ITEM (str): Represents the unseen subject unseen item set.
    """

    TRAIN = 'train'
    VAL = 'val'
    TEST = 'test'
    SEEN_SUBJECT_UNSEEN_ITEM = 'seen_subject_unseen_item'
    UNSEEN_SUBJECT_SEEN_ITEM = 'unseen_subject_seen_item'
    UNSEEN_SUBJECT_UNSEEN_ITEM = 'unseen_subject_unseen_item'

TaskTypes

Bases: StrEnum

Enum for task types.

Attributes:

Name Type Description
BINARY_CLASSIFICATION str

Represents binary classification tasks.

REGRESSION str

Represents regression tasks.

Source code in src/configs/constants.py
318
319
320
321
322
323
324
325
326
327
328
class TaskTypes(StrEnum):
    """
    Enum for task types.

    Attributes:
        BINARY_CLASSIFICATION (str): Represents binary classification tasks.
        REGRESSION (str): Represents regression tasks.
    """

    BINARY_CLASSIFICATION = 'binary_classification'
    REGRESSION = 'regression'