Post Processing
This module provides a simple, unified, way to apply automatic transformations (e.g. formatting) to
the results of an analysis.
-
gismo.post_processing.post_documents_cluster_json(gismo, cluster)[source]
Convert cluster of documents into basic json
- Parameters:
-
- Returns:
dictionary with keys ‘document’, ‘focus’, and recursive ‘children’
- Return type:
dict
-
gismo.post_processing.post_documents_cluster_print(gismo, cluster, post_item=None, depth='')[source]
Print an ASCII view of a document cluster with metrics (focus, relevance, similarity)
- Parameters:
gismo (Gismo) – Gismo instance
cluster (Cluster) – Cluster of documents
post_item (function, optional) – Post-processing function for individual documents
depth (str, optional) – Current depth string used in recursion
-
gismo.post_processing.post_documents_item_content(gismo, i, max_size=None)[source]
Document indice to document content.
Assumes that document has a ‘content’ key.
- Parameters:
gismo (Gismo) – Gismo instance
i (int) – document indice
max_size (int, optional) – Maximum number of chars to return
- Returns:
Content of document i from corpus
- Return type:
str
-
gismo.post_processing.post_documents_item_raw(gismo, i)[source]
Document indice to document entry
- Parameters:
-
- Returns:
Document i from corpus
- Return type:
object
-
gismo.post_processing.post_features_cluster_json(gismo, cluster)[source]
Convert feature cluster into basic json
- Parameters:
-
- Returns:
dictionary with keys ‘feature’, ‘focus’, and recursive ‘children’
- Return type:
dict
-
gismo.post_processing.post_features_cluster_print(gismo, cluster, post_item=None, depth='')[source]
Print an ASCII view of a feature cluster with metrics (focus, relevance, similarity)
- Parameters:
gismo (Gismo) – Gismo instance
cluster (Cluster) – Cluster of features
post_item (function, optional) – Post-processing function for individual features
depth (str, optional) – Current depth string used in recursion
-
gismo.post_processing.post_features_item_raw(gismo, i)[source]
Feature indice to feature name
- Parameters:
-
- Returns:
Feature i from embedding
- Return type:
str
-
gismo.post_processing.post_landmarks_cluster_json(landmark, cluster)[source]
Default post processor for a cluster of landmarks.
- Parameters:
-
- Returns:
A dict with the head landmark, cluster focus, and list of children.
- Return type:
dict
-
gismo.post_processing.post_landmarks_cluster_print(landmark, cluster, post_item=None, depth='')[source]
ASCII display post processor for a cluster of landmarks.
- Parameters:
landmark (Landmarks) – A Landmarks instance
cluster (Cluster) – Cluster of the landmarks to process.
post_item (function, optional) – Post-processing function for individual landmarks
depth (str, optional) – Current depth string used in recursion
-
gismo.post_processing.post_landmarks_item_raw(landmark, i)[source]
Default post processor for individual landmarks.
- Parameters:
-
- Returns:
The landmark of indice i.
- Return type:
object