Skip to main content

Summary

Cube for news storage and analysis

This cube provides an implementation of Semnews:

  • store news articles and tweets.

  • extract and synthetize information.

  • provide semantic useful and original visualisation.

  • analytics tools and datamining/machine learning processings.

Installation

Creation of the instance:

  • Create an instance using: cubicweb-ctl create semnews <name-of-instance>

  • Create the instance’s database using: cubicweb-ctl db-create <name-of-instance>

Add articles sources

Source of articles could be created using:

  • Blogs/RSS feeds:

    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')
  • Tweet:

    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')

The synchronization interval could be setted to a more specific value, or setted to “no” for manual synchronization only.

Semnews comes with some predifined blogs/tweets/rss feeds:

  • Some french political blogs. You can add them using:

    cubicweb-ctl shell <name-of-instance> <path-to-cube-code-source>/migration/examples_blogs_fr.py
  • Some international english newspapers. You can add them using:

    cubicweb-ctl shell <name-of-instance> <path-to-cube-code-source>/migration/examples_newspapers.py
  • Some french newspapers. You can add them using:

    cubicweb-ctl shell <name-of-instance> <path-to-cube-code-source>/migration/examples_newspapers_fr.py
  • Some french politician tweets. You can add them using:

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

Add Named Entities sources

Semnews is based on a named entities process, that you have to define:

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>)

See the document of the NER cube for more details. Example of source:

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"')

Commands

Semnews provide to commands:

  • A command to extract named entities from articles:

    cubicweb-ctl process-ner <name-of-instance>
  • A command to cleanup recognized entities according to some Dbpedia categories (see entities/external_resources.py):

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

Release files for cubicweb-semnews 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cubicweb-semnews 0.2.0
File Size Uploaded
cubicweb-semnews-0.2.0.tar.gz 151.2 kB Details

Release files / cubicweb-semnews-0.2.0.tar.gz

Download URL cubicweb-semnews-0.2.0.tar.gz
Size 151.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6e2fc0d98cc4be03e530c1b0cb1e42b23bb1a3238610e8f073f7756f640f207c
BLAKE2b-256 checksum
How to use checksums
a6f23835295e596c255acf22754beb5d13ee32bfc8a46ac59dc1c2c7b8f36ac7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page