allegro / allRank

allRank is a framework for training learning-to-rank neural models based on PyTorch.
Apache License 2.0
850 stars 118 forks source link

How to run "run_example.sh" #44

Open supercar1 opened 2 years ago

supercar1 commented 2 years ago

I've been trying several says to run "run_example.sh" but I'm not having any success, can someone help? I have already installed docker, tried to create an image and container with the provided dockerfile, and when I run "./run_example.sh" on terminal, it opens the code in Visual Studio Code... But doesn't do anything.

Any help is appreciated, thanks in advance!

kretes commented 2 years ago

Hello.

This is strange that vs code opens. If you investigate the script yourself - https://github.com/allegro/allRank/blob/master/scripts/run_example.sh - you can see there is just docker called.

Is there any output in the terminal?

What is the output of docker image ls | grep allrank ?

supercar1 commented 2 years ago

Hi, and thanks for your answer! I later managed to run the code in spyder, by running first the "generate_dummy_data.py", and then the "main.py".

To run the main.py, I typed in spyder's console: runfile('C:/allrank/allrank/rank_and_click.py', args='--job-dir /allrank/test_run1 --run-id test_run1 --config-file-name /allrank/scripts/local_config.json --input-model-path /allrank/test_run1/results/test_run/model.pkl --roles vali', wdir='C:/allrank/allrank') (If anyone needs to do the same, remember to adjust for your file path)

On another note, is there any estimate for when the prediction of a set will be available? Right now it seems only a model is trained, without any predictions made.

Thanks in advance! :)

kretes commented 2 years ago

Hi, what do you mean by prediction of a set? Once you have an LTRModel you can use its score method to get the scores. See https://github.com/allegro/allRank/blob/2923985135c8afcdae6392e5b810b62da7851276/allrank/models/model.py#L82