langchain_community.callbacks.wandb_callback
.analyze_textΒΆ
- langchain_community.callbacks.wandb_callback.analyze_text(text: str, complexity_metrics: bool = True, visualize: bool = True, nlp: Optional[Any] = None, output_dir: Optional[Union[str, Path]] = None) dict [source]ΒΆ
Analyze text using textstat and spacy.
- Parameters
text (str) β The text to analyze.
complexity_metrics (bool) β Whether to compute complexity metrics.
visualize (bool) β Whether to visualize the text.
nlp (spacy.lang) β The spacy language model to use for visualization.
output_dir (str) β The directory to save the visualization files to.
- Returns
- A dictionary containing the complexity metrics and visualization
files serialized in a wandb.Html element.
- Return type
(dict)