项目作者: redis-developer

项目描述 :
Named Entity Recognition for Redis
高级语言: Python
项目地址: git://github.com/redis-developer/rediner.git
创建时间: 2020-10-19T17:59:28Z
项目社区:https://github.com/redis-developer/rediner

开源协议:MIT License

下载


rediner

Named Entity Recognition (NER) analysis in RedisGraph.

Overview

This project contains an example of using the SpaCy
NER model to harvest
named entities from blog posts or other web pages. The crawler program
produces graph structures that can be loaded into RedisGraph for analysis
via Cypher Queries.

Demo

A demo is available online. Please be kind!

A Quick Start

  1. Create an environment an load the requirements:

    1. pip install -r requirements.txt
    2. python -m spacy download en_core_web_sm
  2. Collect some entries:

    1. mkdir out
    2. python -m rediner.blog --same --store --dir out --verbose https://www.milowski.com/
  3. Run the SpaCy model:

    1. python -m rediner --yaml -r ner out > milowski-com-terms.yaml
  4. Start RedisGraph:

    1. docker run -p 6379:6379 redislabs/redisgraph:latest
  5. Setup the indexes:

    1. python demo/setupdb.py milowski.com
  6. Ingest the data:

    1. python -m rediner load -r --graph milowski.com out
    2. python -m rediner load -r --graph milowski.com milowski-com-terms.yaml
  7. Run the demo application:

    1. cd demo
    2. python view.py
  8. View the application locally at http://localhost:5000/

Once the application is running, you can examine the dataset in various ways. For starters, try loading the graphs with the defaults by clicking on the ‘Load’
button. This will load the entities that match the minimum counts and show a
graph of cooccurrences.

You can:

  • use the “same” checkbox to enable entities that co-occur on the same article.
  • use the “multiple” checkbox to enable entities that co-occur on more than one article.
  • use search to access the full text search. This will display a subgraph of
    entities from the search results.
  • clicking on a node in the graph will show the articles which contain the
    entities with a link back to the original resource.

Next steps

You can view more extensive document on the website.