graphai.core.text.draw module

graphai.core.text.draw.draw_ontology(results, graph, level=3)

Draws the ontology neighbourhood induced by the given set of wikify results. The resulting svg is not returned but stored in /tmp/file.svg.

Parameters:
  • results (pd.DataFrame) – A pandas DataFrame with columns [‘concept_id’, ‘concept_name’, ‘search_score’,

  • 'levenshtein_score'

  • 'graph_score'

  • 'ontology_local_score'

  • 'ontology_global_score'

  • 'keywords_score'

  • 'mixed_score'].

  • graph (ConceptsGraph) – The concepts graph and ontology object.

  • level (int) – Level up to which the visualisation considers categories. Default: 3.

graphai.core.text.draw.draw_graph(results, graph, concept_score_threshold=0.3, edge_threshold=0.3, min_component_size=3)

Draws the concept graph neighbourhood induced by the given set of wikify results. The resulting svg is not returned but stored in /tmp/file.svg.

Parameters:
  • results (pd.DataFrame) – A pandas DataFrame with columns [‘concept_id’, ‘concept_name’, ‘search_score’,

  • 'levenshtein_score'

  • 'graph_score'

  • 'ontology_local_score'

  • 'ontology_global_score'

  • 'keywords_score'

  • 'mixed_score'].

  • graph (ConceptsGraph) – The concepts graph and ontology object.

  • concept_score_threshold (float) – Score threshold below which concepts are filtered out. Default: 0.3.

  • edge_threshold (float) – Score threshold below which edges are filtered out. Default: 0.3.

  • min_component_size (int) – Size threshold below which connected components are filtered out. Default: 3.