- Machine Learning ๐ค
- Counterfactual Learning ๐
- Information Retrieval ๐
rjagerman / shoelace Goto Github PK
View Code? Open in Web Editor NEWNeural Learning to Rank using Chainer
License: MIT License
Neural Learning to Rank using Chainer
License: MIT License
Hi, thanks for your library.
the accuracy of output example code, for listmle, listpl and listnet are the same. you computed ndcg in your article.
how did you compute ndcg?
Hi Rolf,
I'm reading your code about ListMLE loss and found that in LogCumsumExp the max is subtracted and added back later,
, what is the reason for doing that?Thx
-Yu
Hi,
Thank you for making your code available!
I was wondering if you could give me some directions for how to actually use the trained neural network for predicting query scores. That is, supose I have a training file where each line looks like this:
1 qid:25662 1:5.0 2:1.0 3:1.0
and I trained your model on it following your example code in README:
from shoelace.dataset import LtrDataset
from shoelace.iterator import LtrIterator
from shoelace.loss.listwise import listnet
from chainer import training, optimizers, links, Chain
from chainer.training import extensions
# Load data and set up iterator
with open('./path/to/ranksvm.txt', 'r') as f:
training_set = LtrDataset.load_txt(f)
training_iterator = LtrIterator(training_set, repeat=True, shuffle=True)
# Create neural network with chainer and apply loss function
predictor = links.Linear(None, 1)
class Ranker(Chain):
def __call__(self, x, t):
return listnet(self.predictor(x), t)
loss = Ranker(predictor=predictor)
# Build optimizer, updater and trainer
optimizer = optimizers.Adam()
optimizer.setup(loss)
updater = training.StandardUpdater(training_iterator, optimizer)
trainer = training.Trainer(updater, (40, 'epoch'))
trainer.extend(extensions.ProgressBar())
# Train neural network
trainer.run()
Now I have a test file where each line looks like this:
qid:34562 1:2.0 2:3.0 3:5.0
How do I use the trainer above to predict the query score?
Thanks very much!
Nowhere in the docs is the format of input dataset mentioned.
In what format should data be fed to the model?
Thank you?
Hey there, thanks for your library, it seems very useful. I noticed an issue with the docs located at:
https://rjagerman.github.io/shoelace/datasets.html
The section on datasets contains the snippet
`from shoelace.dataset import LtrIterator
iterator = LtrIterator(dataset)`
Which appears to contain an incorrect import statement, as LtrIterator is located in shoelace.iterator.
The Readme.MD contains the correct snippet.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.