Coder Social home page Coder Social logo

Comments (6)

yao8839836 avatar yao8839836 commented on August 23, 2024

@batselem

Hi, thank you for reading the code, link_prediction gives the rank of every enity in correct (positive) test triples, so the labels are "1".

from kg-bert.

spacewalk01 avatar spacewalk01 commented on August 23, 2024

Thank you very much for a quick response!
Yes but tail_corrupt_list contains corrupted triples. How did you label them? As I skim through it, it looks like all the triples in tail_corrupt_list get "1" label.

Thank you.

from kg-bert.

spacewalk01 avatar spacewalk01 commented on August 23, 2024

Ah, even though they all get label "1", you only get the rank of the first triple which is the original correct triple: rank1 = np.where(argsort1 == 0)[0][0]
Am I correct? Thanks.

from kg-bert.

yao8839836 avatar yao8839836 commented on August 23, 2024

@batselem

Yes, all the triples in tail_corrupt_list get "1" label. This is inappropriate when writing the code,but only the "1" of the target postive tiple is used to obtain values (probability of being correct) of the target postive tiple and corrputed tiples.

        # get the dimension corresponding to current label 1 of all corrupted triples and the positive test triple
        rel_values = preds[:, all_label_ids[0]]

Here all_label_ids[0] is the label of the target positive triple.
The "1" of corrupted triples are not used in any computation, and the ranks should be correct.

from kg-bert.

spacewalk01 avatar spacewalk01 commented on August 23, 2024

I understand it, Thank you very much. Excellent work!

from kg-bert.

yao8839836 avatar yao8839836 commented on August 23, 2024

@batselem

Thank you!

from kg-bert.

Related Issues (20)

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.