DOI: 10.6084/m9.figshare.25676394.v1
title: Supplementary Data to "Model interpretability enhances domain generalization in the case of textual complexity modeling"

description: This data collection contains models, training features, log files, and the results table accompanying the paper “Interpretability Benefits Generalizability: The Case of Modeling Textual Complexity” by Frans van der Sluis and Egon L. van den Broek.Master TableThe master table (<code>master_table.csv</code>) consolidates results for each model configuration assessed and includes the following key columns:<code>data_file</code>: Identifies the feature set used as input for the model.<code>id</code>: Unique identifier for the training run, linking to a corresponding log file in <code>logs.tar.gz</code>.<code>model</code>: Type of model evaluated, either torch, glmnet (glm), vec2read, probabilistic language models (plm), or chatgpt3.5.<code>depth</code>: Interaction depth categorized into level 1, 2, or 3.<code>input features</code>: Total number of input features used.<code>_parameters_</code>: Calculated number of model coefficients or parameters.Performance MetricsMetrics listed are evaluated during the outer loop of the training process.<b>Classification Metrics (</b><code><strong>_classif_</strong></code><b>)</b>: Includes accuracy (acc), precision, recall, f1 score, true negatives (tn), true positives (tp), false negatives (fn), and false positives (fp) for task 1 (text classification).<b>Generalization Metrics (</b><code><strong>_guardian_</strong></code><b>)</b>: Metrics for task 2 (predicting appraisals of processing difficulty) include rank order correlation (rho), Pearson’s correlation with the predicted class probability for the ‘complex’ class (rprob), and Pearson’s correlation with the logit-value of the prediction (rlogit).Torch-Specific Columns<code>outer_epoch</code> and <code>inner_epoch</code>: Specifies the number of training epochs run in the respective outer and inner loop.<code>total_epoch</code>: Total number of epochs run before early stopping.<code>best_epoch</code>: Epoch achieving the lowest validation loss, used for further processing. Note that the model was re-trained on the full EnSiWiki dataset if not stopped early.<code>_net_</code>: Details parameters (e.g., model depth and width) for torch models, with parameter ranges (e.g., learning rate and weight decay) listed in JSON format and tuned in the inner loop.<code>_tuned_</code>: Specifies parameters set after tuning.Intermediate tuning resultsThe repository includes intermediate and final results from the tuning process:<b>Inner loop results</b>: Intermediate tuning results for FNN models are provided in <code>pytorch_cv_inner_loop.csv</code>.<b>Outer loop results</b>: Final results from the outer loop are available for both FNN and GLM models. These results form the input to the master table. Files include:<code>glmnet_cv_outer_loop.csv</code><code>pytorch_cv_outer_loop.csv</code>Model FilesThree specific model files highlighted within the paper are stored in the files: <code>glmnet_cv_277.RDS</code>, <code>glmnet_cv_281.RDS</code>, and <code>glmnet_cv_282.RDS</code>. These files store the logistic regression models with feature interaction depth at levels 1, 3, and 2, respectively. The files are encoded in RDS format and can be read using the R function <code>readRDS</code> along with the <code>glmnet</code> and <code>mlr3</code> libraries.Feature Sets FilesIncludes two sets of features derived from the training and target corpora: Engineered features and BERT embeddings. These feature sets are inputs for the computational models. Note that the code expects data in 'parquet' format, but they are provided here in CSV format for easier access:<code>bert_base_uncased-features_embedding-layer-10_11.csv.gz</code> for BERT features.<code>wundt_v16_8-model-ridge-na.csv.gz</code> for engineered features.<i>Index Columns for Feature Files:</i><code>filename</code>: Source of the corpus.<code>id</code>: Unique identifier for the article.<code>wiki_id</code>: Specific article identifier used in Wikipedia.<code>pair_id</code>: Identifier linking article pairs, referring to the Pairs table.<code>length</code>: Word count of the article.<code>lang</code>: Language of the article, with options including ‘simple’, ‘english’, or unspecified (’’).<code>label</code>: Classification of the article source, where 0 = Simple Wikipedia, 1 = English Wikipedia, 2 = The Guardian articles.<i>Feature Columns for BERT Embeddings:</i><code>d_0</code> to <code>d_767</code>: Represents one of the 768 embedding dimensions from the BERT model.<i>Feature Columns for Engineered Features:</i><code>lucene_characters_per_word_mean</code> (Feature LenCha): Average word length in characters.<code>lucene_syllables_per_word_mean</code> (Feature LenSyl): Average word length in syllables.<code>wordnet_log_cumulative_spread_*_posall_stonge_mean</code> (Feature Sem): Semantic neighborhood density based on WordNet.<code>snowball_swe_w55_n*_mean</code> (Feature EntWor): Word repetition for n-grams (n=1,2,3) measured within a 55-word sliding window.<code>esa_swe_w30_mean</code> (Feature EntSem): Semantic entropy measured within a high-dimensional topic space via Explicit Semantic Analysis.<code>loc__cor2_f0_i0_log_mean_mean</code> (Feature Dep): Mean logarithmic length of dependencies within a sentence.<code>cc_sent_geo_log_p_mean</code> (Feature LogPr): Log probabilities of 5-gram word sequences per sentence, derived from the CommonCrawl corpus.<code>coref_fwin_fill_local_*_mean</code> (Feature CohRef): Mean coherence measured by the number of coreferences with 1 to 5 preceding sentences.<code>esacoh_fwin_fill_local_*_mean</code> (Feature CohSem): Mean coherence measured by semantic relatedness to 1 to 5 preceding sentences.<code>causal_word_span_ratio</code> (Feature ConCau): Ratio of causal connectives to the number of words.<code>noncausal_word_span_ratio</code> (Feature ConAlt): Ratio of non-causal connectives to the number of words.Feature Interactions RankingsThe feature sets are accompanied by a list of the top-100,000 second- and third-order combinations of features, ranked by their F-score. These precomputed lists facilitate the inclusion of multiplicative feature interactions at depth levels 2 and 3 in the models. Note that the code expects data in 'parquet' format, but they are provided here in CSV format for easier access:<code>bert_base_uncased-features_embedding-layer-10_11-combis_depth2.csv.gz</code> for second-order combinations of BERT features.<code>bert_base_uncased-features_embedding-layer-10_11-combis_depth3.csv.gz</code> for third-order combinations of BERT features.<code>wundt_v16_8-model-ridge-na-combis_depth2.csv.gz</code> for second-order combinations of engineered features.<code>wundt_v16_8-model-ridge-na-combis_depth3.csv.gz</code> for third-order combinations of engineered features.<i>Columns for Combinations Files:</i><code>combi</code>: A JSON-formatted list of feature indexes, mapping to columns in the feature data files.<code>f</code>: The F-score indicating the discriminative power of the feature combination for distinguishing between Simple and English Wikipedia texts.<code>p</code>: The p-value associated with the F-score.CodeThe code accompanying this work is available on Github, https://github.com/fsluis/textual-complexity, and archived at Zenodo, doi 10.5281/zenodo.14359835.ReferencesVan der Sluis, F., & van den Broek, E. L. (2025). Model interpretability enhances domain generalization in the case of textual complexity modeling. <i>Patterns, 6</i>, 101177. https://doi.org/10.1016/j.patter.2025.101177