Sign inSign up

rahulbot/news-entity-server

By rahulbot

•Updated over 1 year ago

A small API server to return entities and other metadata for online news articles.

Image
Data science
Web servers
0

656

rahulbot/news-entity-server repository overview

⁠News Entity Server

A small API server to return entities and other metadata for online news articles. Originally built to support the Data Against Feminicide⁠ project. Technically, this exposes API endpoints that accepts URLs and returns entities in JSON. Uses spaCy under the hood for entity extraction.

Install from Docker: The easiest approach to just start using this is to install the pre-built image from DockerHub. Set a WEB_CONCURRENCY env var if you want more than one worker.

docker pull rahulbot/news-entity-server:latest
docker run -p 8000:8000 -e MODEL_MODE=small -m 8G news-entity-server:latest

⁠Usage

API documentation is available at http://localhost:5000/redoc⁠. See the code in test/test_server.py for examples.

⁠API Endpoints

Every endpoint returns a dict like this:

{
  "duration": 123,
  "status": "ok",
  "version": "0.0.1", 
  "results": { ... }  
}
  • duration: the number of milliseconds the request too to complete on the server
  • status: "ok" if it worked, "error" if it did not work
  • version: a semantically versioned number indicating the server version
  • results: a dict of the results you requested (potentially different for different endpoints)
⁠/entities/from-url

POST a url and language to this endpoint and it returns JSON with all the entities it finds. Add a title argument, set to 1 or 0, to optionally include the article title in the entity extraction.

⁠/entities/from-content

POST text and language content to this endpoint, and it returns JSON with all the entities it finds.

⁠/content/from-url

POST a url to this endpoint, and it returns just the extracted content from the HTML.

Tag summary

Content type

Image

Digest

sha256:76dd42c1c…

Size

3.5 GB

Last updated

over 1 year ago

docker pull rahulbot/news-entity-server