{ "cells": [ { "cell_type": "markdown", "id": "61ea49f8", "metadata": {}, "source": [ "# 1) semantic, sparse, bertscore, lexical similarity between LLM on new_alt_text proposal " ] }, { "cell_type": "code", "execution_count": 1, "id": "d50c12ab", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "c:\\Users\\nicola\\anaconda3\\envs\\accessibility\\lib\\site-packages\\tqdm\\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", " from .autonotebook import tqdm as notebook_tqdm\n" ] } ], "source": [ "import torch\n", "import numpy as np\n", "from transformers import BertTokenizer, BertModel\n", "\n", "def cosine_similarity(a, b):\n", " return np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))\n", "\n", "\n", "#funziona meglio che sentence_embeddings perchè il tokenizer skippa token speciali\n", "def bert_score(reference, candidate, return_similarity_matrix=False):\n", " \n", " # Load the BERT tokenizer and model\n", " tokenizer = BertTokenizer.from_pretrained(\"bert-base-uncased\")\n", " model = BertModel.from_pretrained(\"bert-base-uncased\")\n", " \n", " # Tokenize the input text\n", " ref_tokens = tokenizer(reference, return_tensors=\"pt\", add_special_tokens=False)#add_special_tokens=False mi evita codifica dei caratteri speciali\n", " can_tokens = tokenizer(candidate, return_tensors=\"pt\", add_special_tokens=False)\n", " print(\"ref_tokens:\",ref_tokens)\n", " print(\"can_tokens:\",can_tokens)\n", "\n", " # Get the BERT embeddings\n", " model.eval()\n", " with torch.no_grad():\n", " ref_outputs = model(**ref_tokens)\n", " ref_embeddings = ref_outputs.last_hidden_state[0]\n", "\n", " can_outputs = model(**can_tokens)\n", " can_embeddings = can_outputs.last_hidden_state[0]\n", " #print(\"can_embeddings:\",can_embeddings,can_embeddings.shape)\n", " \n", " # Compute cosine similarities\n", " cosine_similarities = np.zeros((can_embeddings.shape[0], ref_embeddings.shape[0]))\n", " for i, c in enumerate(can_embeddings):\n", " for j, r in enumerate(ref_embeddings):\n", " cosine_similarities[i, j] = cosine_similarity(c, r)\n", " \n", "\n", " # Align cosine similarities\n", " max_similarities = cosine_similarities.max(axis=1)\n", "\n", " # Average similarity scores\n", " bertscore = max_similarities.mean()\n", "\n", " if return_similarity_matrix:\n", " return bertscore, cosine_similarities\n", " else:\n", " return bertscore" ] }, { "cell_type": "code", "execution_count": 2, "id": "83aeef57", "metadata": {}, "outputs": [], "source": [ "from sklearn.feature_extraction.text import TfidfVectorizer\n", "def preprocess_text(text):\n", " # Lowercase the text\n", " text = text.lower()\n", " # Remove punctuation\n", " text = re.sub(r'[^\\w\\s]', '', text)\n", " return text" ] }, { "cell_type": "code", "execution_count": 3, "id": "a14006c3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "ref_tokens: {'input_ids': tensor([[3899]]), 'token_type_ids': tensor([[0]]), 'attention_mask': tensor([[1]])}\n", "can_tokens: {'input_ids': tensor([[29145]]), 'token_type_ids': tensor([[0]]), 'attention_mask': tensor([[1]])}\n", "0.4610232412815094\n", "[[0.46102324]]\n", "(1, 1)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\nicola\\AppData\\Local\\Temp\\ipykernel_20916\\1344219625.py:6: DeprecationWarning: __array__ implementation doesn't accept a copy keyword, so passing copy=False failed. __array__ must implement 'dtype' and 'copy' keyword arguments. To learn more, see the migration guide https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword\n", " return np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))\n" ] } ], "source": [ "#just a test\n", "bertscore, sim_matrix=bert_score(\"dog\", \"zebra\",return_similarity_matrix=True)\n", "print(bertscore)\n", "print(sim_matrix)\n", "print(sim_matrix.shape)" ] }, { "cell_type": "code", "execution_count": 4, "id": "239aa298", "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 5, "id": "cf109d62", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
image_urlalt_textmllm_response
0https://ichef.bbci.co.uk/news/480/cpsprodpb/fd...A shot through a window of a wasteland in Pokr...{'original_alt_text_assessment': '4', 'assessm...
1https://ichef.bbci.co.uk/news/480/cpsprodpb/72...A man in a Caracas market speaks while holding...{'original_alt_text_assessment': '4', 'assessm...
2https://ichef.bbci.co.uk/ace/standard/480/cpsp...A man stands in a pile of rubble with a damage...{'original_alt_text_assessment': '4', 'assessm...
3https://ichef.bbci.co.uk/images/ic/480x270/p0m...A collage showing a man in a suit with a newsp...{'original_alt_text_assessment': '4', 'assessm...
4https://ichef.bbci.co.uk/news/480/cpsprodpb/2b...A composite image of Rupert Grint as an adult,...{'original_alt_text_assessment': '3', 'assessm...
5https://ichef.bbci.co.uk/images/ic/480x270/p0m...The Global Story, The Global Story, Is there a...{'original_alt_text_assessment': '3', 'assessm...
6https://ichef.bbci.co.uk/news/1024/cpsprodpb/3...The pink facade of the Saudades art deco-style...{'original_alt_text_assessment': '2', 'assessm...
7https://ichef.bbci.co.uk/news/480/cpsprodpb/66...Lando Norris speaking to Max Verstappen after ...{'original_alt_text_assessment': '4', 'assessm...
8https://ichef.bbci.co.uk/news/480/cpsprodpb/10...The Northern Lights snake across the curvature...{'original_alt_text_assessment': '4', 'assessm...
9https://ichef.bbci.co.uk/news/480/cpsprodpb/e1...A woman cries as she holds her injured child, ...{'original_alt_text_assessment': '4', 'assessm...
\n", "
" ], "text/plain": [ " image_url \\\n", "0 https://ichef.bbci.co.uk/news/480/cpsprodpb/fd... \n", "1 https://ichef.bbci.co.uk/news/480/cpsprodpb/72... \n", "2 https://ichef.bbci.co.uk/ace/standard/480/cpsp... \n", "3 https://ichef.bbci.co.uk/images/ic/480x270/p0m... \n", "4 https://ichef.bbci.co.uk/news/480/cpsprodpb/2b... \n", "5 https://ichef.bbci.co.uk/images/ic/480x270/p0m... \n", "6 https://ichef.bbci.co.uk/news/1024/cpsprodpb/3... \n", "7 https://ichef.bbci.co.uk/news/480/cpsprodpb/66... \n", "8 https://ichef.bbci.co.uk/news/480/cpsprodpb/10... \n", "9 https://ichef.bbci.co.uk/news/480/cpsprodpb/e1... \n", "\n", " alt_text \\\n", "0 A shot through a window of a wasteland in Pokr... \n", "1 A man in a Caracas market speaks while holding... \n", "2 A man stands in a pile of rubble with a damage... \n", "3 A collage showing a man in a suit with a newsp... \n", "4 A composite image of Rupert Grint as an adult,... \n", "5 The Global Story, The Global Story, Is there a... \n", "6 The pink facade of the Saudades art deco-style... \n", "7 Lando Norris speaking to Max Verstappen after ... \n", "8 The Northern Lights snake across the curvature... \n", "9 A woman cries as she holds her injured child, ... \n", "\n", " mllm_response \n", "0 {'original_alt_text_assessment': '4', 'assessm... \n", "1 {'original_alt_text_assessment': '4', 'assessm... \n", "2 {'original_alt_text_assessment': '4', 'assessm... \n", "3 {'original_alt_text_assessment': '4', 'assessm... \n", "4 {'original_alt_text_assessment': '3', 'assessm... \n", "5 {'original_alt_text_assessment': '3', 'assessm... \n", "6 {'original_alt_text_assessment': '2', 'assessm... \n", "7 {'original_alt_text_assessment': '4', 'assessm... \n", "8 {'original_alt_text_assessment': '4', 'assessm... \n", "9 {'original_alt_text_assessment': '4', 'assessm... " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_mllm_response=pd.read_json(\"C:\\cartella_condivisa\\MachineLearning\\HIISlab\\\\accessibility\\\\notebook_miei\\LLM_accessibility_validator\\outputs\\https_www.bbc.com_gemma3-4b_2025_11_23-09_45_08\\mllm_alttext_assessments.json\")\n", "df_mllm_response" ] }, { "cell_type": "code", "execution_count": 6, "id": "42e9a488", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'original_alt_text_assessment': '4',\n", " 'assessment': 'failure',\n", " 'evaluation_result': \"The alt-text accurately describes the image content but lacks context. While 'A shot through a window of a wasteland in Pokrovsk' is technically correct, it doesn't convey the significance of the image within the article. The image depicts the devastation caused by the conflict in Pokrovsk, highlighting the ongoing war and the challenges faced by Ukrainian troops. The alt-text should reflect this broader context. It’s a descriptive caption, not an informative alt-text.\",\n", " 'new_alt_text': 'Devastation in Pokrovsk, Ukraine - a city under siege during the ongoing conflict.'}" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_mllm_response.iloc[0]['mllm_response']" ] }, { "cell_type": "code", "execution_count": 7, "id": "15ae0f66", "metadata": {}, "outputs": [], "source": [ "def apply_parser_to_dataframe(df, column_name='mllm_response'):\n", " \"\"\"\n", " Apply the MLLM response parser to a dataframe column and expand results into separate columns.\n", " \n", " Args:\n", " df (pd.DataFrame): The input dataframe\n", " column_name (str): Name of the column containing MLLM responses\n", " \n", " Returns:\n", " pd.DataFrame: Dataframe with additional columns for parsed attributes\n", " \"\"\"\n", " # Apply the parsing function to each row\n", " #parsed_results = df[column_name].apply(parse_mllm_alt_text_response) #skipped because already parsed\n", " parsed_results = df[column_name]\n", " \n", " # Convert the list of dictionaries to a DataFrame\n", " parsed_df = pd.DataFrame(parsed_results.tolist())\n", " \n", " # Concatenate with the original dataframe\n", " result_df = pd.concat([df, parsed_df], axis=1)\n", " \n", " return result_df" ] }, { "cell_type": "code", "execution_count": 8, "id": "2639f30a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
image_urlalt_textmllm_responseoriginal_alt_text_assessmentassessmentevaluation_resultnew_alt_text
0https://ichef.bbci.co.uk/news/480/cpsprodpb/fd...A shot through a window of a wasteland in Pokr...{'original_alt_text_assessment': '4', 'assessm...4failureThe alt-text accurately describes the image co...Devastation in Pokrovsk, Ukraine - a city unde...
1https://ichef.bbci.co.uk/news/480/cpsprodpb/72...A man in a Caracas market speaks while holding...{'original_alt_text_assessment': '4', 'assessm...4failureThe alt-text accurately describes the image co...Man in Caracas market speaks about rising food...
2https://ichef.bbci.co.uk/ace/standard/480/cpsp...A man stands in a pile of rubble with a damage...{'original_alt_text_assessment': '4', 'assessm...4failureThe alt-text describes the scene accurately bu...Ukraine: Man surveys damage after missile stri...
3https://ichef.bbci.co.uk/images/ic/480x270/p0m...A collage showing a man in a suit with a newsp...{'original_alt_text_assessment': '4', 'assessm...4failureThe alt-text is not appropriate. The image dep...Satirical depiction of information overload an...
4https://ichef.bbci.co.uk/news/480/cpsprodpb/2b...A composite image of Rupert Grint as an adult,...{'original_alt_text_assessment': '3', 'assessm...3failureThe alt-text ‘A composite image of Rupert Grin...Rupert Grint: Ron Weasley – adult and child
5https://ichef.bbci.co.uk/images/ic/480x270/p0m...The Global Story, The Global Story, Is there a...{'original_alt_text_assessment': '3', 'assessm...3failureThe alt-text is overly verbose and doesn't acc...Protest demonstration.
6https://ichef.bbci.co.uk/news/1024/cpsprodpb/3...The pink facade of the Saudades art deco-style...{'original_alt_text_assessment': '2', 'assessm...2failureThe alt-text is inappropriate. The image depic...Art Deco building facade in Mumbai, India.
7https://ichef.bbci.co.uk/news/480/cpsprodpb/66...Lando Norris speaking to Max Verstappen after ...{'original_alt_text_assessment': '4', 'assessm...4failureThe alt-text is overly specific and doesn't ac...Lando Norris speaking to Max Verstappen after ...
8https://ichef.bbci.co.uk/news/480/cpsprodpb/10...The Northern Lights snake across the curvature...{'original_alt_text_assessment': '4', 'assessm...4failureThe alt-text is not appropriate. While it desc...NASA astronaut's footage of the Northern Light...
9https://ichef.bbci.co.uk/news/480/cpsprodpb/e1...A woman cries as she holds her injured child, ...{'original_alt_text_assessment': '4', 'assessm...4failureThe alt-text is overly descriptive and verbose...Israeli strikes in Gaza – a woman holds her cr...
\n", "
" ], "text/plain": [ " image_url \\\n", "0 https://ichef.bbci.co.uk/news/480/cpsprodpb/fd... \n", "1 https://ichef.bbci.co.uk/news/480/cpsprodpb/72... \n", "2 https://ichef.bbci.co.uk/ace/standard/480/cpsp... \n", "3 https://ichef.bbci.co.uk/images/ic/480x270/p0m... \n", "4 https://ichef.bbci.co.uk/news/480/cpsprodpb/2b... \n", "5 https://ichef.bbci.co.uk/images/ic/480x270/p0m... \n", "6 https://ichef.bbci.co.uk/news/1024/cpsprodpb/3... \n", "7 https://ichef.bbci.co.uk/news/480/cpsprodpb/66... \n", "8 https://ichef.bbci.co.uk/news/480/cpsprodpb/10... \n", "9 https://ichef.bbci.co.uk/news/480/cpsprodpb/e1... \n", "\n", " alt_text \\\n", "0 A shot through a window of a wasteland in Pokr... \n", "1 A man in a Caracas market speaks while holding... \n", "2 A man stands in a pile of rubble with a damage... \n", "3 A collage showing a man in a suit with a newsp... \n", "4 A composite image of Rupert Grint as an adult,... \n", "5 The Global Story, The Global Story, Is there a... \n", "6 The pink facade of the Saudades art deco-style... \n", "7 Lando Norris speaking to Max Verstappen after ... \n", "8 The Northern Lights snake across the curvature... \n", "9 A woman cries as she holds her injured child, ... \n", "\n", " mllm_response \\\n", "0 {'original_alt_text_assessment': '4', 'assessm... \n", "1 {'original_alt_text_assessment': '4', 'assessm... \n", "2 {'original_alt_text_assessment': '4', 'assessm... \n", "3 {'original_alt_text_assessment': '4', 'assessm... \n", "4 {'original_alt_text_assessment': '3', 'assessm... \n", "5 {'original_alt_text_assessment': '3', 'assessm... \n", "6 {'original_alt_text_assessment': '2', 'assessm... \n", "7 {'original_alt_text_assessment': '4', 'assessm... \n", "8 {'original_alt_text_assessment': '4', 'assessm... \n", "9 {'original_alt_text_assessment': '4', 'assessm... \n", "\n", " original_alt_text_assessment assessment \\\n", "0 4 failure \n", "1 4 failure \n", "2 4 failure \n", "3 4 failure \n", "4 3 failure \n", "5 3 failure \n", "6 2 failure \n", "7 4 failure \n", "8 4 failure \n", "9 4 failure \n", "\n", " evaluation_result \\\n", "0 The alt-text accurately describes the image co... \n", "1 The alt-text accurately describes the image co... \n", "2 The alt-text describes the scene accurately bu... \n", "3 The alt-text is not appropriate. The image dep... \n", "4 The alt-text ‘A composite image of Rupert Grin... \n", "5 The alt-text is overly verbose and doesn't acc... \n", "6 The alt-text is inappropriate. The image depic... \n", "7 The alt-text is overly specific and doesn't ac... \n", "8 The alt-text is not appropriate. While it desc... \n", "9 The alt-text is overly descriptive and verbose... \n", "\n", " new_alt_text \n", "0 Devastation in Pokrovsk, Ukraine - a city unde... \n", "1 Man in Caracas market speaks about rising food... \n", "2 Ukraine: Man surveys damage after missile stri... \n", "3 Satirical depiction of information overload an... \n", "4 Rupert Grint: Ron Weasley – adult and child \n", "5 Protest demonstration. \n", "6 Art Deco building facade in Mumbai, India. \n", "7 Lando Norris speaking to Max Verstappen after ... \n", "8 NASA astronaut's footage of the Northern Light... \n", "9 Israeli strikes in Gaza – a woman holds her cr... " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_mllm_response_parsed=apply_parser_to_dataframe(df_mllm_response)\n", "df_mllm_response_parsed" ] }, { "cell_type": "code", "execution_count": 9, "id": "3a69075e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
image_urlalt_textmllm_response
0https://ichef.bbci.co.uk/news/480/cpsprodpb/fd...A shot through a window of a wasteland in Pokr...{'original_alt_text_assessment': '5', 'assessm...
1https://ichef.bbci.co.uk/news/480/cpsprodpb/72...A man in a Caracas market speaks while holding...{'original_alt_text_assessment': '3', 'assessm...
2https://ichef.bbci.co.uk/ace/standard/480/cpsp...A man stands in a pile of rubble with a damage...{'original_alt_text_assessment': '3', 'assessm...
3https://ichef.bbci.co.uk/images/ic/480x270/p0m...A collage showing a man in a suit with a newsp...{'original_alt_text_assessment': '3', 'assessm...
4https://ichef.bbci.co.uk/news/480/cpsprodpb/2b...A composite image of Rupert Grint as an adult,...{'original_alt_text_assessment': '4', 'assessm...
5https://ichef.bbci.co.uk/images/ic/480x270/p0m...The Global Story, The Global Story, Is there a...{'original_alt_text_assessment': '2', 'assessm...
6https://ichef.bbci.co.uk/news/1024/cpsprodpb/3...The pink facade of the Saudades art deco-style...{'original_alt_text_assessment': '2', 'assessm...
7https://ichef.bbci.co.uk/news/480/cpsprodpb/66...Lando Norris speaking to Max Verstappen after ...{'original_alt_text_assessment': '3', 'assessm...
8https://ichef.bbci.co.uk/news/480/cpsprodpb/10...The Northern Lights snake across the curvature...{'original_alt_text_assessment': '4', 'assessm...
9https://ichef.bbci.co.uk/news/480/cpsprodpb/e1...A woman cries as she holds her injured child, ...{'original_alt_text_assessment': '4', 'assessm...
\n", "
" ], "text/plain": [ " image_url \\\n", "0 https://ichef.bbci.co.uk/news/480/cpsprodpb/fd... \n", "1 https://ichef.bbci.co.uk/news/480/cpsprodpb/72... \n", "2 https://ichef.bbci.co.uk/ace/standard/480/cpsp... \n", "3 https://ichef.bbci.co.uk/images/ic/480x270/p0m... \n", "4 https://ichef.bbci.co.uk/news/480/cpsprodpb/2b... \n", "5 https://ichef.bbci.co.uk/images/ic/480x270/p0m... \n", "6 https://ichef.bbci.co.uk/news/1024/cpsprodpb/3... \n", "7 https://ichef.bbci.co.uk/news/480/cpsprodpb/66... \n", "8 https://ichef.bbci.co.uk/news/480/cpsprodpb/10... \n", "9 https://ichef.bbci.co.uk/news/480/cpsprodpb/e1... \n", "\n", " alt_text \\\n", "0 A shot through a window of a wasteland in Pokr... \n", "1 A man in a Caracas market speaks while holding... \n", "2 A man stands in a pile of rubble with a damage... \n", "3 A collage showing a man in a suit with a newsp... \n", "4 A composite image of Rupert Grint as an adult,... \n", "5 The Global Story, The Global Story, Is there a... \n", "6 The pink facade of the Saudades art deco-style... \n", "7 Lando Norris speaking to Max Verstappen after ... \n", "8 The Northern Lights snake across the curvature... \n", "9 A woman cries as she holds her injured child, ... \n", "\n", " mllm_response \n", "0 {'original_alt_text_assessment': '5', 'assessm... \n", "1 {'original_alt_text_assessment': '3', 'assessm... \n", "2 {'original_alt_text_assessment': '3', 'assessm... \n", "3 {'original_alt_text_assessment': '3', 'assessm... \n", "4 {'original_alt_text_assessment': '4', 'assessm... \n", "5 {'original_alt_text_assessment': '2', 'assessm... \n", "6 {'original_alt_text_assessment': '2', 'assessm... \n", "7 {'original_alt_text_assessment': '3', 'assessm... \n", "8 {'original_alt_text_assessment': '4', 'assessm... \n", "9 {'original_alt_text_assessment': '4', 'assessm... " ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_mllm_response_1=pd.read_json(\"C:\\cartella_condivisa\\MachineLearning\\HIISlab\\\\accessibility\\\\notebook_miei\\LLM_accessibility_validator\\outputs\\https_www.bbc.com_gpt-4o_2025_11_23-09_47_49\\mllm_alttext_assessments.json\")\n", "df_mllm_response_1" ] }, { "cell_type": "code", "execution_count": 10, "id": "158aaea9", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
image_urlalt_textmllm_responseoriginal_alt_text_assessmentassessmentevaluation_resultnew_alt_text
0https://ichef.bbci.co.uk/news/480/cpsprodpb/fd...A shot through a window of a wasteland in Pokr...{'original_alt_text_assessment': '5', 'assessm...5successThe alt-text is appropriate as it provides a d...Damaged homes and wasteland in Pokrovsk, Ukrai...
1https://ichef.bbci.co.uk/news/480/cpsprodpb/72...A man in a Caracas market speaks while holding...{'original_alt_text_assessment': '3', 'assessm...3warningThe alt-text partially describes the image but...Man in Caracas market holding coffee, represen...
2https://ichef.bbci.co.uk/ace/standard/480/cpsp...A man stands in a pile of rubble with a damage...{'original_alt_text_assessment': '3', 'assessm...3warningThe original alt-text provides descriptive det...Destruction in Ukraine: rubble, burnt car, and...
3https://ichef.bbci.co.uk/images/ic/480x270/p0m...A collage showing a man in a suit with a newsp...{'original_alt_text_assessment': '3', 'assessm...3warningThe alt-text describes the image but doesn't c...Metaphor for restricted words on social media,...
4https://ichef.bbci.co.uk/news/480/cpsprodpb/2b...A composite image of Rupert Grint as an adult,...{'original_alt_text_assessment': '4', 'assessm...4successThe alt-text appropriately identifies the imag...Rupert Grint as an adult and child, reflecting...
5https://ichef.bbci.co.uk/images/ic/480x270/p0m...The Global Story, The Global Story, Is there a...{'original_alt_text_assessment': '2', 'assessm...2failureThe original alt-text does not directly descri...Protesters holding 'Trump Help!' and 'Refuge P...
6https://ichef.bbci.co.uk/news/1024/cpsprodpb/3...The pink facade of the Saudades art deco-style...{'original_alt_text_assessment': '2', 'assessm...2failureThe alt-text is inaccurate and does not match ...Yellow art deco-style building in Mumbai's Ban...
7https://ichef.bbci.co.uk/news/480/cpsprodpb/66...Lando Norris speaking to Max Verstappen after ...{'original_alt_text_assessment': '3', 'assessm...3warningThe alt-text describes the image content direc...Lando Norris discussing post-race matters afte...
8https://ichef.bbci.co.uk/news/480/cpsprodpb/10...The Northern Lights snake across the curvature...{'original_alt_text_assessment': '4', 'assessm...4successThe alt-text describes the image content effec...Northern Lights over Earth’s curvature filmed ...
9https://ichef.bbci.co.uk/news/480/cpsprodpb/e1...A woman cries as she holds her injured child, ...{'original_alt_text_assessment': '4', 'assessm...4successThe alt-text appropriately describes the emoti...A crying mother holds her injured child in a G...
\n", "
" ], "text/plain": [ " image_url \\\n", "0 https://ichef.bbci.co.uk/news/480/cpsprodpb/fd... \n", "1 https://ichef.bbci.co.uk/news/480/cpsprodpb/72... \n", "2 https://ichef.bbci.co.uk/ace/standard/480/cpsp... \n", "3 https://ichef.bbci.co.uk/images/ic/480x270/p0m... \n", "4 https://ichef.bbci.co.uk/news/480/cpsprodpb/2b... \n", "5 https://ichef.bbci.co.uk/images/ic/480x270/p0m... \n", "6 https://ichef.bbci.co.uk/news/1024/cpsprodpb/3... \n", "7 https://ichef.bbci.co.uk/news/480/cpsprodpb/66... \n", "8 https://ichef.bbci.co.uk/news/480/cpsprodpb/10... \n", "9 https://ichef.bbci.co.uk/news/480/cpsprodpb/e1... \n", "\n", " alt_text \\\n", "0 A shot through a window of a wasteland in Pokr... \n", "1 A man in a Caracas market speaks while holding... \n", "2 A man stands in a pile of rubble with a damage... \n", "3 A collage showing a man in a suit with a newsp... \n", "4 A composite image of Rupert Grint as an adult,... \n", "5 The Global Story, The Global Story, Is there a... \n", "6 The pink facade of the Saudades art deco-style... \n", "7 Lando Norris speaking to Max Verstappen after ... \n", "8 The Northern Lights snake across the curvature... \n", "9 A woman cries as she holds her injured child, ... \n", "\n", " mllm_response \\\n", "0 {'original_alt_text_assessment': '5', 'assessm... \n", "1 {'original_alt_text_assessment': '3', 'assessm... \n", "2 {'original_alt_text_assessment': '3', 'assessm... \n", "3 {'original_alt_text_assessment': '3', 'assessm... \n", "4 {'original_alt_text_assessment': '4', 'assessm... \n", "5 {'original_alt_text_assessment': '2', 'assessm... \n", "6 {'original_alt_text_assessment': '2', 'assessm... \n", "7 {'original_alt_text_assessment': '3', 'assessm... \n", "8 {'original_alt_text_assessment': '4', 'assessm... \n", "9 {'original_alt_text_assessment': '4', 'assessm... \n", "\n", " original_alt_text_assessment assessment \\\n", "0 5 success \n", "1 3 warning \n", "2 3 warning \n", "3 3 warning \n", "4 4 success \n", "5 2 failure \n", "6 2 failure \n", "7 3 warning \n", "8 4 success \n", "9 4 success \n", "\n", " evaluation_result \\\n", "0 The alt-text is appropriate as it provides a d... \n", "1 The alt-text partially describes the image but... \n", "2 The original alt-text provides descriptive det... \n", "3 The alt-text describes the image but doesn't c... \n", "4 The alt-text appropriately identifies the imag... \n", "5 The original alt-text does not directly descri... \n", "6 The alt-text is inaccurate and does not match ... \n", "7 The alt-text describes the image content direc... \n", "8 The alt-text describes the image content effec... \n", "9 The alt-text appropriately describes the emoti... \n", "\n", " new_alt_text \n", "0 Damaged homes and wasteland in Pokrovsk, Ukrai... \n", "1 Man in Caracas market holding coffee, represen... \n", "2 Destruction in Ukraine: rubble, burnt car, and... \n", "3 Metaphor for restricted words on social media,... \n", "4 Rupert Grint as an adult and child, reflecting... \n", "5 Protesters holding 'Trump Help!' and 'Refuge P... \n", "6 Yellow art deco-style building in Mumbai's Ban... \n", "7 Lando Norris discussing post-race matters afte... \n", "8 Northern Lights over Earth’s curvature filmed ... \n", "9 A crying mother holds her injured child in a G... " ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_mllm_response_parsed_1=apply_parser_to_dataframe(df_mllm_response_1)\n", "df_mllm_response_parsed_1" ] }, { "cell_type": "code", "execution_count": 12, "id": "3992a33f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "('Devastation in Pokrovsk, Ukraine - a city under siege during the ongoing conflict.',\n", " \"Damaged homes and wasteland in Pokrovsk, Ukraine with smoke rising, highlighting war's impact on the city.\")" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "reference=df_mllm_response_parsed[\"new_alt_text\"].iloc[0]\n", "candidate=df_mllm_response_parsed_1[\"new_alt_text\"].iloc[0]\n", "reference,candidate" ] }, { "cell_type": "markdown", "id": "a72020fc", "metadata": {}, "source": [ "# semantic similarity (bertscore)" ] }, { "cell_type": "code", "execution_count": 13, "id": "c1dad7b8", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "ref_tokens: {'input_ids': tensor([[25594, 1999, 13433, 21638, 4492, 6711, 1010, 5924, 1011, 1037,\n", " 2103, 2104, 6859, 2076, 1996, 7552, 4736, 1012]]), 'token_type_ids': tensor([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]), 'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]])}\n", "can_tokens: {'input_ids': tensor([[ 5591, 5014, 1998, 5949, 3122, 1999, 13433, 21638, 4492, 6711,\n", " 1010, 5924, 2007, 5610, 4803, 1010, 20655, 2162, 1005, 1055,\n", " 4254, 2006, 1996, 2103, 1012]]), 'token_type_ids': tensor([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", " 0]]), 'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n", " 1]])}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\nicola\\AppData\\Local\\Temp\\ipykernel_20916\\1344219625.py:6: DeprecationWarning: __array__ implementation doesn't accept a copy keyword, so passing copy=False failed. __array__ must implement 'dtype' and 'copy' keyword arguments. To learn more, see the migration guide https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword\n", " return np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))\n" ] }, { "data": { "text/plain": [ "np.float64(0.5812176442146302)" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bertscore =bert_score(reference, candidate,return_similarity_matrix=False)\n", "bertscore" ] }, { "cell_type": "markdown", "id": "e901f280", "metadata": {}, "source": [ "## lexical similarity" ] }, { "cell_type": "code", "execution_count": 14, "id": "1c2d1cff", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[1. , 0.70703788],\n", " [0.70703788, 1. ]])" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from sklearn.metrics.pairwise import cosine_similarity as cosine_similarity_sklearn\n", "text=[reference,candidate]\n", "# Vectorize the text data\n", "vectorizer = TfidfVectorizer(stop_words=None, analyzer='char', ngram_range=(1, 3))\n", "tfidf_matrix = vectorizer.fit_transform(text)\n", "# Compute cosine similarity between each pair of entries\n", "cos_sim_matrix = cosine_similarity_sklearn(tfidf_matrix)\n", "cos_sim_matrix" ] }, { "cell_type": "code", "execution_count": 14, "id": "f2304218", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(2, 278)" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tfidf_matrix.shape" ] }, { "cell_type": "code", "execution_count": 15, "id": "d4afb728", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "np.float64(0.7070378833564678)" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cos_sim_lexical = cosine_similarity(tfidf_matrix[0].toarray().flatten(),tfidf_matrix[1].toarray().flatten())\n", "cos_sim_lexical" ] }, { "cell_type": "markdown", "id": "1bc19425", "metadata": {}, "source": [ "## semantic similarity embeddings" ] }, { "cell_type": "code", "execution_count": 15, "id": "b6ff8518", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(2, 768)" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from sentence_transformers import SentenceTransformer\n", "model = SentenceTransformer('sentence-transformers/all-mpnet-base-v2')\n", "embeddings = model.encode([reference, candidate],output_value=\"sentence_embedding\")# comando per estrarre un embedding solo media di tutti gli embedding delle parole\n", " # \"token_embeddings\" comando per estrarre un embedding per ogni parola\n", "embeddings.shape" ] }, { "cell_type": "code", "execution_count": 32, "id": "6310f4b2", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "None\n" ] } ], "source": [ "# per capire se usa default prompt_name per differenziare i task come modelli avanzati come gemma\n", "print(model.default_prompt_name )" ] }, { "cell_type": "code", "execution_count": 16, "id": "2eb31bbb", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[0.9999995 , 0.82111526],\n", " [0.82111526, 1. ]], dtype=float32)" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cos_sim_matrix_emb = cosine_similarity_sklearn(embeddings)\n", "cos_sim_matrix_emb" ] }, { "cell_type": "code", "execution_count": 17, "id": "93a846e4", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "np.float32(0.8211156)" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cos_sim_emb = cosine_similarity(embeddings[0],embeddings[1])\n", "cos_sim_emb" ] }, { "cell_type": "code", "execution_count": 18, "id": "a7cf3288", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(tensor([[1.0000, 0.8211],\n", " [0.8211, 1.0000]]),\n", " 'cosine')" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# USING MODEL SIMILARITY METHOD\n", "similarities = model.similarity(embeddings, embeddings)\n", "similarities,model.similarity_fn_name" ] }, { "cell_type": "markdown", "id": "2cfe315e", "metadata": {}, "source": [ "## sparse encoder" ] }, { "cell_type": "code", "execution_count": 20, "id": "a457ad0a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "torch.Size([2, 30522])\n", "tensor([[1.0000, 0.6181],\n", " [0.6181, 1.0000]])\n", "Sparsity: 99.62%\n", "Avg non-zero dimensions per embedding: 116.50\n" ] } ], "source": [ "from sentence_transformers import SparseEncoder\n", "\n", "# 1. Load a pretrained SparseEncoder model\n", "model = SparseEncoder(\"naver/splade-cocondenser-ensembledistil\")\n", "model.similarity_fn_name = \"cosine\" # set similarity function to cosine default is dot product\n", "\n", "# The sentences to encode\n", "sentences = [reference, candidate]\n", "\n", "# 2. Calculate sparse embeddings by calling model.encode()\n", "embeddings = model.encode(sentences)\n", "print(embeddings.shape)\n", "# [#, 30522] - sparse representation with vocabulary size dimensions\n", "\n", "# 3. Calculate the embedding similarities (using dot product by default)\n", "similarities = model.similarity(embeddings, embeddings)\n", "print(similarities)\n", "# tensor()\n", "\n", "# 4. Check sparsity statistics\n", "stats = SparseEncoder.sparsity(embeddings)\n", "print(f\"Sparsity: {stats['sparsity_ratio']:.2%}\") # Typically >99% zeros\n", "print(f\"Avg non-zero dimensions per embedding: {stats['active_dims']:.2f}\")" ] }, { "cell_type": "markdown", "id": "326230d3", "metadata": {}, "source": [ "# 2) Correlation analysis between LLM assessment response pairs" ] }, { "cell_type": "code", "execution_count": 21, "id": "37b4d56b", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 22, "id": "75f16536", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "([4, 4, 4, 4, 3, 3, 2, 4, 4, 4], [5, 3, 3, 3, 4, 2, 2, 3, 4, 4])" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list1=df_mllm_response_parsed[\"original_alt_text_assessment\"].astype(int).tolist()\n", "list2=df_mllm_response_parsed_1[\"original_alt_text_assessment\"].astype(int).tolist()\n", "list1,list2" ] }, { "cell_type": "code", "execution_count": 23, "id": "fa2837db", "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjcAAAGwCAYAAABVdURTAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjcsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvTLEjVAAAAAlwSFlzAAAPYQAAD2EBqD+naQAAPjFJREFUeJzt3QtUlXW+//EvdxQBAeWuqGkIIgJWXtJ0juY9b+fMlFNjNdbMtHRGZ6ZWR5ddzHPSMk9jp1nmOKXNacx/tkQbK4ux1DEtL4CCFxKv3EFULiqIsP/r90M2GxUFBPbez36/1trJ/u0HfB62D3x6nu/v93UymUwmAQAAMAhna+8AAABAayLcAAAAQyHcAAAAQyHcAAAAQyHcAAAAQyHcAAAAQyHcAAAAQ3EVB1NTUyO5ubni7e0tTk5O1t4dAADQBGpZvrKyMgkNDRVn59tfm3G4cKOCTbdu3ay9GwAAoAWysrIkPDz8tts4XLhRV2zqvjk+Pj7W3h0AANAEpaWl+uJE3e/x23G4cFN3K0oFG8INAAD2pSklJRQUAwAAQyHcAAAAQyHcAAAAQyHcAAAAQyHcAAAAQyHcAAAAQyHcAAAAQyHcAAAAQyH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7sqN+oaEh4e36d+h3kyj/qNVOD77x3to/3gP7ZvR37+2OsY7XbGpQ0ExAAAwFMINAAAwFMJNK/Lw8JBXXnlF/2lEHJ/94z20f7yH9s3o75+tHKPDFRQDAABj48oNAAAwFMINAAAwFMINAAAwFMINAAAwFMLNLSxZskTuv/9+vYpxYGCgTJ06VTIyMu74zdywYYP07dtXPD09pX///vLFF180eF3Vbr/88ssSEhIiHTp0kNGjR8vx48fFXo5x9erVMnz4cPHz89MPtf979+5tsM1TTz2lV362fIwbN07s4fjWrl17076r99IW38OWHN/IkSNvOj71mDhxos29f8rKlSslNjbWvBDYkCFD5MsvvzTMOdjc47On86+lx2hP52BLjs/ezsEbLV26VO/PvHnzxObPQzVbCg2NHTvWtGbNGlN6eropNTXVNGHCBFP37t1N5eXljX6rvvvuO5OLi4vpzTffNB05csS0cOFCk5ubmyktLc28zdKlS02+vr6mTZs2mQ4ePGiaPHmyqWfPnqYrV67YxTH+/Oc/N/35z382paSkmI4ePWp66qmn9PFkZ2ebt3nyySdN48aNM+Xl5Zkf58+fN9nD8antfXx8Gux7fn5+g21s5T1syfEVFxc3ODb1uerfrPo6tvb+KZ999pnp888/N/3444+mjIwM04IFC/Q5pfbbCOdgc4/Pns6/lh6jPZ2DLTk+ezsHLe3du9fUo0cPU2xsrGnu3LmmxtjKeUi4aYLCwkI1Xd60Y8eORrf52c9+Zpo4cWKDsUGDBpl+/etf649rampMwcHBpmXLlplfv3jxosnDw8P08ccfm+zhGG907do1k7e3t+nDDz9scGJOmTLFZGuacnzqB4w64Rpjy+9hS96/t99+W79/loHIVt+/On5+fqa//vWvhjwH73R89nz+NfUY7fkcbMl7aC/nYFlZmalPnz6mpKQk04gRI24bbmzlPOS2VBOUlJToP/39/RvdZs+ePfrSmqWxY8fqceXUqVOSn5/fYBvVI2PQoEHmbWz9GG90+fJlqaqquulztm/frm+VREZGynPPPSfFxcViL8dXXl4uERERuunblClT5PDhw+bXbPk9bMn79/7778tjjz0mXl5eNv/+VVdX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", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "plt.scatter(list1, list2)\n", "plt.plot(\n", " np.unique(list1),\n", " np.poly1d(np.polyfit(list1, list2, 1))(np.unique(list1))\n", "\n", ")\n", "plt.xlabel(\"gemma4b\")\n", "plt.ylabel(\"gtp-4o\")\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "f5576a0a", "metadata": {}, "source": [ "### Correlation Coefficients" ] }, { "cell_type": "code", "execution_count": 24, "id": "51ad4f42", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PearsonSpearmanKendall Tau
Results0.536020.483190.422944
\n", "
" ], "text/plain": [ " Pearson Spearman Kendall Tau\n", "Results 0.53602 0.48319 0.422944" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd\n", "from scipy.stats import spearmanr, kendalltau\n", "\n", "pearson_correlation = np.corrcoef(list1, list2)[0, 1]\n", "spearman_correlation, _ = spearmanr(list1, list2)\n", "kendall_tau_correlation, _ = kendalltau(list1, list2)\n", "\n", "correlation_table = pd.DataFrame({\n", " \"Pearson\": [pearson_correlation],\n", " \"Spearman\": [spearman_correlation],\n", " \"Kendall Tau\": [kendall_tau_correlation]\n", "}, index=['Results'])\n", "\n", "correlation_table" ] } ], "metadata": { "kernelspec": { "display_name": "accessibility", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.19" } }, "nbformat": 4, "nbformat_minor": 5 }