Giter Site home page Giter Site logo

feisun / bert4rec Goto Github PK

View Code? Open in Web Editor NEW
592.0 10.0 154.0 64.93 MB

BERT4Rec: Sequential Recommendation with Bidirectional Encoder Representations from Transformer

License: Apache License 2.0

Python 94.90% Shell 5.10%
sequential-recommendation recommendation

bert4rec's Issues

TF 2.0

Can you upgrade your code to TensorFlow 2.0?

预测速度很慢的原因是啥?怎么解决?

bert4rec在我们的场景下使用的时候,预测速度非常慢。
这个原因是不是拿了所有物料做softmax导致的。
但是作为cloze任务,这个又无法避免,想问下有什么解决办法吗

PyTorch Implementation

Hi, I'm wondering if you also have a PyTorch implementation of the BERT4REC available. Thank you very much!

cannot duplicate result

I used the original code as well as the ml-1m data listed in the repo. But the loss didn't drop since 10000 iteration, final loss remained on about 5.12. Is there any preprocessing do I need to do before training? Thanks!

How to use User features(such as age, demographics) to construct the Sequential Recommendation System ?

I want to train a next-procedure prediction for the medical dataset. After checking the data processing pipeline, what I have figured out is: the emphasis is done on the sequence of item interaction for users along with the timestamp in the loaded data. But there is no consideration of user features.
But, what I know is user features and item features also play a role, In my case, user features are very critical. How I can use such features to design the sequential recommendation system? Thank you!

pytorch implementation

I'm wondering if you also have a PyTorch implementation of the BERT4REC available. Thank you very much!

Why is the result of NDCG not stored in the eval_result.txt file?

After running run_beauty.sh,I got eval_result.txt.
The eval_result.txt only included masked_lm_accuracy and masked_lm_loss.
I tried and found that NDCG and other evaluation metrics only outputed in the info log.
Could you please tell me how can I get these evaluation metrics results and store them in the result txt file?
I found the source codes as followed:
` #tf.logging.info('special eval ops:', special_eval_ops)
result = estimator.evaluate(
input_fn=eval_input_fn,
steps=None,
hooks=[EvalHooks()])

    output_eval_file = os.path.join(FLAGS.checkpointDir,
                                    "eval_results.txt")
    with tf.gfile.GFile(output_eval_file, "w") as writer:
        tf.logging.info("***** Eval results *****")
        tf.logging.info(bert_config.to_json_string())
        writer.write(bert_config.to_json_string()+'\n')
        for key in sorted(result.keys()):
            tf.logging.info("  %s = %s", key, str(result[key]))
            writer.write("%s = %s\n" % (key, str(result[key])))`

Data generation not deterministic

masked_lm_prob, max_predictions_per_seq, vocab, random.Random(random.randint(1,10000)),

Your data generation code is not deterministic, hence making it difficult to reproduce your result.

As shown in the referenced code, create_instances_threading() receive random.Random(random.randint(1, 10000)) as rng, which makes it undeterministic.

Please reply.

Code isn't aviable

This paper refer me to this repo. I don't see any code in this repo. Can you update this repo? Thank you

Learning rate

I modified lr=1e-3 (1e-4 in your paper) and found that the convergence speed is much faster. Similar phenomena also appeared in other code reproduction repositories, e.g, cr_1 and cr_2.

Data preprocessing?

Hello. Thanks for uploading the code.

But can you also upload how you preprocessed the data?

I would like to reproduce your results from raw data.

Thank you.

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.