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

supporting list input for keras #4

Open
systats opened this issue Apr 25, 2020 · 2 comments
Open

supporting list input for keras #4

systats opened this issue Apr 25, 2020 · 2 comments

Comments

@systats
Copy link

systats commented Apr 25, 2020

Is there a way to create a recipe for list of matrices? Like inputing a DTM and Image Pixels for a custom keras model at the same time would be great. Also is there a way to incorporate a keras tokenizer into a recipe?

Thanks for all your work! And I would be delighted to help on that end if possible.

@EmilHvitfeldt
Copy link
Member

Is there a way to create a recipe for list of matrices?

at the moment only matrices and data.frames are supported as input in recipes.

Also is there a way to incorporate a keras tokenizer into a recipe?

You should take a look at textrecipes. While it doesn't have direct support for keras (yet) you can pass any tokenization function to "step_tokenize()'

library(recipes)
library(textrecipes)
library(keras)
rec <- recipe(~ text, data = your_data) %>%
  step_tokenize(text, custom_token = text_to_word_sequence) %>%
  step_tokenfilter(text, max_tokens = 100) %>%
  step_tfidf(text) %>%
  prep()

@topepo
Copy link
Member

topepo commented Apr 26, 2020

We've also been talking about how to use sparse matrices inside of recipes. I don't think that we'll support passing a sparse matrix to recipe() (because of their limitations) but use them internally to handle larger data sets.

That's a "forward looking statement" so don't get too excited yet.

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

No branches or pull requests

3 participants