DeepGraphLearning / graphvite

GraphVite: A General and High-performance Graph Embedding System
https://graphvite.io
Apache License 2.0
1.22k stars 151 forks source link

issue with entity_prediction #51

Closed gustavopuma closed 4 years ago

gustavopuma commented 4 years ago

I trained a model with the following graph:

Robert Hernandez,hasTechnology_Skills,Calendar and scheduling software Robert Hernandez,hasTechnology_Skills,Autodesk AutoCAD Robert Hernandez,hasTechnologySkills,Autodesk Revit Robert Hernandez,hasOccupation,Engineering Teachers Postsecondary Engineering Teachers_ Postsecondary,executeTechnologySkills,Finite element analysis software Engineering Teachers Postsecondary,executeTechnologySkills,The MathWorks MATLAB Engineering Teachers Postsecondary,executeTechnologySkills,Calendar and scheduling software Engineering Teachers Postsecondary,executeTechnologySkills,Autodesk AutoCAD Engineering Teachers Postsecondary,executeTechnologySkills,Autodesk Revit Engineering Teachers Postsecondary,executeTechnologySkills,Dassault Systemes CATIA Engineering Teachers Postsecondary,executeTechnologySkills,Dassault Systemes SolidWorks Engineering Teachers Postsecondary,executeTechnologySkills,PTC Creo Parametric Engineering Teachers Postsecondary,executeTechnologySkills,Computer aided manufacturing CAM software Engineering Teachers Postsecondary,executeTechnologySkills,Blackboard Learn Engineering Teachers Postsecondary,executeTechnologySkills,Course management system software Engineering Teachers Postsecondary,executeTechnologySkills,Desire2Learn Engineering Teachers Postsecondary,executeTechnologySkills,Learning management system LMS Engineering Teachers Postsecondary,executeTechnologySkills,Sakai CLE Engineering Teachers Postsecondary,executeTechnologySkills,Data entry software Engineering Teachers Postsecondary,executeTechnologySkills,Email software Engineering Teachers Postsecondary,executeTechnologySkills,Microsoft Outlook Engineering Teachers Postsecondary,executeTechnologySkills,DOC Cop Engineering Teachers Postsecondary,executeTechnologySkills,iParadigms Turnitin Engineering Teachers Postsecondary,executeTechnologySkills,Web browser software Engineering Teachers Postsecondary,executeTechnology_Skills,Microsoft Office

I receive predictions with Technology_Skills already related with the person Robert Hernandez but I expected receive predictions not related with him but related with the respective occupation, for example Data entry software its not related with the person but its related with his occupation so when I do : predictions = app1.entity_prediction(H=["Robert Hernandez"],R=["hasTechnology_Skills"],target="tail",k=25) I was expecting receive Data entry for example.

KiddoZhu commented 4 years ago

It's nature the model predicts existing facts, since it is trained to do so. You may set a sufficient large k, filter predictions overlapped with the training set, and get what you want.

gustavopuma commented 4 years ago

Could be very usefull if I pass a full triplet(H,R,T) , receive just the score related to this triplet as top 1. If I dont know the position into the rank I need to pass a very big k or do several predictions ultil find the the related relation I need.

KiddoZhu commented 4 years ago

You may call app.solver.predict(samples) for this purpose. See the document for details.

Note it's better to batch your predictions, i.e. call predict() once with many samples rather than call predict() many times.