diff options
author | Karl Berry <karl@freefriends.org> | 2021-05-28 20:50:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-05-28 20:50:12 +0000 |
commit | c9ab655bc2475da8e6dd89170ad13371d8154d0b (patch) | |
tree | 962580a228d0d86a4c74a8fff197addb9bf1585f | |
parent | 032b61130748c97ac695a189ca1d224dea73c6e8 (diff) |
bjfuthesis (28may21)
git-svn-id: svn://tug.org/texlive/trunk@59378 c570f23f-e606-0410-a88d-b1316a301751
30 files changed, 1825 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/LICENSE b/Master/texmf-dist/doc/latex/bjfuthesis/LICENSE new file mode 100644 index 00000000000..f288702d2fa --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<https://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<https://www.gnu.org/licenses/why-not-lgpl.html>. diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/README.md b/Master/texmf-dist/doc/latex/bjfuthesis/README.md new file mode 100644 index 00000000000..08f84f196b6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/README.md @@ -0,0 +1,23 @@ +# Beijing Forestry University (BJFU) Thesis Template in LaTeX +Copyright (C) 2021 Liu Changxin + +Version 0.0.1 (2021-05-28) + +## License +Licensed under the GNU General Public License v3.0 (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.gnu.org/licenses/gpl-3.0.html + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +## Abstract +The bjfuthesis class is a LaTeX class intended for students in Beijing Forestry University (BJFU) to write their theses. The class is based on the ctexbook class. It modifies some of the layout and style definitions of these packages in order to provide a document layout that should be compatible with Beijing Forestry University Thesis Standard. + +## Installation +Get the latest release of bjfuthesis from + + https://github.com/bjfu-projects/bjfu-thesis
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/bibliography.bib b/Master/texmf-dist/doc/latex/bjfuthesis/demo/bibliography.bib new file mode 100644 index 00000000000..ad383a0c4ea --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/bibliography.bib @@ -0,0 +1,317 @@ +@article{su2009survey, + title={A survey of collaborative filtering techniques}, + author={Su, Xiaoyuan and Khoshgoftaar, Taghi M}, + journal={Advances in artificial intelligence}, + volume={2009}, + year={2009}, + publisher={Hindawi} +} + +@article{sun2017collaborative, + title={Collaborative intent prediction with real-time contextual data}, + author={Sun, Yu and Yuan, Nicholas Jing and Xie, Xing and McDonald, Kieran and Zhang, Rui}, + journal={ACM Transactions on Information Systems (TOIS)}, + volume={35}, + number={4}, + pages={1--33}, + year={2017}, + publisher={ACM New York, NY, USA} +} + +@inproceedings{zou2020survey, + title={A survey on application of knowledge graph}, + author={Zou, Xiaohan}, + booktitle={Journal of Physics: Conference Series}, + volume={1487}, + number={1}, + pages={012016}, + year={2020}, + organization={IOP Publishing} +} + +@misc{karlgren1990algebra, + title={An algebra for recommendations: Using reader data as a basis for measuring document proximity}, + author={Karlgren, Jussi}, + year={1990}, + publisher={Department of Computer and Systems Sciences, Stockholm University} +} + +@book{karlgren1994newsgroup, + title={Newsgroup clustering based on user behavior-a recommendation algebra}, + author={Karlgren, Jussi}, + year={1994}, + publisher={Swedish Institute of Computer Science} +} + +@article{jafarkarimi2012naive, + title={A naive recommendation model for large databases}, + author={Jafarkarimi, Hosein and Sim, Alex Tze Hiang and Saadatdoost, Robab}, + journal={International Journal of Information and Education Technology}, + volume={2}, + number={3}, + pages={216}, + year={2012}, + publisher={IACSIT Press} +} + +@article{singhal2012introducing, + title={Introducing the knowledge graph: things, not strings}, + author={Singhal, Amit}, + journal={Official google blog}, + volume={5}, + pages={16}, + year={2012} +} + +@inproceedings{bordes2013translating, + title={Translating embeddings for modeling multi-relational data}, + author={Bordes, Antoine and Usunier, Nicolas and Garcia-Duran, Alberto and Weston, Jason and Yakhnenko, Oksana}, + booktitle={Neural Information Processing Systems (NIPS)}, + pages={1--9}, + year={2013} +} + +@inproceedings{wang2014knowledge, + title={Knowledge graph embedding by translating on hyperplanes}, + author={Wang, Zhen and Zhang, Jianwen and Feng, Jianlin and Chen, Zheng}, + booktitle={Proceedings of the AAAI Conference on Artificial Intelligence}, + volume={28}, + number={1}, + year={2014} +} + +@inproceedings{lin2015learning, + title={Learning entity and relation embeddings for knowledge graph completion}, + author={Lin, Yankai and Liu, Zhiyuan and Sun, Maosong and Liu, Yang and Zhu, Xuan}, + booktitle={Proceedings of the AAAI Conference on Artificial Intelligence}, + volume={29}, + number={1}, + year={2015} +} + +@article{yang2014embedding, + title={Embedding entities and relations for learning and inference in knowledge bases}, + author={Yang, Bishan and Yih, Wen-tau and He, Xiaodong and Gao, Jianfeng and Deng, Li}, + journal={arXiv preprint arXiv:1412.6575}, + year={2014} +} + +@article{lin2015modeling, + title={Modeling relation paths for representation learning of knowledge bases}, + author={Lin, Yankai and Liu, Zhiyuan and Luan, Huanbo and Sun, Maosong and Rao, Siwei and Liu, Song}, + journal={arXiv preprint arXiv:1506.00379}, + year={2015} +} + +@article{guu2015traversing, + title={Traversing knowledge graphs in vector space}, + author={Guu, Kelvin and Miller, John and Liang, Percy}, + journal={arXiv preprint arXiv:1506.01094}, + year={2015} +} + +@inproceedings{toutanova2016compositional, + title={Compositional learning of embeddings for relation paths in knowledge base and text}, + author={Toutanova, Kristina and Lin, Xi Victoria and Yih, Wen-tau and Poon, Hoifung and Quirk, Chris}, + booktitle={Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)}, + pages={1434--1444}, + year={2016} +} + +@book{fielding2000architectural, + title={Architectural styles and the design of network-based software architectures}, + author={Fielding, Roy T}, + volume={7}, + year={2000}, + publisher={University of California, Irvine Irvine} +} + +@inproceedings{koren2008factorization, + title={Factorization meets the neighborhood: a multifaceted collaborative filtering model}, + author={Koren, Yehuda}, + booktitle={Proceedings of the 14th ACM SIGKDD international conference on Knowledge discovery and data mining}, + pages={426--434}, + year={2008} +} + +@inproceedings{wang2018shine, + title={Shine: Signed heterogeneous information network embedding for sentiment link prediction}, + author={Wang, Hongwei and Zhang, Fuzheng and Hou, Min and Xie, Xing and Guo, Minyi and Liu, Qi}, + booktitle={Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining}, + pages={592--600}, + year={2018} +} + +@inproceedings{wang2018dkn, + title={DKN: Deep knowledge-aware network for news recommendation}, + author={Wang, Hongwei and Zhang, Fuzheng and Xie, Xing and Guo, Minyi}, + booktitle={Proceedings of the 2018 world wide web conference}, + pages={1835--1844}, + year={2018} +} + +@article{sun2017collaborative, + title={Collaborative intent prediction with real-time contextual data}, + author={Sun, Yu and Yuan, Nicholas Jing and Xie, Xing and McDonald, Kieran and Zhang, Rui}, + journal={ACM Transactions on Information Systems (TOIS)}, + volume={35}, + number={4}, + pages={1--33}, + year={2017}, + publisher={ACM New York, NY, USA} +} + +@inproceedings{zhang2016collaborative, + title={Collaborative knowledge base embedding for recommender systems}, + author={Zhang, Fuzheng and Yuan, Nicholas Jing and Lian, Defu and Xie, Xing and Ma, Wei-Ying}, + booktitle={Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining}, + pages={353--362}, + year={2016} +} + +@inproceedings{wang2018shine, + title={Shine: Signed heterogeneous information network embedding for sentiment link prediction}, + author={Wang, Hongwei and Zhang, Fuzheng and Hou, Min and Xie, Xing and Guo, Minyi and Liu, Qi}, + booktitle={Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining}, + pages={592--600}, + year={2018} +} + +@inproceedings{yu2014personalized, + title={Personalized entity recommendation: A heterogeneous information network approach}, + author={Yu, Xiao and Ren, Xiang and Sun, Yizhou and Gu, Quanquan and Sturt, Bradley and Khandelwal, Urvashi and Norick, Brandon and Han, Jiawei}, + booktitle={Proceedings of the 7th ACM international conference on Web search and data mining}, + pages={283--292}, + year={2014} +} + +@article{rendle2012factorization, + title={Factorization machines with libfm}, + author={Rendle, Steffen}, + journal={ACM Transactions on Intelligent Systems and Technology (TIST)}, + volume={3}, + number={3}, + pages={1--22}, + year={2012}, + publisher={ACM New York, NY, USA} +} + +@inproceedings{cheng2016wide, + title={Wide \& deep learning for recommender systems}, + author={Cheng, Heng-Tze and Koc, Levent and Harmsen, Jeremiah and Shaked, Tal and Chandra, Tushar and Aradhye, Hrishi and Anderson, Glen and Corrado, Greg and Chai, Wei and Ispir, Mustafa and others}, + booktitle={Proceedings of the 1st workshop on deep learning for recommender systems}, + pages={7--10}, + year={2016} +} + +@inproceedings{wang2018dkn, + title={DKN: Deep knowledge-aware network for news recommendation}, + author={Wang, Hongwei and Zhang, Fuzheng and Xie, Xing and Guo, Minyi}, + booktitle={Proceedings of the 2018 world wide web conference}, + pages={1835--1844}, + year={2018} +} + +@article{漆桂林2017知识图谱研究进展, + title={知识图谱研究进展}, + author={漆桂林 and 高桓 and 吴天星}, + journal={情报工程}, + volume={3}, + number={1}, + pages={004--025}, + year={2017} +} + +@article{徐增林2016知识图谱技术综述, + title={知识图谱技术综述}, + author={徐增林 and 盛泳潘 and 贺丽荣 and 王雅芳}, + year={2016}, + publisher={电子科技大学学报自然版} +} + +@article{李涓子2017知识图谱研究综述, + title={知识图谱研究综述}, + author={李涓子 and 侯磊 and others}, + journal={山西大学学报 (自然科学版)}, + number={2017 年 03}, + pages={454--459}, + year={2017}, + publisher={山西大学} +} + +@article{曹倩2015知识图谱的技术实现流程及相关应用, + title={知识图谱的技术实现流程及相关应用}, + author={曹倩 and 赵一鸣}, + journal={情报理论与实践}, + volume={38}, + number={12}, + pages={13--18}, + year={2015} +} + +@inproceedings{tang2019akupm, + title={AKUPM: Attention-enhanced knowledge-aware user preference model for recommendation}, + author={Tang, Xiaoli and Wang, Tengyun and Yang, Haizhi and Song, Hengjie}, + booktitle={Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery \& Data Mining}, + pages={1891--1899}, + year={2019} +} + +@inproceedings{cao2019unifying, + title={Unifying knowledge graph learning and recommendation: Towards a better understanding of user preferences}, + author={Cao, Yixin and Wang, Xiang and He, Xiangnan and Hu, Zikun and Chua, Tat-Seng}, + booktitle={The world wide web conference}, + pages={151--161}, + year={2019} +} + +@inproceedings{zhao2017meta, + title={Meta-graph based recommendation fusion over heterogeneous information networks}, + author={Zhao, Huan and Yao, Quanming and Li, Jianda and Song, Yangqiu and Lee, Dik Lun}, + booktitle={Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining}, + pages={635--644}, + year={2017} +} + +@inproceedings{sun2018recurrent, + title={Recurrent knowledge graph embedding for effective recommendation}, + author={Sun, Zhu and Yang, Jie and Zhang, Jie and Bozzon, Alessandro and Huang, Long-Kai and Xu, Chi}, + booktitle={Proceedings of the 12th ACM Conference on Recommender Systems}, + pages={297--305}, + year={2018} +} + +@inproceedings{wang2018ripplenet, + title={Ripplenet: Propagating user preferences on the knowledge graph for recommender systems}, + author={Wang, Hongwei and Zhang, Fuzheng and Wang, Jialin and Zhao, Miao and Li, Wenjie and Xie, Xing and Guo, Minyi}, + booktitle={Proceedings of the 27th ACM International Conference on Information and Knowledge Management}, + pages={417--426}, + year={2018} +} + +@article{黄立威2018基于深度学习的推荐系统研究综述, + title={基于深度学习的推荐系统研究综述}, + author={黄立威 and 江碧涛 and 吕守业 and 刘艳博 and 李德毅}, + journal={计算机学报}, + volume={41}, + number={7}, + pages={1619--1647}, + year={2018} +} + +@article{常亮2019知识图谱的推荐系统综述, + title={知识图谱的推荐系统综述}, + author={常亮 and 张伟涛 and 古天龙 and 孙文平 and 宾辰忠 and others}, + journal={智能系统学报}, + volume={14}, + number={2}, + pages={207--216}, + year={2019} +} + +@mastersthesis{王一鸣2018基于知识图谱的推荐技术研究及应用, + title={基于知识图谱的推荐技术研究及应用}, + author={王一鸣}, + year={2018}, + school={电子科技大学} +} diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/contents/abstract.tex b/Master/texmf-dist/doc/latex/bjfuthesis/demo/contents/abstract.tex new file mode 100644 index 00000000000..71627e7e3fd --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/contents/abstract.tex @@ -0,0 +1,14 @@ +\chapter*{摘要} +\begin{abstract} + 随着在线电影数量不断增加,用户选择电影的时间成本不断上升,准确的推荐算法成为了必然要求。为解决协同过滤推荐算法中的稀缺性问题与冷启动问题,研究人员用商品属性或社交网络等信息来辅助推荐算法。现有的将知识图谱作为辅助信息的推荐算法包括基于嵌入的方法和基于路径的方法,但这两种方法均存在一些缺陷,没有充分有效地利用知识图谱中的相关信息,推荐的准确度较低。 + + 本文设计并实现了基于“涟漪网络”知识图谱的推荐算法。“涟漪网络”算法的核心是利用现实生活中的雨滴产生的涟漪在水面上不断扩散的思路,来模拟用户偏好的扩散。对于每一个用户,涟漪网络将其过往偏好作为知识图谱中的一个种子集,然后沿知识图谱中的关系路径不断地拓展用户的偏好,进而发现基于等级划分的某个候选物品的潜在兴趣,其中多个“涟漪”重叠形成知识图谱中的用户偏好分布。该算法的实验结果和以往的CKE、DKN、PER等模型结果相比,表现出更优的性能。利用该算法,本文设计并实现了一个基于电影知识图谱的推荐系统,该系统包括管理员用户和普通用户,管理员能够新增、编辑和删除电影与用户,普通用户能够浏览、收藏与购买电影。该系统可以为用户提供一个高效的电影推荐功能,方便用户选择满足自己偏好的电影。 +\end{abstract} +\keywordscn{知识图谱,推荐系统,涟漪网络,用户偏好,电影商店} +\chapter*{Abstract} +\begin{abstract} + As the number of online movies continues to increase and the time cost for users to choose movies continues to rise, accurate recommendation algorithms have become an inevitable 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. + + This paper designs and implements a recommendation algorithm based on Ripple Network. 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 ``ripples" 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 suit their preferences. +\end{abstract} +\keywordsen{Knowledge graph, recommendation system, Ripple Network, user preferences, movie store} diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/contents/acknowledge.tex b/Master/texmf-dist/doc/latex/bjfuthesis/demo/contents/acknowledge.tex new file mode 100644 index 00000000000..bfccc876b41 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/contents/acknowledge.tex @@ -0,0 +1,10 @@ +\chapter{致谢} +论文的撰写工作已经接近尾声,在本文的撰写过程中我要特别感谢李冬梅老师的莅临指导。在毕业论文完成期间,李冬梅老师多次对我的毕业论文提出意见与建议。同时,她多次询问论文的撰写进度,更是体现了她对学生无微不至的关怀。每每当我在论文编写中遇到艰深晦涩之处时,她都能不失时机而恰到好处地给予我最有用的提示与建议,使我的毕业论文得以顺利完成。 + +其次,我要感谢我本科期间曾经为我上课的所有老师。比如,由我的概率论老师为我打下的数学基础才使我得以用最大后验概率估计法完成嵌入表示的学习算法,蓝海洋老师任教的网站设计课程是我完成电影推荐系统的基石。总之,我要感谢大学四年来所有老师孜孜不倦的谆谆教诲与夜以继日的无私奉献。 + +接着,我还要感谢我的同学,是他们思维的火花激起了论文写作中的灵感。与他们的交流使我受益匪浅。 + +最后,我还要感谢我的父母,他们一直以来对我生活上与学习上的鼓励与引导是我得益完成论文的关键要素。 + +感谢所有在论文撰写工作中为我提供过帮助的人。 diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/contents/mainbody.tex b/Master/texmf-dist/doc/latex/bjfuthesis/demo/contents/mainbody.tex new file mode 100644 index 00000000000..055e7b1de6b --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/contents/mainbody.tex @@ -0,0 +1,548 @@ +\chapter{绪论} +\section{研究背景与意义} +一直以来,电影推荐都是在线流媒体播放平台发展中的一个重要问题,做好电影推荐可以使用户能在海量电影中选择满足其偏好的电影,提高用户满意度,从而提高在线流媒体播放平台的流量转化率及购买率,提高在线流媒体播放平台的经济收益。近年来,随着电影行业及互联网行业的不断发展,在线电影数量不断增加,用户在海量电影中选择满足其偏好的电影的难度不断上升,性能优异的推荐算法成为了必然要求。自从在线流媒体播放平台出现以来,人们便开始尝试利用推荐算法来提高平台流量转化率,出现了诸如协同过滤的推荐算法\cite{su2009survey}。但这些算法未能解决数据稀缺性及冷启动问题,并不能为在线流媒体播放平台提供良好的推荐性能。为此,人们尝试将辅助信息融入推荐算法中以解决数据稀缺性及冷启动问题\cite{sun2017collaborative},并提高推荐性能。 + +知识图谱,一种结构化的语义知识库,被用于迅速提供对物理世界中的概念和相互关系的描述,为解决推荐问题提供了新的方法\cite{zou2020survey},近年来受到国内外研究人员的广泛关注,成为了当前的研究热点。知识图谱通过对复杂的原始数据进行加工、处理及整合,转化成简单可靠、清晰明了的“实体,关系,实体”三元组,汇聚了大量的知识信息,从而能实现基于知识信息的响应和推理。 + +知识图谱常被用于作为辅助信息添加至推荐算法中以提高推荐的准确性,这已是当前的研究焦点。 + +近年来,随着在线流媒体播放平台的发展,电影推荐系统应运而生,它作为现代信息技术与传统电影产业相结合的产物,对流媒体播放平台的用户体验起着至关重要的作用,其可大幅度减少用户寻找满足其偏好电影的时间,并提高用户点击率与购买率,从而提高流媒体播放平台的经济收益。电影推荐系统能为用户推荐其感兴趣的电影,而减少对用户不感兴内容的显示,从而满足用户需求。但是,目前网络上绝大多数的电影推荐系统都使用传统的基于协同过滤的推荐算法,未能有效利用知识图谱等辅助信息,返回给用户的推荐结果中包含大量用户不感兴趣的电影,同时,却将一些本应推荐给用户的、用户感兴趣的电影丢弃了。造成这一问题的主要原因便是对于新加入的无用户评分的电影以及新注册的用户推荐算法缺少相关信息。 + +对于海量的电影数据,为了实现准确地推荐给用户其感兴趣的电影,传统的基于协同过滤的推荐算法是远远满足了不用户需求的,特别是对新注册用户,推荐的准确度无法得到保证。所以,本文旨在以知识图谱作为辅助信息,构建一个合适的电影推荐系统,并利用知识图谱中包含的丰富的辅助信息,最终实现一个电影推荐系统,为用户提供有效的、准确的电影推荐,从而提高用户满意度,提高平台收益。 +\section{国内外研究现状} +\subsection{推荐系统研究现状} +推荐系统由Jussi Karlgren于哥伦比亚大学在一份技术报告中作为“数字书架”被首次提及\cite{karlgren1990algebra},而后自1994年起被在SICS的Jussi Karlgren\cite{karlgren1994newsgroup}、由Pattie Maes于MIT领导的研究团队、位于Bellcore的Will Hill以及同样位于MIT的Paul Resnick规模实现并在技术性报告及出版物中起作用,他们与GroupLens的工作被授予了2010年ACM软件系统奖。 + +自从在90年代中期首批有关协同过滤的论文出现后推荐系统便成为了重要的研究领域。在工业界与学术界在该世纪有众多建设新的推荐系统的工作。由于该领域包含众多的研究问题及其能帮助用户解决在过多信息中提供个性化推荐的实际应用,因此研究人员对该领域的兴趣依旧很高。 + +当前,推荐列表在推荐系统将其产生的过程中的方式主要有两种:基于内容推荐与协同过滤\cite{jafarkarimi2012naive}。基于内容推荐的算法使用一些有关物品的离散特征来推荐出拥有相似性的物品。协同过滤方法根据用户的历史行为(诸如其评价过的、点击过的、购买过的商品等)并与其他用户的相似决策结合起来建立模形。这种算法可以被用于预测用户对物品的偏好程度。这两种方法常常被同时使用。 + +此外,近来有越来越多的推荐算法被提出:多准则推荐系统。多准则推荐系统可以被定义为包含多标准偏好信息的推荐系统,而不是构建基于单一凭据的推荐系统。风险感知推荐系统,现存推荐系统的主要方法聚焦于基于上下文信息推荐最相关内容给用户,而没有将不相关内容打扰用户的推荐风险纳入考量。考虑推送推荐内容给用户而打扰用户的风险在某些情况下是需要考虑的,比如,在一个专业会议上、在凌晨或是在晚上。而此类推荐算法为该问题提供了解决方案。 + +现实中,大量使用的往往是混合推荐系统。同时结合协同过滤、基于内容过滤以及其他方法的混合方法现在被大量使用。数种不同方法没有任何理由不能被结合起来。混合推荐可以在多种方式下被实现:将基于内容的和基于协同滤的预测被分开实现再将他们将合起来,亦或是将两种方法统一到同一模型中。 +\subsection{知识图谱的研究现状} +在知识表示与知识推理中,知识图谱是一个使用图结构的数据模型或拓扑结构的知识库来整合数据。知识图谱常被用来存储内连接的对实体的描述——对象、事件、情形或抽象概念,并包括自由形式的语义。 + +该词汇早在1972年在一个有关构建模块化指令系统的课程中被提出。在80年代末,名叫知识图谱的项目主要聚焦于语义网络的设计。在2007年,DBpedia和Freebase作为基于图的有关常识的知识库被创立。DBpedia致立于从Wikipedia中抽取数据,而Freebase也包含一系列公开的数据集。它们两者都未将自己称为“知识图谱”但构建并描述了其相关概念。 + +在2012年,谷歌正式提出了知识图谱的概念\cite{singhal2012introducing},建立于DBpedia和Freebase以及其他数据源的基础之上。他们后来将包括CIA World Factbook, Wikidata和Wikipedia的网站的RDFa, Microdata, JSON-LD内容从它们的索引网站上抽取并纳入知识图谱。与知识图谱相关联的实体与关系类型使用来自scheme.org的术语被更广泛地被组织起来。 + +谷歌的知识图谱非常重要的一块是“自由库”,一个大型的协同工作知识库。“自由库”使用图结构作为其数据结构,可以将其视作一个有向图。谷歌知识图谱模型便是谷歌团队利用其在“自由库”之上的技术积累开发出来的\cite{漆桂林2017知识图谱研究进展}。 + +自此,数个大型跨国公司开始利用它们的知识图谱,很快知识图谱流行起来。 + +在2019年,IEEE将其关于“大数据”和“数据挖掘与智能计算”的年度国际会议融入有关知识图谱的国际会议。 + +以上是知识图谱发展的主要进程。 + +知识图谱一般表示为三元组的形式,即G=(h,r,t),其中G为知识图谱,h和t是知识库中的实体集合,分别为三元组的头结点与尾节点\cite{徐增林2016知识图谱技术综述}。 + +目前知识图谱的构建过程中主要使有定义层次学习的思想及事实学习的思想等方法。 + +定义层次学习是通过使用机器学习等技术,从文字、图片等信息中提取知识表达中的定义,并确定其上下文信息。而知识图谱本质上是属于一种精炼的异构信息网络。利用定义层次学习可以在一定程度上完成对于知识图谱的构建。 + +事实学习分为有监督的事实学习、半监督的事实学习以及无监督的事实学习。有监督的事实学习通过人为标注的语料信息输入以及深度学习方法来完成知识图谱的构建,而半监督的事实学习方法使用启发式地自动标注文本,但缺陷是训练数据集中可能含有大量的噪声数据。而无监督的学习方法主要使用基于深度学习模型的自然语言处理(NLP)的方法,无须人为干预,由训练模型自动完成信息抽取、信息整合的方法。随着深度学习算法的发展,目前基于无监督的学习方法的事实学习逐渐成为主流\cite{李涓子2017知识图谱研究综述}。 + +目前出现了诸多使用以上思想设计的知识图谱嵌入算法:基于翻译的TransE\cite{bordes2013translating}、TransH\cite{wang2014knowledge}、TransR\cite{lin2015learning}和基于语义分析的DistMult\cite{yang2014embedding}等。 + +目前,知识图谱在业界的应用已经取得了巨大成功\cite{曹倩2015知识图谱的技术实现流程及相关应用}: + +(1)搜索引擎技术。如前所述,知识图谱最早便是由谷歌提出以改善其搜索引擎的。在将知识图谱应用于搜索引擎之后,搜索引擎能对一些常见的搜索内容基于其使用的知识图谱信息快速给出搜索结果。同时,对于一些名词性的搜索内容,搜索引擎能使用知识图谱以知识卡片的形式给出其相关信息。研究表明,在谷歌将知识图谱技术融入其搜索引擎之后,用户点击进入维基百科的次数明显减少,说明利用知识图谱技术的搜索引擎可以更好的直接给出用户需要的信息而不需要用户再访问其他网站。 + +(2)智能问答。信息检索系统中非常常见的一种便是问答系统。问答系统在用户输入问题后能迅速给出用户需要的答案。而在将知识图谱技术应用于问答系统后,其回答的准确率有非常大的提升。目前苹果的智能助理Siri以及谷歌的智能助理谷歌助理(Google Assistant)都使用了知识图谱技术。 + +此外,知识图谱还广泛应用于金融、医疗等多个领域。 +\subsection{基于知识图谱的推荐系统研究现状} +由于传统的推荐系统无法解决稀缺性问题和冷启动问题,因此研究人员企图将辅助信息加入到推荐算法中以改善推荐性能。而这类辅助信息有社交网络、用户/物品属性、图像与上下文等。 + +在数种类型的辅助信息中,知识图谱通常包含有更丰富的信息与物品间的联结。一个知识图谱是一种结点关联实体、边关联关系的有向异构图。近来,研究者已提出数种学术性知识图谱,比如DBpedia和NELL,以及商业性质的知识图谱,比如谷歌知识图谱和Microsoft Satori。这些知识图谱成功应用于问答系统、词向量嵌入与文字分类等。 + +而目前基于知识图谱构建推荐系统的方法主要有以下几类: + +(1)基于嵌入的方法。基于嵌入的方法通过知识图谱嵌入计算算法将知识图谱中的实体信息与关系信息映射为低维向量空间中的向量表示(嵌入信息)。而后推荐算法利用该嵌入表示来完成相应的计算,并给出推荐结果。目前基于知识图谱中嵌入表示信息的方法的推荐模型有CKE\cite{zhang2016collaborative}、DKN\cite{wang2018dkn}以及SHINE\cite{wang2018shine}等。CKE是微软在 KDD2016 年发表的,其模型结构在原有系统过滤得到 U, V 向量的基础上,将物品的嵌入与其他描述信息相结合,这些信息主要有: +采用 TransR 算嵌入得到的知识图谱,图谱内每个实体嵌入表示被提取为物品的结构化向量信息。 +采用SDAE模型得到物品描述性文本的文本性嵌入表示。 +采用SCAE模型得到物品相关图像的视觉嵌入表示。DKN是之前同样由微软团队在 WWW2018 会议上发表的。它是一个主要针对新闻任务提出的框架,知识图谱用在对新闻标题作嵌入的层面。DKN 提出对新闻标题内每一个关键实体,在知识图谱内找到其实体嵌入和上下文嵌入。 +SHINE设计深度自编码器来嵌入语义网络,社交网络来进行推荐。其为用户-物品的交互使用自动编码器并刻画用户感兴趣的概率。 + +(2)基于路径的方法。基于路径的方法将知识图谱视为异构信息网络,主要是通过知识图谱中的路径中的关系信息来辅助推荐算法来完成推荐相关的计算工作。目前基于知识图谱中路径信息的推荐模型有HIN\cite{zhao2017meta}、RKGE\cite{sun2018recurrent}等。HIN是2017年在KDD上提出的,与 PER\cite{yu2014personalized}类似,都将将知识图谱视为异构信息网络。其针对Yelp和Amazon数据集分别设计了元路径,并得到了L个评估函数。并在建模时使用FM模型,使用FM组损失函数进行梯度下降,并最终得到推荐结果。RKGE模型使用了基于循环神经网络的方法。在人为定义元路径并抽取出所有路径之后,对每种元路径都使用循环神经网络模型来抽取并推理其路径中所包含的信息。 + +(3)混合式方法。基于嵌入的方法未能充分利用实体间的关系模式信息,而基于路径的方法仅考虑了实体间的语义连通信息,未能有效使用用户/物品本身的语义信息。因此,目前出现了混合式方法,即同时结合了基于嵌入的方法与基于路径的方法的优点。混合式方法是当前的研究热点与焦点,使用该方法的典型模型有AKUPM\cite{tang2019akupm}和RCoLM\cite{cao2019unifying}等。AKUPM是用于推荐的以注意力机制增强的推荐模型,RCoLM则是基于联合学习并以任务为导向的推荐算法。本文实现的电影推荐系统是基于论文“涟漪网络:在知识图谱上传递用户偏好的推荐模型\cite{wang2018ripplenet}”的,其中所使用的算法模量型是也隶属混合式方法。 +\begin{figure} + \includegraphics[width=\textwidth]{enhanced-recommendation} + \bicaption{受知识图谱增强的电影推荐系统}{Knowledge graph enhanced movie recommendation system}\label{fig:enhanced-recommendation} +\end{figure} + +受到将知识图谱成功应用于多种类型任务的启发,研究人员企图将知识图谱作为辅助信息加入推荐算法中以改善推荐系统的性能。图~\ref{fig:enhanced-recommendation}中显示了知识图谱提供丰富的信息与物品间的连接,有利于提高推荐结果的准确性、多样性和可解释性。知识图谱可以从以下三个方面提高推荐性能: + +(1)知识图谱引入了实体语义相关性,这可以帮助找到其潜在的联系并提高推荐物品的准确性。 + +(2)知识图谱由各种类型的关系构成,这对合理的扩展用户兴趣并增加推荐商品的多样性是有益的。 + +(3)知识图谱连接用户的历史记录及推荐的商品,因此为推荐系统提高了可解释性。 + +将知识图谱作为辅助信息加入至推荐系统中是当前的热点问题。 +\section{本文的主要研究内容} +本文在研究推荐算法、知识图谱和基于知识图谱的推荐算法的相关研究基础上,做了以下数个方面的研究: + +(1)设计并实现了基于知识图谱的电影推荐系统,使用“电影透镜1兆数据”作为数据集,此外还从IMDb及豆瓣爬取了相关电影数据作为研究对象。 + +(2)根据论文“涟漪网络:在知识图谱上传递用户偏好的推荐模型\cite{wang2018ripplenet}”实现了基于知识图谱的推荐算法——涟漪网络,该算法能根据用户的历史行为来为用户进行电影推荐。此外,将涟漪网络算法与其他基于知识网络的推荐算法(DKN\cite{wang2018dkn}、CKE\cite{zhang2016collaborative} 、PER\cite{yu2014personalized}、SHINE\cite{wang2018shine}、LibFM\cite{rendle2012factorization}和Wide\&Deep\cite{cheng2016wide}等)进行性能比较。 + +(3)实现一个基于知识图谱的电影推荐系统,该系统能够根据用户的历史行为(评分、收藏等)来为用户进行电影推荐。该系统分为管理员、未登录用户、普通登录用户。管理员能增加、修改和删除电影和普通用户;未登录用户能根据影分类查看电影及查看电影详情;普通登录用户除能进行未登录用户的操作外,还能购买、收藏及评价电影。 +\section{论文结构} +本论文一共分为五个章节。 + +第一章是绪论。简明介绍知识图谱作为辅助信息在推荐算法中的重要作用以及推荐算法对在线流媒体播放平台的重要作用,介绍了推荐系统、知识图谱和基于知识图谱的推荐系统的发展和应用以及本文的主要工作及创新点。 + +第二章是相关理论和技术。介绍了目前知识图谱和推荐系统的研究现状,并对传统的推荐算法与加入辅助信息的推荐算法作了较为细致的分类与阐述。同时还介绍了本文实现的电影推荐系统的技术栈,比如数据库、前端架构、后端架构等。 + +第三章是涟漪网络。介绍了涟漪网络算法,以及计算相关实体嵌入的过程中使用的深度学习算法,并对该算法进行了讨论。最后,还对涟漪网络推荐算法的准确度进行了测试。 + +第四章是电影推荐系统。介绍了以涟漪网络算法为基础构建的电影推荐系统:介绍了系统架构、系统功能、电影推荐流程以及如何保证该系统的安全性。 + +第五章是研究结论和展望。总结了涟漪网络算法的设计与实现、电影推荐系统的功能,并指出了其中可以改进的地方。 +\chapter{相关理论和技术} +\section{知识图谱} +\subsection{知识图谱的概念及发展进程} +知识图谱,是一种知识可视化或知识领域映射地图,是显示知识发展进程与结构关系的一系列三元组(实体,关系,实体),用可视化技术描述知识信息及其载体,挖掘、分析、建立、绘制和可视化知识以及它们之间的相互关系。 + +知识图谱是谷歌于2012年提出的,目的是为了增强其搜索引擎。而后微软于2013年7月发布了其Microsoft Satori知识图谱。除传统搜索服务提供商之外,包括Apple,Facebook,IBM等互联网企业也在探索该领域。 + +此外,业界也出现了社区构建的开源知识图谱,如DBpedia,NELL和Wikidata等。 + +以Freebase、WordNet和GeneOntology等为例的知识图谱已成为支持人工智能相关应用的非常重要的资源。 +\subsection{知识图谱的构建方法} +知识图谱是由多实体结点和不同关系边构成的多关系图,一个边是一个事实三元组(头结点,关系,尾结点)(记为(h, r, t))。而知识图谱的构建便是寻找这样的三元组。 + +在过去十年,在构建大型知识图谱方面已取得很大的成就,然而,还没有清晰的支持构建知识图谱的范式。主要有两个困难:(1)知识图谱是符号化的逻辑系统而知识图谱的应用常常是包含在连续空间的计算。(2)在一张图谱上进行知识聚合是困难的。 + +目前,知识图谱主要通过以下3个步骤来完成构建: + +(1)信息抽取。即从各类型的源数据中抽取出实体(概念)、实体间的关系,并在此基础之上形成确切的知识表达。 + +(2)知识融合。对新获得的知识进行整合,以完成消歧义。 + +(3)知识加工。对融合后的新知识经过质量核查后将正确的部分加入至知识图谱中。 +\subsection{知识图谱的应用} +知识图谱以更接近人类认知的方式为互联网的信息表达提供了一种新的方式,而且提供了一种更益于组织与利用海量的方式。当前知识图谱主要用于搜索引擎(Bing,Google Search)、个人助理(Google Assistant)以及问答系统。 +\section{推荐系统} +推荐系统是根据用户可能给某物品评分或用户可能偏好的内容过滤系统的一个子集。 + +推荐系统广泛使用于多个领域,通常有为视频或音乐服务生成推荐清单的表现形式。 +\subsection{传统的推荐系统} +传统的推荐系统主要分为基于内容的推荐系统、基于协同过滤的推荐系统和混合推荐系统\cite{黄立威2018基于深度学习的推荐系统研究综述}。(1)基于内容的推荐系统主要用于文本相关的项目,因为内容常常是使用关键字来描述的。该算法通过计算相关物品的离散特征,然后推荐具有与其类似特征的有关物品。(2)基于协同过滤的推荐系统主要通过将具有与目标用户相似特征的用户所交互过的物品推荐给目标用户。 + +基于内容推荐与通过协同过滤推荐的有关区别可以从比较两个流行音乐推荐系统的实现方式中得出:(1)潘多拉音乐使用一个基于内容推荐的推荐算法。它根据艺人或歌曲的属性来生成一个包含相似风格歌曲的电台,并且该电台的内容会根据收听用户的反馈进行调整。当用户对一首歌曲“不感兴趣”时该算法将弱化该歌曲的一些属性;而当用户喜欢一首歌曲时,将强化一些属性。并且该算法会根据该属性调整歌曲的顺序,若越过一个阀值时将某一歌曲从列表中删除。(2)“终级fm”使用一个协同过滤的推荐算法。它记录用户经常收听的乐队和歌手,然后与其它用户的有关行为进行比较,建立一个电台,并以此推荐歌曲。“终级fm”会给用户推荐其他具有相似特征用户的播放列表(并保证目标用户未收听过)。 + +而上述两种推荐算法都有其长处与短处。潘多拉音乐所使用的基于内容推荐的推荐算法是根据物品本身的性质来进行推荐的,因此不需要用户信息就可以有较好的准确度。但该算法严重以来物品本身的特性,因此局限性较大,推荐的内容都是与种子集相关的,推荐结果的多样性较低。而“终级fm”使用的协同过滤算法需要根据用户与物品的交互来生成推荐结果,因此需要大量的用户数据,存在数据稀缺性问题与冷启动问题。 +\subsection{基于知识图谱的推荐系统} +基于内容推荐与协同过滤推荐两者均存在一些局限性,为了提高推荐的准确性与解决传统的推荐算法的数据稀缺性与冷启动问题,研究者将一些辅助信息加入至推荐算法中,通常这些辅助信息包括上下文信息、用户或物品的属性、图片和社交网络\cite{常亮2019知识图谱的推荐系统综述}\cite{王一鸣2018基于知识图谱的推荐技术研究及应用}。 + +而随着知识图谱的发展,当前将知识图谱作为辅助信息加入推荐系统来提高推荐系统性能已经成为了一个热门的研究方向。将知识图谱作为辅助信息加入推荐算法可以产生两个优点: + +(1)提高推荐系统的准确性。知识图谱可以表示不同实体间的关系,可以将物品及其相关属性对应于知识图谱之中,从而推荐算法可以理解物品之间的关系。此外,用户与用户间的关系信息也可以映射至知识图谱之中,从而推荐算法可以更准确地分析物品与物品间的关系、用户与物品之间的关系。 + +(2)提高推荐系统的可解释性。由于推荐结果依照知识图谱中的关系信息,因此可以由知识图谱中的关系路径得到推荐结果的原因。 + +目前主要的基于知识图谱的推荐算法有基于嵌入的方法、基于路径的方法以及混合式方法: + +(1)基于嵌入的方法。基于嵌入的方法使用知识图谱的信息来完善实体的嵌入表示。为了将知识图谱中的信息添加至推荐算法中来辅助推荐,需要使用知识图谱嵌入表示算法(Knowledge Graph Embedding, KGE)表计算实体嵌入(实体嵌入指由知识图谱中信息得到的在低维向量空间中的向量表示)。KGE算法有TransE\cite{bordes2013translating}、TransH\cite{wang2014knowledge}、TransR\cite{lin2015learning}和DistMult\cite{yang2014embedding}等。而推荐算法将通过计算得到的嵌入表示来计算物品-物品间、用户-用户间以及用户-物品间的关系,从而对用户进行物品推荐。 + +(2)基于路径的方法\cite{lin2015modeling}\cite{guu2015traversing}\cite{toutanova2016compositional}。基于路径的方法将知识图谱视为异构信息网络。而推荐系统利用该异构信息网络寻找实体间的关系,从而完成推荐。 + +(3)混合式方法。基于嵌入的方法未能充分利用实体间的关系模式信息,而基于路径的方法仅考虑了实体间的语义连通信息,未能有效使用用户/物品本身的语义信息。因此,目前出现了混合式方法,即同时结合了基于嵌入的方法与基于路径的方法的优点。混合式方法是当前的研究热点与焦点,使用该方法的典型模型有AKUPM\cite{tang2019akupm}和RCoLM\cite{cao2019unifying}等。本文基于的算法也隶属该类。 +\section{系统开发技术} +\label{sec:tech-stack} +\subsection{数据采集技术} +电影推荐系统使用的数据来自“电影透镜1兆数据”\footnote{https://grouplens.org/datasets/movielens/1m/}数据集,此外还从IMDb\footnote{https://www.imdb.com/}及豆瓣\footnote{https://www.douban.com/}爬取了相关电影数据作为研究对象。 + +在数据采集的过程中,使用Scrapy框架进行了数据爬取,爬取的数据包括电影名称、电影封面、预告片图片、电景情节介绍、导演、演员以及剧作家。 + +最终,一共爬取了3684部电影的数据。其中,从IMDb爬取了3494部电影数据,从豆瓣爬取了190条电影数据(由于豆瓣限制了每IP访问量故爬取的数据较少)。 +\subsection{数据存储技术} +本系统使用MongoDB与Neo4j存储数据。 + +\noindent (1)MongoDB + +MongoDB是一个新兴的非关系型存储的分布式存储数据的数据库,属于NoSQL,与MySQL等传统的关系型数据库相比,它提供更好的高并发支持,具有高可靠性的优点。与此同时,得益于其基于文档储存的特点,相比较传统的关系型数据库,它的存储结构更灵活。 + +在本系统中,MongoDB存储普通用户数据、管理员数据、电影数据等。 + +\noindent(2)Neo4j + +Neo4j是一个具有高性能的图数据库,它将结构化的数据信息储存在网络上而不是存储在表中。它具有健壮和成熟的数据库的所有特点。虽然Neo4j是一个新兴的数据库,但它已在具有超过1亿节点、关系和属性的产品中得到了应用,充分体现了其高性能、高可靠性的特点。 + +在本系统中,知识图谱的有关信息被存储在Neo4j中,由于知识图谱本身图的特性,这充分利用了Neo4j作为图数据库的特点,可以提供良好的性能支持。 +\subsection{后端技术} +本系统使用Flask框架作为网站后端框架。Flask是一个Python编写的轻量级微框架。它具有轻量、便捷、可扩展等特点。 + +本系统选择Flask框架充分利用了其便捷、可扩展以及开发便捷的特点,与本系统要求相符。 + +本系统使用表现层状态转换(REST)风格的应用程序接口(API)作为前后端的交互接口。 + +表现层状态转换(Representational State Transfer,REST)是一种基于HTTP协议的软件交互体系结构样式,该协议是由Roy Thomas Fielding博士在2000年的博士论文中引用的\cite{fielding2000architectural},目的是促进不同的软件/程序的开发。在网络上互相传输数据。表示层状态转换基于超文本传输协议(HTTP)的一组约束,该协议是一种旨在提供万维网服务的软件构造样式。符合或兼容此体系结构样式(简称为REST或RESTful)的网络服务允许客户端发出使用统一资源标识符访问和操作网络资源的请求,这些资源与一组预定义的操作一致。因此,表示层状态转换提供了Internet上计算机系统之间相互使用资源的互操作性。与其他类型的网络服务(例如SOAP服务)相比,它们使用自己定义的一组操作来访问网络资源。 + +得益于本系统使用了REST风格的API,本系统能更有效地使用缓存来提升响应速度,同时本系统前后端的相互间通讯的无状态性可以让不同的服务器的处理一连串请求中不同的请求,提高了本系统的可扩展性。与此同时,得益于REST风格语义化的接口,使前后端交互接口更清晰明了,使接口的使用者能更高效便捷地进行相关的开发工作。 +\subsection{前端技术} +本系统前端使用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网络服务器框架。 + +通过使用Angular框架,本系统具有一个现代化、模块化的网页架构。同时借助于Angular Material Components官方组件库,本系统前端UI符合材料设计(Material Design)。 +\chapter{基于涟漪网络知识图谱的推荐算法} +\label{ch:offline-recommendation} +\section{涟漪网络} +\subsection{架构} +涟漪网络的总体架构如图~\ref{fig:ripplenet-framework}中所示,图上方的知识图谱中展示由用户交互产生的涟漪。涟漪网络以一个用户$u$和一个电影$v$作为输入,并输出用户$u$与电影$v$之间产生交互的概率。对输入用户$u$而言,其历史交互记录$V_u$是知识图谱中的种子集,而后沿着知识图谱中的关系边形成多个涟漪集$S_u^{k}\ (k=1, 2, \dots, H)$。一个涟漪集是距离种子集$V_u$ $k$跳的知识三元组。这些涟漪集用于与迭代地与电影$v$的嵌入(黄色的块)表示相计算以得到关于电影$v$的用户$u$的反应(绿色的块),最后结合得到用户的最终嵌入表示(灰色的块)。最终,将用户$u$与电影$v$的嵌入表示相结合以计算出预测概率$y_{uv}$。 +\begin{figure} + \includegraphics[width=\textwidth]{ripplenet-framework} + \bicaption{涟漪网络的总体架构}{The overall framework of the Ripple Network}\label{fig:ripplenet-framework} +\end{figure} +\subsection{涟漪集} +\begin{figure} + \includegraphics[width=\textwidth]{illustration-of-ripple-sets} + \bicaption{电影知识图谱中由“阿甘正传”激发的涟漪集}{Sets of ripples of “Forest Gump” in Knowledge Graph of movies}\label{fig:illustration-of-ripple-sets} +\end{figure} +知识图谱常常含有丰富的事实信息与实体间的联系。比如,如图~\ref{fig:illustration-of-ripple-sets}(图中不同颜色的圆圈表示有不同跳的涟漪集。较浅的蓝色代表中间与周边实体的关联程度。)所示电影“阿甘正传”与“罗伯特·泽米吉斯”相连,它们之间的联系是“罗伯特·泽米吉斯”是电影“阿甘正传”的导演。而“回到未来”也与“罗伯特·泽米吉斯”相连。因此,如果一个用户与电影“阿甘正传”交互过,则他很有可能也对“回到未来”感兴趣。为了描述用户在知识图谱中分层次的可能偏好集,递归定义用户$u$的k跳相关实体如下: + +\textbf{定义1(相关实体集) } 给定交互矩阵$\Upsilon$与知识图谱$G$,则用户$u$的$k$跳相关实体可以定义为 +\begin{equation} + E_u^k=\{t|(h, r, t)\in G \text{且} h\in E^{k-1}_u\}, k = 1, 2, \dots, H\label{relevant-entities} +\end{equation} +式\eqref{relevant-entities}中$E_u^0=V_u=\{v | y_{uv}=1\}$是用户的历史偏好集,可以看作用户$u$在知识图谱中的种子集。 + +相关实体集可以看作用户的历史偏好集在知识图谱中的自然扩展。给定相关实体集的定义,以下定义用户$u$的$k$跳涟漪集: + +\textbf{定义2(涟漪集)}用户u的k跳涟漪集可以看作是知识图谱中以$E^{k-1}_u$为起点的知识三元组: +\begin{equation} + S_u^k = \{(h, r, t)|(h, r, t)\in G \text{且} h\in E^{k-1}_u\}, k = 1, 2, \dots, H\label{ripple-set} +\end{equation} +“涟漪”这个词有两重意思:(1)对由多个雨点产生的真实涟漪的模拟,用户由其在实体中交互过的潜在兴趣集在知识图谱中由近及远地传递。这一过程如图~\ref{fig:illustration-of-ripple-sets}所示。(2)用户的潜在兴趣随着在知识图谱中会传递的跳数$k$的增大逐渐递减。图~\ref{fig:illustration-of-ripple-sets}中蓝色的变浅也显示了潜在兴趣递减的过程。 + +一个顾虑是在跳数$k$增加的过程中涟漪集的大小可能太大。为了解决这个问题,注意到: + +(1)在真实使用的知识图谱中大量的实体是沉没实体,意思是它们只有传入链路而没有传出链路。 + +(2)在电影推荐的具体情境下,关系可以限制在情境相关的分类中以减少涟漪集的数量并提高实体间的相关度。 + +(3)最大跳数$H$通常在实际应用中不会太大,因为离用户历史列表较远的实体会带来更多的嗓音而不是较好的信号。 + +(4)在涟漪网络中,我们可以对一个固定大小的邻集而不是对完整的涟漪集采样从而更进一步地减小计算工作量。设计这样的采样器是一个未来的重要工作,尤其是非统一的采样器能更好地捕获用户的分等级的潜在兴趣。 +\subsection{偏好扩散} +\label{sec:osum} +在传统的协同过滤算法中是通过学习用户与物品的潜在联系来完成推荐过程,而在涟漪网络算法中,这一过程是通过偏好扩散完成的:对每一个用户,涟漪网络将它的过往兴趣视为一个知识图谱中的种子集,然后沿知识图谱中的路径重复地拓展用户的兴趣来发现它的按等级划分的关于一个候选物品的潜在的兴趣。我们使用真实的由雨滴产生的涟漪在水面上扩散来模拟偏好扩散,其中多个“涟漪”重叠形成一个知识图谱上的作为结果的用户偏好分布。 + +如图~\ref{fig:ripplenet-framework},每一部电影都具有一个嵌入表示v,$v\in R^{d}$,其中$d$是嵌入表示向量的维数。嵌入表示可以包含实体的独热编码\cite{koren2008factorization}、词汇集\cite{wang2018dkn}、上下文信息\cite{sun2017collaborative}或属性\cite{wang2018shine},而选择哪一种嵌入向量的计算方式取决于其应用场合。给定电影的嵌入表示v以及用户$1$跳涟漪集$S_u^{1}$,每一个$S_U^{1}$中的事实三元组($h_i$,$r_i$,$t_i$)根据电影v以及三元组中的头节点$head_i$的比较和三元组中的关系$r_i$来确定电影$v$和实体$head_i$之间的相关度: +\begin{equation} + p_i=softmax(v^TR_ih_i)=\frac{exp(v^TR_ih_i)}{\sum_{(h, r, t)\in S_u^1} exp(v^TRh)}\label{eq:item-entity-relevance} +\end{equation} +其中$R_i\in R^{d\times d}$与$h_i\in R^d$分别是关系$r_i$和头节点$h_i$的嵌入表示。相关度$p_i$可以认为是在向量空间$R_i$中的电影v与实体$h_i$之间的相似度。同时还将关系信息的嵌入表示矩阵在计算电影v与实体$h_i$之间的相似度时纳入考量,因为不同就电影-实体对之间的相似度在具有不同关系信息时可能有所不同。比如,“阿甘正传”与“回到未来”在导演方面有很高的相似度,但它们在考虑体裁信息或剧作家方面可能没有任何联系。 + +在取得相似度信息之后,将$S_u^{1}$中三元组的尾节点根据计算得到的相似概率进行加权求和,得到向量$o^{1}_u$: +\begin{equation} + o^1_u=\sum_{(h_i,r_i,t_i)\in S_u^1}p_it_i\label{eq:o1} +\end{equation} +式~\eqref{eq:o1}中$t_i\in R^{d}$是事实三元组中的尾节点$t_i$。向量$o^{1}_u$可以视为用户偏好集$V_u$关于电影$v$的1次反应。与协同过滤算法类似的是,它根据用户交互过的物品来表示用户嵌入而不是使用单独的参数来表示用户并以此来缩减参数。通过式~\eqref{eq:item-entity-relevance}与式~\eqref{eq:o1},用户的偏好从其交互过的电影(种子集)成功在知识图谱中进行了一次扩散,这称为涟漪网络中的偏好扩散。 + +注意到可以将式~\eqref{eq:item-entity-relevance}中的$v$替换为$o_u^1$,我们可以重复偏好扩散的过程以得到用户的2次反应$o_u^2$。以此类推,最终我们可以将该用户偏好集扩散至$H$跳。我们可以得到用户的涟漪集$S_u^{i}, i=1,\dots,H$。从中我们可以得到用户的不同次反应$o^{1}_u, o^{2}_u, o^{H}_u$。用户$u$关于电影$v$的嵌入表示由结合所有次不同反应计算得到: +\begin{equation} + u=o_u^1+o_u^2+\dots+o_u^H\label{eq:osum} +\end{equation} +尽管最后一跳的用户响应中理论上包含了所有之前跳的信息,但对$o^k_u$进行求和仍然是有必要的,因为最后一跳的用户响应可能在偏好传递的过程中稀释了,不能很好地表示用户嵌入。最终,用户嵌入与电影嵌入相结合以来输出预测的用户对电影感兴趣的概率: +\begin{equation} + y_{uv}=\zeta(u^Tv)\label{eq:predicted-possibility} +\end{equation} +其中,$\zeta(x)=\frac{1}{1+exp(-x)}$是sigmoid函数。 +\section{学习算法} +在涟漪网络算法中我们的目标是通过式~\eqref{eq:predicted-possibility}求出用户对电影感兴趣的概率。但是,为了将其计算出来我们需要先求出所有物品、用户以及关系的嵌入表示,如第\ref{sec:osum}节中所述,用户的嵌入表示可以通过其涟漪集来代替,以此消元。但物品及关系的嵌入表示却是需要求出来的。 + +为了求出物品及关系的嵌入表示,我们使用最大后验概率估计的方法。 + +我们的目标是在已经得到知识图谱$G$以及用户与电影的交互矩阵$\Upsilon$的情况下最大化模型参数$\Gamma$: +\begin{equation} + max\ p(\Gamma |G,\Upsilon) +\end{equation} +其中参数$\Gamma$包含了所有的嵌入,包含全部的实体、关系和电影。这我等价于最大化 +\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} +根据贝叶斯公式,在式~\eqref{eq:equal-max}中,第一项$p(\Gamma)$测量模型参数的先验概率。我们将$p(\Gamma)$设为均值为0,方差为对角协方差矩阵的正态分布: +\begin{equation} + p(\Gamma)=N(0,\lambda_1^{-1}I) +\end{equation} +式~\eqref{eq:equal-max}中的第二项是给定$\Gamma$的知识图谱的最大似然函数。最近,有研究者提出了许多种计算知识图谱嵌入的方法,包括基于距离的方法和基于语义匹配的方法。在本算法中,我们使用三路张量分解的方法来建立知识图谱嵌入的最大似然函数: +\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^TRt,\lambda_2^{-1})\label{eq:term2} +\end{equation} +其中若$I_{h,r,t}\in G$则标志$I_{h,r,t}$等于1否则为0。基于式~\eqref{eq:term2}中的定义,知识图谱嵌入中的实体对评分函数与偏好传递过程中的电影-实体对可以在相同的计算模型下被统一。式~\eqref{eq:equal-max}中的第三项是给定$\Gamma$与知识图谱的似然函数,可以看作伯努利分布的累乘: +\begin{equation} + p(\Upsilon|\Gamma,G)=\prod_{(u,v)\in \Upsilon}\zeta(u^Tv)^{y_{uv}}\centerdot (1-\zeta (u^Tv))^{1-y_{uv}} +\end{equation} +对式~\eqref{eq:equal-max}取负对数,我们有下面的损失函数: +\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^Tv)+(1-y_{uv}log(1-\zeta(u^Tv))))\\ ++\frac{\lambda_2}{2}\sum_{r\in R}\|I_r-E^TRE\|_2^2+\frac{\lambda_1}{2}(\|V\|^2_2+\|E\|^2_2+\sum_{r\in R}\|R\|^2_2)\label{eq:term3} +\end{multline} +其中$V$和$E$是对所有电影与实体的嵌入表示。$I_r$是在知识图谱中的对关系$r$的标志向量$I$的分片。在式~\eqref{eq:term3}中第一项度量交互矩阵$\Upsilon$与由涟漪网络的估测值之间的交叉熵,第二项度量真实的知识图谱分片$I_r$以及人为构建的指示矩阵$E^{T}RE$之间的均方误差,最后一项是为防止过拟合加入的正则项。 + +直接求解上式来得到参数$\Gamma$是不可能的,因此我们使用随机梯度下降算法递归地优化损失函数来求解模型参数。然后我们再计算关于参数$\Gamma$的损失函数的梯度并更根据采样得到的一小批数据反向传递以更新参数并最终得到参数$\Gamma$。 +\section{分析} +\subsection{可解释性} +可解释的推荐系统旨在阐释为什么用户会对一件物品感兴趣,这帮助提升用户对推荐结果的满意度以及对推荐系统的信任。对推荐结果的解释通常基于标签、语义分析等。因为涟漪网络探索用户基于知识图谱的兴趣,因此它提供了一种基于知识图谱中的关系路径来阐述推荐结果的全新方式。比如,在图~\ref{fig:illustration-of-ripple-sets}中,当用户对“幸福终点站”感兴趣,则该用户也可能对“荒岛余生”感兴趣。因为在知识图谱中,“汤姆·汉克斯”与“幸福终点站”相连,关系是演员,而“汤姆·汉克斯”与“荒岛余生”也相连,关系也是演员,也就是说“荒岛余生”与“幸福终点站”有相同的演员。这便解释了为什么当用户对“幸福终点站”感兴趣,则该用户也可能对“荒岛余生”感兴趣。而涟漪网络算法正是通过这种方式运作的。涟漪网络算法通过在知识图谱中寻找与用户交互过的电影(种子集)相连的物品,并不断扩散,最终推荐结果之所以拥有较高的准确性,正是因为如上所述的原因。 +\subsection{涟漪重叠} +在涟漪网络中一个常见的现象是用户涟漪集中的电影可能非常多,而会在偏好传递的过程中不可避免地导致其真实的潜在偏好信息被稀释。然后,观察到用户点击记录中不同的电影常常高度重叠。换句话说,从种子集出发到达一部电影常常有不止一条路径。比如,在图~\ref{fig:illustration-of-ripple-sets}中,如果一个用户喜欢“阿甘正传”,则他也可能喜欢“荒岛余生”。在该知识图谱中,从“阿甘正传”到“荒岛余生”有两条路径:“阿甘正传-U.S.-荒岛余生”与“阿甘正传-汤姆·汉克斯-荒岛余生”,这正是涟漪重叠的表现。 +\section{测试} +\subsection{数据集} +该测试使用“电影透镜1兆数据”数据集。该数据集由电影信息、用户信息以及用户对电影的评分三部分组成。其中,含有电影数据3883条、用户数据6040条以及1000209条用户对电影的评分数据。因该数据集数据量适中,数据准确可靠,因此在推荐系统的性能测试中被广泛使用。 + +对于知识图谱,该测试依据“电影透镜1兆数据”中的电影从Microsoft Satori中提取相关的知识图谱数据来构建知识图谱。 +\subsection{基线} +在本测试中,将本算法的测试结果与以下算法的相比较: + +DKN\cite{wang2018dkn}是之前同样由微软团队在 WWW2018 会议上发表的。它是一个主要针对新闻任务提出的框架,知识图谱用在对新闻标题作嵌入的层面。DKN 提出对新闻标题内每一个关键实体,在知识图谱内找到其实体嵌入和上下文嵌入。 + +CKE\cite{zhang2016collaborative} 是微软在 KDD2016 年发表的,其模型结构在原有系统过滤得到 U, V 向量的基础上,将物品的嵌入与其他描述信息相结合,这些信息主要有: +采用 TransR 算嵌入得到的知识图谱,图谱内每个实体嵌入表示被提取为物品的结构化向量信息。 +采用SDAE模型得到物品描述性文本的文本性嵌入表示。 +采用SCAE模型得到物品相关图像的视觉嵌入表示。 + +SHINE\cite{wang2018shine}设计深度自编码器来嵌入语义网络,社交网络来进行推荐。其为用户-物品的交互使用自动编码器并刻画用户感兴趣的概率。 + +PER\cite{yu2014personalized}将知识图谱作为辅助信息基于路径的方法中比较经典的算法,是对后续模型做的改进。其提出的元路径可以为推荐系统提供可靠的方向,但是需要事先熟悉领域内知识,进行人为路径设计。 + +LibFM\cite{rendle2012factorization}是一个广泛使用的基于功能的在CTR场景中的分解模型。 + +Wide\&Deep\cite{cheng2016wide}是一个结合线性路径的推荐模型。类似于LibFM,我们将用户、物品及实体的嵌入表示作为其输入。 +\subsection{测试步骤} +在涟漪网络中,设置跳数$H$=2。根据实验结果,较大的跳数几乎无法提高性能却会造成较大的计算负担。我们将数据划分为训练集、评估集与测试集,按照6:2:2的比较。实验进行5次,计算准确度与AUC然后取平均值。 +\subsection{结果} +测试结果如表~\ref{tab:acc-auc}中所示,总体上涟漪网络算法的性能最佳,其次是Wide\&Deep算法,说明他们可以充分利用知识图谱中的有效信息来辅助推荐算法。而表现最差的是PER算法,这可能是因为手工定义的元路径在电影推荐方面效果较差。 +\begin{table} + \bicaption{在兴趣预测计算中的AUC和准确度}{AUC and ACC in interest prediction}\label{tab:acc-auc} + \begin{tabular}{lcl} + \toprule + 算法 & AUC & 准确度 \\ + \midrule + 涟漪网络 & 0.899 & 0.835 \\ + DKN & 0.655 & 0.589 \\ + CKE & 0.796 & 0.739 \\ + SHINE & 0.778 & 0.732\\ + LibFM & 0.892 & 0.812\\ + Wide\&Deep & 0.903 & 0.822\\ + \bottomrule + \end{tabular} +\end{table} +\chapter{电影推荐系统} +\section{系统整体设计} +如第\ref{sec:tech-stack}节中所述,本系统使用的数据来自“电影透镜1兆数据”、IMDb和豆瓣。其中IMDb和豆瓣的数据是使用爬虫处理的。最后再使用Python脚本对数据进行处理加工,并导入MongoDB和Neo4j。 + +本系统使用MongoDB和Neo4j存储数据。其中,MongoDB作为非关系型的新兴NoSQL数据库,以灵活非结构化的方式存储普通用户数据、管理员数据、电影数据等,并提供高并发的性能支持与可分布式存储的扩展性。而在以高性能著称的图数据库Neo4j中,则存储用于推荐算法使用的电影知识图谱信息。 + +本系统后端使用由Python编写的Flask框架,Flask框架是轻量级的微框架,以高可扩展性著称,为本系统的后端网页应用服务器提供支持。 + +在Flask中,基于REST风格构建API以供前端使用,REST风格的语义化API使后端API的构建与前端API的使用清晰明了。 + +本系统前端使用Angular作为前端网页框架。Angular是基于TypeScript的网页框架,以模块化及可重用的组件设计著称。Angular为本系统提供了模块化的网页设计,使本系统前端逻辑清晰,易于维护。此外,本系统使用了Angular材料组件库(Angular Material Components),得益于此,本系统遵循材料设计(Material Design)语言,使视觉传达风格清晰明了,具有网格化的布局、响应式动化与过渡效过、光线与阴影等。 +\section{数据库设计} +如前所述,本系统MongoDB用于存储普通用户数据、管理员数据、电影数据等,而Neo4j作为高性能的图数据,用于存储知识图谱。Neo4j的存储逻辑较简单,此处不作介绍。以下说明MongoDB中数据的存储方式。 + +不同于MySQL等关系型数据库,MongoDB作为非结构化存储的NoSQL数据库,没有表、列与行的概念,而只有集合与文档的概念,即在数据库中存储集合(一定程度上对应于关系型数据库的表),在表中存储文档(一定程度上对应于关系型数据库的行),而关系型数据库中的列则对应于MongoDB中文档的属性。 + +本系统在MongoDB中建立4个集合,分别用于用户、管理员、体裁与电影数据。因其中的数据为非结构化数据,因此无法用表格的形式给出,目前习惯上以JSON结构给出数据逻辑结构,故以下以JSON结构来表示存储结构: + +以下为普通用户集合的数据结构,用户集合中的文档存储用户ID、哈希处理后的密码、其评价过的电影(包括电影ID、评分及时间)以及由推荐算法服务器写入的推荐列表、已购买电影及心愿单: +\begin{verbatim} + { + _id: Integer, + password: String, + rating: Array([ + { + movieId: Integer, + rating: Integer, + timestamp: Integer + }, + ... + ]), + recommendation: Array([Interger, ...]), + bought: Array([Interger, ...]), + wishlist: Array([Interger, ...]) + } +\end{verbatim} + +以下来管理员集合的数据结构,其存储结构较简单,管理员集合中的文档存储管理员ID、哈希处理后的密码: +\begin{verbatim} + { + _id: String, + password: String + } +\end{verbatim} + +以下为体裁集合的数据结构,其存储结构较简单,体裁集合中的文档存储体裁名称: +\begin{verbatim} + { + _id: String + } +\end{verbatim} + +以下为电影集合的数据结构,电影集合中的文档存储电影ID、电影封面、体裁、价格、评分累加和、评分总数量、预告片图片、剧情介绍、导演、剧本作家及演员。需要说明的是评分累加和以及评分总数量对应于用户集合中的评分,但只起缓存作用,定期计算。(经测试表明,每次用户访问时计算的开销较大,用户得到响应的时间过长): +\begin{verbatim} + { + _id: Integer, + title: String, + cover: String, + genres: Array([String, ...]), + price: Float, + ratingSum: Integer, + ratingCount: Integer, + trailer_image_url: String, + storyline: Array([String, ...]), + directors: Array([String, ...]), + writers: Array([String, ...]), + actors: Array([String, ...]), + } +\end{verbatim} +\section{系统功能说明} +\begin{figure} + \includegraphics[width=\textwidth]{use-case} + \bicaption{系统功能用例图}{Use case diagram for the system }\label{fig:use-case} +\end{figure} +本系统用户角色分为未登录用户、普通用户与管理员用户,其用例说明如图~\ref{fig:use-case}。 +\subsection{未登录用户} +未登录用户能进行以下操作: + +\noindent (1)接收随机的电影推荐。 + +未登录用户首页随机显示50部电影,如图~\ref{fig:anonymous-index}所示: +\begin{figure} + \includegraphics[width=.96\textwidth]{anonymous-index} + \bicaption{未登录用户首页}{Index page for anonymous user }\label{fig:anonymous-index} +\end{figure} + +\noindent (2)按分类查看电影。 + +未登录用户可以根据电影的分类来查看电影,如图~\ref{fig:anonymous-category}所示: +\begin{figure} + \includegraphics[width=.96\textwidth]{anonymous-category} + \bicaption{未登录用户分类页面}{Category page for anonymous user }\label{fig:anonymous-category} +\end{figure} + +\noindent (3)查看电影详情。 + +未登录用户可以查看电影详情,如图~\ref{fig:anonymous-details}。而点击页面上的“添加至心愿单”和“购买”会跳转至登录界面。 +\begin{figure} + \includegraphics[height=.7\textheight]{anonymous-details} + \bicaption{未登录用户电影详情页面}{Movie details page for anonymous user }\label{fig:anonymous-details} +\end{figure} +\noindent (4)搜索电影 + +未登录用户可从应用栏右部的搜索框搜索电影,本系统支持模糊搜索。 +\subsection{注册与登录} +\noindent(1)注册 + +本系统对普通用户开放注册功能,如图~\ref{fig:sign-up},并能提供用户名是否含不合法字符、是否与已注册用户名冲突、密码是否符合复杂度要求等的检测。 +\begin{figure} + \includegraphics[width=.96\textwidth]{sign-up} + \bicaption{注册页面}{Sign up page}\label{fig:sign-up} +\end{figure} + +\noindent (2)登录 + +本系统提供登录功能,并能根据不同的登录错误类型作出不同的响应。 +\subsection{普通用户} +普通用户具备未登录用户的所有功能。此外,还具有以下功能: + +\noindent (1)添加心愿单 + +已登录用户能在电影详情页面添加电影至心愿单。 + +\noindent (2)购买 + +已登录用户能在电影详情页面购买电影。 + +\noindent (3)评价 + +已登录用户能在电影详情页面评价电影。电影评价功能位于电影详情页面,对于未登录用户不显示用于评分的组件,对于已登录用户显示,如图~\ref{fig:general-details}所示。 + +\begin{figure} + \includegraphics[width=.96\textwidth]{general-details} + \bicaption{电影评分页面}{Rating page for movies}\label{fig:general-details} +\end{figure} + +\noindent (4)查看已购买的电影 + +已登录用户能通过侧导航栏跳转至查看已购买的电影的页面。 + +\noindent (5)查看已添加心愿单的电影 + +已登录用户能通过侧导航栏跳转至查看已添加心愿单的电影的页面。 +\subsection{管理员用户} +\noindent (1)管理电影信息 + +管理员能增加电影、删除电影与修改电影信息,如图~\ref{fig:admin-movie}所示。 +\begin{figure} + \includegraphics[width=.96\textwidth]{admin-movie} + \bicaption{管理电影页面}{Movie administration page }\label{fig:admin-movie} +\end{figure} + +\noindent (2)管理用户信息 + +管理员能增加用户、删除用户与修改用户密码。 +\section{电影推荐流程} +本系统的推荐流程分为离线推荐与实时推荐,如图~\ref{fig:recommendation-procedure}所示。 + +\begin{figure} + \includegraphics[width=\textwidth]{recommendation-procedure} + \bicaption{系统电影推荐流程}{Movie recommendation procedure }\label{fig:recommendation-procedure} +\end{figure} + +其中,离线推荐使用第\ref{ch:offline-recommendation}章中所述的涟漪网络算法,而实时推荐作为补充,描述如下: + +(1)离线推荐服务器定期运行涟漪网络算法。离线推荐服务器从MongoDB服务器获取用户信息与电影评分、电影是否加入心愿单等数据以及从Neo4j服务器获取知识图谱数据信息。然后执行涟漪网络算法。最后离线推荐服务器将计算得到的各用户推荐列表存入MongoDB数据库中,等待用户访问时将该结果推荐给用户。 + +(2)当用户访问时,网页后端服务器查询推荐列表中的电影数据是否达到阀值,如果推荐列表中的数量过少,则根据用户交互随机将同体裁电影加入推荐列表的末端作为补充并最终显示给用户。 + +上述步骤中,(1)中的离线推荐准确度高,但算法运算时间长,无法做到即时响应用户请求。(2)中的实时推荐方法准确度低,但算法运算快,可以做到实时响应请求并即时发出响应。两者相互补充组成了本系统的电影推荐算法。 +\section{系统安全性} +本系统对已登录普通用户与管理员在前后端交互过程中使用JSON网络令牌(JSON Web Token, JWT)实现授权与认证(Authorization and Authentication),以此保证了系统的安全性,本系统的总体安全性设计如图~\ref{fig:jwt}所示。 + +\begin{figure} + \includegraphics[height=.6\textheight]{jwt} + \bicaption{系统总体安全性设计}{Overall security design for the system}\label{fig:jwt} +\end{figure} + +在用户登录时,Flask后端网页服务器会生成一个长期JSON网络令牌和一个临时JSON网络令牌,令牌中存储有用户id以及过期时间,并且该令牌使用非对称加密算法加密,其中含有由Flask后端网页服务器颁发的签名信息,这确保了JSON网络令牌不会被伪造。 + +前端网页服务器在接收到令牌后会将令牌存储在浏览器的localStorage中,并在每一个接下来的请求头中附上该令牌,而后端服务器只有在该令牌有效(指确实为后端网页服务器颁发且该另令牌尚未过期)的情况下才会继续执行有关请求。与此同时,若该请求是用户内容相关,则后端服务器还会检测令牌中的id是否与请求内容中的id相同。若不满足以上任意一项,则后端网页服务器返回未授权错误信息。 + +其中,若后端网页服务器发现令牌过期,则会将该信息发送给前端网页服务器,前端网页服务器将会将长期令牌发送给后端服务器以刷新(renew)临时令牌。 + +此外,本系统还使用了哈希算法对密码进行哈希处理,数据库中的密码全部为哈希处理后的密码。同时,用户登录过程是后端网页服务器使用原密码与哈希处理后的密码进行比较,而没有开放哈希处理后的密码与哈希处理后的密码进行比较,这提高了本系统的安全性。这在同时使网站仅允许HTTPS(HTTPS-only)网络连接的情况下可以充分保证本系统的安全性。 + +需要注意的是,虽然本系统在用户登录与注册时的密码在前端没有进行哈希处理,但是本系统在部署时使用HTTPS-only的连接,在这种情况下,所有的数据传输都处于加密状态,避免了中间人攻击的可能,因此明文传输密码而不使用哈希处理是安全的,在实际应用过程中可行。而本系统在后端对由前端网页服务器传入的明文密码的目的是避免数据库中存入明文的密码。如果数据库中存入明文的密码,则当数据库中用户密码泄露时攻击者可以轻易使用泄露的密码登录本系统。而如上所述,本系统后端只开放了接收明文密码的接口,即直接将数据库中哈希处理后的密码与用户请求中的明文密码进行对比,即使攻击者获取了用户哈希后的密码,要计算其对应的明文密码是困难的,甚至在明文密码足够复杂的情况下是不可能的。以上措施保证了本系统的安全性。 +\chapter{研究结论和展望} +\section{工作总结} +随着互联网的发展,用户可选择的电影数量不断增加,为了使用户快速找到感兴趣的电影,各种推荐算法应运而生。这些算法存在推荐准确性较低、数据稀缺性以及冷启动问题。本文针对此现状,以电影推荐为研究对象,使用知识图谱作为辅助信息,利用涟漪网络算法实现了电影推荐系统。具体地说,主要的研究工作如下: + +(1)从IMDb和豆瓣上使用基于Scrapy框架的爬虫爬取了3684部电影数据。其中,从IMDb爬取了3494部电影数据,从豆瓣爬取了190条电影数据(由于豆瓣限制了每IP访问量故爬取的数据较少)。这些电影数据包括电影封面图片、电影情节介绍、电影预告片图片、电影演员列表、导演以及剧本作家等信息。 + +(2)根据论文“涟漪网络:在知识图谱上传递用户偏好的推荐模型\cite{wang2018ripplenet}”设计并实现了基于知识图谱的涟漪网络推荐算法,通过使用“电影透镜1兆数据”数据集以及从IMDb和豆瓣上爬取的电影数据,实现了基于用户心愿单和用户评分并以知识图谱为辅助信息的推荐算法。并对实现的推荐算法进行了试验,并计算了其AUC和准确度两个关键的性能指标。并对比了DKN\cite{wang2018dkn}、CKE\cite{zhang2016collaborative}、PER\cite{yu2014personalized}、SHINE\cite{wang2018shine}、LibFM\cite{rendle2012factorization}以及Wide\&Deep\cite{cheng2016wide}算法的准确度结果。并以此发现,涟漪网络算法的性能最优。 + +(3)基于涟漪网络算法实现了基于知识图谱的电影推荐系统。该系统为未登录用户提供按分类查看电影、查看电影详情的功能;为普通用户提供电影推荐、按分类查看电影、查看电影详情、电影评分、将电影加入心愿单以及购买电影功能;为管理员提供增加、删除、修改、查找电影及用户的功能。同时使用JSON网络令牌、HTTPS以及哈希化密码等手段保障系统的安全性。 +\section{工作展望} +为了给用户提供准确的推荐电影,需要不断优化并改进推荐过程。推荐系统的基础是用户历史偏好集、知识图谱信息以及推荐算法本身。因此有效地记录用户历史偏好集,完善知识图谱信息并改进推荐算法本身是提高推荐结果的重要因素。本文虽然对基于知识图谱的推荐算法有了一定的研究,并且将其应用于电影推荐系统中,但是由于时间和能力所限,该系统仍存在着不足的地方,主要体现在以下两个方面: + +\noindent (1)需要完善知识图谱的信息 + +知识图谱是本文使用的涟漪网络算法的基础,但本文所使用的知识图谱的信息还不够完善,因此在一定程度上影响了涟漪网络算法的性能。 + +\noindent (2)涟漪网络算法有待进一步改进 + +涟漪网络算法目前仅适用于离线推荐,而无法用于实时推荐,这使它的适用场景受到了限制。未来可考虑改造该算法,使其能满足实时推荐的需求。 + +对于以上提及的问题,未来还需要更深入地学习有关知识图谱、推荐算法、深度学习的有关知识,对系统进行改进,从而使其更完善。 diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/cover.pdf b/Master/texmf-dist/doc/latex/bjfuthesis/demo/cover.pdf Binary files differnew file mode 100644 index 00000000000..6ab70639e43 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/cover.pdf diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/admin-movie.png b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/admin-movie.png Binary files differnew file mode 100644 index 00000000000..163ed113259 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/admin-movie.png diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/anonymous-category.png b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/anonymous-category.png Binary files differnew file mode 100644 index 00000000000..2e0e50c64e3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/anonymous-category.png diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/anonymous-details.png b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/anonymous-details.png Binary files differnew file mode 100644 index 00000000000..571e9862dd3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/anonymous-details.png diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/anonymous-index.png b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/anonymous-index.png Binary files differnew file mode 100644 index 00000000000..6493ab444f6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/anonymous-index.png diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/enhanced-recommendation.png b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/enhanced-recommendation.png Binary files differnew file mode 100644 index 00000000000..d5f11fa4d4c --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/enhanced-recommendation.png diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/general-details.png b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/general-details.png Binary files differnew file mode 100644 index 00000000000..d8d33408b57 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/general-details.png diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/illustration-of-ripple-sets.png b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/illustration-of-ripple-sets.png Binary files differnew file mode 100644 index 00000000000..96e2920c7fe --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/illustration-of-ripple-sets.png diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/jwt.pdf b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/jwt.pdf Binary files differnew file mode 100644 index 00000000000..b6fe0199664 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/jwt.pdf diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/recommendation-procedure.pdf b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/recommendation-procedure.pdf Binary files differnew file mode 100644 index 00000000000..049f4c623d6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/recommendation-procedure.pdf diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/ripplenet-framework.png b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/ripplenet-framework.png Binary files differnew file mode 100644 index 00000000000..15bf3fe3aa3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/ripplenet-framework.png diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/sign-up.png b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/sign-up.png Binary files differnew file mode 100644 index 00000000000..2c0f6ed59da --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/sign-up.png diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/use-case.pdf b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/use-case.pdf Binary files differnew file mode 100644 index 00000000000..751a799f6f7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/figures/use-case.pdf diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/thesis.pdf b/Master/texmf-dist/doc/latex/bjfuthesis/demo/thesis.pdf Binary files differnew file mode 100644 index 00000000000..44b245976e4 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/thesis.pdf diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/demo/thesis.tex b/Master/texmf-dist/doc/latex/bjfuthesis/demo/thesis.tex new file mode 100644 index 00000000000..b8f5b59421c --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/demo/thesis.tex @@ -0,0 +1,11 @@ +\documentclass{bjfuthesis} +\begin{document} + \frontmatter + \input{contents/abstract} + \tableofcontents + \mainmatter + \input{contents/mainbody} + \backmatter + \printbibliography + \input{contents/acknowledge} +\end{document} diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/documentation/bjfuthesis.pdf b/Master/texmf-dist/doc/latex/bjfuthesis/documentation/bjfuthesis.pdf Binary files differnew file mode 100644 index 00000000000..fd39414e1f9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/documentation/bjfuthesis.pdf diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/documentation/bjfuthesis.tex b/Master/texmf-dist/doc/latex/bjfuthesis/documentation/bjfuthesis.tex new file mode 100644 index 00000000000..1523a5d6389 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/documentation/bjfuthesis.tex @@ -0,0 +1,11 @@ +\documentclass{bjfuthesis} +\begin{document} + \frontmatter + \input{contents/abstract} + \tableofcontents + \mainmatter + \input{contents/mainbody} + \backmatter + \chapter{参考文献} + \input{contents/acknowledge} +\end{document} diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/documentation/contents/abstract.tex b/Master/texmf-dist/doc/latex/bjfuthesis/documentation/contents/abstract.tex new file mode 100644 index 00000000000..457ae844673 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/documentation/contents/abstract.tex @@ -0,0 +1,10 @@ +\chapter*{摘要} +\begin{abstract} + bjfuthesis文档类是为北京林业大学学生书写毕业论文准备的\LaTeX 文档类。该文档类基于ctexbook文档类。它修改了一些布局与样式来提供与北京林业大学毕业论文规范兼容的文档布局。 +\end{abstract} +\keywordscn{LaTeX,毕业论文,北京林业大学} +\chapter*{Abstract} +\begin{abstract} + The bjfuthesis class is a \LaTeX class intended for students in Beijing Forestry University to write their theses. The class is based on the ctexbook class. It modifies some of the layout and style definitions of these packages in order to provide a document layout that should be compatible with Beijing Forestry University Thesis Standard. +\end{abstract} +\keywordsen{LaTeX, thesis, Beijing Forestry University} diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/documentation/contents/acknowledge.tex b/Master/texmf-dist/doc/latex/bjfuthesis/documentation/contents/acknowledge.tex new file mode 100644 index 00000000000..ceadf4aa0d2 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/documentation/contents/acknowledge.tex @@ -0,0 +1,2 @@ +\chapter{致谢} +感谢社区开发者的贡献。 diff --git a/Master/texmf-dist/doc/latex/bjfuthesis/documentation/contents/mainbody.tex b/Master/texmf-dist/doc/latex/bjfuthesis/documentation/contents/mainbody.tex new file mode 100644 index 00000000000..017c18c9e9d --- /dev/null +++ b/Master/texmf-dist/doc/latex/bjfuthesis/documentation/contents/mainbody.tex @@ -0,0 +1,102 @@ +\chapter{绪论} +\section{研究背景} +国内诸多高校都在GitHub上提供了其高校的论文模板,故本作者秉持开源共享的精神,将本\LaTeX 文档类开源于https://github.com/bjfu-projects/bjfu-thesis。 +\section{文档结构} +第一章为绪论,简单介绍研究背景以及文档结构。 + +第二章为英文使用说明,介绍本文档类的使用方法。 + +第三章为中文使用说明,介绍本文档类的使用方法。 +\chapter{Usage Notes} +The order of following usage notes is based on the structure of the thesis. + + * To include the cover of your thesis, put 'cover.pdf' in the directory. + + * You MUST add `\textbackslash frontmatter` before your abstract. + + * Print title of Chinese abstract or English abstract: `\textbackslash chapter*{abstract title}` + + * Print content of abstract: `\textbackslash begin{abstract}abstract` content`\textbackslash end{abstract}` + + * Print Chinese keywords: `\textbackslash keywordscn{Chinese keywords}` + + * Print English keywords: \textbackslash keywordsen{English keywords} + + * Print table of contents: \textbackslash tableofcontents + + * You MUST add `\textbackslash mainmatter` before the main body of your thesis. + + * The hierachy of the thesis: + `\textbackslash chapter{chapter title}` + `\textbackslash section{section title}` + `\textbackslash subsection{subsection title}` + + * Use following structure: + `\textbackslash chapter{chapter 1 title}` + normal text + `\textbackslash section{section 1.1 title}` + normal text + `\textbackslash section{section 1.2 title}` + `\textbackslash subsection{subsection 1.2.1 title}` + normal text + ... + + * Floats are set to be centered by default, with default allowed positions being current position in code, top, bottom and a separate page. + + * Put images you want to insert in `\textbackslash figures`, and you DO NOT need to include 'figures' in your path + + * Show two captions for a figure or a table: `\textbackslash bicaption{Chinese caption}{English caption}` + You MUST place figures in 'figure' environment, and table in 'table' environment, which MUST match. + Or `\textbackslash bicaption{Chinese caption}{English caption}` will not work as expected. + + * Show a note for a figure or table: `\textbackslash chartnote{a note for a figure or a table}` + + * You MUST add `\textbackslash backmatter` before your references and your acknowledgement. + + * Print bibliography: `\textbackslash printbibliography` +\chapter{使用说明} +以下使用说明的顺序基于论文的结构 + +* 要将你的论文封面插入论文,需将"cover.pdf"置于该目录中 + +* 你必须在摘要部分前加入`\textbackslash frontmatter` + +* 显示中文或英文摘要标题:`\textbackslash chapter*{abstract title}` + +* 显示摘要内容:`\textbackslash begin{abstract}摘要内容\textbackslash end{abstract}` + +* 显示中文关键词:`\textbackslash keywordscn{中文关键词}` + +* 显示英文关键词:`\textbackslash keywordsen{英文关键词}` + +* 显示目录:`\textbackslash tableofcontents` + +* 你必须在你的论文的主体部分前加入`\textbackslash mainmatter` + +* 论文具有的层次划分: +`\textbackslash chapter{一级标题}` +`\textbackslash section{二级标题}` +`\textbackslash subsection{三级标题}` + +* 使用以下层次结构: +`\textbackslash chapter{一级标题 1}` +正文文字 +`\textbackslash section{二级标题 1.1}` +正文文字 +`\textbackslash section{二级标题 1.2}` +`\textbackslash subsection{三级标题 1.2.1}` +正文文字 +…… + +* 浮动体已默认居中,且默认允许的位置已设为“当前代码中的位置、顶部、底部、单独成页” + +* 将你需要插入的图片置于`\textbackslash figures`中,无需在路径中包含“figures” + +* 为一张图或一个表显示两个图(表)题:`\textbackslash bicaption{中文图题}{英文图题}` +你必须将图置于“figure”环境中,表置于“table”环境中,必须匹配。 +否则`\textbackslash bicaption{中文图题}{英文图题}`不会起作用 +* 显示图表注:`\textbackslash chartnote{图的注释或表的注释}` + +* 你必须在你的参考文献前加入`\textbackslash backmatter` + +* 显示参考文献:`\textbackslash printbibliography` diff --git a/Master/texmf-dist/tex/latex/bjfuthesis/bjfuthesis.cls b/Master/texmf-dist/tex/latex/bjfuthesis/bjfuthesis.cls new file mode 100644 index 00000000000..aa284962121 --- /dev/null +++ b/Master/texmf-dist/tex/latex/bjfuthesis/bjfuthesis.cls @@ -0,0 +1,101 @@ +% +% Copyright 2021 Liu Changxin <liuchx@hotmail.com> +% +% Licensed under the GNU General Public License v3.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% https://www.gnu.org/licenses/gpl-3.0.html +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% + +\NeedsTeXFormat{LaTeX2e}[2020/10/01] +\newcommand*\@iflatexlater{\@ifl@t@r\fmtversion} +\@iflatexlater{2020/10/01}{}{\ClassError{bjfuthesis}{The version of LaTeX you installed does not meet the minimum version requirements}} +\def\header@text{北京林业大学本科毕业论文} +\def\keywords@label@zh{关键词:} +\def\keywords@label@en{Keywords: } +\def\chartnote@label{注:} +\ProvidesClass{bjfuthesis}[2021/05/27 LaTeX document style for BJFU thesis] +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}} +\ProcessOptions* +\LoadClass[a4paper,oneside,fontset=none]{ctexbook} +\RequirePackage{pdfpages} +\RequirePackage{graphicx} +\graphicspath{{figures/}} +\RequirePackage{silence} +\RequirePackage{bicaption} +\DeclareCaptionFormat{bjfucaption}{\textbf{\fontsize{9}{21}\selectfont#1#2#3}} +\captionsetup{format=bjfucaption,skip=0pt,labelsep=space} +\captionsetup[figure][bi-second]{name=Figure} +\captionsetup[table][bi-second]{name=Table} +\RequirePackage{amsmath} +\setlength\voffset{-10.4mm} +\setlength\topmargin{0mm} +\setlength\textheight{242mm} +\setlength\footskip{10mm} +\setlength\textwidth{155mm} +\setlength\oddsidemargin{4.6mm} +\setmainfont{Times New Roman} +\setCJKmainfont[AutoFakeBold]{SimSun} +\setCJKmonofont{SimSun} +\newCJKfontfamily\kaiti{KaiTi} +\linespread{1} +\emergencystretch=1em +\RequirePackage{amssymb} +\renewcommand\fps@figure{htbp} +\renewcommand\fps@table{htbp} +\WarningFilter*{latex}{Text page \thepage\space contains only floats} +\NewCommandCopy\oldfigure\figure +\def\figure{\@ifnextchar[\figure@i \figure@ii} +\def\figure@i[#1]{\oldfigure[#1]\centering} +\def\figure@ii{\oldfigure\centering} +\NewCommandCopy\oldtable\table +\def\table{\@ifnextchar[\table@i \table@ii} +\def\table@i[#1]{\oldtable[#1]\centering} +\def\table@ii{\oldtable\centering} +\RequirePackage{fancyhdr} +\pagestyle{fancy} +\fancyhf{} +\fancyhead[C]{\fontsize{9}{12}\selectfont \header@text} +\fancyfoot[C]{\thepage} +\renewcommand\headrulewidth{.5pt} +\fancypagestyle{plain}{\fancyhead[C]{\fontsize{9}{12}\selectfont\header@text}\renewcommand\headrulewidth{.5pt}} +\renewcommand\floatpagefraction{1} +\RequirePackage{titlesec} +\titleformat{\chapter}{\centering\fontsize{16}{30}\bfseries}{\thechapter}{.5em}{} +\titleformat{\section}{\fontsize{14}{37}\bfseries}{\thesection}{.5em}{} +\titleformat{\subsection}{\fontsize{12}{21}\bfseries}{\thesubsection}{.5em}{} +\titlespacing{\chapter}{0pt}{0pt}{10pt} +\titlespacing{\section}{0pt}{0pt}{3pt} +\titlespacing{\subsection}{0pt}{0pt}{0pt} +\RequirePackage{booktabs} +\RequirePackage{titletoc} +\ctexset{chapter/number=\arabic{chapter},chapter/name={}} +\titlecontents{chapter}[0em]{\fontsize{10.5}{21}\bfseries}{\thecontentslabel~}{\thecontentslabel}{\hspace{.5em}\titlerule*{.}\contentspage} +\titlecontents{section}[1em]{\fontsize{10.5}{21}}{\thecontentslabel~}{\thecontentslabel}{\hspace{.5em}\titlerule*{.}\contentspage} +\titlecontents{subsection}[2em]{\fontsize{10.5}{21}}{\thecontentslabel~}{\thecontentslabel}{\hspace{.5em}\titlerule*{.}\contentspage} +\RequirePackage[hidelinks]{hyperref} +\RequirePackage[gbpub=false,style=gb7714-2015]{biblatex} +\addbibresource{bibliography.bib} +\renewcommand\topfraction{1} +\renewcommand\bottomfraction{1} +\renewcommand\textfraction{0} +\newenvironment{abstract}{\kaiti}{\vskip \baselinestretch\baselineskip\par} +\newcommand\keywordscn[1]{\noindent\fontsize{12}{21}\selectfont\textbf{\keywords@label@zh}#1\par} +\newcommand\keywordsen[1]{\noindent\fontsize{12}{21}\selectfont\textbf{\keywords@label@en}#1\par} +\NewCommandCopy\oldfrontmatter\frontmatter +\renewcommand\frontmatter{\IfFileExists{cover.pdf}{\includepdf[pages={1-2}]{cover.pdf}}{\typeout{!! cover.pdf not found}\ClassWarning{bjfuthesis}{cover.pdf not found}}\oldfrontmatter\renewcommand\thepage{\Roman{page}}\fontsize{12}{21}\selectfont} +\NewCommandCopy\oldmainmatter\mainmatter +\renewcommand\mainmatter{\oldmainmatter\fontsize{12}{21}\selectfont} +\newcommand\chartnote[1]{\fontsize{9}{21}\selectfont\\\begin{flushleft}\chartnote@label#1\end{flushleft}} +\NewCommandCopy\oldbackmatter\backmatter +\renewcommand\backmatter{\oldbackmatter\fontsize{10.5}{21}\selectfont} +\NewCommandCopy\oldprintbibliography\printbibliography +\renewcommand\printbibliography{\oldprintbibliography[heading=bibintoc]} +\endinput diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 3fea8de343b..5579ea6368a 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -133,7 +133,7 @@ my @TLP_working = qw( bigfoot bigintcalc bigints binarytree binomexp biochemistry-colors biocon biolett-bst bitelist bithesis bitpattern bitset bitter bizcard - blacklettert1 blindtext blkarray + bjfuthesis blacklettert1 blindtext blkarray blochsphere block blockdraw_mp bloques blowup blox bmstu-iu8 bnumexpr bodegraph bohr boisik bold-extra boites boldtensors bondgraph bondgraphs diff --git a/Master/tlpkg/tlpsrc/bjfuthesis.tlpsrc b/Master/tlpkg/tlpsrc/bjfuthesis.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/tlpkg/tlpsrc/bjfuthesis.tlpsrc diff --git a/Master/tlpkg/tlpsrc/collection-publishers.tlpsrc b/Master/tlpkg/tlpsrc/collection-publishers.tlpsrc index e985b93cbc9..8d2e41c2410 100644 --- a/Master/tlpkg/tlpsrc/collection-publishers.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-publishers.tlpsrc @@ -38,6 +38,7 @@ depend beamer-FUBerlin depend beamer-verona depend beilstein depend bgteubner +depend bjfuthesis depend bmstu-iu8 depend br-lex depend brandeis-dissertation |