跳转到主要内容

新闻存储和分析立方体

项目描述

摘要

新闻存储和分析立方体

此立方体提供了Semnews的实现

  • 存储新闻文章和推文。

  • 提取和综合信息。

  • 提供语义有用和原创的视觉化。

  • 分析工具和数据挖掘/机器学习处理。

安装

实例创建

  • 使用以下命令创建实例:cubicweb-ctl create semnews <实例名称>

  • 使用以下命令创建实例数据库:cubicweb-ctl db-create <实例名称>

添加文章来源

文章来源可以通过以下方式创建

  • 博客/RSS源

    session.create_entity('CWSource', name=<name of the source>, type=u'datafeed',
                          parser=u'rss-parser', lang=<lang of the source>,
                          url=<url of the blog/rss feed>,
                          config=u'synchronization-interval=120min')
  • 推文

    session.create_entity('CWSource', name=<name of the source>, type=u'datafeed',
                          parser=u'tweet-parser', lang=<lang of the source>,
                          url=<url of the blog/rss feed>,
                          config=u'synchronization-interval=120min')

同步间隔可以设置为更具体的值,或设置为“否”以进行手动同步。

Semnews附带一些预定义的博客/推文/RSS源

  • 一些法国政治博客。您可以使用以下方式添加它们

    cubicweb-ctl shell <name-of-instance> <path-to-cube-code-source>/migration/examples_blogs_fr.py
  • 一些国际英文报纸。您可以使用以下方式添加它们

    cubicweb-ctl shell <name-of-instance> <path-to-cube-code-source>/migration/examples_newspapers.py
  • 一些法国报纸。您可以使用以下方式添加它们

    cubicweb-ctl shell <name-of-instance> <path-to-cube-code-source>/migration/examples_newspapers_fr.py
  • 一些法国政治家的推文。您可以使用以下方式添加它们

    cubicweb-ctl shell <name-of-instance> <path-to-cube-code-source>/migration/examples_twitters_fr.py

添加命名实体来源

Semnews基于命名实体处理,您需要定义

session.create_entity('NerProcess', name=<name of process>, host=<appid or sparql endpoint url>,
                      type=<rql or sparql>, lang=<optional lang of the ner source>,
                      request=<request to be performed>)

请参阅NER立方体的文档以获取更多详细信息。示例源

session.create_entity('NerProcess', name=u'dbpedia38-en', host=u'ner',
                      type=u'rql', lang=u'en',
                      request=u'Any U WHERE X label %(token)s, X cwuri U, '
                               'X ner_source NS, NS name "dbpedia38-en"')

命令

Semnews提供以下命令

  • 用于从文章中提取命名实体的命令

    cubicweb-ctl process-ner <name-of-instance>
  • 根据一些Dbpedia类别清理已识别实体(请参阅entities/external_resources.py)的命令

    cubicweb-ctl cleanup-ner <name-of-instance>

项目详情


下载文件

下载您平台上的文件。如果您不确定该选择哪一个,请了解更多关于安装包的信息。

源分发

cubicweb-semnews-0.2.0.tar.gz (151.2 kB 查看散列值)

上传时间

支持