-
Notifications
You must be signed in to change notification settings - Fork 1
/
TransE_model_allow_all_tails.html
52 lines (49 loc) · 5.03 KB
/
TransE_model_allow_all_tails.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module TransE_model_allow_all_tails</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>TransE_model_allow_all_tails</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/data/s6jetraj/Development/TEST/CBRF-FB13-/TransE_model_allow_all_tails.py">/data/s6jetraj/Development/TEST/CBRF-FB13-/TransE_model_allow_all_tails.py</a></font></td></tr></table>
<p><tt>@author: Jelena Trajkovic<br>
<br>
This python file is used to define methods <br>
needed for explanations generation, by using <br>
slightly adapted Polleti/Cozman model:<br>
allow model to predict best possible tails,<br>
and introduce composed relations.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="numpy.html">numpy</a><br>
</td><td width="25%" valign=top><a href="train_model.html">train_model</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-find_head_rel_in_dataset"><strong>find_head_rel_in_dataset</strong></a>(head, rel, dataset)</dt><dd><tt>returns the tails already present in the train dataset,<br>
for the given <head, rel> pair.</tt></dd></dl>
<dl><dt><a name="-get_embeddings"><strong>get_embeddings</strong></a>(relation, obj, model)</dt><dd><tt>returns the embeddings for the given relation and tail(obj).</tt></dd></dl>
<dl><dt><a name="-predict_best_possible_tails_TransE"><strong>predict_best_possible_tails_TransE</strong></a>(head, rel, dataset, model)</dt><dd><tt>returns the most plausible tails (top 3) for the given <head, rel> pair,<br>
predicted by TransE model.</tt></dd></dl>
<dl><dt><a name="-predict_best_possible_tails_TransE1"><strong>predict_best_possible_tails_TransE1</strong></a>(head, rel, dataset, model)</dt><dd><tt>returns the most plausible tails (top 1) for the given <head, rel> pair,<br>
predicted by TransE model.<br>
REMARK: The last three functions can be omitted, by writing just one<br>
which will take the number of tails as the argument.</tt></dd></dl>
<dl><dt><a name="-predict_best_possible_tails_TransE10"><strong>predict_best_possible_tails_TransE10</strong></a>(head, rel, dataset, model)</dt><dd><tt>returns the most plausible tails (top 10) for the given <head, rel> pair,<br>
predicted by TransE model.</tt></dd></dl>
<dl><dt><a name="-predict_best_possible_tails_TransE_for_composed_relation"><strong>predict_best_possible_tails_TransE_for_composed_relation</strong></a>(head, rel, dataset, model)</dt><dd><tt>returns the most plausible tails for the composed relation, by predicting the best<br>
possible tails for the first part of the composed relation, and then, for the tails<br>
predicted for the first part of the composed relation, using them as heads, predict<br>
the best possible tails by using the second part of the composed relation.</tt></dd></dl>
<dl><dt><a name="-predict_best_possible_tails_for_relations"><strong>predict_best_possible_tails_for_relations</strong></a>(head, relations, dataset, model)</dt><dd><tt>returns the best possible tails for head and given relations.</tt></dd></dl>
</td></tr></table>
</body></html>