Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

textPredict does not work. #177

Open
moomoofarm1 opened this issue May 6, 2024 · 1 comment
Open

textPredict does not work. #177

moomoofarm1 opened this issue May 6, 2024 · 1 comment

Comments

@moomoofarm1
Copy link
Contributor

moomoofarm1 commented May 6, 2024

trained_model <- textTrainRegression(
 x = word_embeddings_4$texts$harmonytext,
y = Language_based_assessment_data_8$hilstotal,
multi_cores = FALSE)

Fold: rmse 7.171 (duration: 2.77 secs).
Fold: rmse 7.033 (duration: 2.8 secs).
Fold: rmse 7.643 (duration: 3.12 secs).
Fold: rmse 5.882 (duration: 2.79 secs).
Fold: rmse 8.595 (duration: 2.88 secs).
Fold: rmse 7.078 (duration: 2.82 secs).
Fold: rmse 8.562 (duration: 2.74 secs).
Fold: rmse 8.717 (duration: 2.73 secs).
Fold: rmse 8.48 (duration: 2.74 secs).
Fold: rmse 8.764 (duration: 2.76 secs).
There were 21 warnings (use warnings() to see them)

text_to_predict <- "I am not in harmony in my life as much as I would like to be."
prediction3 <- textPredict(
     texts = text_to_predict,
   model_info = trained_model)

Loading model...
The model has been loaded from your global environment.
Completed layers output for texts (variable: 1/1, duration: 1.027426 secs).
Completed layers aggregation for word_type_embeddings.
Completed layers aggregation (variable 1/1, duration: 0.167070 secs).
Embeddings have been saved: textPredict_3269564148.RDS

Error in UseMethod("select") :
no applicable method for 'select' applied to an object of class "NULL"

prediction4 <- textPredict(texts = tibble::as_tibble(list("texts"=text_to_predict)), model_info=trained_model)

Loading model...
The model has been loaded from your global environment.
Embeddings have been loaded from: textPredict_3269564148.RDS
Error in UseMethod("select") :
no applicable method for 'select' applied to an object of class "NULL"

@moomoofarm1
Copy link
Contributor Author

With these code instead produces the same error.

trained_model <- textTrainRegression(
   x = word_embeddings_4$texts[c("satisfactiontexts", "harmonytexts")],
   y = Language_based_assessment_data_8["hilstotal"])

Fold: rmse 7.932 (duration: 7.05 secs).
Fold: rmse 6.791 (duration: 7.56 secs).
Fold: rmse 8.912 (duration: 7.62 secs).
Fold: rmse 6.594 (duration: 8.28 secs).
Fold: rmse 8.314 (duration: 7.74 secs).
Fold: rmse 6.717 (duration: 6.47 secs).
Fold: rmse 8.702 (duration: 5.47 secs).
Fold: rmse 7.487 (duration: 4.76 secs).
Fold: rmse 5.389 (duration: 3.9 secs).
Fold: rmse 8.298 (duration: 3.14 secs).
There were 21 warnings (use warnings() to see them)

 prediction1 <- textPredict(
   model_info = trained_model,
   texts = tibble::as_tibble(
     list("satisfactiontexts"=c("hello"),"harmoneytexts"="hi"),.name_repair = "minimal")
 )

Loading model...
The model has been loaded from your global environment.
Embeddings have been loaded from: textPredict_326952976.RDS
Error in UseMethod("select") :
no applicable method for 'select' applied to an object of class "NULL"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant