Flatten a nested dictionary into a flat dictionary.
Hash a string using sha1.
Import the pandas python package and raise an error if it is not installed.
Import the spacy python package and raise an error if it is not installed.
Import the textstat python package and raise an error if it is not installed.
Import the mlflow python package and raise an error if it is not installed.
Get the metrics to log to MLFlow.
Get the text complexity metrics from textstat.
Analyze text using textstat and spacy.
Construct an html element from a prompt and a generation.