Text Overview
TL;DR: You can explore and compare text datasets.
Report: for visual analysis or metrics export, use the
TextOverviewPreset
.
Use case
You can evaluate and explore text data:
1. To monitor input data for NLP models. When you do not have true labels or actuals, you can monitor changes in the input data (data drift) and descriptive text characteristics. You can run batch checks, for example, comparing the latest batch of text data to earlier or training data. You can often combine it with evaluating Prediction Drift.
2. When you are debugging the model decay. If you observe a drop in the model performance, you can use this report to understand changes in the input data patterns.
3. Exploratory data analysis. You can use the visual report to explore the text data you want to use for training. You can also use it to compare any two datasets.
Text Overview Report
If you want to visually explore the text data, you can create a new Report object and use the TextOverviewPreset
.
Code example
Note that to calculate text-related metrics, you must also import additional libraries:
How it works
The TextOverviewPreset
provides an overview and comparison of text datasets.
Generates a descriptive summary of the text columns in the dataset.
Performs data drift detection to compare the two texts using the domain classifier approach.
Shows distributions of the text descriptors in two datasets, and their correlations with other features.
Performs drift detection for text descriptors.
Data Requirements
You can pass one or two datasets. The reference dataset serves as a benchmark. Evidently analyzes the change by comparing the current production data to the reference data. If you pass a single dataset, there will be no comparison.
To run this preset, you must have text columns in your dataset. Additional features and prediction/target are optional. Pass them if you want to analyze the correlations with text descriptors.
Column mapping. You must explicitly specify the columns that contain text features in column mapping to run this report.
How it looks
The report includes 5 components. All plots are interactive.
Aggregated visuals in plots. Starting from v 0.3.2, all visuals in the Evidently Reports are aggregated by default. This helps decrease the load time and report size for larger datasets. If you work with smaller datasets or samples, you can pass an option to generate plots with raw data. You can choose whether you want it on not based on the size of your dataset.
1. Text Column Summary
The report first shows the descriptive statistics for the text column(s).
![](https://docs.evidentlyai.com/~gitbook/image?url=https%3A%2F%2F256125905-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeE67gM4508ESQxkbpOxj%252Fuploads%252Fgit-blob-7074e49da73257ed1bd5ef7b675b8f63836ed15d%252Fmetric_column_summary_text-min.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=b2e5435c&sv=1)
2. Text Descriptors Distribution
The report generates several features that describe different text properties and shows the distributions of these text descriptors.
Text length
![](https://docs.evidentlyai.com/~gitbook/image?url=https%3A%2F%2F256125905-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeE67gM4508ESQxkbpOxj%252Fuploads%252Fgit-blob-83bcc2b634692787edd2ef67c3148661b6569217%252Fmetric_text_descriptors_distribution_text_length-min.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=18db33fc&sv=1)
Non-letter characters
![](https://docs.evidentlyai.com/~gitbook/image?url=https%3A%2F%2F256125905-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeE67gM4508ESQxkbpOxj%252Fuploads%252Fgit-blob-ac682f2507f57302d98a0c0f09949ec9dbb34b3d%252Fmetric_text_descriptors_distribution_nlc-min.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=b90cde79&sv=1)
Out-of-vocabulary words
![](https://docs.evidentlyai.com/~gitbook/image?url=https%3A%2F%2F256125905-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeE67gM4508ESQxkbpOxj%252Fuploads%252Fgit-blob-9c9c9bdf9d88ff534e8801f98d1919e44b0a0789%252Fmetric_text_descriptors_distribution_oov-min.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=f603a17&sv=1)
3. Text Descriptors Correlations
If the dataset contains numerical features and/or target, the report will show the correlations between features and text descriptors in the current and reference dataset. It helps detects shifts in the relationship.
Text length
![](https://docs.evidentlyai.com/~gitbook/image?url=https%3A%2F%2F256125905-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeE67gM4508ESQxkbpOxj%252Fuploads%252Fgit-blob-dccc3ede0cdf2140b389e4e1cc1ef7d9f727d2e2%252Fmetric_text_descriptors_correlation_text_length-min.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=86a34396&sv=1)
Non-letter characters
![](https://docs.evidentlyai.com/~gitbook/image?url=https%3A%2F%2F256125905-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeE67gM4508ESQxkbpOxj%252Fuploads%252Fgit-blob-a4ac893cc6dd77dc5cf82e746af6befffdfa738f%252Fmetric_text_descriptors_correlation_nlc-min.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=94c5d828&sv=1)
Out-of-vocabulary words
![](https://docs.evidentlyai.com/~gitbook/image?url=https%3A%2F%2F256125905-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeE67gM4508ESQxkbpOxj%252Fuploads%252Fgit-blob-8ffe95dd111fadae6a8b252e8b12332b172357e0%252Fmetric_text_descriptors_correlation_oov-min.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=20857551&sv=1)
4. Text Column Drift
If you pass two datasets, the report performs drift detection using the default data drift method for texts (domain classifier). It returns the ROC AUC of the binary classifier model that can discriminate between reference and current data. If the drift is detected, it also shows the top words that help distinguish between the reference and current dataset.
![](https://docs.evidentlyai.com/~gitbook/image?url=https%3A%2F%2F256125905-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeE67gM4508ESQxkbpOxj%252Fuploads%252Fgit-blob-a57bd7d2e85795086e684893ae26822b75259f1f%252Fmetric_column_drift_text-min.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=b061ec23&sv=1)
5. Text Descriptors Drift
If you pass two datasets, the report also performs drift detection for text descriptors to show statistical shifts in patterns between test characteristics.
![](https://docs.evidentlyai.com/~gitbook/image?url=https%3A%2F%2F256125905-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeE67gM4508ESQxkbpOxj%252Fuploads%252Fgit-blob-a33af2565bb54fe56af397233ce3caead61407a7%252Fmetric_text_descriptors_drift-min.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=8f617054&sv=1)
Metrics output
You can also get the report output as a JSON or a Python dictionary.
Report customization
You can use a different color schema for the report.
You can create a different report or test suite from scratch, taking this one as an inspiration.
Examples
Head to an example how-to notebook to see an example Text Overview preset and other metrics and tests for text data.
Last updated