rstudio / tfdatasets

R interface to TensorFlow Datasets API
https://tensorflow.rstudio.com/tools/tfdatasets/
34 stars 12 forks source link

step_text_embdding_column function not found #81

Closed asheetal closed 3 years ago

asheetal commented 3 years ago

This tutorial uses function call to step_text_embedding_column using pretrained tfhub module_spec https://tensorflow.rstudio.com/guide/tfhub/examples/feature_column/

I am using the tensorflow 2.4 and latest packages. But the tutorial does not run because the function does not exist in latest tfdatasets. Can someone point me to the right direction?

Error in step_text_embedding_column(., list1, module_spec = tfhub_url) : 
  could not find function "step_text_embedding_column"
t-kalinowski commented 3 years ago

Hi, thank you for filing. This example is indeed broken.

Some investigative notes:

This is the PR where the function was removed: https://github.com/rstudio/tfdatasets/pull/67

At a later time, the corresponding functions in the tfhub R package were refactored and renamed to step_pretrained_text_embedding and step_pretrained_text_embedding. However, those functions after refactoring are not compatible with the tfdatasets steps_+ feature_spec() family of functions, but are geared towards the recipes steps in the tidymodels ecosystem. Fixing step_pretrained_text_embedding to work with tfdatasets feature_spec() is going to be a large effort and will likely not happen.

The current design of the feature_spec() approach is geared towards tfestimators. However, tfestimators is deprecated, and all the upstream effort is on keras + keras.preprocessing.

Resolution: removed the broken example.