gransk.plugins.analysis¶
Compute useful things from stuff.
gransk.plugins.analysis.entity_network¶
-
class
gransk.plugins.analysis.entity_network.
Subscriber
(pipeline)¶ Bases:
gransk.core.abstract_subscriber.Subscriber
Class computing network surrounding an entity.
Add subscriber to pipeline.
Parameters: pipeline ( gransk.core.pipeline.Pipeline
) – Pipeline managing subscribers and events.-
consume
(doc, payload)¶ Ignored.
-
get_for
(entity_id, hops=1)¶ Get network around the given entity ID.
Parameters: - entity_id (
str
) – Entity to get network for. - hops (
int
) – Maximum distance of included nodes from the given entity.
Returns: dict
- entity_id (
-
setup
(config)¶ Loads services for related entities and documents.
Parameters: config ( dict
) – Configuration object.
-