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

[Question] Can I use a List of sequence indices as an Input? #133

Closed
Ishitori opened this issue Mar 15, 2023 · 10 comments
Closed

[Question] Can I use a List of sequence indices as an Input? #133

Ishitori opened this issue Mar 15, 2023 · 10 comments

Comments

@Ishitori
Copy link

I have a feature column which is an array containing list of items a user has interacted with. I found a Kaggle example with a similar situation where the author of the notebook uses this kind of feature: https://www.kaggle.com/code/matanivanov/wide-deep-learning-for-recsys-with-pytorch

Is it possible to do the same thing using Pytorch-widedeep library?

@jrzaurin
Copy link
Owner

I will have a look to the Kaggle example and write back, but as long as you can replicate the output of the TabPreprocessor (which is fairly standard) you can pass anything that has that format.
I will try to write an example later with a column in that is a list of tokens (which I think is what you need)

@Ishitori
Copy link
Author

Yes, you can think of this as a list of tokens. It is usually something as a history of purchases, or as in Kaggle example, a list of already watched movies. The order might matter or might not. In my case it does (items are ordered by decreasing of frequency of interaction).

@jrzaurin
Copy link
Owner

@Ishitori sorry I did not have time today, I think it will have to wait until Fday. But if order matters, then a "standard" WideDeep architecture where the deep component is an MLP wont work, right? in that case you would prefer an RNN or a transformer? (note that at the moment we do not support Transformer-based models for the text component. My next updgrade to the library is integrate it with Huggingace.

@Ishitori
Copy link
Author

Oh, sorry for the delayed reply. I would prefer Transformer (attention-based) model, and it doesn't need to work with text (I don't have text features).

Thank you!

@ncsilvaa
Copy link

Hey everyone! This is an interesting feature for recommender systems.
Could you provide an example of how to use it?
Is something possible to do with the current version of the library?
Thanks

@jrzaurin
Copy link
Owner

Ill comment on this asap, travelling at the moment 🙂

@AresDan
Copy link

AresDan commented Jun 22, 2023

Any progress on this topic? Faced similar issue

@jrzaurin
Copy link
Owner

jrzaurin commented Jul 5, 2023

I have holidays approaching soon and I will address some of the open issues, including this :)

thanks!

jrzaurin added a commit that referenced this issue Jul 27, 2023
#133. Also Added a simple/basic transformer model for the text component before integrating with HF. Also added the option of specify the dimension of the feed forward network
@jrzaurin
Copy link
Owner

hi @Ishitori @AresDan and @ncsilvaa

I will soon open a PR form the wide_deep_recsys branch. In the meantime, you have an example of how to use the library for recsys following the notebook that @Ishitori mentioned in his first comment. All the code is here: https://github.com/jrzaurin/pytorch-widedeep/tree/wide_deep_recsys/examples/scripts/wide_deep_for_recsys

I still have to add some unit tests and I will also include a notebook with more explanations here and there. But in the meantime you can have a look to that code which I hope answers the questions here.

Any other question, please, let me know :)

@jrzaurin
Copy link
Owner

PR #183 addresses this issue

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

4 participants