textDimName() changes the names of the dimensions in the word embeddings.
textDimName(word_embeddings, dim_names = TRUE)
Word embeddings with changed names.
see textEmbed
# \donttest{
# Note that dimensions are called Dim1_harmonytexts etc.
word_embeddings_4$texts$harmonytexts
#> # A tibble: 40 × 10
#> Dim1_harmonytexts Dim2_harmonytexts Dim3_harmonytexts Dim4_harmonytexts
#> <dbl> <dbl> <dbl> <dbl>
#> 1 0.421 0.00160 -0.000949 -0.00953
#> 2 -0.00679 0.0737 0.311 -0.103
#> 3 0.119 -0.0586 0.391 -0.160
#> 4 -0.0370 0.234 0.230 -0.0742
#> 5 0.172 0.0862 0.382 -0.256
#> 6 0.210 0.260 -0.0605 -0.0254
#> 7 0.487 0.269 0.147 0.0644
#> 8 0.359 0.0775 0.0650 -0.135
#> 9 0.219 0.231 0.280 -0.0616
#> 10 0.0794 0.389 0.222 -0.292
#> # ℹ 30 more rows
#> # ℹ 6 more variables: Dim5_harmonytexts <dbl>, Dim6_harmonytexts <dbl>,
#> # Dim7_harmonytexts <dbl>, Dim8_harmonytexts <dbl>, Dim9_harmonytexts <dbl>,
#> # Dim10_harmonytexts <dbl>
# Here they are changed to just Dim
w_e_T <- textDimName(word_embeddings_4$texts["harmonytexts"],
dim_names = FALSE
)
# Here they are changed back
w_e_F <- textDimName(w_e_T, dim_names = TRUE)
# }