.. _sphx_glr_gallery_text: Text domain ============ Text-domain metrics are essential for evaluating the performance of models in tasks like text classification, summarization, and translation. TorchMetrics provides a suite of specialized metrics designed for these purposes. Using these text-specific metrics from Torch Metrics helps in developing more precise and robust text-based models, ensuring that performance evaluations are both meaningful and directly applicable to practical NLP tasks. .. raw:: html <div class="sphx-glr-thumbnails"> .. thumbnail-parent-div-open .. raw:: html <div class="sphx-glr-thumbcontainer" tooltip="Perplexity is a measure of how well a probabilistic model predicts a sample."> .. only:: html .. image:: /gallery/text/images/thumb/sphx_glr_perplexity_thumb.png :alt: :ref:`sphx_glr_gallery_text_perplexity.py` .. raw:: html <div class="sphx-glr-thumbnail-title">Perplexity</div> </div> .. raw:: html <div class="sphx-glr-thumbcontainer" tooltip="BERTScore is a text generation metric to compute the similarity between a generated text and a reference text using a pre-trained BERT model. Instead of relying on exact token matches, BERTScore leverages contextual embeddings to capture the semantic similarity between the texts. This makes BERTScore robust to paraphrasing and word order variations. BERTScore has been shown to correlate well with human judgments and is widely used in evaluating text generation models."> .. only:: html .. image:: /gallery/text/images/thumb/sphx_glr_bertscore_thumb.png :alt: :ref:`sphx_glr_gallery_text_bertscore.py` .. raw:: html <div class="sphx-glr-thumbnail-title">BERTScore</div> </div> .. raw:: html <div class="sphx-glr-thumbcontainer" tooltip="The ROUGE (Recall-Oriented Understudy for Gisting Evaluation) metric used to evaluate the quality of generated text compared to a reference text. It does so by computing the overlap between two texts, for which a subsequent precision and recall value can be computed. The ROUGE score is often used in the context of generative tasks such as text summarization and machine translation."> .. only:: html .. image:: /gallery/text/images/thumb/sphx_glr_rouge_thumb.png :alt: :ref:`sphx_glr_gallery_text_rouge.py` .. raw:: html <div class="sphx-glr-thumbnail-title">ROUGE</div> </div> .. thumbnail-parent-div-close .. raw:: html </div> .. toctree:: :hidden: /gallery/text/perplexity /gallery/text/bertscore /gallery/text/rouge