summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/bjfuthesis/example/thesis.lyx
blob: 9c1ba84d643677fe951b4876fce1a969c00f4432 (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
#LyX 2.4 created this file. For more info see https://www.lyx.org/
\lyxformat 606
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass bjfuthesis
\begin_preamble

\end_preamble
\use_default_options false
\maintain_unincluded_children no
\language chinese-simplified
\language_package none
\inputencoding utf8
\fontencoding default
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts true
\font_sc false
\font_roman_osf false
\font_sans_osf false
\font_typewriter_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\float_placement class
\float_alignment class
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 0
\use_package cancel 0
\use_package esint 1
\use_package mathdots 0
\use_package mathtools 0
\use_package mhchem 0
\use_package stackrel 0
\use_package stmaryrd 0
\use_package undertilde 0
\cite_engine biblatex
\cite_engine_type authoryear
\biblio_style plain
\biblatex_bibstyle gb7714-2015
\biblatex_citestyle gb7714-2015
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\use_minted 0
\use_lineno 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tablestyle default
\tracking_changes false
\output_changes false
\change_bars false
\postpone_fragile_content false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\docbook_table_output 0
\end_header

\begin_body

\begin_layout Standard
\begin_inset External
	template PDFPages
	filename contents/cover.pdf
	extra LaTeX "pages=1"

\end_inset


\begin_inset Note Note
status open

\begin_layout Plain Layout

\backslash
newpage
\backslash
null
\backslash
thispagestyle{empty}
\backslash
newpage
\end_layout

\end_inset


\begin_inset External
	template PDFPages
	filename contents/statement-of-originality.pdf

\end_inset

 
\begin_inset External
	template PDFPages
	filename contents/mission-statement.pdf

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
frontmatter
\end_layout

\end_inset

 
\end_layout

\begin_layout Chapter*
摘要
\end_layout

\begin_layout Standard
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
begin{abstract}
\end_layout

\end_inset

 随着在线电影数量不断增加,用户选择电影的时间成本不断上升,准确的推荐算法成为了必然要求。为解决协同过滤推荐算法中的稀缺性问题与冷启动问题,研究人员用商品属性或
社交网络等信息来辅助推荐算法。现有的将知识图谱作为辅助信息的推荐算法包括基于嵌入的方法和基于路径的方法,但这两种方法均存在一些缺陷,没有充分有效地利用知识图谱中
的相关信息,推荐的准确度较低。
\end_layout

\begin_layout Standard
本文实现了基于知识图谱的“涟漪网络”推荐算法。“涟漪网络”算法的核心是利用现实生活中雨滴产生的涟漪在水面上不断扩散的思路,来模拟用户偏好的扩散。对于每一个用户,
涟漪网络将其过往偏好作为知识图谱中的一个种子集,然后沿知识图谱中的关系路径不断地拓展用户偏好,进而发现该用户对某个候选物品以等级划分的潜在兴趣,其中多个“涟漪”
重叠形成知识图谱中的用户偏好分布。该算法的实验结果和以往的CKE、DKN、PER等模型结果相比,表现出更优的性能。利用该算法,本文设计并实现了一个基于知识图谱的
电影推荐系统,该系统包括管理员用户和普通用户,管理员能新增、编辑和删除电影与用户,普通用户能浏览、收藏与购买电影。该系统可以高效准确地为用户推荐电影,方便用户选
择满足自己偏好的电影。 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
end{abstract}
\end_layout

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
keywordscn
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

知识图谱,推荐系统,涟漪网络,用户偏好,电影商店
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset

 
\end_layout

\begin_layout Chapter*
Abstract
\end_layout

\begin_layout Standard
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
begin{abstract}
\end_layout

\end_inset

 As the number of online movies continues to increase and the time cost
 for users to choose movies continues to rise, accurate recommendation algorithm
s have become an necessary requirement.
 In order to address the scarcity and cold start problem of collaborative
 filtering, researchers usually make use of side information, such as product
 attributes or social networks as side information to assist the recommendation.
 The existing recommendation algorithms that use knowledge graph as side
 information include embedding-based methods and path-based methods, but
 both methods have some shortcomings.
 They do not make full and effective use of the relevant information in
 the knowledge graph, and the accuracy of recommendation is relatively low.
\end_layout

\begin_layout Standard
This paper implements a recommendation algorithm, 
\begin_inset Quotes eld
\end_inset

Ripple Network
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

"
\end_layout

\end_inset

, based on knowledge graph.
 The core of the Ripple Network algorithm is to use the idea that the ripples
 produced by raindrops in real life continue to spread on the water surface
 to stimulate the spread of user preferences.
 For each user, Ripple Network uses its past preference as a seed set in
 the knowledge graph, and then continuously expands the user's preferences
 along the relationship path in the knowledge graph, and then discovers
 his hierarchical potential interests concerning a certain candidate item.
 Multiple 
\begin_inset Quotes eld
\end_inset

ripples
\begin_inset Quotes erd
\end_inset

 overlap to form the user preference distribution in the knowledge graph.
 Compared with previous model results of CKE, DKN, PER, etc., the experimental
 results of this algorithm show better performance.
 Using this algorithm, this paper designs and implements a recommendation
 system based on the movie knowledge graph.
 The system includes administrator users and general users.
 The administrator can add, edit and delete movies and users, and general
 users can browse, collect and purchase films.
 The system can provide users with an efficient movie recommendation function,
 which is convenient for users to choose movies that match their preferences.
 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
end{abstract}
\end_layout

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
keywordsen
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

knowledge graph, recommender system, ripple network, user preferences, movie
 store
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset

 
\begin_inset CommandInset toc
LatexCommand tableofcontents

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
mainmatter
\end_layout

\end_inset

 
\end_layout

\begin_layout Chapter
绪论
\end_layout

\begin_layout Section
研究背景与意义
\end_layout

\begin_layout Standard
一直以来,电影推荐都是在线流媒体播放平台发展中的一个重要问题,做好电影推荐可以使用户能在海量电影中选择满足其偏好的电影,提高用户满意度,从而提高在线流媒体播放平
台的流量转化率及购买率,并最终提高在线流媒体播放平台的经济收益。近年来,随着电影行业及互联网行业的不断发展,在线电影数量不断增加,用户在海量电影中选择满足其偏好
的电影的难度不断上升,性能优异的推荐算法成为了必然要求。自从在线流媒体播放平台出现以来,人们便开始尝试利用推荐算法来提高平台流量转化率,出现了诸如协同过滤的推荐
算法
\begin_inset CommandInset citation
LatexCommand cite
key "he2017neural"
literal "false"

\end_inset

。但这些算法未能解决数据稀缺性及冷启动问题,并不能为在线流媒体播放平台提供良好的推荐性能。为此,人们尝试将辅助信息融入推荐算法中以解决数据稀缺性及冷启动问题
\begin_inset CommandInset citation
LatexCommand cite
key "sun2017collaborative"
literal "false"

\end_inset

,并提高推荐性能。
\end_layout

\begin_layout Standard
知识图谱是一种结构化的语义知识库,被用于迅速提供对物理世界中的概念和相互关系的描述,为解决推荐问题提供了新的方法
\begin_inset CommandInset citation
LatexCommand cite
key "zou2020survey"
literal "false"

\end_inset

,近年来受到国内外研究人员的广泛关注,成为了当前的研究热点。知识图谱通过对复杂的原始数据进行加工、处理及整合,转化成简单可靠、清晰明了的“实体,关系,实体”三元
组,汇聚了大量的知识信息,从而能实现基于知识信息的响应和推理。
\end_layout

\begin_layout Standard
知识图谱常被用于作为辅助信息添加至推荐算法中以提高推荐的准确性,这已是当前的研究焦点。
\end_layout

\begin_layout Standard
近年来,随着在线流媒体播放平台的发展,电影推荐系统应运而生,它作为现代信息技术与传统电影产业相结合的产物,对流媒体播放平台的用户体验起着至关重要的作用,其可大幅
度减少用户寻找满足其偏好电影的时间,并提高用户点击率与购买率,从而提高流媒体播放平台的经济收益。电影推荐系统能为用户推荐其感兴趣的电影,而减少对用户不感兴趣内容
的显示,从而满足用户需求。但是,目前网络上绝大多数的电影推荐系统都使用传统的基于协同过滤的推荐算法,未能有效利用知识图谱等辅助信息,返回给用户的推荐结果中包含大
量用户不感兴趣的电影,此外,还将一些本应推荐给用户的、用户感兴趣的电影丢弃了。造成这一问题的主要原因是推荐算法缺少有关新加入的无用户评分的电影以及新注册的用户的
信息。
\end_layout

\begin_layout Standard
对于海量的电影数据,为了实现准确地推荐给用户其感兴趣的电影,基于协同过滤的传统推荐算法是满足了不用户需求的,特别是对新注册用户,推荐的准确度无法得到保证。所以,
本文旨在以知识图谱作为辅助信息,构建一个合适的电影推荐系统,并利用知识图谱中包含的丰富的辅助信息,最终实现一个电影推荐系统,为用户提供有效的、准确的电影推荐,从
而提高用户满意度,提高平台收益。 
\end_layout

\begin_layout Section
国内外研究现状
\end_layout

\begin_layout Subsection
推荐系统研究现状
\end_layout

\begin_layout Standard
推荐系统由Jussi Karlgren于哥伦比亚大学在一份技术报告中以“数字书架”的名称被首次提及,而后自1994年起被在SICS的Jussi
 Karlgren、由Pattie Maes于MIT领导的研究团队、位于Bellcore的Will Hill以及同样位于MIT的Paul Resnick大规模实
现并在技术性报告及出版物大量出现,以上人员与GroupLens的工作被授予了2010年ACM软件系统奖。
\end_layout

\begin_layout Standard
自从在90年代中期首批有关协同过滤的论文出现后推荐系统便成为了重要的研究领域。工业界与学术界出现了众多有关建设新的推荐系统的工作。由于该领域包含众多的研究问题及
其能帮助用户解决在过多信息中提供个性化推荐的实际应用,因此研究人员对该领域的兴趣依旧很高。
\end_layout

\begin_layout Standard
当前,推荐列表在推荐系统将其产生的过程中的方式主要有两种:基于内容推荐与协同过滤推荐
\begin_inset CommandInset citation
LatexCommand cite
key "jafarkarimi2012naive"
literal "false"

\end_inset

。基于内容推荐的算法使用一些有关物品的离散特征来推荐出拥有相似性的物品。协同过滤方法根据用户的历史行为(诸如其评价过的、点击过的、购买过的商品等)并与其他用户的
相似决策结合来建立模形,这种算法可以被用于预测用户对物品的偏好程度。这两种方法常常被同时使用。
\end_layout

\begin_layout Standard
此外,近来有越来越多的推荐算法被提出:多准则推荐系统。多准则推荐系统可以被定义为包含多标准偏好信息的推荐系统,而不是构建基于单一凭据的推荐系统。风险感知推荐系统
,现存推荐系统的主要方法聚焦于基于上下文信息推荐最相关内容给用户,而没有将不相关内容打扰用户的推荐风险考虑在内。考虑推送推荐内容给用户而造成打扰用户的风险在某些
情况下是需要考虑的,比如,在一个工作会议上或是在凌晨或是在晚上。而此类推荐算法为该问题提供了解决方案。
\end_layout

\begin_layout Standard
现实中,大量使用的往往是混合推荐系统。其同时结合了协同过滤、基于内容过滤以及其他方法,这种混合式的推荐方法现在被大量使用。混合推荐可以在多种方式下被实现:将基于
内容的和基于协同滤的预测模型被分开实现再将他们结合起来,亦或是将两种方法统一到同一模型中并一同实现。 
\end_layout

\begin_layout Subsection
知识图谱的研究现状
\end_layout

\begin_layout Standard
在知识表示与知识推理中,知识图谱是一个使用图结构的数据模型或拓扑结构的知识库。知识图谱常被用来存储基于内连接的对实体的描述——对象、事件、情形或抽象概念,并包括
自由形式的语义。
\end_layout

\begin_layout Standard
该词汇最早在1972年于一个有关构建模块化指令系统的课程中被提出。在80年代末,命名为知识图谱的项目主要聚焦于语义网络的设计。在2007年,DBpedia和Fr
eebase作为基于图的常识性知识库被创立。DBpedia致力于从Wikipedia中抽取数据,而Freebase也包含一系列公开的数据集。它们两者都未将自己称
为“知识图谱”,但实则构建并描述了有关知识图谱的相关概念。
\end_layout

\begin_layout Standard
在2012年,谷歌正式提出了知识图谱的概念
\begin_inset CommandInset citation
LatexCommand cite
key "singhal2012introducing"
literal "false"

\end_inset

,并构建了基于DBpedia和Freebase以及其他数据源的谷歌知识图谱。他们后来将包括CIA World Factbook, Wikidata和Wikipe
dia的网站的RDFa, Microdata, JSON-LD内容从它们的索引网站上抽取并纳入知识图谱。与知识图谱相关联的实体与关系类型使用来自scheme.or
g的术语被更广泛地组织了起来。
\end_layout

\begin_layout Standard
谷歌知识图谱中非常重要的一项是“自由库”,它是一个大型的协同工作知识库。“自由库”使用图结构作为其数据结构,可以将其视作一个有向图。谷歌知识图谱模型便是谷歌团队
利用其在“自由库”之上的技术积累开发出来的
\begin_inset CommandInset citation
LatexCommand cite
key "漆桂林2017知识图谱研究进展"
literal "false"

\end_inset

。
\end_layout

\begin_layout Standard
自此,数个大型跨国公司开始利用它们的知识图谱,很快知识图谱流行起来,有免费的知识图谱,如DBpedia和NELL,以及商业性质的知识图谱,如谷歌知识图谱和Mic
rosoft Satori。这些知识图谱被成功应用于问答系统、词向量嵌入与文字分类等。在2019年,IEEE将其关于“大数据”和“数据挖掘与智能计算”的年度国际
会议融入有关知识图谱的国际会议。
\end_layout

\begin_layout Standard
以上是知识图谱发展的主要进程。
\end_layout

\begin_layout Standard
知识图谱一般表示为三元组的形式,即
\begin_inset Formula $G=(h,r,t)$
\end_inset

,其中
\begin_inset Formula $G$
\end_inset

为知识图谱,
\begin_inset Formula $h$
\end_inset

和
\begin_inset Formula $t$
\end_inset

是知识库中的实体集合,分别为三元组的头结点与尾节点
\begin_inset CommandInset citation
LatexCommand cite
key "徐增林2016知识图谱技术综述"
literal "false"

\end_inset

。知识图谱也可以看作是一种结点对应实体、边对应关系的有向异构图。
\end_layout

\begin_layout Standard
目前知识图谱的构建过程中主要使用了定义层次学习及事实学习。
\end_layout

\begin_layout Standard
定义层次学习是通过使用机器学习等技术,从文字、图片等信息中提取知识表达中的定义,并确定其上下文信息。而知识图谱本质上是属于一种精炼的异构信息网络。利用定义层次学
习可以在一定程度上完成对于知识图谱的构建。
\end_layout

\begin_layout Standard
事实学习分为有监督的事实学习、半监督的事实学习以及无监督的事实学习。有监督的事实学习通过人为标注的语料信息输入以及深度学习方法来完成知识图谱的构建,而半监督的事
实学习方法使用启发式地自动标注文本,但缺陷是训练数据集中可能含有大量的噪声数据。而无监督的学习方法主要使用基于深度学习模型的自然语言处理(NLP)的方法,无须人
为干预,由训练模型自动完成信息抽取、信息整合。随着深度学习算法的发展,目前基于无监督的事实学习逐渐成为主流
\begin_inset CommandInset citation
LatexCommand cite
key "李涓子2017知识图谱研究综述"
literal "false"

\end_inset

。
\end_layout

\begin_layout Standard
目前出现了诸多使用以上理论方法设计的知识图谱嵌入算法:基于翻译的TransE
\begin_inset CommandInset citation
LatexCommand cite
key "bordes2013translating"
literal "false"

\end_inset

、TransH
\begin_inset CommandInset citation
LatexCommand cite
key "wang2014knowledge"
literal "false"

\end_inset

、TransR
\begin_inset CommandInset citation
LatexCommand cite
key "lin2017learning"
literal "false"

\end_inset

和基于语义分析的DistMult
\begin_inset CommandInset citation
LatexCommand cite
key "yang2014embedding"
literal "false"

\end_inset

等。
\end_layout

\begin_layout Standard
目前,知识图谱在业界的应用已经取得了巨大成功
\begin_inset CommandInset citation
LatexCommand cite
key "曹倩2015知识图谱的技术实现流程及相关应用"
literal "false"

\end_inset

:
\end_layout

\begin_layout Standard
(1)搜索引擎技术。如前所述,知识图谱最早便是由谷歌提出以改善其搜索引擎的。在将知识图谱应用于搜索引擎之后,搜索引擎能对一些常见的搜索内容基于其使用的知识图谱信
息快速给出搜索结果。同时,对于一些名词性的搜索内容,搜索引擎能使用知识图谱以知识卡片的形式给出其相关信息。研究表明,在谷歌将知识图谱技术融入其搜索引擎之后,用户
点击进入维基百科的次数明显减少,说明利用知识图谱技术的搜索引擎可以更好的直接给出用户需要的信息而不需要用户再浏览其他网站。
\end_layout

\begin_layout Standard
(2)智能问答。信息检索系统中非常常见的一种便是问答系统。问答系统在用户输入问题后能迅速给出用户需要的答案。而在将知识图谱技术应用于问答系统后,其回答的准确率有
非常大的提升。目前苹果的智能助理Siri以及谷歌的智能助理谷歌助理(Google Assistant)都使用了知识图谱技术。
\end_layout

\begin_layout Standard
此外,知识图谱还广泛应用于金融、医疗等多个领域。 
\end_layout

\begin_layout Subsection
基于知识图谱的推荐系统研究现状
\end_layout

\begin_layout Standard
由于传统的推荐系统无法解决稀缺性问题和冷启动问题,因此研究人员企图将辅助信息加入到推荐算法中以改善推荐性能。而这类辅助信息有社交网络、用户/物品属性、图像与上下
文等。
\end_layout

\begin_layout Standard
在数种类型的辅助信息中,知识图谱通常包含有更丰富的信息以及物品间的联系。图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:enhanced-recommendation"
plural "false"
caps "false"
noprefix "false"

\end_inset

中说明了知识图谱提供丰富的信息与物品间的连接,有利于提高推荐结果的准确性、多样性和可解释性。知识图谱可以从以下三个方面提高推荐性能: 
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename figures/enhanced-recommendation.png
	width 100text%

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

基于知识图谱的电影推荐系统
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

Knowledge graph enhanced movie recommendation system
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "fig:enhanced-recommendation"

\end_inset

 
\end_layout

\end_inset


\end_layout

\begin_layout Standard
(1)知识图谱引入了实体语义相关性,这可以帮助找到实体间潜在的联系并提高推荐物品的准确性。
\end_layout

\begin_layout Standard
(2)知识图谱由各种类型的关系构成,这对合理地扩展用户兴趣并增加推荐商品的多样性是有益的。
\end_layout

\begin_layout Standard
(3)知识图谱连接用户的历史记录及推荐的商品,因此提高了推荐系统的可解释性。
\end_layout

\begin_layout Standard
将知识图谱作为辅助信息加入至推荐系统中是当前的热点问题,目前基于知识图谱构建推荐系统的方法主要有以下几类:
\end_layout

\begin_layout Standard
(1)基于嵌入的方法。基于嵌入的方法通过知识图谱嵌入计算算法将知识图谱中的实体信息与关系信息映射为低维向量空间中的向量表示(嵌入表示)。而后推荐算法利用该嵌入表
示来完成相应的计算,并给出推荐结果。目前将知识图谱中嵌入表示信息作为辅助信息的推荐模型有CKE
\begin_inset CommandInset citation
LatexCommand cite
key "zhang2016collaborative"
literal "false"

\end_inset

、DKN
\begin_inset CommandInset citation
LatexCommand cite
key "wang2018dkn"
literal "false"

\end_inset

以及SHINE
\begin_inset CommandInset citation
LatexCommand cite
key "wang2018shine"
literal "false"

\end_inset

等。CKE是微软在 KDD2016 年发表的,其模型结构在原有系统过滤得到
\begin_inset Formula $U$
\end_inset

, 
\begin_inset Formula $V$
\end_inset

向量的基础上,将物品的嵌入与其他描述信息相结合,这些信息主要有: 采用 TransR 算法嵌入得到的知识图谱,图谱内每个实体嵌入表示被提取为物品的结构化向量信息
。 采用SDAE模型得到物品描述性文本的文本嵌入表示。 采用SCAE模型得到物品相关图像的视觉嵌入表示。DKN是之前同样由微软团队在WWW2018会议上发表的。
它是一个主要针对新闻推荐任务提出的框架,知识图谱用于辅助计算新闻标题的嵌入表示。DKN提出对新闻标题内每一个关键实体,在知识图谱内找到其实体嵌入和上下文嵌入。
 SHINE设计深度自编码器来嵌入语义网络,社交网络并进行推荐。其为用户-物品的交互使用自动编码器并计算用户感兴趣的概率。此外,嵌入表示可以包含实体的独热编码
\begin_inset CommandInset citation
LatexCommand cite
key "koren2008factorization"
literal "false"

\end_inset

、词汇集
\begin_inset CommandInset citation
LatexCommand cite
key "wang2018dkn"
literal "false"

\end_inset

、上下文信息
\begin_inset CommandInset citation
LatexCommand cite
key "sun2017collaborative"
literal "false"

\end_inset

或属性
\begin_inset CommandInset citation
LatexCommand cite
key "wang2018shine"
literal "false"

\end_inset

,而选择哪一种嵌入向量的计算方式取决于其应用场合。
\end_layout

\begin_layout Standard
(2)基于路径的方法。基于路径的方法将知识图谱作为异构信息网络,主要是通过知识图谱中的路径关系信息来辅助推荐算法完成推荐相关的计算工作。目前基于知识图谱中路径信
息的推荐模型有HIN
\begin_inset CommandInset citation
LatexCommand cite
key "zhao2017meta"
literal "false"

\end_inset

、RKGE
\begin_inset CommandInset citation
LatexCommand cite
key "sun2018recurrent"
literal "false"

\end_inset

等。HIN是2017年在KDD上提出的,与PER
\begin_inset CommandInset citation
LatexCommand cite
key "yu2014personalized"
literal "false"

\end_inset

类似,都将知识图谱作为异构信息网络。它针对Yelp和Amazon数据集分别设计了元路径,并得到了L个评估函数。并在建模时使用FM模型,使用FM损失函数组进行梯度
下降,并最终得到推荐结果。RKGE模型使用了基于循环神经网络的方法。在人为定义元路径并抽取出所有路径之后,对每种元路径都使用循环神经网络模型来抽取并推理其路径中
所包含的信息。
\end_layout

\begin_layout Standard
(3)混合式方法。基于嵌入的方法未能充分利用实体间的关系模式信息,而基于路径的方法仅考虑了实体间的语义连通信息,未能有效使用用户/物品本身的语义信息。因此,目前
出现了混合式方法,即同时结合了基于嵌入的方法与基于路径的方法的优点。混合式方法是当前的研究热点与焦点,使用该方法的典型模型有AKUPM
\begin_inset CommandInset citation
LatexCommand cite
key "tang2019akupm"
literal "false"

\end_inset

和RCoLM
\begin_inset CommandInset citation
LatexCommand cite
key "cao2019unifying"
literal "false"

\end_inset

等。AKUPM是通过注意力机制增强的推荐模型,RCoLM则是基于联合学习并以任务为导向的推荐算法。本文实现的电影推荐系统基于文献
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
parencite
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

wang2018ripplenet
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset

,其所使用的算法模型是也属于混合式方法。 
\end_layout

\begin_layout Section
本文的主要研究内容
\end_layout

\begin_layout Standard
本文在推荐算法、知识图谱和基于知识图谱的推荐算法的相关研究基础上,做了以下三方面的研究:
\end_layout

\begin_layout Standard
(1)对推荐系统所需的数据进行采集和处理,使用“MovieLens 1M Dataset”作为数据集,此外还从IMDb及豆瓣网爬取了相关电影数据并进行处理,作为
本文的研究对象。
\end_layout

\begin_layout Standard
(2)根据文献
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
parencite
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

wang2018ripplenet
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset

提出的算法,实现了基于知识图谱的涟漪网络推荐算法,此算法能根据用户的历史行为为用户进行电影推荐。不同于文献
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
parencite
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

wang2018ripplenet
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset

中仅使用用户评分计算用户偏好,本文在用户偏好的计算过程中还结合了用户收藏,这在一定程度上缓解了冷启动问题并改进了推荐性能。此外,将涟漪网络算法与其他基于知识图谱
的推荐算法(DKN
\begin_inset CommandInset citation
LatexCommand cite
key "wang2018dkn"
literal "false"

\end_inset

、CKE
\begin_inset CommandInset citation
LatexCommand cite
key "zhang2016collaborative"
literal "false"

\end_inset

 、PER
\begin_inset CommandInset citation
LatexCommand cite
key "yu2014personalized"
literal "false"

\end_inset

、SHINE
\begin_inset CommandInset citation
LatexCommand cite
key "wang2018shine"
literal "false"

\end_inset

、LibFM
\begin_inset CommandInset citation
LatexCommand cite
key "rendle2012factorization"
literal "false"

\end_inset

和Wide&Deep
\begin_inset CommandInset citation
LatexCommand cite
key "cheng2016wide"
literal "false"

\end_inset

等)进行了性能比较。
\end_layout

\begin_layout Standard
(3)实现了一个基于知识图谱的电影推荐系统,该系统能够根据用户的历史行为(评分、收藏等)来为用户进行电影推荐。该系统分为管理员、未登录用户、普通登录用户。管理员
能增加、修改和删除电影和普通用户;未登录用户能根据电影分类查看电影列表以及查看电影详情;普通登录用户除了能进行未登录用户的所有操作外,还能购买、收藏及为电影评分
。 
\end_layout

\begin_layout Section
论文结构
\end_layout

\begin_layout Standard
本论文一共分为五个章节。
\end_layout

\begin_layout Standard
第1章是绪论。简明介绍知识图谱作为辅助信息在推荐算法中的作用以及推荐算法对在线流媒体播放平台的作用,同时介绍了推荐系统、知识图谱和基于知识图谱的推荐系统的发展和
应用,并说明了本文的主要工作。
\end_layout

\begin_layout Standard
第2章是相关理论和技术。介绍了目前知识图谱和推荐系统的研究现状,并对传统的推荐算法与加入辅助信息的推荐算法作了较为细致的分类与阐述。同时还介绍了本文实现的电影推
荐系统所使用的技术栈,诸如数据库、前端架构、后端架构等。
\end_layout

\begin_layout Standard
第3章是涟漪网络。介绍了涟漪网络算法,以及计算相关实体嵌入的过程中使用的深度学习算法,并对以上算法进行了讨论。最后,还对涟漪网络推荐算法的准确度进行了测试。
\end_layout

\begin_layout Standard
第4章是电影推荐系统。介绍了以涟漪网络算法为基础构建的电影推荐系统:介绍了系统架构、系统功能、电影推荐流程以及如何保证该系统的安全性。
\end_layout

\begin_layout Standard
第5章是研究结论和展望。总结了涟漪网络算法的设计与实现、电影推荐系统的功能,并指出了其中可以改进的地方。 
\end_layout

\begin_layout Chapter
相关理论和技术
\end_layout

\begin_layout Section
知识图谱
\end_layout

\begin_layout Subsection
知识图谱的概念及发展进程
\end_layout

\begin_layout Standard
知识图谱,是一种知识可视化或知识领域映射地图,是显示知识发展进程与结构关系的一系列三元组(实体,关系,实体),用可视化技术描述知识信息及其载体,挖掘、分析、建立
、绘制和可视化知识以及实体之间的相互关系。
\end_layout

\begin_layout Standard
知识图谱是谷歌于2012年提出的,目的是为了增强其搜索引擎。而后微软于2013年7月发布了Microsoft Satori知识图谱。除传统搜索服务提供商之外,包
括Apple,Facebook,IBM等互联网企业也在探索该领域。此外,业界也出现了社区构建的开源知识图谱,如DBpedia,NELL和Wikidata等。以F
reebase、WordNet和GeneOntology等为例的知识图谱已成为支持人工智能相关应用的非常重要的资源。 
\end_layout

\begin_layout Subsection
知识图谱的构建方法
\end_layout

\begin_layout Standard
知识图谱是由多实体结点和不同关系边构成的多关系图,一个边是一个事实三元组(头结点,关系,尾结点),记为
\begin_inset Formula $(h,r,t)$
\end_inset

。而知识图谱的构建便是寻找这样的三元组。
\end_layout

\begin_layout Standard
在过去十年间,出现了诸多构建大型知识图谱的方法,然而,还没有清晰准确的构建知识图谱的范式。主要有两个困难:(1)知识图谱是符号化的逻辑系统而知识图谱的应用常常包
含在连续空间中的计算;(2)在一张知识图谱上进行知识聚合是困难的。
\end_layout

\begin_layout Standard
目前,知识图谱主要通过以下3个步骤来完成构建:
\end_layout

\begin_layout Standard
(1)信息抽取。即从各类型的源数据中抽取出实体(概念)、实体间的关系,并在此基础之上形成确切的知识表达。
\end_layout

\begin_layout Standard
(2)知识融合。对新获得的知识进行整合,以完成消歧义。
\end_layout

\begin_layout Standard
(3)知识加工。经过质量核查后将融合后的新知识的正确的部分加入至知识图谱中。 
\end_layout

\begin_layout Subsection
知识图谱的应用
\end_layout

\begin_layout Standard
知识图谱以更接近人类认知的方式为互联网的信息表达提供了一种新的方式,而且提供了一种更益于组织与利用海量数据的方式。当前知识图谱主要用于推荐系统、搜索引擎、个人助
理以及问答系统。 
\end_layout

\begin_layout Section
推荐系统
\end_layout

\begin_layout Standard
推荐系统是内容过滤系统的一个子集,被广泛使用于多个领域,它向用户推荐满足其偏好的物品,并通常具有为视频或音乐服务生成推荐清单的表现形式。 
\end_layout

\begin_layout Subsection
传统的推荐系统
\end_layout

\begin_layout Standard
传统的推荐系统主要分为基于内容的推荐系统、基于协同过滤的推荐系统和混合推荐系统
\begin_inset CommandInset citation
LatexCommand cite
key "黄立威2018基于深度学习的推荐系统研究综述"
literal "false"

\end_inset

。基于内容的推荐系统主要用于文本相关的项目,因为内容常常是使用关键字来描述的。该算法通过计算相关物品的离散特征,然后推荐具有与用户历史偏好物品类似特征的有关物品
。基于协同过滤的推荐系统主要通过将具有与目标用户相似特征的用户所交互过的物品推荐给目标用户。
\end_layout

\begin_layout Standard
基于内容的推荐与基于协同过滤的推荐的有关区别可以通过比较两个流行音乐推荐系统的实现方式看出。(1)潘多拉音乐使用一个基于内容推荐的推荐算法。它根据艺人或歌曲的属
性来生成一个包含相似风格歌曲的电台,并且该电台的内容会根据收听用户的反馈进行调整。当用户对一首歌曲“不感兴趣”时该算法将弱化该歌曲的一些属性;而当用户喜欢一首歌
曲时,将强化一些属性。并且该算法会根据该属性调整歌曲的顺序,若属性的值越过一个阀值时推荐算法便将某一歌曲从列表中删除。(2)“终级fm”使用协同过滤的推荐算法。
它记录用户经常收听的乐队和歌手,然后与其它用户的有关行为进行比较,建立一个电台,并以此推荐歌曲。“终级fm”会给用户推荐其他具有相似特征用户的播放列表(并保证目
标用户未收听过)。
\end_layout

\begin_layout Standard
基于内容的推荐与基于协同过滤的推荐各有优缺点。潘多拉音乐所使用的基于内容推荐的推荐算法是根据物品本身的性质来进行推荐的,因此不需要用户信息就可以有较好的准确度。
但该算法严重依赖物品本身的特性,因此局限性较大,推荐的内容都是与种子集相关的,推荐结果的多样性较低。而“终级fm”使用的协同过滤算法需要根据用户与物品的交互来生
成推荐结果,因此需要大量的用户数据,存在数据稀缺性问题与冷启动问题。 
\end_layout

\begin_layout Subsection
基于知识图谱的推荐系统
\end_layout

\begin_layout Standard
基于内容推荐与协同过滤推荐两者均存在一些局限性,为了提高推荐的准确性,解决传统推荐算法的数据稀缺性与冷启动问题,研究者将一些辅助信息加入至推荐算法中,通常这些辅
助信息包括上下文信息、用户或物品的属性、图片和社交网络
\begin_inset CommandInset citation
LatexCommand cite
key "常亮2019知识图谱的推荐系统综述,秦川2020基于知识图谱的推荐系统研究综述"
literal "false"

\end_inset

。
\end_layout

\begin_layout Standard
而随着知识图谱的发展,将知识图谱作为辅助信息来提高推荐系统的性能已经成为了热门的研究方向。将知识图谱作为辅助信息加入推荐算法的优点有:
\end_layout

\begin_layout Standard
(1)提高推荐系统的准确性。知识图谱可以表示不同实体间的关系,可以将物品及其相关属性对应于知识图谱之中,从而推荐算法可以理解物品之间的关系。此外,用户与用户间的
关系信息也可以映射至知识图谱之中,从而推荐算法可以更准确地分析物品与物品间的关系、用户与物品之间的关系。
\end_layout

\begin_layout Standard
(2)提高推荐系统的可解释性。由于推荐结果依照知识图谱中的关系信息,因此可以由知识图谱中的关系路径得到推荐系统给出推荐结果的原因。
\end_layout

\begin_layout Standard
目前主要的基于知识图谱的推荐算法有基于嵌入的方法、基于路径的方法以及混合式方法:
\end_layout

\begin_layout Standard
(1)基于嵌入的方法。基于嵌入的方法使用知识图谱的信息来完善实体的嵌入表示。为了将知识图谱中的信息添加至推荐算法中来辅助推荐,需要使用知识图谱嵌入表示算法(Kn
owledge Graph Embedding, KGE)表计算实体嵌入(实体嵌入指由知识图谱中的信息得到的在低维向量空间中的向量表示)。KGE算法有Trans
E
\begin_inset CommandInset citation
LatexCommand cite
key "bordes2013translating"
literal "false"

\end_inset

、TransH
\begin_inset CommandInset citation
LatexCommand cite
key "wang2014knowledge"
literal "false"

\end_inset

、TransR
\begin_inset CommandInset citation
LatexCommand cite
key "lin2017learning"
literal "false"

\end_inset

和DistMult
\begin_inset CommandInset citation
LatexCommand cite
key "yang2014embedding"
literal "false"

\end_inset

等。而推荐算法利用该嵌入表示来进行相关计算,从而对用户进行物品推荐。
\end_layout

\begin_layout Standard
(2)基于路径的方法
\begin_inset CommandInset citation
LatexCommand cite
key "lin2015modeling,guu2015traversing,toutanova2016compositional"
literal "false"

\end_inset

。基于路径的方法将知识图谱视为异构信息网络。而推荐系统利用该异构信息网络寻找实体间的关系,从而完成推荐。
\end_layout

\begin_layout Standard
(3)混合式方法。基于嵌入的方法未能充分利用实体间的关系模式信息,而基于路径的方法仅考虑了实体间的语义连通信息,未能有效利用用户/物品本身的语义信息。混合式方法
结合了基于嵌入的方法与基于路径的方法的优点,该方法是当前的研究热点与焦点,使用该方法的典型模型有AKUPM
\begin_inset CommandInset citation
LatexCommand cite
key "tang2019akupm"
literal "false"

\end_inset

和RCoLM
\begin_inset CommandInset citation
LatexCommand cite
key "cao2019unifying"
literal "false"

\end_inset

等。本文实现的算法属于混合方法。 
\end_layout

\begin_layout Section
系统开发技术
\end_layout

\begin_layout Standard
\begin_inset CommandInset label
LatexCommand label
name "sec:tech-stack"

\end_inset

 
\end_layout

\begin_layout Subsection
数据采集技术
\end_layout

\begin_layout Standard
电影推荐系统使用的数据来自“MovieLens 1M Dataset”
\begin_inset Foot
status collapsed

\begin_layout Plain Layout
https://grouplens.org/datasets/movielens/1m/
\end_layout

\end_inset

数据集,此外还从IMDb
\begin_inset Foot
status collapsed

\begin_layout Plain Layout
https://www.imdb.com/
\end_layout

\end_inset

及豆瓣网
\begin_inset Foot
status collapsed

\begin_layout Plain Layout
https://www.douban.com/
\end_layout

\end_inset

爬取了相关电影数据并进行处理作为本文的研究对象。
\end_layout

\begin_layout Standard
在数据采集的过程中,使用Scrapy框架进行了数据爬取,爬取的数据包括电影名称、电影封面、预告片图片、电景情节介绍、导演、演员以及剧作家。
\end_layout

\begin_layout Standard
最终,总计爬取了3684部电影的数据。其中,从IMDb爬取了3494条电影数据,从豆瓣爬取了190条电影数据(由于豆瓣网限制了每IP访问量故爬取的数据较少)。
 
\end_layout

\begin_layout Subsection
数据存储技术
\end_layout

\begin_layout Standard
本系统使用MongoDB与Neo4j存储数据。
\end_layout

\begin_layout Standard
\noindent
(1)MongoDB
\end_layout

\begin_layout Standard
MongoDB是一个新兴的非关系型存储的分布式存储数据的数据库,属于NoSQL,与MySQL等传统的关系型数据库相比,它提供更好的高并发支持,具有高可靠性的优点
。与此同时,得益于其基于文档储存的特点,相比较传统的关系型数据库,它的存储结构更灵活。
\end_layout

\begin_layout Standard
在本系统中,MongoDB存储普通用户数据、管理员数据、电影数据等。
\end_layout

\begin_layout Standard
\noindent
(2)Neo4j
\end_layout

\begin_layout Standard
Neo4j是一个具有高性能的图数据库,它将结构化的数据信息储存在网络上而不是存储在表中。它具有健壮和成熟的数据库的所有特点。虽然Neo4j是一个新兴的数据库,但
它已在具有超过1亿节点、关系和属性的产品中得到了应用,充分体现了其高性能、高可靠性的特点。
\end_layout

\begin_layout Standard
在本系统中,最终需存储的图结点有182011个,需存储的边有1241995条。如果将它们存储在传统的关系型数据库中,会因大量的连接查询导致极大的性能开销,表现为
查询耗时久。Neo4j对图数据处理做了优化,因此查询等操作可以在较短的时间内完成,故本系统将知识图谱数据存储在Neo4j中而不是关系型数据库中。
\end_layout

\begin_layout Subsection
后端技术
\end_layout

\begin_layout Standard
本系统使用Flask框架作为网站后端框架。Flask是一个Python编写的轻量级微框架。它具有轻量、便捷、可扩展等特点。系统使用Flask框架充分利用了其便捷
、可扩展以及开发便捷的特点,与本系统要求相符。
\end_layout

\begin_layout Standard
系统使用表现层状态转换(REST)风格的应用程序接口(API)作为前后端的交互接口。表现层状态转换(Representational State
 Transfer,REST)是一种基于HTTP协议的软件交互体系结构样式,该协议是由Roy Thomas Fielding博士在2000年的博士论文中引用的
\begin_inset CommandInset citation
LatexCommand cite
key "fielding2000architectural"
literal "false"

\end_inset

,目的是促进不同的软件/程序的开发。在网络上互相传输数据。表示层状态转换基于超文本传输​​协议(HTTP)的一组约束,该协议是一种旨在提供万维网服务的软件构造样
式。符合或兼容此体系结构样式(简称为REST或RESTful)的网络服务允许客户端发出使用统一资源标识符访问和操作网络资源的请求,这些资源与一组预定义的操作一致
。因此,表示层状态转换提供了Internet上计算机系统之间相互使用资源的互操作性。与其他类型的网络服务(例如SOAP服务)相比,它们使用自己定义的一组操作来访
问网络资源。
\end_layout

\begin_layout Standard
得益于本系统使用了REST风格的API,本系统能更有效地使用缓存来提升响应速度,同时前后端间的通讯的无状态性可以让不同的服务器处理一连串请求中不同的请求,提高了
本系统的可扩展性。与此同时,得益于REST风格语义化的接口,使前后端交互接口更清晰明了,使接口的使用者能更高效便捷地进行相关的开发工作。 
\end_layout

\begin_layout Subsection
前端技术
\end_layout

\begin_layout Standard
本系统前端使用Angular框架。Angular(通常指“Angular 2+”或“Angular v2及以上”)是一个基于TypeScript的开源网络应用框
架,它的开发由Google的Angular团队领导同时也有个人及其他公司维护。Angular完全从相同团队开发的AngularJS重新编写而来。Angular常
常作为MEAN技术栈的一部分。MEAN技术栈指MongoDB数据库、Express.js网络服务器框架、Angular/AngularJS以及Node.js服务器运
行时。不同于MEAN技术栈,本系统将其中的“E”(指Express.js网络服务器框架)替换为了Flask网络服务器框架。
\end_layout

\begin_layout Standard
通过使用Angular框架,本系统具有一个现代化、模块化、响应式的网页架构。同时借助于Angular Material Components官方组件库,本系统前
端UI符合材料设计(Material Design)。 
\end_layout

\begin_layout Chapter
基于涟漪网络知识图谱的推荐算法
\end_layout

\begin_layout Standard
\begin_inset CommandInset label
LatexCommand label
name "ch:offline-recommendation"

\end_inset

 
\end_layout

\begin_layout Section
涟漪网络
\end_layout

\begin_layout Standard
本算法基于文献
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
parencite
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

wang2018ripplenet
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset

实现,并在其基础上进行了一定的改进:文献
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
parencite
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

wang2018ripplenet
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset

中计算用户偏好时并未考虑用户收藏,本文在计算用户偏好时,将用户收藏考虑在内,这在一定程度上缓解了数据稀缺性问题和冷启动问题并改进了推荐性能。 
\end_layout

\begin_layout Subsection
架构
\end_layout

\begin_layout Standard
涟漪网络的总体架构如图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:ripplenet-framework"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示,图上方的知识图谱中展示了由用户交互产生的涟漪。涟漪网络以一个用户
\begin_inset Formula $u$
\end_inset

和一个电影
\begin_inset Formula $v$
\end_inset

作为输入,并输出用户
\begin_inset Formula $u$
\end_inset

与电影
\begin_inset Formula $v$
\end_inset

之间产生交互的概率。对输入用户
\begin_inset Formula $u$
\end_inset

而言,其历史交互记录
\begin_inset Formula $V_{u}$
\end_inset

是知识图谱中的种子集,而后沿着知识图谱中的关系边形成多个涟漪集
\begin_inset Formula $S_{u}^{k}\ (k=1,2,\dots,H)$
\end_inset

。第
\begin_inset Formula $k$
\end_inset

个涟漪集是种子集
\begin_inset Formula $V_{u}$
\end_inset

经过
\begin_inset Formula $k$
\end_inset

跳得到的知识三元组。然后迭代地利用这些涟漪集与电影
\begin_inset Formula $v$
\end_inset

的嵌入表示(黄色的块)计算出用户
\begin_inset Formula $u$
\end_inset

对电影
\begin_inset Formula $v$
\end_inset

的的响应(绿色的块),最后结合得到用户的最终嵌入表示(灰色的块)。最终,利用用户
\begin_inset Formula $u$
\end_inset

与电影
\begin_inset Formula $v$
\end_inset

的嵌入表示计算出用户
\begin_inset Formula $u$
\end_inset

对电影
\begin_inset Formula $v$
\end_inset

感兴趣的预测概率
\begin_inset Formula $y_{uv}$
\end_inset

。 
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename figures/ripplenet-framework.png
	width 100text%

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

涟漪网络的总体架构
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

The overall framework of the Ripple Network
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "fig:ripplenet-framework"

\end_inset

 
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
涟漪集
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename figures/illustration-of-ripple-sets.png
	width 100text%

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

电影知识图谱中由“阿甘正传”激发的涟漪集
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

Sets of ripples of “Forest Gump” in Knowledge Graph of movies
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "fig:illustration-of-ripple-sets"

\end_inset

 
\end_layout

\end_inset


\end_layout

\begin_layout Standard
知识图谱常常含有丰富的事实信息与实体间的联系。比如,图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:illustration-of-ripple-sets"
plural "false"
caps "false"
noprefix "false"

\end_inset

(图中不同颜色的圆圈表示不同跳数的涟漪集,越浅的蓝色代表种子集与该区域内实体的关联程度越低)中电影“阿甘正传”与“罗伯特·泽米吉斯”相连,它们之间的联系为“罗伯
特·泽米吉斯”是电影“阿甘正传”的导演。而“回到未来”也与“罗伯特·泽米吉斯”相连。因此,如果一个用户与电影“阿甘正传”交互过,则他很有可能也对“回到未来”感兴
趣。为了描述用户在知识图谱中分层次的潜在偏好集,递归定义用户
\begin_inset Formula $u$
\end_inset

的
\begin_inset Formula $k$
\end_inset

跳相关实体如下:
\end_layout

\begin_layout Standard

\series bold
定义1(相关实体集)
\series default
 给定交互矩阵
\begin_inset Formula $\Upsilon$
\end_inset

与知识图谱
\begin_inset Formula $G$
\end_inset

,则用户
\begin_inset Formula $u$
\end_inset

的
\begin_inset Formula $k$
\end_inset

跳相关实体集的定义为式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:relevant-entities"
plural "false"
caps "false"
noprefix "false"

\end_inset

。
\end_layout

\begin_layout Standard
\begin_inset Formula 
\begin{equation}
E_{u}^{k}=\{t|(h,r,t)\in G\text{且}h\in E_{u}^{k-1}\},k=1,2,\dots,H\label{eq:relevant-entities}
\end{equation}

\end_inset


\end_layout

\begin_layout Standard
式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:relevant-entities"
plural "false"
caps "false"
noprefix "false"

\end_inset

中,
\begin_inset Formula $E_{u}^{0}=V_{u}=\{v|y_{uv}=1\}$
\end_inset

是用户的历史偏好集(历史偏好集是指用户在最高为5的评分中给出的评分
\begin_inset Formula $\geqslant$
\end_inset

4的物品以及用户已加入收藏的物品),可以看作是用户
\begin_inset Formula $u$
\end_inset

在知识图谱中的种子集。
\end_layout

\begin_layout Standard
相关实体集可以看作是用户的历史偏好集在知识图谱中的自然扩展。给定相关实体集的定义,以下定义用户
\begin_inset Formula $u$
\end_inset

的
\begin_inset Formula $k$
\end_inset

跳涟漪集:
\end_layout

\begin_layout Standard

\series bold
定义2(涟漪集)
\series default
用户
\begin_inset Formula $u$
\end_inset

的
\begin_inset Formula $k$
\end_inset

跳涟漪集可以看作是知识图谱中以
\begin_inset Formula $E_{u}^{k-1}$
\end_inset

为起点的知识三元组,定义如式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:ripple-set"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示。
\end_layout

\begin_layout Standard
\begin_inset Formula 
\begin{equation}
S_{u}^{k}=\{(h,r,t)|(h,r,t)\in G\text{且}h\in E_{u}^{k-1}\},k=1,2,\dots,H\label{eq:ripple-set}
\end{equation}

\end_inset


\end_layout

\begin_layout Standard
“涟漪”这个词有两重意思:(1)对由多个雨点产生的真实涟漪的模拟,用户对电影的潜在兴趣集在知识图谱中由近及远地传递。这一过程如图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:illustration-of-ripple-sets"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示。(2)用户的潜在兴趣随着知识图谱中传递的跳数
\begin_inset Formula $k$
\end_inset

的增大逐渐递减。图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:illustration-of-ripple-sets"
plural "false"
caps "false"
noprefix "false"

\end_inset

中蓝色的变浅显示了潜在兴趣递减的过程。
\end_layout

\begin_layout Standard
一个可能出现的问题是在跳数
\begin_inset Formula $k$
\end_inset

增加的过程中涟漪集的大小可能过大。为了解决这个问题,注意到:
\end_layout

\begin_layout Standard
(1)在真实使用的知识图谱中大量的实体是沉没实体,意思是它们只有传入链路而没有传出链路。
\end_layout

\begin_layout Standard
(2)在电影推荐的具体情境下,关系可以限制在情境相关的分类中以减少涟漪集的数量并提高实体间的相关度。
\end_layout

\begin_layout Standard
(3)最大跳数
\begin_inset Formula $H$
\end_inset

通常在实际应用中不会过大,因为离用户历史偏好集较远的实体会带来更多的错误推荐而不是更丰富的推荐结果。
\end_layout

\begin_layout Standard
(4)在涟漪网络中,我们可以对一个固定大小的邻集而不是对完整的涟漪集采样从而更进一步地减小计算工作量。设计这样的采样器是一个重要的工作,尤其是非统一的采样器能更
好地捕获用户的分等级的潜在兴趣。 
\end_layout

\begin_layout Subsection
偏好扩散
\end_layout

\begin_layout Standard
\begin_inset CommandInset label
LatexCommand label
name "sec:osum"

\end_inset

 传统的协同过滤算法是通过学习用户与物品间的潜在联系来完成推荐,而在涟漪网络算法中,这一过程是通过偏好扩散完成的:对每个用户,涟漪网络将他的过往兴趣视为知识图谱
中的种子集,然后沿知识图谱中的路径不断地拓展用户的潜在兴趣集,进而得到按等级划分的关于候选物品的潜在兴趣集。我们利用现实生活中的由雨滴产生的涟漪在水面上扩散来模
拟偏好扩散的过程,其中多个“涟漪”重叠形成基于知识图谱的用户偏好分布。
\end_layout

\begin_layout Standard
如图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:ripplenet-framework"
plural "false"
caps "false"
noprefix "false"

\end_inset

,每部电影都有一个嵌入表示
\begin_inset Formula $v$
\end_inset

,
\begin_inset Formula $v\in\mathbb{R}^{d}$
\end_inset

,其中
\begin_inset Formula $\mathbb{R}$
\end_inset

是实数集,
\begin_inset Formula $d$
\end_inset

是嵌入表示向量的维数。给定电影的嵌入表示
\begin_inset Formula $v$
\end_inset

以及用户
\begin_inset Formula $1$
\end_inset

跳涟漪集
\begin_inset Formula $S_{u}^{1}$
\end_inset

,可以利用电影
\begin_inset Formula $v$
\end_inset

、
\begin_inset Formula $S_{u}^{1}$
\end_inset

中的三元组中头节点
\begin_inset Formula $head_{i}$
\end_inset

以及该三元组中的关系
\begin_inset Formula $r_{i}$
\end_inset

来计算出电影
\begin_inset Formula $v$
\end_inset

和实体
\begin_inset Formula $head_{i}$
\end_inset

之间的相关度,如式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:item-entity-relevance"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示。
\end_layout

\begin_layout Standard
\begin_inset Formula 
\begin{equation}
p_{i}=softmax(v^{T}R_{i}h_{i})=\frac{exp(v^{T}R_{i}h_{i})}{\sum_{(h,r,t)\in S_{u}^{1}}exp(v^{T}Rh)}\label{eq:item-entity-relevance}
\end{equation}

\end_inset


\end_layout

\begin_layout Standard
式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:item-entity-relevance"
plural "false"
caps "false"
noprefix "false"

\end_inset

中,
\begin_inset Formula $R_{i}\in\mathbb{R}^{d\times d}$
\end_inset

与
\begin_inset Formula $h_{i}\in\mathbb{R}^{d}$
\end_inset

分别是关系
\begin_inset Formula $r_{i}$
\end_inset

和头节点
\begin_inset Formula $h_{i}$
\end_inset

的嵌入表示。相关度
\begin_inset Formula $p_{i}$
\end_inset

为向量空间
\begin_inset Formula $R_{i}$
\end_inset

中的电影
\begin_inset Formula $v$
\end_inset

与实体
\begin_inset Formula $h_{i}$
\end_inset

之间的相似度。同时还考虑了关系信息的嵌入表示矩阵在计算电影
\begin_inset Formula $v$
\end_inset

与实体
\begin_inset Formula $h_{i}$
\end_inset

之间的相似度,因为不同电影-实体对之间的相似度在不同关系的场景下可能有所不同。比如,“阿甘正传”与“回到未来”在导演方面有很高的相似度,但它们在体裁或剧作家方面
可能没有联系。
\end_layout

\begin_layout Standard
在完成相似度计算之后,将
\begin_inset Formula $S_{u}^{1}$
\end_inset

中三元组的尾节点根据计算得到的相似度进行加权求和,得到向量
\begin_inset Formula $o_{u}^{1}$
\end_inset

,如式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:o1"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示。
\end_layout

\begin_layout Standard
\begin_inset Formula 
\begin{equation}
o_{u}^{1}=\sum_{(h_{i},r_{i},t_{i})\in S_{u}^{1}}p_{i}t_{i}\label{eq:o1}
\end{equation}

\end_inset


\end_layout

\begin_layout Standard
式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:o1"
plural "false"
caps "false"
noprefix "false"

\end_inset

中,
\begin_inset Formula $t_{i}\in\mathbb{R}^{d}$
\end_inset

,
\begin_inset Formula $t_{i}$
\end_inset

是事实三元组中的尾节点。向量
\begin_inset Formula $o_{u}^{1}$
\end_inset

可以视为用户偏好集
\begin_inset Formula $V_{u}$
\end_inset

关于电影
\begin_inset Formula $v$
\end_inset

的
\begin_inset Formula $1$
\end_inset

次响应。与协同过滤算法类似的是,它根据用户交互过的物品来表示用户嵌入而不是使用单独的参数来表示用户,从而减少了参数数量。通过式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:item-entity-relevance"
plural "false"
caps "false"
noprefix "false"

\end_inset

与式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:o1"
plural "false"
caps "false"
noprefix "false"

\end_inset

,用户的偏好从其交互过的电影(即种子集)成功在知识图谱中进行了一次扩散,这称为涟漪网络中的偏好扩散。
\end_layout

\begin_layout Standard
可以将式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:item-entity-relevance"
plural "false"
caps "false"
noprefix "false"

\end_inset

中的
\begin_inset Formula $v$
\end_inset

替换为
\begin_inset Formula $o_{u}^{1}$
\end_inset

,我们可以再次进行偏好扩散以得到用户的2次响应
\begin_inset Formula $o_{u}^{2}$
\end_inset

。以此类推,最终我们可以将该用户的偏好集扩散至
\begin_inset Formula $H$
\end_inset

跳,得到用户的涟漪集
\begin_inset Formula $S_{u}^{i},i=1,\dots,H$
\end_inset

。从中可以得到用户的多次响应
\begin_inset Formula $o_{u}^{1},o_{u}^{2},o_{u}^{H}$
\end_inset

。用户
\begin_inset Formula $u$
\end_inset

关于电影
\begin_inset Formula $v$
\end_inset

的嵌入表示是通过结合所有的不同响应并计算得到的,如式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:osum"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示。 
\begin_inset Formula 
\begin{equation}
u=o_{u}^{1}+o_{u}^{2}+\dots+o_{u}^{H}\label{eq:osum}
\end{equation}

\end_inset


\end_layout

\begin_layout Standard
尽管最后一跳的用户响应中理论上包含了所有之前得到的信息,但是对
\begin_inset Formula $o_{u}^{k}$
\end_inset

进行求和仍然是有必要的,因为之前得到的用户响应可能在偏好传递的过程中稀释了,因此仅使用最后一跳的响应不能很好地表示用户嵌入。最终,利用用户嵌入与电影嵌入,计算出
用户对电影感兴趣的概率,如式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:predicted-possibility"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示。 
\begin_inset Formula 
\begin{equation}
y_{uv}=\zeta(u^{T}v)\label{eq:predicted-possibility}
\end{equation}

\end_inset


\end_layout

\begin_layout Standard
其中,
\begin_inset Formula $\zeta(x)=\frac{1}{1+exp(-x)}$
\end_inset

是sigmoid函数。 
\end_layout

\begin_layout Section
学习算法
\end_layout

\begin_layout Standard
在涟漪网络算法中,我们的目标是通过式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:predicted-possibility"
plural "false"
caps "false"
noprefix "false"

\end_inset

求出用户对电影感兴趣的概率。但是,为了将其计算出来我们需要先求出所有物品、用户以及关系的嵌入表示,如第
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:osum"
plural "false"
caps "false"
noprefix "false"

\end_inset

节中所述,用户的嵌入表示可以通过其涟漪集来代替,以此消元。但物品及关系的嵌入表示却是需要求出来的。
\end_layout

\begin_layout Standard
为了求出物品及关系的嵌入表示,这里使用最大后验概率估计的方法。
\end_layout

\begin_layout Standard
我们的目标是在已经得到知识图谱
\begin_inset Formula $G$
\end_inset

以及用户与电影的交互矩阵
\begin_inset Formula $\Upsilon$
\end_inset

的情况下最大化模型参数
\begin_inset Formula $\Gamma$
\end_inset

,如式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:max"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示。 
\begin_inset Formula 
\begin{equation}
max\ p(\Gamma|G,\Upsilon)\label{eq:max}
\end{equation}

\end_inset


\end_layout

\begin_layout Standard
式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:max"
plural "false"
caps "false"
noprefix "false"

\end_inset

中,参数
\begin_inset Formula $\Gamma$
\end_inset

包含了全部的实体、关系和电影的嵌入表示。可以将式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:max"
plural "false"
caps "false"
noprefix "false"

\end_inset

等价于最大化式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:equal-max"
plural "false"
caps "false"
noprefix "false"

\end_inset

。
\end_layout

\begin_layout Standard
\begin_inset Formula 
\begin{equation}
p(\Gamma|G,\Upsilon)=\frac{p(\Gamma,G,\Upsilon)}{p(G,\Upsilon)}\varpropto p(\Gamma)\centerdot p(G|\Gamma)\centerdot p(\Upsilon|\Gamma,G)\label{eq:equal-max}
\end{equation}

\end_inset


\end_layout

\begin_layout Standard
根据贝叶斯公式,在式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:equal-max"
plural "false"
caps "false"
noprefix "false"

\end_inset

中,第一项
\begin_inset Formula $p(\Gamma)$
\end_inset

代表模型参数的先验概率。设
\begin_inset Formula $p(\Gamma)$
\end_inset

为均值为0,方差为对角协方差矩阵的正态分布,如式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:normal-distribution"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示。
\end_layout

\begin_layout Standard
\begin_inset Formula 
\begin{equation}
p(\Gamma)=N(0,\lambda_{1}^{-1}I)\label{eq:normal-distribution}
\end{equation}

\end_inset


\end_layout

\begin_layout Standard
式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:equal-max"
plural "false"
caps "false"
noprefix "false"

\end_inset

中,
\begin_inset Formula $p(G|\Gamma)$
\end_inset

是给定
\begin_inset Formula $\Gamma$
\end_inset

的知识图谱的最大似然函数。最近,有研究者提出了多种计算知识图谱嵌入的方法,包括基于距离的方法和基于语义匹配的方法。在本算法中,使用三路张量分解的方法来建立知识图
谱嵌入的最大似然函数,如式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:term2"
plural "false"
caps "false"
noprefix "false"

\end_inset

。
\end_layout

\begin_layout Standard
\begin_inset Formula 
\begin{equation}
p(G|\Gamma)=\prod_{(h,r,t)\in E\times R\times E}p((h,r,t)|\Gamma)=\prod_{(h,r,t)\in E\times R\times E}N(I_{h,r,t}-h^{T}Rt,\lambda_{2}^{-1})\label{eq:term2}
\end{equation}

\end_inset


\end_layout

\begin_layout Standard
式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:term2"
plural "false"
caps "false"
noprefix "false"

\end_inset

中,若
\begin_inset Formula $I_{h,r,t}\in G$
\end_inset

则标志
\begin_inset Formula $I_{h,r,t}$
\end_inset

等于1,否则为0。式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:equal-max"
plural "false"
caps "false"
noprefix "false"

\end_inset

中的第三项是给定
\begin_inset Formula $\Gamma$
\end_inset

与知识图谱的似然函数,可以看作伯努利分布的累乘,如式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:bernoulli"
plural "false"
caps "false"
noprefix "false"

\end_inset

。
\end_layout

\begin_layout Standard
\begin_inset Formula 
\begin{equation}
p(\Upsilon|\Gamma,G)=\prod_{(u,v)\in\Upsilon}\zeta(u^{T}v)^{y_{uv}}\centerdot(1-\zeta(u^{T}v))^{1-y_{uv}}\label{eq:bernoulli}
\end{equation}

\end_inset


\end_layout

\begin_layout Standard
对式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:equal-max"
plural "false"
caps "false"
noprefix "false"

\end_inset

取负对数,有如式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:term3"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示的损失函数: 
\begin_inset Formula 
\begin{multline}
min\ L=-log(p(\Upsilon|\Gamma,G)\centerdot p(G|\Gamma)\centerdot p(\Gamma))\\
=\sum_{(u,v)\in\Upsilon}-(y_{uv}log\ \zeta(u^{T}v)+(1-y_{uv}log(1-\zeta(u^{T}v))))\\
+\frac{\lambda_{2}}{2}\sum_{r\in R}\|I_{r}-E^{T}RE\|_{2}^{2}+\frac{\lambda_{1}}{2}(\|V\|_{2}^{2}+\|E\|_{2}^{2}+\sum_{r\in R}\|R\|_{2}^{2})\label{eq:term3}
\end{multline}

\end_inset


\end_layout

\begin_layout Standard
式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:term3"
plural "false"
caps "false"
noprefix "false"

\end_inset

中,
\begin_inset Formula $V$
\end_inset

和
\begin_inset Formula $E$
\end_inset

是所有电影与实体的嵌入表示,
\begin_inset Formula $I_{r}$
\end_inset

是在知识图谱中对关系
\begin_inset Formula $r$
\end_inset

的标志向量
\begin_inset Formula $I$
\end_inset

的分向量。在式
\begin_inset CommandInset ref
LatexCommand eqref
reference "eq:term3"
plural "false"
caps "false"
noprefix "false"

\end_inset

中,第一项是交互矩阵
\begin_inset Formula $\Upsilon$
\end_inset

与涟漪网络的估测值之间的交叉熵,第二项是真实的知识图谱分向量
\begin_inset Formula $I_{r}$
\end_inset

以及人为构建的指示矩阵
\begin_inset Formula $E^{T}RE$
\end_inset

之间的均方误差,最后一项是为防止过拟合加入的正则项。
\end_layout

\begin_layout Standard
直接求解上式来得到参数
\begin_inset Formula $\Gamma$
\end_inset

是不可能的,因此可以使用随机梯度下降算法递归地优化损失函数来求解模型参数,而后再计算参数
\begin_inset Formula $\Gamma$
\end_inset

的损失函数的梯度,并根据采样得到的一小批数据反向传递,然后更新参数并最终得到参数
\begin_inset Formula $\Gamma$
\end_inset

。 
\end_layout

\begin_layout Section
分析
\end_layout

\begin_layout Subsection
可解释性
\end_layout

\begin_layout Standard
可解释的推荐系统旨在阐释为什么用户会对一件物品感兴趣,这帮助提升用户对推荐结果的满意度以及对推荐系统的信任。对推荐结果的解释通常基于标签、语义分析等。因为涟漪网
络探索用户基于知识图谱的兴趣,因此它提供了一种基于知识图谱中的关系路径来阐述推荐结果的全新方式。比如,在图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:illustration-of-ripple-sets"
plural "false"
caps "false"
noprefix "false"

\end_inset

中,当用户对“幸福终点站”感兴趣,则该用户也可能对“荒岛余生”感兴趣。因为在知识图谱中,“汤姆·汉克斯”与“幸福终点站”相连,关系是演员,而“汤姆·汉克斯”与“
荒岛余生”也相连,关系也是演员,换句话说,“荒岛余生”与“幸福终点站”有相同的演员。这便解释了用户对“幸福终点站”和“荒岛余生”同时感兴趣的原因。涟漪网络算法通
过在知识图谱中寻找与用户交互过的电影(种子集)相连的物品,并不断扩散,最终确保推荐结果具有较高的准确性。 
\end_layout

\begin_layout Subsection
涟漪重叠
\end_layout

\begin_layout Standard
在涟漪网络中,一个可能的问题是涟漪集中的电影非常多,从而在偏好传递的过程中不可避免地导致用户的真实潜在偏好信息被稀释。然而,用户点击记录中不同的电影常常高度重叠
(从种子集出发到达一部电影常常有不止一条路径),这在很大程度上避免了真实潜在偏好信息被稀释的问题。比如,在图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:illustration-of-ripple-sets"
plural "false"
caps "false"
noprefix "false"

\end_inset

中,如果一个用户喜欢“阿甘正传”,则他也可能喜欢“荒岛余生”。在该知识图谱中,从“阿甘正传”到“荒岛余生”有两条路径:“阿甘正传-U.S.-荒岛余生”与“阿甘正传-
汤姆·汉克斯-荒岛余生”,这正是涟漪重叠的表现。 
\end_layout

\begin_layout Section
测试
\end_layout

\begin_layout Subsection
数据集
\end_layout

\begin_layout Standard
本测试使用“MovieLens 1M Dataset”数据集。该数据集由电影信息、用户信息以及用户对电影的评价三部分组成。其中,含有电影数据3883条、用户数据
6040条以及1000209条用户对电影的评价数据。因该数据集数据量适中,数据准确可靠,因此在推荐系统的性能测试中被广泛使用。
\end_layout

\begin_layout Standard
本测试使用的知识图谱来自Microsoft Satori,是依据“MovieLens 1M Dataset”中的电影名称从Microsoft Satori中提取
相关的节点的与关系数据得到的。 
\end_layout

\begin_layout Subsection
基线
\end_layout

\begin_layout Standard
本测试中,会将本算法的测试结果与以下算法的相比较:
\end_layout

\begin_layout Standard
DKN
\begin_inset CommandInset citation
LatexCommand cite
key "wang2018dkn"
literal "false"

\end_inset

是由微软团队在WWW2018会议上发表的。它是一个主要针对新闻任务提出的框架,知识图谱用于辅助计算新闻标题的嵌入表示。DKN提出对新闻标题内每一个关键实体,在知
识图谱内找到其实体嵌入和上下文嵌入。
\end_layout

\begin_layout Standard
CKE
\begin_inset CommandInset citation
LatexCommand cite
key "zhang2016collaborative"
literal "false"

\end_inset

是微软在KDD2016年发表的,其模型结构在原有系统过滤得到
\begin_inset Formula $U$
\end_inset

,
\begin_inset Formula $V$
\end_inset

向量的基础上,将物品的嵌入与其他描述信息相结合,这些信息主要有: 采用TransR算法计算知识图谱嵌入表示,知识图谱内每个实体嵌入表示被提取为物品的结构化向量信
息。 采用SDAE模型得到物品描述性文本的文本性嵌入表示。 采用SCAE模型得到物品相关图像的视觉嵌入表示。
\end_layout

\begin_layout Standard
SHINE
\begin_inset CommandInset citation
LatexCommand cite
key "wang2018shine"
literal "false"

\end_inset

设计深度自编码器并嵌入语义网络以及社交网络来进行推荐。其为用户-物品的交互使用自动编码器并刻画用户感兴趣的概率。
\end_layout

\begin_layout Standard
PER
\begin_inset CommandInset citation
LatexCommand cite
key "yu2014personalized"
literal "false"

\end_inset

是以基于路径的方法来将知识图谱作为辅助信息中的比较经典的算法。其提出的元路径可以为推荐系统提供可靠的方向,但是需要使用者了解领域内知识,进行人为路径设计。
\end_layout

\begin_layout Standard
LibFM
\begin_inset CommandInset citation
LatexCommand cite
key "rendle2012factorization"
literal "false"

\end_inset

是一个广泛使用的在CTR场景中的分解推荐模型。
\end_layout

\begin_layout Standard
Wide&Deep
\begin_inset CommandInset citation
LatexCommand cite
key "cheng2016wide"
literal "false"

\end_inset

是一个结合线性路径的推荐模型。类似于LibFM,我们将用户、物品及实体的嵌入表示作为其输入。 
\end_layout

\begin_layout Subsection
测试步骤
\end_layout

\begin_layout Standard
在涟漪网络中,设置跳数
\begin_inset Formula $H=2$
\end_inset

。根据实验结果,较大的跳数几乎无法提高性能却会造成较大的计算开销。我们将数据划分为训练集、评估集与测试集,按照6:2:2的比例进行分配。实验进行5次,计算准确度
以及AUC然后取平均值。 
\end_layout

\begin_layout Subsection
结果
\end_layout

\begin_layout Standard
测试结果如表
\begin_inset CommandInset ref
LatexCommand ref
reference "tab:acc-auc"
plural "false"
caps "false"
noprefix "false"

\end_inset

中所示,总体上涟漪网络算法的性能最佳,其次是Wide&Deep算法,说明他们可以充分利用知识图谱中的有效信息来辅助推荐算法。而表现最差的是PER算法,这可能是因
为手工定义的元路径在电影推荐方面效果较差。 
\begin_inset Float table
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

在兴趣预测计算中的AUC和准确度
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

AUC and ACC in interest prediction
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "tab:acc-auc"

\end_inset

 
\begin_inset Tabular
<lyxtabular version="3" rows="7" columns="3">
<features booktabs="true" tabularvalignment="middle">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<row>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
算法 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
AUC 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
准确度 
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
涟漪网络 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.899 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.835 
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
DKN 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.655 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.589 
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CKE 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.796 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.739 
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
SHINE 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.778 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.732
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
LibFM 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.892 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.812
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Wide&Deep 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.903 
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.822
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Chapter
基于知识图谱的电影推荐系统
\end_layout

\begin_layout Section
系统整体设计
\end_layout

\begin_layout Standard
如第
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:tech-stack"
plural "false"
caps "false"
noprefix "false"

\end_inset

节中所述,本系统使用的数据来自“MovieLens 1M Dataset”、IMDb和豆瓣网。其中IMDb和豆瓣网的数据是使用爬虫爬取得到的。最后再使用Pyth
on脚本对这些数据进行处理加工,并导入MongoDB数据库和Neo4j数据库。
\end_layout

\begin_layout Standard
本系统使用MongoDB和Neo4j存储数据。其中,MongoDB作为非关系型的新兴NoSQL数据库,以灵活的非结构化的方式存储普通用户数据、管理员数据、电影数
据等,并提供高并发的性能支持与可分布式存储的扩展性。而在以高性能著称的图数据库Neo4j中,存储用于推荐算法使用的电影知识图谱。
\end_layout

\begin_layout Standard
本系统后端使用Python编写的Flask框架,Flask框架是轻量级的微框架,以高可扩展性著称,为本系统的后端网页应用服务器提供支持。在Flask中,基于RE
ST风格构建API以供前端使用,REST风格的语义化API使后端API的构建与前端API的使用简单方便。
\end_layout

\begin_layout Standard
本系统前端使用Angular作为前端网页框架。Angular是基于TypeScript的网页框架,以模块化及可重用的组件设计著称。Angular为本系统提供了模
块化的网页设计,使本系统前端逻辑清晰,易于维护。此外,本系统使用了Angular材料组件库(Angular Material Components),得益于此,
本系统遵循材料设计(Material Design)语言,使视觉传达风格简洁美观,具有响应式动化与过渡效过、光线与阴影等。 
\end_layout

\begin_layout Section
数据库设计
\end_layout

\begin_layout Standard
如前所述,本系统的MongoDB数据库用于存储普通用户数据、管理员数据、电影数据等,而Neo4j作为高性能的图数据库,用于存储知识图谱。以下逐一说明MongoD
B数据库与Neo4j数据库的存储结构。
\end_layout

\begin_layout Standard
不同于MySQL等关系型数据库,MongoDB数据库作为非结构化存储的NoSQL数据库,没有表、列与行的概念,而只有集合与文档的概念,即在数据库中存储集合(一定
程度上对应于关系型数据库的表),在集合中存储文档(一定程度上对应于关系型数据库的行),而关系型数据库中的列则对应于MongoDB数据库中文档的属性。
\end_layout

\begin_layout Standard
本系统在MongoDB数据库中建立4个集合,分别用于存储用户、管理员、体裁与电影数据。因其中的数据为非结构化数据,因此无法用表格的形式给出,目前习惯上以JSON
形式给出数据的逻辑结构,以下以JSON形式来表示存储结构:
\end_layout

\begin_layout Standard
以下为普通用户集合的数据结构,用户集合中的文档存储用户ID、哈希处理后的密码、其进行过评分的电影(包括电影ID、评分及时间)以及由推荐算法服务器写入的推荐列表、
已购买电影及心愿单: 
\end_layout

\begin_layout Verbatim
    {
\end_layout

\begin_layout Verbatim
        _id: Integer,
\end_layout

\begin_layout Verbatim
        password: String,
\end_layout

\begin_layout Verbatim
        rating: Array([
\end_layout

\begin_layout Verbatim
            {
\end_layout

\begin_layout Verbatim
                movieId: Integer,
\end_layout

\begin_layout Verbatim
                rating: Integer,
\end_layout

\begin_layout Verbatim
                timestamp: Integer
\end_layout

\begin_layout Verbatim
            },
\end_layout

\begin_layout Verbatim
            ...
\end_layout

\begin_layout Verbatim
        ]),
\end_layout

\begin_layout Verbatim
        recommendation: Array([Interger, ...]),
\end_layout

\begin_layout Verbatim
        bought: Array([Interger, ...]),
\end_layout

\begin_layout Verbatim
        wishlist: Array([Interger, ...])
\end_layout

\begin_layout Verbatim
    }
\end_layout

\begin_layout Standard
以下为管理员集合的数据结构,其存储结构较简单,管理员集合中的文档存储管理员ID、哈希处理后的密码: 
\end_layout

\begin_layout Verbatim
    {
\end_layout

\begin_layout Verbatim
        _id: String,
\end_layout

\begin_layout Verbatim
        password: String
\end_layout

\begin_layout Verbatim
    }
\end_layout

\begin_layout Standard
以下为体裁集合的数据结构,其存储结构较简单,体裁集合中的文档存储体裁名称: 
\end_layout

\begin_layout Verbatim
    {
\end_layout

\begin_layout Verbatim
        _id: String
\end_layout

\begin_layout Verbatim
    }
\end_layout

\begin_layout Standard
以下为电影集合的数据结构,电影集合中的文档存储电影ID、电影封面、体裁、价格、评分累加和、评分总数量、预告片图片、剧情介绍、导演、剧本作家及演员。需要说明的是评
分累加和以及评分总数量对应于用户集合中的评分,但只起缓存作用,定期计算。(经测试表明,每次用户访问时计算的开销较大,用户得到响应的时间过长):
 
\end_layout

\begin_layout Verbatim
    {
\end_layout

\begin_layout Verbatim
        _id: Integer,
\end_layout

\begin_layout Verbatim
        title: String,
\end_layout

\begin_layout Verbatim
        cover: String,
\end_layout

\begin_layout Verbatim
        genres: Array([String, ...]),
\end_layout

\begin_layout Verbatim
        price: Float,
\end_layout

\begin_layout Verbatim
        ratingSum: Integer,
\end_layout

\begin_layout Verbatim
        ratingCount: Integer,
\end_layout

\begin_layout Verbatim
        trailer_image_url: String,
\end_layout

\begin_layout Verbatim
        storyline: Array([String, ...]),
\end_layout

\begin_layout Verbatim
        directors: Array([String, ...]),
\end_layout

\begin_layout Verbatim
        writers: Array([String, ...]),
\end_layout

\begin_layout Verbatim
        actors: Array([String, ...]),
\end_layout

\begin_layout Verbatim
    }
\end_layout

\begin_layout Standard
Neo4j数据库用于存储推荐算法使用的知识图谱,含有182011个结点、1241995条边,其数据结构可表示为: 
\end_layout

\begin_layout Verbatim
    node: actor | country | director | film | genre | language
\end_layout

\begin_layout Verbatim
        | person_or_entity_appearing_in_film | rating | star
\end_layout

\begin_layout Verbatim
        | writer
\end_layout

\begin_layout Verbatim
    relationship: actor.film | director.film | film.country
\end_layout

\begin_layout Verbatim
        | film.director | film.genre | film.language | film.rating
\end_layout

\begin_layout Verbatim
        | film.star | film.writer | genre.film
\end_layout

\begin_layout Verbatim
        | person_or_entity_appearing_in_film.film | writer.film
\end_layout

\begin_layout Verbatim
    edge = (node) - [relationship] -> (node)
\end_layout

\begin_layout Section
系统功能说明
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename figures/use-case.pdf

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

系统功能用例图
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

Use case diagram for the system 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "fig:use-case"

\end_inset

 
\end_layout

\end_inset


\end_layout

\begin_layout Standard
本系统用户角色分为未登录用户、普通用户与管理员用户,其用例说明如图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:use-case"
plural "false"
caps "false"
noprefix "false"

\end_inset

。 
\end_layout

\begin_layout Subsection
系统导航
\end_layout

\begin_layout Standard
本系统使用浮动侧边栏作为导航方式,如图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:admin-navigation"
plural "false"
caps "false"
noprefix "false"

\end_inset

。点击侧导航栏右下角的固定的按钮可以将浮动侧边栏设为固定,再次点击后将取消固定。 
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Box Boxed
position "c"
hor_pos "l"
has_inner_box 0
inner_pos "c"
use_parbox 0
use_makebox 0
width ""
special "none"
height "1in"
height_special "totalheight"
thickness "0.4pt"
separation "3pt"
shadowsize "4pt"
framecolor "black"
backgroundcolor "none"
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename figures/admin-navigation.png
	width 94text%

\end_inset


\end_layout

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

系统侧导航栏(管理员)
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

Side navigation panel of the system (for administrators)
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "fig:admin-navigation"

\end_inset

 
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
未登录用户
\end_layout

\begin_layout Standard
未登录用户能进行以下操作:
\end_layout

\begin_layout Standard
\noindent
(1)接收随机的电影推荐
\end_layout

\begin_layout Standard
未登录用户首页随机显示50部电影,如图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:anonymous-index"
plural "false"
caps "false"
noprefix "false"

\end_inset

。 
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Box Boxed
position "c"
hor_pos "l"
has_inner_box 0
inner_pos "c"
use_parbox 0
use_makebox 0
width ""
special "none"
height "1in"
height_special "totalheight"
thickness "0.4pt"
separation "3pt"
shadowsize "4pt"
framecolor "black"
backgroundcolor "none"
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename figures/anonymous-index.png
	width 94text%

\end_inset


\end_layout

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

未登录用户首页
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

Index page for anonymous users 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "fig:anonymous-index"

\end_inset

 
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\noindent
(2)按分类查看电影
\end_layout

\begin_layout Standard
未登录用户可以根据电影的分类来查看电影,如图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:anonymous-category"
plural "false"
caps "false"
noprefix "false"

\end_inset

。 
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Box Boxed
position "c"
hor_pos "l"
has_inner_box 0
inner_pos "c"
use_parbox 0
use_makebox 0
width ""
special "none"
height "1in"
height_special "totalheight"
thickness "0.4pt"
separation "3pt"
shadowsize "4pt"
framecolor "black"
backgroundcolor "none"
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename figures/anonymous-category.png
	width 94text%

\end_inset


\end_layout

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

未登录用户分类页面
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

Category page for anonymous users 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "fig:anonymous-category"

\end_inset

 
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\noindent
(3)查看电影详情
\end_layout

\begin_layout Standard
未登录用户可以查看电影详情,如图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:anonymous-details"
plural "false"
caps "false"
noprefix "false"

\end_inset

。点击页面上的“添加至心愿单”和“购买”会跳转至登录界面。 
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Box Boxed
position "c"
hor_pos "l"
has_inner_box 0
inner_pos "c"
use_parbox 0
use_makebox 0
width ""
special "none"
height "1in"
height_special "totalheight"
thickness "0.4pt"
separation "3pt"
shadowsize "4pt"
framecolor "black"
backgroundcolor "none"
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename figures/anonymous-details.png
	special height=0.7\textheight

\end_inset


\end_layout

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

未登录用户电影详情页面
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

Movie details page for anonymous users 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "fig:anonymous-details"

\end_inset

 
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\noindent
(4)搜索电影
\end_layout

\begin_layout Standard
未登录用户可以使用应用栏右侧的搜索框搜索电影,如图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:anonymous-search"
plural "false"
caps "false"
noprefix "false"

\end_inset

。本系统支持模糊搜索,与此同时,随着用户搜索内容的不断输入,系统会在搜索框下方显示候选的匹配词条,方便用户直接点击查看,此外,用户也能通过回车跳转至完整的搜索结
果页面。 
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Box Boxed
position "c"
hor_pos "l"
has_inner_box 0
inner_pos "c"
use_parbox 0
use_makebox 0
width ""
special "none"
height "1in"
height_special "totalheight"
thickness "0.4pt"
separation "3pt"
shadowsize "4pt"
framecolor "black"
backgroundcolor "none"
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename figures/anonymous-search.png
	width 94text%

\end_inset


\end_layout

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

未登录用户电影搜索界面(侧导航栏已固定)
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

Movie search page for anonymous users (side navigation panel pinned)
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "fig:anonymous-search"

\end_inset

 
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
注册与登录
\end_layout

\begin_layout Standard
\noindent
(1)注册
\end_layout

\begin_layout Standard
本系统对普通用户开放注册功能,并能提供用户名是否含不合法字符、是否与已注册用户名冲突、密码是否符合复杂度要求等的检测。
\end_layout

\begin_layout Standard
\noindent
(2)登录
\end_layout

\begin_layout Standard
本系统提供登录功能,并能根据不同的登录错误类型相应地作出响应。 
\end_layout

\begin_layout Subsection
普通用户
\end_layout

\begin_layout Standard
普通用户具备未登录用户的所有功能。此外,还具备以下功能:
\end_layout

\begin_layout Standard
\noindent
(1)添加心愿单
\end_layout

\begin_layout Standard
已登录用户能在电影详情页面添加电影至心愿单。
\end_layout

\begin_layout Standard
\noindent
(2)购买
\end_layout

\begin_layout Standard
已登录用户能在电影详情页面购买电影。
\end_layout

\begin_layout Standard
\noindent
(3)评分
\end_layout

\begin_layout Standard
已登录用户能在电影详情页面给电影评分。电影评分功能位于电影详情页面,如图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:general-details"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示。
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Box Boxed
position "c"
hor_pos "l"
has_inner_box 0
inner_pos "c"
use_parbox 0
use_makebox 0
width ""
special "none"
height "1in"
height_special "totalheight"
thickness "0.4pt"
separation "3pt"
shadowsize "4pt"
framecolor "black"
backgroundcolor "none"
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename figures/general-details.png
	width 94text%

\end_inset


\end_layout

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

电影评分页面
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

Rating page for movies
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "fig:general-details"

\end_inset

 
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\noindent
(4)查看已购买的电影
\end_layout

\begin_layout Standard
已登录用户能通过侧导航栏跳转至查看已购买的电影的页面。
\end_layout

\begin_layout Standard
\noindent
(5)查看已添加心愿单的电影
\end_layout

\begin_layout Standard
已登录用户能通过侧导航栏跳转至查看已添加心愿单的电影的页面。 
\end_layout

\begin_layout Subsection
管理员用户
\end_layout

\begin_layout Standard
\noindent
(1)管理电影信息
\end_layout

\begin_layout Standard
管理员能增加电影、删除电影与修改电影信息,如图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:admin-movie"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示。 
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Box Boxed
position "c"
hor_pos "l"
has_inner_box 0
inner_pos "c"
use_parbox 0
use_makebox 0
width ""
special "none"
height "1in"
height_special "totalheight"
thickness "0.4pt"
separation "3pt"
shadowsize "4pt"
framecolor "black"
backgroundcolor "none"
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename figures/admin-movie.png
	width 94text%

\end_inset


\end_layout

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

管理电影页面
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

Movie administration page
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "fig:admin-movie"

\end_inset

 
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\noindent
(2)管理用户信息
\end_layout

\begin_layout Standard
管理员能增加用户、删除用户与修改用户密码。
\end_layout

\begin_layout Standard
\noindent
(3)管理知识图谱
\end_layout

\begin_layout Standard
管理员能增加、删除、修改以及查找知识图谱中的结点与关系,如图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:admin-knowledge-graph"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示。该界面中的结点及关系可以以动态的方式呈现,同时支持以填写选项的方式以及使用Cypher语句的方式来增加、删除、修改以及查找知识图谱中的结点与关系。当鼠标悬
浮于某一节点或关系之上时,将显示有关这一节点或关系的有关信息。 
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Box Boxed
position "c"
hor_pos "l"
has_inner_box 0
inner_pos "c"
use_parbox 0
use_makebox 0
width ""
special "none"
height "1in"
height_special "totalheight"
thickness "0.4pt"
separation "3pt"
shadowsize "4pt"
framecolor "black"
backgroundcolor "none"
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename figures/admin-knowledge-graph.png
	width 94text%

\end_inset


\end_layout

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

管理知识图谱页面
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

Knowledge graph administration page
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "fig:admin-knowledge-graph"

\end_inset

 
\end_layout

\end_inset


\end_layout

\begin_layout Section
电影推荐流程
\end_layout

\begin_layout Standard
本系统的推荐流程分为离线推荐与实时推荐,如图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:recommendation-procedure"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示。
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename figures/recommendation-procedure.pdf

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

电影推荐流程
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

Movie recommendation procedure
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "fig:recommendation-procedure"

\end_inset

 
\end_layout

\end_inset


\end_layout

\begin_layout Standard
其中,离线推荐使用第
\begin_inset CommandInset ref
LatexCommand ref
reference "ch:offline-recommendation"
plural "false"
caps "false"
noprefix "false"

\end_inset

章所述的涟漪网络算法,此算法是基于文献
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
parencite
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

wang2018ripplenet
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset

实现的。不同于文献
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
parencite
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

wang2018ripplenet
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset

中仅使用用户评分计算用户偏好,本推荐系统在用户偏好的计算过程中还结合了用户收藏,这在一定程度上缓解了冷启动问题并改进了推荐性能。 此外,本推荐系统还结合了实时推
荐机制作为补充,描述如下:
\end_layout

\begin_layout Standard
(1)离线推荐服务器定期运行涟漪网络算法。离线推荐服务器从MongoDB数据库服务器获取用户信息与电影评分、电影是否加入心愿单等数据以及从Neo4j数据库服务器
获取知识图谱数据信息。然后执行涟漪网络算法。最后离线推荐服务器将计算得到的各用户推荐列表存入MongoDB数据库中,等待用户访问时将该结果推荐给用户。
\end_layout

\begin_layout Standard
(2)当用户访问时,网页后端服务器查询推荐列表中的电影数据是否达到阀值,如果推荐列表中的数量过少,则根据用户交互随机将同体裁电影加入推荐列表的末端作为补充并最终
显示给用户。
\end_layout

\begin_layout Standard
上述步骤中,(1)中的离线推荐准确度高,但算法运算时间长,无法做到即时响应用户请求。(2)中的实时推荐方法准确度低,但算法运算快,可以做到实时响应请求并即时发出
响应。两者相互补充组成了本系统的电影推荐算法。 
\end_layout

\begin_layout Section
系统安全性
\end_layout

\begin_layout Standard
本系统对已登录普通用户与管理员在前后端交互过程中使用JSON网络令牌(JSON Web Token, JWT)实现授权与认证(Authorization
 and Authentication),以此保证系统的安全性,本系统的总体安全性设计如图
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:jwt"
plural "false"
caps "false"
noprefix "false"

\end_inset

所示。
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename figures/jwt.pdf

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
bicaption
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

系统总体安全性设计
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

Overall security design for the system
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "fig:jwt"

\end_inset

 
\end_layout

\end_inset


\end_layout

\begin_layout Standard
在用户登录时,Flask后端网页服务器会生成一个长期JSON网络令牌和一个临时JSON网络令牌,令牌中存储有用户id以及过期时间,并且该令牌使用非对称加密算法加
密,其中含有由Flask后端网页服务器颁发的签名信息,这确保了JSON网络令牌不会被伪造。
\end_layout

\begin_layout Standard
前端网页服务器在接收到令牌后会将令牌存储在浏览器的localStorage中,并在每一个接下来的请求头中附上该令牌,而后端服务器只有在该令牌有效(指确实为后端网
页服务器颁发且该另令牌尚未过期)的情况下才会继续执行有关请求。与此同时,若该请求是用户内容相关的,则后端服务器还会检测令牌中的id是否与请求中使用的id相同。若
不满足以上任意一项,则后端网页服务器返回未授权错误。
\end_layout

\begin_layout Standard
其中,若后端网页服务器发现令牌过期,则会将该信息发送给前端网页服务器,前端网页服务器将会将长期令牌发送给后端服务器以刷新(renew)临时令牌。
\end_layout

\begin_layout Standard
此外,本系统还使用了哈希算法对密码进行哈希处理,数据库中的密码全部为哈希处理后的密码。同时,用户登录过程是后端网页服务器使用原密码与哈希处理后的密码进行比较,而
没有开放哈希处理后的密码与哈希处理后的密码进行比较的接口,这保障了本系统的安全性。这在同时令网站仅允许HTTPS(HTTPS-only)网络连接的情况下可以充分
保证本系统的安全性。
\end_layout

\begin_layout Standard
需要指出的是,虽然本系统在用户登录与注册时密码在前端没有进行哈希处理,但是本系统在部署时使用HTTPS-only的连接,在这种情况下,所有的数据传输都处于加密状
态,避免了中间人攻击的可能,因此明文传输密码而不使用哈希处理是安全的,在实际使用的过程中可行。而本系统的后端网页服务器对前端网页服务器传入的明文密码进行哈希处理
的目的是避免数据库中存入明文的密码。如果数据库中存入明文的密码,则当数据库中用户密码泄露时攻击者可以轻易使用泄露的密码登录本系统。而如上所述,本系统后端只开放了
接收明文密码的接口,即只将数据库中哈希处理后的密码与用户请求中的明文密码进行对比,即使攻击者获取了用户哈希后的密码,要计算其对应的明文密码也是困难的,甚至在明文
密码足够复杂的情况下是不可能的。因此,以上措施保证了本系统的安全性。 
\end_layout

\begin_layout Chapter
研究结论和展望
\end_layout

\begin_layout Section
工作总结
\end_layout

\begin_layout Standard
随着互联网的发展,用户可选择的电影数量不断增加,为了让用户快速找到感兴趣的电影,各种推荐算法应运而生。这些算法存在推荐准确性较低、数据稀缺性以及冷启动问题。本文
针对此现状,以电影推荐为研究对象,使用知识图谱作为辅助信息,利用涟漪网络算法实现了电影推荐系统。具体地说,主要的研究工作如下:
\end_layout

\begin_layout Standard
(1)使用基于Scrapy框架的爬虫从IMDb和豆瓣网上爬取了3684条电影数据。其中,从IMDb爬取了3494条电影数据,从豆瓣网爬取了190条电影数据(由于
豆瓣网限制了每IP访问量故爬取的数据较少)。这些电影数据包括电影封面图片、电影情节介绍、电影预告片图片、电影演员列表、导演以及剧本作家等信息。
\end_layout

\begin_layout Standard
(2)根据文献
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
parencite
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

wang2018ripplenet
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset

实现了基于知识图谱的涟漪网络推荐算法,通过使用“MovieLens 1M Dataset”数据集以及从IMDb和豆瓣网上爬取的电影数据,实现了基于用户心愿单和用
户评分并以知识图谱为辅助信息的推荐算法。不同于文献
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
parencite
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout

{
\end_layout

\end_inset

wang2018ripplenet
\begin_inset ERT
status collapsed

\begin_layout Plain Layout

}
\end_layout

\end_inset

中仅使用用户评分计算用户偏好,本文在用户偏好的计算过程中还结合了用户收藏,这在一定程度上缓解了冷启动问题并改进了推荐性能。并对实现的推荐算法进行了实验,计算了其
AUC和准确度两个关键的性能指标,将该指标与DKN
\begin_inset CommandInset citation
LatexCommand cite
key "wang2018dkn"
literal "false"

\end_inset

、CKE
\begin_inset CommandInset citation
LatexCommand cite
key "zhang2016collaborative"
literal "false"

\end_inset

、PER
\begin_inset CommandInset citation
LatexCommand cite
key "yu2014personalized"
literal "false"

\end_inset

、SHINE
\begin_inset CommandInset citation
LatexCommand cite
key "wang2018shine"
literal "false"

\end_inset

、LibFM
\begin_inset CommandInset citation
LatexCommand cite
key "rendle2012factorization"
literal "false"

\end_inset

以及Wide&Deep
\begin_inset CommandInset citation
LatexCommand cite
key "cheng2016wide"
literal "false"

\end_inset

算法的进行了对比。并以此发现,涟漪网络算法的性能最优。
\end_layout

\begin_layout Standard
(3)基于涟漪网络算法实现了基于知识图谱的电影推荐系统。该系统为未登录用户提供按分类查看电影、查看电影详情的功能;为普通用户提供电影推荐、按分类查看电影、查看电
影详情、电影评分、将电影加入心愿单以及购买电影功能;为管理员提供增加、删除、修改、查找电影及用户的功能。同时使用JSON网络令牌、HTTPS以及哈希化密码等手段
保障系统的安全性。 
\end_layout

\begin_layout Section
工作展望
\end_layout

\begin_layout Standard
为了给用户提供准确的推荐电影,需要不断优化并改进推荐过程。推荐系统的基础是用户历史偏好集、知识图谱信息以及推荐算法本身。因此有效地记录用户历史偏好集,完善知识图
谱信息并改进推荐算法本身是提高推荐结果的重要因素。本文虽然对基于知识图谱的推荐算法有了一定的研究,并且将其应用于电影推荐系统中,但是由于时间和能力所限,该系统仍
存在着不足的地方,主要体现在以下两个方面:
\end_layout

\begin_layout Standard
\noindent
(1)需要完善知识图谱的信息
\end_layout

\begin_layout Standard
知识图谱是本文使用的涟漪网络算法的基础,但本文所使用的知识图谱的信息还不够完善,因此在一定程度上影响了涟漪网络算法的性能。
\end_layout

\begin_layout Standard
\noindent
(2)涟漪网络算法有待进一步改进
\end_layout

\begin_layout Standard
尽管涟漪网络算法相比于传统的推荐算法在准确度上有所提升,但涟漪网络算法目前仅适用于离线推荐,而无法用于实时推荐,这使它的适用场景受到了限制。未来可考虑改造该算法
,使其能满足实时推荐的需求。
\end_layout

\begin_layout Standard
对于以上提及的问题,未来还需要更深入地学习有关知识图谱、推荐算法、深度学习的有关知识,对系统进行改进,从而使其更完善。 
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
backmatter
\end_layout

\end_inset

 
\begin_inset CommandInset bibtex
LatexCommand bibtex
bibfiles "bibliography"

\end_inset

 
\end_layout

\begin_layout Chapter
致谢
\end_layout

\begin_layout Standard
论文的撰写工作已经接近尾声,在本文的撰写过程中我要特别感谢李冬梅老师的指导。在毕业论文完成期间,李冬梅老师多次对我的毕业论文提出意见与建议。同时,她多次询问论文
的撰写进度,更是体现了她对学生无微不至的关怀。每每当我在论文编写中遇到艰深晦涩之处时,她都能不失时机而恰到好处地给予我最有用的提示与建议,使我的毕业论文得以顺利
完成。
\end_layout

\begin_layout Standard
其次,我要感谢我本科期间曾经为我上课的所有老师。比如,由我的概率论老师为我打下的数学基础才使我得以用最大后验概率估计法完成嵌入表示的学习算法,蓝海洋老师任教的网
站设计课程是我完成电影推荐系统的基石。总之,我要感谢大学四年来所有老师孜孜不倦的谆谆教诲与夜以继日的无私奉献。
\end_layout

\begin_layout Standard
接着,我还要感谢我的同学,是他们思维的火花激起了论文写作中的灵感。与他们的交流使我受益匪浅。
\end_layout

\begin_layout Standard
最后,我还要感谢我的父母,他们一直以来对我生活上与学习上的鼓励与引导是我得益完成论文的关键要素。
\end_layout

\begin_layout Standard
感谢所有在论文撰写工作中为我提供过帮助的人。 
\end_layout

\end_body
\end_document