GithubHelp home page GithubHelp logo

aaronheee / recformer Goto Github PK

View Code? Open in Web Editor NEW
73.0 73.0 24.0 26 KB

Replication of the paper "Text Is All You Need: Learning Language Representations for Sequential Recommendation" on KDD'23.

Python 99.04% Shell 0.96%

recformer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

recformer's Issues

Regarding the issue with reproduction

Hello. I have encountered an issue with reproducing the results. I replicated two methods, Recformer and UniSRec, using default parameters. The results for Recformer seem reasonable, but the performance of the reproduced UniSRec is significantly better than reported in the paper. What could be the reason for this?
image

the process of dataset

Traceback (most recent call last):
File "D:\download\RecFormer-main\RecFormer-main\pretrain_data\meta_data_process.py", line 53, in
if line['asin'] is not None and line['title'] is not None:
KeyError: 'title'

(text) D:\download\RecFormer-main\RecFormer-main\pretrain_data>python meta_data_process.py
Check meta asins: 25%|███████████▊ | 2/8 [01:18<03:55, 39.31s/it]
Traceback (most recent call last):
File "D:\download\RecFormer-main\RecFormer-main\pretrain_data\meta_data_process.py", line 53, in
if line['asin'] is not None and line['title'] is not None:
KeyError: 'title'
there have some trouble
may i ask why

Difference between RecformerModel and RecformerForSeqRec

Firstly, congratulations on the publication! The idea presented is interesting, and the it is very well written.

I'm a bit confused about the distinction between RecformerModel and RecformerForSeqRec.

I understand that you used RecformerForSeqRec to derive the results in the paper for sequential recommendations. However, I'm curious about the purpose of RecformerModel. Is it essentially the model allenai/longformer-base-4096, but with variations in token type embedding and item position embedding?

Thanks!

Candidates for ranking

In the paper, it is said that "We rank the ground-truth item of each sequence among all items for evaluation.."
Do the candidates include items in all train, val, and test sequences?

AttributeError: 'NoneType' object has no attribute 'encode_item'

Overview

When I followed the steps described in the Training section on the README, I stumbled upon an issue and couldn't move forward.

Note

I downloaded the processed data and then ran python save_longformer_ckpt.py after storing them in the pretrain_data folder.
The next code bash lightning_run.sh gives me the following error.

Given I go with the default setting including the training strategy deepspeed_stage_2, it looks like not running python zero_to_fp32.py . pytorch_model.bin could be the culprit but I don't see it created automatically to the checkpoint folder)
Thanks for your guidance.

Error Detail

zero_to_fp32.py

Traceback (most recent call last):
  File "./anaconda3/lib/python3.11/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "./RecFormer-main/lightning_pretrain.py", line 46, in _par_tokenize_doc
    input_ids, token_type_ids = tokenizer_glb.encode_item(item_attr)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'encode_item'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./RecFormer-main/lightning_pretrain.py", line 156, in <module>
    main()
  File "./RecFormer-main/lightning_pretrain.py", line 102, in main
    doc_tuples = list(tqdm(pool_func, total=len(item_attrs), ncols=100, desc=f'[Tokenize] {path_corpus}'))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./anaconda3/lib/python3.11/site-packages/tqdm/std.py", line 1178, in __iter__
    for obj in iterable:
  File "./anaconda3/lib/python3.11/multiprocessing/pool.py", line 873, in next
    raise value
AttributeError: 'NoneType' object has no attribute 'encode_item'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.