{"id":177415,"date":"2025-04-08T14:28:14","date_gmt":"2025-04-08T14:28:14","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/bertscore-new-metrics-for-language-models\/"},"modified":"2025-04-08T14:28:14","modified_gmt":"2025-04-08T14:28:14","slug":"bertscore-new-metrics-for-language-models","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=177415","title":{"rendered":"BERTScore: New Metrics for Language Models"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"article-start\">\n<p>We all depend on LLMs for our everyday activities, but quantifying \u201c<em>How efficient they are<\/em>\u201d is a gigantic challenge. Conventional metrics such as <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2025\/03\/bleu-metric\/\">BLEU<\/a>, <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2025\/03\/rouge\/\">ROUGE<\/a>, and <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2025\/04\/how-meteor-improves-ai-text-evaluation\/\">METEOR<\/a> tend to fail in comprehending the real meaning of the text. They are too keen on matching similar words instead of comprehending the concept behind it. BERTScore reverses this by applying BERT embeddings to assess the quality of the text with better comprehension of meaning and context.<\/p>\n<p>Whether you\u2019re training a chatbot, translating, or making summaries, BERTScore makes it easier for you to evaluate your models better. It captures when two sentences convey the same thing despite using different words\u2014something older metrics completely miss. As we dive into how BERTScore operates, you\u2019ll learn how this brilliant evaluation approach ties together computer measurement and human intuition and revolutionizes the way we test and refine today\u2019s sophisticated language models.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-what-is-bertscore\">What is BERTScore?<\/h2>\n<p>BERTScore is a neural evaluation metric for text generation that uses contextual embeddings from pre-trained language models like BERT to calculate similarity scores between candidate and reference texts. Unlike traditional n-gram-based metrics, BERTScore can identify semantic equivalence even when different words are used, making it useful for evaluating language tasks where multiple valid outputs exist.<\/p>\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"826\" height=\"432\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/1-1.webp\" alt=\"\" class=\"wp-image-230370\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/1-1.webp 826w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/1-1-300x157.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/1-1-768x402.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/1-1-150x78.webp 150w\" sizes=\"(max-width: 826px) 100vw, 826px\"\/><\/figure>\n<p>Formulated by Zhang et al. and presented in their 2019 paper \u201c<a href=\"https:\/\/arxiv.org\/pdf\/1904.09675\">BERTScore: Evaluating Text Generation with BERT<\/a>,\u201d this score has gained rapid acceptance within the NLP community due to its high correlation with human evaluation across a range of text generation tasks.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-bertscore-architecture\">BERTScore Architecture<\/h2>\n<p>BERTScore\u2019s architecture is elegantly simple yet powerful, consisting of three main components:<\/p>\n<ol class=\"wp-block-list\">\n<li><strong>Embedding Generation<\/strong>: Each token in both reference and candidate texts is embedded using a pre-trained contextual embedding model (typically BERT).<\/li>\n<li><strong>Token Matching<\/strong>: The algorithm computes pairwise cosine similarities between all tokens in the reference and candidate texts, creating a similarity matrix.<\/li>\n<li><strong>Score Aggregation<\/strong>: These similarity scores are aggregated into precision, recall, and F1 measures that represent how well the candidate text matches the reference.<\/li>\n<\/ol>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"827\" height=\"519\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/2-1.webp\" alt=\"\" class=\"wp-image-230371\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/2-1.webp 827w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/2-1-300x188.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/2-1-768x482.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/2-1-150x94.webp 150w\" sizes=\"auto, (max-width: 827px) 100vw, 827px\"\/><\/figure>\n<p>The beauty of BERTScore is that it leverages the contextual understanding of pre-trained models without requiring additional training for the evaluation task.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-how-to-use-bertscore-nbsp\">How to Use BERTScore?\u00a0<\/h2>\n<p>BERTScore can be customized using several parameters to suit specific evaluation needs:<\/p>\n<div class=\"table-responsive mb-3\">\n<table class=\"table table-hover table-bordered\">\n<thead\/>\n<tbody>\n<tr>\n<td><b>Parameter<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<td><b>Default<\/b><\/td>\n<\/tr>\n<tr>\n<td>model_type<\/td>\n<td>Pre-trained model to use (e.g., \u2018bert-base-uncased\u2019)<\/td>\n<td>\u2018roberta-large\u2019<\/td>\n<\/tr>\n<tr>\n<td>num_layers<\/td>\n<td>Which layer\u2019s embeddings to use<\/td>\n<td>17 (for roberta-large)<\/td>\n<\/tr>\n<tr>\n<td>idf<\/td>\n<td>Whether to use IDF weighting for token importance<\/td>\n<td>False<\/td>\n<\/tr>\n<tr>\n<td>rescale_with_baseline<\/td>\n<td>Whether to rescale scores based on a baseline<\/td>\n<td>False<\/td>\n<\/tr>\n<tr>\n<td>baseline_path<\/td>\n<td>Path to baseline scores<\/td>\n<td>None<\/td>\n<\/tr>\n<tr>\n<td>lang<\/td>\n<td>Language of the texts being compared<\/td>\n<td>\u2018en\u2019<\/td>\n<\/tr>\n<tr>\n<td>use_fast_tokenizer<\/td>\n<td>Whether to use HuggingFace\u2019s fast tokenizers<\/td>\n<td>False<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>These parameters allow researchers to fine-tune BERTScore for different languages, domains, and evaluation requirements.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-how-does-bertscore-work\">How Does BERTScore Work?<\/h2>\n<p>BERTScore evaluates the similarity between generated text and reference text through a token-level matching process using contextual embeddings. Here is a step-by-step breakdown of how it operates:<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"822\" height=\"212\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/3-1-1.webp\" alt=\"\" class=\"wp-image-230372\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/3-1-1.webp 822w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/3-1-1-300x77.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/3-1-1-768x198.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/3-1-1-150x39.webp 150w\" sizes=\"auto, (max-width: 822px) 100vw, 822px\"\/><figcaption class=\"wp-element-caption\">Source: <a href=\"https:\/\/rumn.medium.com\/bert-score-explained-8f384d37bb06\" target=\"_blank\" rel=\"nofollow noopener\">BERTScore<\/a><\/figcaption><\/figure>\n<ol class=\"wp-block-list\">\n<li><strong>Tokenization<\/strong>: Both candidate (generated) and reference texts are tokenized using the tokenizer corresponding to the pre-trained model being used (e.g., BERT, RoBERTa).<\/li>\n<li><strong>Contextual Embedding<\/strong>: Each token is then embedded using a pre-trained contextual model. Importantly, these embeddings capture the meaning of words in context rather than static word representations. For example, the word \u201cbank\u201d would have different embeddings in \u201criver bank\u201d versus \u201cfinancial bank.\u201d<\/li>\n<li><strong>Cosine Similarity Computation<\/strong>: For each token in the candidate text, BERTScore computes its cosine similarity with every token in the reference text, creating a similarity matrix.<\/li>\n<li><strong>Greedy Matching<\/strong>:\n<ul class=\"wp-block-list\">\n<li>For precision: Each candidate token is matched with the most similar reference token<\/li>\n<li>For recall: Each reference token is matched with the most similar candidate token<\/li>\n<\/ul>\n<\/li>\n<li><strong>Importance Weighting (Optional)<\/strong>: Tokens can be weighted by their inverse document frequency (IDF) to emphasize content words over function words.<\/li>\n<li><strong>Score Aggregation<\/strong>:\n<ul class=\"wp-block-list\">\n<li><em>Precision<\/em> is calculated as the average of the maximum similarity scores for each candidate token<\/li>\n<li><em>Recall<\/em> is calculated as the average of the maximum similarity scores for each reference token<\/li>\n<li><em>F1<\/em> combines precision and recall using the harmonic mean formula<\/li>\n<\/ul>\n<\/li>\n<li><strong>Score Normalization (Optional)<\/strong>: Raw scores can be rescaled based on baseline scores to make them more interpretable.<\/li>\n<\/ol>\n<p>This approach allows BERTScore to capture semantic equivalence even when different words are used to express the same meaning, making it more robust than lexical matching metrics for evaluating modern text generation systems.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-implementation-in-python\">Implementation in Python<\/h2>\n<p>Let\u2019s implement BERTScore step by step to understand how it works in practice.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-1-setup-and-installation\">1. Setup and Installation<\/h3>\n<p>First, install the necessary packages:<\/p>\n<pre class=\"wp-block-code\"><code># Install the bert-score package\n\npip install bert-score<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-2-basic-implementation\">2. Basic Implementation<\/h3>\n<p>Here\u2019s how to calculate BERTScore between candidate and reference texts:<\/p>\n<pre class=\"wp-block-code\"><code>import bert_score\n\n# Define reference and candidate texts\n\nreferences = [\"The cat sat on the mat.\", \"The feline rested on the floor covering.\"]\n\ncandidates = [\"A cat was sitting on a mat.\", \"The cat was on the mat.\"]\n\n# Calculate BERTScore\n\nP, R, F1 = bert_score.score(\n\n\u00a0\u00a0\u00a0\u00a0candidates,\u00a0\n\n\u00a0\u00a0\u00a0\u00a0references,\u00a0\n\n\u00a0\u00a0\u00a0\u00a0lang=\"en\",\u00a0\n\n\u00a0\u00a0\u00a0\u00a0model_type=\"roberta-large\",\u00a0\n\n\u00a0\u00a0\u00a0\u00a0num_layers=17,\n\n\u00a0\u00a0\u00a0\u00a0verbose=True\n\n)\n\n# Print results\n\nfor i, (p, r, f) in enumerate(zip(P, R, F1)):\n\n\u00a0\u00a0\u00a0\u00a0print(f\"Example {i+1}:\")\n\n\u00a0\u00a0\u00a0\u00a0print(f\"\u00a0 Precision: {p.item():.4f}\")\n\n\u00a0\u00a0\u00a0\u00a0print(f\"\u00a0 Recall: {r.item():.4f}\")\n\n\u00a0\u00a0\u00a0\u00a0print(f\"\u00a0 F1: {f.item():.4f}\")\n\n\u00a0\u00a0\u00a0\u00a0print()<\/code><\/pre>\n<p>Output:<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"476\" height=\"240\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/4-1.webp\" alt=\"\" class=\"wp-image-230373\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/4-1.webp 476w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/4-1-300x151.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/4-1-150x76.webp 150w\" sizes=\"auto, (max-width: 476px) 100vw, 476px\"\/><\/figure>\n<p>This demonstrates how BERTScore captures semantic similarity even when different phrasings are used.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-bert-embeddings-and-cosine-similarity\">BERT Embeddings and Cosine Similarity<\/h2>\n<p>The core of BERTScore lies in how it leverages contextual embeddings and cosine similarity. Let\u2019s break down the process:<\/p>\n<p><strong>1. Generating Contextual Embeddings:<\/strong> With this distinction in mind, BERTScore is a measure really alternative to the traditional n-gram-based measures, since it is based on contextual embedding generation. Unlike static word embeddings (such as Word2Vec or GloVe), contextual embeddings are finely tuned for semantic similarity evaluation as they account for the importance of surrounding context in assigning meaning to words.<\/p>\n<pre class=\"wp-block-code\"><code>import torch\n\nfrom transformers import AutoTokenizer, AutoModel\n\ndef get_bert_embeddings(texts, model_name=\"bert-base-uncased\"):\n\n\u00a0\u00a0\u00a0\u00a0# Load tokenizer and model\n\n\u00a0\u00a0\u00a0\u00a0tokenizer = AutoTokenizer.from_pretrained(model_name)\n\n\u00a0\u00a0\u00a0\u00a0model = AutoModel.from_pretrained(model_name)\n\n\u00a0\u00a0\u00a0\u00a0# Move model to GPU if available\n\n\u00a0\u00a0\u00a0\u00a0device = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n\n\u00a0\u00a0\u00a0\u00a0model.to(device)\n\n\u00a0\u00a0\u00a0\u00a0# Process texts in batch\n\n\u00a0\u00a0\u00a0\u00a0encoded_input = tokenizer(texts, padding=True, truncation=True, return_tensors=\"pt\")\n\n\u00a0\u00a0\u00a0\u00a0encoded_input = {k: v.to(device) for k, v in encoded_input.items()}\n\n\u00a0\u00a0\u00a0\u00a0# Get model output\n\n\u00a0\u00a0\u00a0\u00a0with torch.no_grad():\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0outputs = model(**encoded_input)\n\n\u00a0\u00a0\u00a0\u00a0# Use embeddings from the last layer\n\n\u00a0\u00a0\u00a0\u00a0embeddings = outputs.last_hidden_state\n\n\u00a0\u00a0\u00a0\u00a0# Remove padding tokens\n\n\u00a0\u00a0\u00a0\u00a0attention_mask = encoded_input['attention_mask']\n\n\u00a0\u00a0\u00a0\u00a0embeddings = [emb[mask.bool()] for emb, mask in zip(embeddings, attention_mask)]\n\n\u00a0\u00a0\u00a0\u00a0return embeddings\n\n# Example usage\n\ntexts = [\"The cat sat on the mat.\", \"A cat was sitting on a mat.\"]\n\nembeddings = get_bert_embeddings(texts)\n\nprint(f\"Number of texts: {len(embeddings)}\")\n\nprint(f\"Shape of first text embeddings: {embeddings[0].shape}\")<\/code><\/pre>\n<p><strong>Output:<\/strong><\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"635\" height=\"63\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/5-1.webp\" alt=\"\" class=\"wp-image-230374\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/5-1.webp 635w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/5-1-300x30.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/5-1-150x15.webp 150w\" sizes=\"auto, (max-width: 635px) 100vw, 635px\"\/><\/figure>\n<p><strong>2. Computing Cosine Similarity: <\/strong>BERTScore uses cosine similarity, a metric that measures how aligned two vectors are in the embedding space regardless of their size, to calculate the semantic similarity between tokens once contextual embeddings for the reference and candidate texts have been created.<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"829\" height=\"538\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/6-1.webp\" alt=\"\" class=\"wp-image-230375\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/6-1.webp 829w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/6-1-300x195.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/6-1-768x498.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/6-1-150x97.webp 150w\" sizes=\"auto, (max-width: 829px) 100vw, 829px\"\/><\/figure>\n<p>Now, let\u2019s implement the cosine similarity calculation between tokens:<\/p>\n<pre class=\"wp-block-code\"><code>def token_cosine_similarity(embeddings1, embeddings2):\n\n\u00a0\u00a0\u00a0\u00a0# Normalize embeddings for cosine similarity\n\n\u00a0\u00a0\u00a0\u00a0embeddings1_norm = embeddings1 \/ embeddings1.norm(dim=1, keepdim=True)\n\n\u00a0\u00a0\u00a0\u00a0embeddings2_norm = embeddings2 \/ embeddings2.norm(dim=1, keepdim=True)\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0similarity_matrix = torch.matmul(embeddings1_norm, embeddings2_norm.transpose(0, 1))\n\n\u00a0\u00a0\u00a0\u00a0return similarity_matrix\n\n# Example usage with our previously generated embeddings\n\nsim_matrix = token_cosine_similarity(embeddings[0], embeddings[1])\n\nprint(f\"Shape of similarity matrix: {sim_matrix.shape}\")\n\nprint(\"Similarity matrix (token-to-token):\")\n\nprint(sim_matrix)<\/code><\/pre>\n<p><strong>Output:<\/strong><\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"827\" height=\"407\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/7-2.webp\" alt=\"\" class=\"wp-image-230377\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/7-2.webp 827w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/7-2-300x148.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/7-2-768x378.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/7-2-150x74.webp 150w\" sizes=\"auto, (max-width: 827px) 100vw, 827px\"\/><\/figure>\n<h2 class=\"wp-block-heading\" id=\"h-bertscore-precision-recall-and-f1\">BERTScore: Precision, Recall, and F1<\/h2>\n<p>Let\u2019s implement the core BERTScore calculation from scratch to understand the mathematics behind it:<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-mathematical-formulation\">Mathematical Formulation<\/h3>\n<p>BERTScore calculates three metrics:<\/p>\n<p>1. <strong>Precision<\/strong>: How many tokens in the candidate text match tokens in the reference?<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"353\" height=\"85\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/8-1.webp\" alt=\"\" class=\"wp-image-230379\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/8-1.webp 353w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/8-1-300x72.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/8-1-350x85.webp 350w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/8-1-150x36.webp 150w\" sizes=\"auto, (max-width: 353px) 100vw, 353px\"\/><\/figure>\n<p>2. <strong>Recall<\/strong>: How many tokens in the reference text are covered by the candidate?<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"351\" height=\"94\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/9.webp\" alt=\"\" class=\"wp-image-230378\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/9.webp 351w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/9-300x80.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/9-150x40.webp 150w\" sizes=\"auto, (max-width: 351px) 100vw, 351px\"\/><\/figure>\n<p>3. <strong>F1<\/strong>: The harmonic mean of precision and recall<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"117\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/10.webp\" alt=\"\" class=\"wp-image-230380\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/10.webp 400w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/10-300x88.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/10-150x44.webp 150w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\"\/><\/figure>\n<p>Where:<\/p>\n<ul class=\"wp-block-list\">\n<li><em>x<\/em> and<em> y<\/em> are the candidate and reference texts, respectively<\/li>\n<li><em>x<sub>i\u200b<\/sub><\/em> and <em>y<sub>j<\/sub>\u200b <\/em>are the token embeddings.<\/li>\n<\/ul>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"435\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/11.webp\" alt=\"\" class=\"wp-image-230381\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/11.webp 826w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/11-300x158.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/11-768x404.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/11-150x79.webp 150w\" sizes=\"auto, (max-width: 826px) 100vw, 826px\"\/><\/figure>\n<h2 class=\"wp-block-heading\" id=\"h-implementation\">Implementation<\/h2>\n<pre class=\"wp-block-code\"><code>def calculate_bertscore(candidate_embeddings, reference_embeddings):\n\n\u00a0\u00a0\u00a0\u00a0# Compute similarity matrix\n\n\u00a0\u00a0\u00a0\u00a0sim_matrix = token_cosine_similarity(candidate_embeddings, reference_embeddings)\n\n\u00a0\u00a0\u00a0\u00a0# Compute precision (max similarity for each candidate token)\n\n\u00a0\u00a0\u00a0\u00a0precision = sim_matrix.max(dim=1)[0].mean().item()\n\n\u00a0\u00a0\u00a0\u00a0# Compute recall (max similarity for each reference token)\n\n\u00a0\u00a0\u00a0\u00a0recall = sim_matrix.max(dim=0)[0].mean().item()\n\n\u00a0\u00a0\u00a0\u00a0# Compute F1\n\n\u00a0\u00a0\u00a0\u00a0f1 = 2 * precision * recall \/ (precision + recall) if precision + recall &gt; 0 else 0\n\n\u00a0\u00a0\u00a0\u00a0return precision, recall, f1\n\n# Example\n\ncand_emb = embeddings[0]\u00a0 # \"The cat sat on the mat.\"\n\nref_emb = embeddings[1] \u00a0 # \"A cat was sitting on a mat.\"\n\nprecision, recall, f1 = calculate_bertscore(cand_emb, ref_emb)\n\nprint(f\"Custom BERTScore calculation:\")\n\nprint(f\"\u00a0 Precision: {precision:.4f}\")\n\nprint(f\"\u00a0 Recall: {recall:.4f}\")\n\nprint(f\"\u00a0 F1: {f1:.4f}\")<\/code><\/pre>\n<p><strong>Output:<\/strong><\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"368\" height=\"99\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/12.webp\" alt=\"\" class=\"wp-image-230382\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/12.webp 368w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/12-300x81.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/12-150x40.webp 150w\" sizes=\"auto, (max-width: 368px) 100vw, 368px\"\/><\/figure>\n<p>This implementation demonstrates the core algorithm behind BERTScore. The actual library includes additional optimizations, IDF weighting options, and baseline rescaling.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-advantages-and-limitations\">Advantages and Limitations<\/h2>\n<div class=\"table-responsive mb-3\">\n<table class=\"table table-hover table-bordered\">\n<thead\/>\n<tbody>\n<tr>\n<td><b>Advantages<\/b><\/td>\n<td><b>Limitations<\/b><\/td>\n<\/tr>\n<tr>\n<td>Captures semantic similarity beyond lexical overlap<\/td>\n<td>Computationally more intensive than n-gram metrics<\/td>\n<\/tr>\n<tr>\n<td>Correlates better with human judgments<\/td>\n<td>Performance depends on the quality of underlying embeddings<\/td>\n<\/tr>\n<tr>\n<td>Works well across different tasks and domains<\/td>\n<td>May not capture structural or logical coherence<\/td>\n<\/tr>\n<tr>\n<td>No training required specifically for evaluation<\/td>\n<td>Can be sensitive to the choice of BERT layer and model<\/td>\n<\/tr>\n<tr>\n<td>Handles synonyms and paraphrases naturally<\/td>\n<td>Less interpretable than explicit matching metrics<\/td>\n<\/tr>\n<tr>\n<td>Language-agnostic (with appropriate models)<\/td>\n<td>Requires GPU for efficient processing of large datasets<\/td>\n<\/tr>\n<tr>\n<td>Can be customized with different embedding models<\/td>\n<td>Not designed to evaluate factual correctness<\/td>\n<\/tr>\n<tr>\n<td>Effectively handles multiple valid references<\/td>\n<td>May struggle with highly creative or unusual text<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2 class=\"wp-block-heading\" id=\"h-practical-applications\">Practical Applications<\/h2>\n<p>BERTScore has found wide application across numerous NLP tasks:<\/p>\n<ol class=\"wp-block-list\">\n<li><strong>Machine Translation: <\/strong>BERTScore helps evaluate translations by focusing on meaning preservation rather than exact wording, which is particularly valuable given the different valid ways to translate a sentence.<\/li>\n<li><strong>Summarization: <\/strong>When evaluating summaries, BERTScore can identify when different phrasings capture the same key information, making it more flexible than ROUGE for assessing summary quality.<\/li>\n<li><strong>Dialog Systems: <\/strong>For conversational AI, BERTScore can evaluate response appropriateness by measuring semantic similarity to reference responses, even when the wording differs significantly.<\/li>\n<li><strong>Text Simplification: <\/strong>BERTScore can assess whether simplifications maintain the original meaning while using different vocabulary, a task where lexical overlap metrics often fall short.<\/li>\n<li><strong>Content Creation: <\/strong>When evaluating AI-generated creative content, BERTScore can measure how well the generation captures the intended themes or information without requiring exact matching.<\/li>\n<\/ol>\n<h2 class=\"wp-block-heading\" id=\"h-comparison-with-other-metrics\">Comparison with Other Metrics<\/h2>\n<p>How does BERTScore stack up against other popular evaluation metrics?<\/p>\n<div class=\"table-responsive mb-3\">\n<table class=\"table table-hover table-bordered\">\n<thead\/>\n<tbody>\n<tr>\n<td><b>Metric<\/b><\/td>\n<td><b>Basis<\/b><\/td>\n<td><b>Strengths<\/b><\/td>\n<td><b>Weaknesses<\/b><\/td>\n<td><b>Human Correlation<\/b><\/td>\n<\/tr>\n<tr>\n<td>BLEU<\/td>\n<td>N-gram precision<\/td>\n<td>Fast, interpretable<\/td>\n<td>Surface-level, position-insensitive<\/td>\n<td>Moderate<\/td>\n<\/tr>\n<tr>\n<td>ROUGE<\/td>\n<td>N-gram recall<\/td>\n<td>Good for summarization<\/td>\n<td>Misses semantic equivalence<\/td>\n<td>Moderate<\/td>\n<\/tr>\n<tr>\n<td>METEOR<\/td>\n<td>Enhanced lexical matching<\/td>\n<td>Handles synonyms<\/td>\n<td>Still primarily lexical<\/td>\n<td>Moderate-High<\/td>\n<\/tr>\n<tr>\n<td>BERTScore<\/td>\n<td>Contextual embeddings<\/td>\n<td>Semantic understanding<\/td>\n<td>Computationally intensive<\/td>\n<td>High<\/td>\n<\/tr>\n<tr>\n<td>BLEURT<\/td>\n<td>Learned metric (fine-tuned)<\/td>\n<td>Task-specific<\/td>\n<td>Requires training<\/td>\n<td>Very High<\/td>\n<\/tr>\n<tr>\n<td>LLM-as-Judge<\/td>\n<td>Direct LLM evaluation<\/td>\n<td>Comprehensive<\/td>\n<td>Black box, expensive<\/td>\n<td>Very High<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>BERTScore offers a balance between sophistication and practicality, capturing semantic similarity without requiring task-specific training.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n<p>BERTScore represents a significant advancement in text generation advancements by leveraging the semantic understanding capabilities of contextual embeddings. Its ability to capture meaning beyond surface-level lexical matches makes it valuable for evaluating modern language models, where creativity and variation in outputs are both expected and desired.<\/p>\n<p>While no single metric can perfectly assess text quality, it is important to note that BERTScore provides a reliable framework that not only aligns with human evaluation across diverse tasks but also offers consistent results. Furthermore, when combined with traditional metrics as well as human analysis, it ultimately enables deeper insights into language generation capabilities.<\/p>\n<p>As language models evolve, tools like BERTScore become necessary for identifying model strengths and weaknesses, and improving the overall quality of natural language generation systems.<\/p>\n<div class=\"border-top py-3 author-info my-4\">\n<div class=\"author-card d-flex align-items-center\">\n<div class=\"flex-shrink-0 overflow-hidden\">\n                                    <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/author\/riyab20021618492\/\" class=\"text-decoration-none active-avatar\"><br \/>\n                                                                       <img decoding=\"async\" src=\"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_5X1DGT2.webp\" width=\"48\" height=\"48\" alt=\"Riya Bansal.\" loading=\"lazy\" class=\"rounded-circle\"\/><\/p>\n<p>                                <\/a>\n                                <\/div>\n<\/p><\/div>\n<p>Gen AI Intern at Analytics Vidhya\u00a0<br \/>Department of Computer Science, Vellore Institute of Technology, Vellore, India\u00a0<\/p>\n<p>I am currently working as a Gen AI Intern at Analytics Vidhya, where I contribute to innovative AI-driven solutions that empower businesses to leverage data effectively. As a final-year Computer Science student at Vellore Institute of Technology, I bring a solid foundation in software development, data analytics, and machine learning to my role.\u00a0<\/p>\n<p>Feel free to connect with me at <a href=\"https:\/\/www.analyticsvidhya.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"57253e2e367935363924363b173639363b2e233e3424213e333f2e367934383a\">[email\u00a0protected]<\/a>\u00a0<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<p><h4 class=\"fs-24 text-dark\">Login to continue reading and enjoy expert-curated content.<\/h4>\n<p>                        <button class=\"btn btn-primary mx-auto d-table\" data-bs-toggle=\"modal\" data-bs-target=\"#loginModal\" id=\"readMoreBtn\">Keep Reading for Free<\/button>\n                    <\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>We all depend on LLMs for our everyday activities, but quantifying \u201cHow efficient they are\u201d is a gigantic challenge. Conventional metrics such as BLEU, ROUGE, and METEOR tend to fail in comprehending the real meaning of the text. They are too keen on matching similar words instead of comprehending the concept behind it. BERTScore reverses [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":177416,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[70474,3856,13896,8558],"dealstore":[],"offerexpiration":[],"class_list":["post-177415","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-bertscore","tag-language","tag-metrics","tag-models"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>BERTScore: New Metrics for Language Models - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=177415\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"BERTScore: New Metrics for Language Models - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"We all depend on LLMs for our everyday activities, but quantifying \u201cHow efficient they are\u201d is a gigantic challenge. Conventional metrics such as BLEU, ROUGE, and METEOR tend to fail in comprehending the real meaning of the text. They are too keen on matching similar words instead of comprehending the concept behind it. BERTScore reverses [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=177415\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-08T14:28:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/BERTScore.webp.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1312\" \/>\n\t<meta property=\"og:image:height\" content=\"736\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=177415#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=177415\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"BERTScore: New Metrics for Language Models\",\"datePublished\":\"2025-04-08T14:28:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=177415\"},\"wordCount\":1565,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=177415#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/BERTScore.webp.webp\",\"keywords\":[\"BERTScore\",\"Language\",\"Metrics\",\"Models\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=177415#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=177415\",\"url\":\"https:\/\/fivemor.com\/?p=177415\",\"name\":\"BERTScore: New Metrics for Language Models - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=177415#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=177415#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/BERTScore.webp.webp\",\"datePublished\":\"2025-04-08T14:28:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=177415#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=177415\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=177415#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/BERTScore.webp.webp\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/BERTScore.webp.webp\",\"width\":1312,\"height\":736},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=177415#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"BERTScore: New Metrics for Language Models\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"BERTScore: New Metrics for Language Models - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=177415","og_locale":"en_US","og_type":"article","og_title":"BERTScore: New Metrics for Language Models - Som2ny Network","og_description":"We all depend on LLMs for our everyday activities, but quantifying \u201cHow efficient they are\u201d is a gigantic challenge. Conventional metrics such as BLEU, ROUGE, and METEOR tend to fail in comprehending the real meaning of the text. They are too keen on matching similar words instead of comprehending the concept behind it. BERTScore reverses [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=177415","og_site_name":"Som2ny Network","article_published_time":"2025-04-08T14:28:14+00:00","og_image":[{"width":1312,"height":736,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/BERTScore.webp.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=177415#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=177415"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"BERTScore: New Metrics for Language Models","datePublished":"2025-04-08T14:28:14+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=177415"},"wordCount":1565,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=177415#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/BERTScore.webp.webp","keywords":["BERTScore","Language","Metrics","Models"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=177415#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=177415","url":"https:\/\/fivemor.com\/?p=177415","name":"BERTScore: New Metrics for Language Models - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=177415#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=177415#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/BERTScore.webp.webp","datePublished":"2025-04-08T14:28:14+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=177415#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=177415"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=177415#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/BERTScore.webp.webp","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/BERTScore.webp.webp","width":1312,"height":736},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=177415#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"BERTScore: New Metrics for Language Models"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/177415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=177415"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/177415\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/177416"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=177415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=177415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=177415"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=177415"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=177415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}