if (FALSE) {
library(text)
# --- Step 1: embed the text column (produces text-level + word-type embeddings)
embeddings <- textEmbed(Language_based_assessment_data_8["harmonywords"])
# --- Step 2: run textWordPrediction
result <- textWordPrediction(
words = Language_based_assessment_data_8$harmonywords,
word_types_embeddings = embeddings$word_types,
x = Language_based_assessment_data_8$hilstotal,
n_models = 5, # 5 real fits with different CV seeds
n_permutations = 10000, # 5 x 10 000 = 50 000 total null samples
seed = 1003
)
# --- Step 3: inspect word-level scores
result$word_data
# --- Step 4: pass directly to textProjectionPlot
textProjectionPlot(result)
}
Run the code above in your browser using DataLab