This code supplement's Yuhao Mao's master's thesis "A Framework Design For Integrating Knowledge Graphs into Recommendation Systems" work and the resulting publication(s). The framework uses movies as an example and is generalizable into other media types.
- Yuhao Mao, "A Framework Design For Integrating Knowledge Graphs into Recommendation Systems", Master's thesis, Concordia University, 2021
- Yuhao Mao, Serguei A. Mokhov, Sudhir P. Mudur: Application of Knowledge Graphs to Provide Side Information for Improved Recommendation Accuracy. CoRR abs/2101.03054 (2021)
- Sudhir Mudur, Serguei Mokhov, and Yuhao Mao. 2021. A Framework for Enhancing Deep Learning Based Recommender Systems with Knowledge Graphs. In IDEAS 2021: 25th International Database Engineering Applications Symposium, July 14–16, 2021, Montreal, Canada. ACM, New York, NY, USA, 10 pages. https://doi.org/10.1145/1122445.1122456
A recommendation system is needed as long as there are users, but since users have few ratings on items, there will be problems such as data sparsity. This problem can be solved by adding the knowledge graph as side information, but the existing solution does not include the construction of the knowledge graph. By adding the construction of the knowledge graph can help us better manage the data.
- Movie RS
- Book RS
- News RS
- User RS
- CTR (Click-Through-Rate)
kg_final.txt
: now_movie_id, relation, xxxratings_final.txt
: user_id, user_gender, user_age, user_job, new_movie_id, rating
- python3
- Neo4j: https://neo4j.com/download/?ref=try-neo4j-lp
- rdflib. Version: 4.2.2
- urllib.request. '3.7'
- networkx. '2.4'
- matplotlib. '3.1.2'
- requests. '2.22.0'
- bs4. '4.8.0'
- imdb. '6.8'
- py2neo. "2.0"
- owlready2 "0.22"
- pandas. '0.25.0'
- numpy. '1.17.0'
- tensorflow. '1.14.0'
- sklearn. '0.21.3'
- linecache. '3.5'
brew install python3
pip3 install rdflib
pip3 install urllib.request
pip3 install networkx
pip3 install matplotlib
pip3 install requests
pip3 install bs4
pip3 install IMDbPy
pip3 install py2neo
pip3 install owlready2
pip3 install pandas
pip3 install numpy
pip3 install tensorflow
pip3 install sklearn
pip3 install linecache
- Clone the repo
- Install dependencies
yum install python3 gcc python3-devel
pip3 install requests
pip3 install py2neo
pip3 install numpy
pip3 install pandas
...
- How to train a model: go to
src/recommendation_system/
folder and run main.py - What IDE did we use to develop code? Recommend to use PyCharm (any version). Or use any text editing software such as vim or VS Code.
- How to run from command line:
python3 xxxx.py
- How to run from Google Colab? Upload all the files to colab, and click run.
Tested MacOS version: macOS Mojave 10.14.6
cd ../web_crawler
,python3 add_infos.py
to get thekg_additional
file. It includes movie director, writer and stars information.- Start Neo4j desktop then
cd ../knowledge_graph
and runpython3 main.py
. It create all triples in Neo4j. cd ../recommendation_system/data_process
and runtriples2txt.py
,ratings2txt.py
,kg_final.py
to getratings_final.txt
andkg_final.txt
cd ../recommendation_system
and runmain.py
- Java API wrapper
- Support different machine learning backends
- Support more storage methods and more input formats
- More effective loss function
- Full-platform support
- Auto installation
- Frame rate. https://en.wikipedia.org/wiki/Frame_rate. Accessed: 2019- 07-23.
- Software framework. https://en.wikipedia.org/wiki/Software_framework. Accessed: 2019-06-22.
- RDF OWL difference https://www.cambridgesemantics.com/blog/semantic-university/learn-owl-rdfs/rdfs-vs-owl/
- Owlready2 documentation https://pythonhosted.org/Owlready2/
- Py2neo documentation https://py2neo.org/2.0/
- Introduce to RS https://towardsdatascience.com/introduction-to-recommender-systems-6c66cf15ada
- auc&acc https://developers.google.com/machine-learning/crash-course/classification/roc-and-auc
- https://zhuanlan.zhihu.com/p/54325231
- youtube: https://www.youtube.com/watch?v=BP0IZ1uyUDE
- https://blog.csdn.net/dreamzuora/article/details/86543157