记录以记录对Invenio的建议。

record-recommender的Python项目详细描述


https://travis-ci.org/CERNDocumentServer/record-recommender.svg?branch=master

记录推荐程序为invenio创建推荐。 通过从ElasticSearch读取页面视图和下载,计算 建议并将其存储在redis中以供检索和显示 因维尼奥。

用法

生成建议的工作流为:

  1. recommender fetch 24缓存过去24周的页面浏览量和下载量 来自ElasticSearch。
  2. recommender profiles 24从页面视图生成用户配置文件 以及下载。对于未登录的用户配置文件,基于 已创建IP地址和用户代理。
  3. recommender build 50使用50个进程计算建议 并将它们存储在指定的redis服务器中。

另外,建议可以自动获取,配置文件 生成并使用一个命令计算所有这些建议:

最近24周的推荐人更新\推荐人24 50并使用 50道工序。

配置

配置文件应在^{tt4}中$ 否则,可以使用 命令行选项--config_path

# Record-Recommender configuration.elasticsearch:es_index:['index-2014','index-2015','index-2016']es_user:useres_password:es_host:localhostes_port:443recommendation_version:1# Sentry connection stringsentry:redis:host:localhostport:6379db:0prefix:'Reco_1::'cache:base_path:cache/cache_file_prefix:''logging:version:1disable_existing_loggers:Falseformatters:simple:format:'%(asctime)s-%(name)s-%(levelname)s-%(message)s'handlers:console:class:logging.StreamHandlerlevel:INFOformatter:simplestream:ext://sys.stdoutsentry:class:raven.handlers.logging.SentryHandlerlevel:WARNdsn:file:class :logging.FileHandlerformatter:simplelevel:DEBUGfilename:log_recommender.logloggers:record_recommender:level:DEBUGhandlers:[console,file,sentry]propagate:no# elasticsearch:#   level: WARN#   handlers: [console]#   propagate: noroot:level:ERRORhandlers:[console,file,sentry]

除了配置文件中的配置选项之外 可以设置覆盖配置文件中的环境变量。

  • RECOMMENDER_ES_PASSWORD设置ElasticSearch密码。
  • RECOMMENDER_SENTRY设置哨兵连接字符串。

命令行

Usage: recommender [OPTIONS] COMMAND [ARGS]...

Record-Recommender command line version.

Options:
-v, --verbose           Enables verbose mode.
-c, --config_path TEXT  Path to the configuration file.
--help                  Show this message and exit.

Commands:
debug               Debug the application and recommender.
fetch               Fetch newest PageViews and Downloads.
build               Calculate all recommendations.
profiles            Number of weeks to build.
update_recommender  Download and build the recommendations.

调试建议

作为第一步,查看定义的^{tt8}中创建的用户配置文件$ 文件夹。

使用 recommender debug获取交互式python shell的命令。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
字符串Java字母替换无效   java Spring Roo JPA MS SQL Server无法打开JPA EntityManager组织。冬眠例外GenericJDBCException:无法打开连接   在scala中使用JavaWS对大型数据文件进行java流式处理   Java编译器是否将字节和短字符识别为文本?   java无法查找符号错误,空指针   mongodb在Java中重用数据库连接   java将多个StringArray从字符串文件获取到活动中   java是一个变量,它只保存最后一次鼠标单击的坐标   c#尺寸有限;添加、删除和洗牌   java如何在Android中显示来自资产文件夹的文本文件中的文本   Android应用程序中的java Tensorflow Lite自定义对象检测模型错误   java如何在foreachloop中使用scanner将来自命令行的输入存储到数组中   java如何定义一个好的存储库接口   Android中的java解析动态json对象