analytics#

predict_backend.ml.nlp.analytics.graph_stats(kg, use_nx=True, community_attr='Louvain Community')#

Computes various statistics of a networkX Graph,

Parameters:
  • kg (Graph) – The knowledge graph (networkX object) on which compute the statistics

  • use_nx (bool) – if True uses community_louvain to compute Louvain Communities

  • community_attr (str) – used if use_nx=False. It is the feature to consider for the Louvain Communities

Return type:

Optional[Dict]

Returns:

Dict with extracted features