You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NeuRec is an awesome project, and I had applied TransRec session-based recommender and achieved the best performance comparing to other individual algorithms.
However, regarding the engineering perspective, NeuRec is unfriendly in terms of Python project style when trying to modify its code (e.g. add serialization feature) in order to use it as a package along with other machine learning libraries, because it does not put all the classes under a unified package namespace (normal Python package will create its own root namespace, e.g. import tensorflow as tf) and using some absolute importing for relative directory (see below log).
➜ tmp ls NeuRec
NeuRec.properties appveyor.yml conf evaluator next.png travis_linux_steps.sh
README.md appveyor_windows_steps.ps1 data main.py requirements.txt tutorial.ipynb
WeChat_QR_Code.jpg architecture.jpg dataset model setup.py util
➜ tmp python
Python 3.6.3 (default, Jan 29 2020, 11:15:24)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.10.44.4)] on darwin
Type "help", "copyright", "credits" or "license"for more information.
>>> import NeuRec.data
Traceback (most recent call last):
File "<stdin>", line 1, in<module>
File "/Users/dev/tmp/NeuRec/data/__init__.py", line 1, in<module>
from .sampler import PointwiseSampler
File "/Users/dev/tmp/NeuRec/data/sampler.py", line 4, in<module>
from util import DataIterator
ModuleNotFoundError: No module named 'util'.
>>>
This should be done by relative importing from .util import Data or absolute importing from NeuRec.util import Data.
Solution
The solution should be easy, create a new root directory 'NeuRec' and move all components into 'NeuRec' as the subdirectories, although lots of trivial importing statements in all Python files needs to be fixed.
I have a temporary solution https://github.com/DavidChenLondon/NeuRec/tree/smk which works in our recommendation engine, and includes other features like serializing NeuRec TensorFlow models.
Issue
NeuRec is an awesome project, and I had applied TransRec session-based recommender and achieved the best performance comparing to other individual algorithms.
However, regarding the engineering perspective, NeuRec is unfriendly in terms of Python project style when trying to modify its code (e.g. add serialization feature) in order to use it as a package along with other machine learning libraries, because it does not put all the classes under a unified package namespace (normal Python package will create its own root namespace, e.g. import tensorflow as tf) and using some absolute importing for relative directory (see below log).
This should be done by relative importing
from .util import Data
or absolute importingfrom NeuRec.util import Data
.Solution
The solution should be easy, create a new root directory 'NeuRec' and move all components into 'NeuRec' as the subdirectories, although lots of trivial importing statements in all Python files needs to be fixed.
I have a temporary solution https://github.com/DavidChenLondon/NeuRec/tree/smk which works in our recommendation engine, and includes other features like serializing NeuRec TensorFlow models.
However, I know that NeuRec is under active development (https://github.com/wubinzzu/NeuRec/tree/v3.x with https://github.com/ZhongchuanSun/reckit) currently, so it's hard for me to make a diverged change without discussing with NeuRec team first.
The text was updated successfully, but these errors were encountered: