-
Notifications
You must be signed in to change notification settings - Fork 1
/
example3.m
executable file
·41 lines (30 loc) · 1.21 KB
/
example3.m
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
% =======================================================================
% author: Xueqing Liu
% =======================================================================
% Chi Wang et al., Towards Interactive Construction of Topical Hierarchy: A
% Recursive Tensor Decomposition Approach, KDD 2015.
% =================================================
% Example 3: MER case 2: neither of t1 and t2 is their lca
% ==================================================
global vocabulary parentfolder datafolder
parentfolder = '.';
datafolder = 'data';
dataname = 'dblptitle';
path([parentfolder, '/DataProcess/readdata/'], path);
path([parentfolder, '/Library/'], path);
%LoadData;
%SetParameters;
t.tree = node([], [], [], '1', 1:size(vocabulary, 1));
EXP(t, [], 2, dwmat, options);
EXP(t, [1], 3, dwmat, options);
EXP(t, [2], 2, dwmat, options);
EXP(t, [1, 1], 2, dwmat, options);
EXP(t, [1, 2], 2, dwmat, options);
EXP(t, [1, 1, 1], 2, dwmat, options);
EXP(t, [1, 2, 1], 2, dwmat, options);
EXP(t, [1, 1, 1, 1], 2, dwmat, options);
MER(t, [1 2 1], [1, 1, 1, 1]);
fid = fopen([datafolder, '/', dataname '/tree.txt'], 'w');
DFSprint(t.tree, fid, '');
fclose(fid);