NTMC-Community / MatchZoo

Facilitating the design, comparison and sharing of deep text matching models.
Apache License 2.0
3.85k stars 900 forks source link

How to get the predicted documents? #706

Closed datistiquo closed 5 years ago

datistiquo commented 5 years ago

I use the DRRM model with RankCrossEntropyLoss. The output values model.predict() are also negative. What are their meanings? And how do I get the predicted document IDs for an input query? I would like to map this output to the corresponding documents. It seems a bit different to classification?

Thanks.

datistiquo commented 5 years ago

If I have the output like:

prediction
array([[ 2.1248043 ],
       [-0.7405751 ],
       [ 1.2434225 ],], dtype=float32)

Is the order of this array the same like from the input? So If I want to predict one query with 3 docs:

query doc1 query doc2 query doc3

So the first predicted number 2.12 corresponds to doc1? For probabilities I would take the argmax but they are no probabilities?

@bwanglzu @yangliuy

bwanglzu commented 5 years ago

hi @datistiquo I'm not the person who designed this network, as far as I know, the final score (so called matching score) is produced by a term gathering network.

erarchical matching patterns and produce a matching score. Finally, the overall matching score is generated by aggregating the scores from each query term with a term gating network computing the aggregation weights.

So this model do not produce probability.

This is the place we try to make prediction, you can see that it's simply an interface of keras predict method. You prediction is made in order.

bwanglzu commented 5 years ago

@faneshion maybe you can elaberate a bit more on the result (negative values)?