{ "cells": [ { "cell_type": "markdown", "id": "f100a963", "metadata": {}, "source": [ "# Test Post-processing: PREFIX & TIME/DATE trong ngoặc []" ] }, { "cell_type": "code", "execution_count": null, "id": "94f79399", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "^C\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Collecting gradio\n", " Downloading gradio-6.14.0-py3-none-any.whl.metadata (17 kB)\n", "Requirement already satisfied: anyio<5.0,>=3.0 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from gradio) (4.13.0)\n", "Collecting brotli>=1.1.0 (from gradio)\n", " Downloading brotli-1.2.0-cp311-cp311-win_amd64.whl.metadata (6.3 kB)\n", "Collecting fastapi<1.0,>=0.115.2 (from gradio)\n", " Downloading fastapi-0.136.1-py3-none-any.whl.metadata (28 kB)\n", "Collecting gradio-client==2.5.0 (from gradio)\n", " Downloading gradio_client-2.5.0-py3-none-any.whl.metadata (7.1 kB)\n", "Collecting groovy~=0.1 (from gradio)\n", " Downloading groovy-0.1.2-py3-none-any.whl.metadata (6.1 kB)\n", "Collecting hf-gradio<1.0,>=0.4.1 (from gradio)\n", " Downloading hf_gradio-0.4.1-py3-none-any.whl.metadata (428 bytes)\n", "Requirement already satisfied: httpx<1.0,>=0.24.1 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from gradio) (0.28.1)\n", "Requirement already satisfied: huggingface-hub<2.0,>=0.33.5 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from gradio) (1.12.0)\n", "Requirement already satisfied: jinja2<4.0 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from gradio) (3.1.6)\n", "Requirement already satisfied: markupsafe<4.0,>=2.0 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from gradio) (3.0.3)\n", "Requirement already satisfied: numpy<3.0,>=1.0 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from gradio) (2.4.4)\n", "Collecting orjson~=3.0 (from gradio)\n", " Downloading orjson-3.11.9-cp311-cp311-win_amd64.whl.metadata (43 kB)\n", "Requirement already satisfied: packaging in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from gradio) (26.0)\n", "Collecting pandas<4.0,>=1.0 (from gradio)\n", " Using cached pandas-3.0.2-cp311-cp311-win_amd64.whl.metadata (19 kB)\n", "Collecting pillow<13.0,>=8.0 (from gradio)\n", " Using cached pillow-12.2.0-cp311-cp311-win_amd64.whl.metadata (9.0 kB)\n", "Requirement already satisfied: pydantic<=3.0,>=2.0 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from gradio) (2.13.3)\n", "Collecting pydub<1.0 (from gradio)\n", " Using cached pydub-0.25.1-py2.py3-none-any.whl.metadata (1.4 kB)\n", "Collecting python-multipart<1.0,>=0.0.18 (from gradio)\n", " Downloading python_multipart-0.0.27-py3-none-any.whl.metadata (2.1 kB)\n", "Collecting pytz>=2017.2 (from gradio)\n", " Downloading pytz-2026.2-py2.py3-none-any.whl.metadata (22 kB)\n", "Requirement already satisfied: pyyaml<7.0,>=5.0 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from gradio) (6.0.3)\n", "Collecting safehttpx<0.2.0,>=0.1.7 (from gradio)\n", " Downloading safehttpx-0.1.7-py3-none-any.whl.metadata (4.2 kB)\n", "Collecting semantic-version~=2.0 (from gradio)\n", " Using cached semantic_version-2.10.0-py2.py3-none-any.whl.metadata (9.7 kB)\n", "Collecting starlette<2.0,>=0.40.0 (from gradio)\n", " Downloading starlette-1.0.0-py3-none-any.whl.metadata (6.3 kB)\n", "Collecting tomlkit<0.15.0,>=0.12.0 (from gradio)\n", " Using cached tomlkit-0.14.0-py3-none-any.whl.metadata (2.8 kB)\n", "Requirement already satisfied: typer<1.0,>=0.12 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from gradio) (0.25.0)\n", "Requirement already satisfied: typing-extensions~=4.0 in C:\\Users\\ADMIN\\AppData\\Roaming\\Python\\Python311\\site-packages (from gradio) (4.15.0)\n", "Collecting uvicorn>=0.14.0 (from gradio)\n", " Downloading uvicorn-0.46.0-py3-none-any.whl.metadata (6.7 kB)\n", "Requirement already satisfied: fsspec in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from gradio-client==2.5.0->gradio) (2026.3.0)\n", "Requirement already satisfied: idna>=2.8 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from anyio<5.0,>=3.0->gradio) (3.13)\n", "Requirement already satisfied: typing-inspection>=0.4.2 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from fastapi<1.0,>=0.115.2->gradio) (0.4.2)\n", "Requirement already satisfied: annotated-doc>=0.0.2 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from fastapi<1.0,>=0.115.2->gradio) (0.0.4)\n", "Requirement already satisfied: certifi in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from httpx<1.0,>=0.24.1->gradio) (2026.4.22)\n", "Requirement already satisfied: httpcore==1.* in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from httpx<1.0,>=0.24.1->gradio) (1.0.9)\n", "Requirement already satisfied: h11>=0.16 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from httpcore==1.*->httpx<1.0,>=0.24.1->gradio) (0.16.0)\n", "Requirement already satisfied: filelock>=3.10.0 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from huggingface-hub<2.0,>=0.33.5->gradio) (3.29.0)\n", "Requirement already satisfied: hf-xet<2.0.0,>=1.4.3 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from huggingface-hub<2.0,>=0.33.5->gradio) (1.4.3)\n", "Requirement already satisfied: tqdm>=4.42.1 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from huggingface-hub<2.0,>=0.33.5->gradio) (4.67.3)\n", "Requirement already satisfied: python-dateutil>=2.8.2 in C:\\Users\\ADMIN\\AppData\\Roaming\\Python\\Python311\\site-packages (from pandas<4.0,>=1.0->gradio) (2.9.0.post0)\n", "Collecting tzdata (from pandas<4.0,>=1.0->gradio)\n", " Downloading tzdata-2026.2-py2.py3-none-any.whl.metadata (1.4 kB)\n", "Requirement already satisfied: annotated-types>=0.6.0 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from pydantic<=3.0,>=2.0->gradio) (0.7.0)\n", "Requirement already satisfied: pydantic-core==2.46.3 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from pydantic<=3.0,>=2.0->gradio) (2.46.3)\n", "Requirement already satisfied: click>=8.2.1 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from typer<1.0,>=0.12->gradio) (8.3.3)\n", "Requirement already satisfied: shellingham>=1.3.0 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from typer<1.0,>=0.12->gradio) (1.5.4)\n", "Requirement already satisfied: rich>=13.8.0 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from typer<1.0,>=0.12->gradio) (15.0.0)\n", "Requirement already satisfied: colorama in C:\\Users\\ADMIN\\AppData\\Roaming\\Python\\Python311\\site-packages (from click>=8.2.1->typer<1.0,>=0.12->gradio) (0.4.6)\n", "Requirement already satisfied: six>=1.5 in C:\\Users\\ADMIN\\AppData\\Roaming\\Python\\Python311\\site-packages (from python-dateutil>=2.8.2->pandas<4.0,>=1.0->gradio) (1.17.0)\n", "Requirement already satisfied: markdown-it-py>=2.2.0 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from rich>=13.8.0->typer<1.0,>=0.12->gradio) (4.0.0)\n", "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in C:\\Users\\ADMIN\\AppData\\Roaming\\Python\\Python311\\site-packages (from rich>=13.8.0->typer<1.0,>=0.12->gradio) (2.19.2)\n", "Requirement already satisfied: mdurl~=0.1 in C:\\Users\\ADMIN\\miniconda3\\envs\\quantize\\Lib\\site-packages (from markdown-it-py>=2.2.0->rich>=13.8.0->typer<1.0,>=0.12->gradio) (0.1.2)\n", "Downloading gradio-6.14.0-py3-none-any.whl (19.7 MB)\n", " ---------------------------------------- 0.0/19.7 MB ? eta -:--:--\n", " -- ------------------------------------- 1.0/19.7 MB 12.7 MB/s eta 0:00:02\n", " ------------- -------------------------- 6.6/19.7 MB 21.2 MB/s eta 0:00:01\n", " --------------------- ------------------ 10.5/19.7 MB 19.8 MB/s eta 0:00:01\n", " --------------------------------- ------ 16.5/19.7 MB 22.6 MB/s eta 0:00:01\n", " ---------------------------------------- 19.7/19.7 MB 21.1 MB/s 0:00:01\n", "Downloading gradio_client-2.5.0-py3-none-any.whl (59 kB)\n", "Downloading fastapi-0.136.1-py3-none-any.whl (117 kB)\n", "Downloading groovy-0.1.2-py3-none-any.whl (14 kB)\n", "Downloading hf_gradio-0.4.1-py3-none-any.whl (4.5 kB)\n", "Downloading orjson-3.11.9-cp311-cp311-win_amd64.whl (127 kB)\n", "Using cached pandas-3.0.2-cp311-cp311-win_amd64.whl (9.9 MB)\n", "Using cached pillow-12.2.0-cp311-cp311-win_amd64.whl (7.1 MB)\n", "Using cached pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n", "Downloading python_multipart-0.0.27-py3-none-any.whl (29 kB)\n", "Downloading safehttpx-0.1.7-py3-none-any.whl (9.0 kB)\n", "Using cached semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)\n", "Downloading starlette-1.0.0-py3-none-any.whl (72 kB)\n", "Using cached tomlkit-0.14.0-py3-none-any.whl (39 kB)\n", "Downloading brotli-1.2.0-cp311-cp311-win_amd64.whl (369 kB)\n", "Downloading pytz-2026.2-py2.py3-none-any.whl (510 kB)\n", "Downloading uvicorn-0.46.0-py3-none-any.whl (70 kB)\n", "Downloading tzdata-2026.2-py2.py3-none-any.whl (349 kB)\n", "Installing collected packages: pytz, pydub, brotli, tzdata, tomlkit, semantic-version, python-multipart, pillow, orjson, groovy, uvicorn, starlette, pandas, safehttpx, fastapi, gradio-client, hf-gradio, gradio\n", "\n", " ---------------------------------------- 0/18 [pytz]\n", " ---- ----------------------------------- 2/18 [brotli]\n", " ------ --------------------------------- 3/18 [tzdata]\n", " -------- ------------------------------- 4/18 [tomlkit]\n", " --------------- ------------------------ 7/18 [pillow]\n", " --------------- ------------------------ 7/18 [pillow]\n", " --------------- ------------------------ 7/18 [pillow]\n", " ------------------------ --------------- 11/18 [starlette]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " -------------------------- ------------- 12/18 [pandas]\n", " ---------------------------- ----------- 13/18 [safehttpx]\n", " --------------------------------- ------ 15/18 [gradio-client]\n", " ------------------------------------- -- 17/18 [gradio]\n", " ------------------------------------- -- 17/18 [gradio]\n", " ------------------------------------- -- 17/18 [gradio]\n", " ------------------------------------- -- 17/18 [gradio]\n", " ------------------------------------- -- 17/18 [gradio]\n", " ------------------------------------- -- 17/18 [gradio]\n", " ------------------------------------- -- 17/18 [gradio]\n", " ------------------------------------- -- 17/18 [gradio]\n", " ------------------------------------- -- 17/18 [gradio]\n", " ---------------------------------------- 18/18 [gradio]\n", "\n", "Successfully installed brotli-1.2.0 fastapi-0.136.1 gradio-6.14.0 gradio-client-2.5.0 groovy-0.1.2 hf-gradio-0.4.1 orjson-3.11.9 pandas-3.0.2 pillow-12.2.0 pydub-0.25.1 python-multipart-0.0.27 pytz-2026.2 safehttpx-0.1.7 semantic-version-2.10.0 starlette-1.0.0 tomlkit-0.14.0 tzdata-2026.2 uvicorn-0.46.0\n" ] } ], "source": [ "!pip install gradio" ] }, { "cell_type": "code", "execution_count": 4, "id": "e8be21f1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "✅ Import thành công!\n" ] } ], "source": [ "\"\"\"\n", "Import trực tiếp các hàm cần thiết từ app.py mà không kéo theo gradio/torch.\n", "\"\"\"\n", "import re, os, sys, ipaddress, unicodedata\n", "from datetime import datetime\n", "from typing import Dict, List, Optional, Tuple, Callable, Pattern\n", "from dataclasses import dataclass\n", "from urllib.parse import urlparse\n", "\n", "_app_path = r\"d:\\CODE\\DEMO_HF\\GLiNER2-multi\\app.py\"\n", "with open(_app_path, encoding=\"utf-8\") as f:\n", " _source = f.read()\n", "\n", "# Tách phần từ section 2 đến hết section 2d (trước section 3 - Model Wrappers)\n", "_cut = _source.find(\"class _BaseWrapper\")\n", "_pure_source = _source[_source.find(\"# ======\"):_cut] if _cut > 0 else \"\"\n", "\n", "# Bỏ dòng gán WhitespaceTokenSplitter (cần gliner2)\n", "_pure_source = \"\\n\".join(\n", " line for line in _pure_source.splitlines()\n", " if \"WhitespaceTokenSplitter\" not in line\n", ")\n", "\n", "_ns = {\n", " \"re\": re, \"os\": os, \"ipaddress\": ipaddress, \"unicodedata\": unicodedata,\n", " \"datetime\": datetime, \"Dict\": Dict, \"List\": List, \"Optional\": Optional,\n", " \"Tuple\": Tuple, \"Callable\": Callable, \"Pattern\": Pattern,\n", " \"dataclass\": dataclass, \"urlparse\": urlparse,\n", " \"defaultdict\": __import__(\"collections\").defaultdict,\n", " \"frozenset\": frozenset,\n", "}\n", "exec(_pure_source, _ns)\n", "\n", "apply_advanced_postprocessing = _ns[\"apply_advanced_postprocessing\"]\n", "detect_by_rules = _ns[\"detect_by_rules\"]\n", "resolve_span_conflicts = _ns[\"resolve_span_conflicts\"]\n", "clean_text_with_mapping = _ns[\"clean_text_with_mapping\"]\n", "normalize_predictions = _ns[\"normalize_predictions\"]\n", "LABELS = _ns[\"LABELS\"]\n", "RULE_BASED_LABELS = _ns[\"RULE_BASED_LABELS\"]\n", "\n", "print(\"✅ Import thành công!\")" ] }, { "cell_type": "markdown", "id": "e1e398d1", "metadata": {}, "source": [ "## Câu 1: Test PREFIX — \"Đại diện Công ty TNHH Giải pháp AI là ông Lê Văn Á\"\n", "PREFIX `ông` phải được giữ lại vì theo sau bởi PERSONAL_NAME `Lê Văn Á`." ] }, { "cell_type": "code", "execution_count": 7, "id": "16631f6e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Gap giữa PREFIX và PERSONAL_NAME: 1 ký tự\n", " text[38:41] = 'ông' → label: PREFIX\n", " text[42:50] = 'Lê Văn Á' → label: PERSONAL_NAME\n", "\n", "--- Trước postprocessing ---\n", " [PREFIX] 'ông'\n", " [PERSONAL_NAME] 'Lê Văn Á'\n", "\n", "--- Sau postprocessing ---\n", " [PREFIX] 'ông'\n", " [PERSONAL_NAME] 'Lê Văn Á'\n", "\n", "✅ PREFIX 'ông' được giữ lại (có PERSONAL_NAME theo sau)\n" ] } ], "source": [ "text1 = \"Đại diện Công ty TNHH Giải pháp AI là ông Lê Văn Á\"\n", "\n", "# Tính vị trí chính xác — \"ông\" standalone (không phải trong \"Công\")\n", "s_prefix = text1.index(\" ông \") + 1 # bỏ space đầu\n", "e_prefix = s_prefix + len(\"ông\")\n", "s_name = text1.index(\"Lê Văn Á\")\n", "e_name = s_name + len(\"Lê Văn Á\")\n", "\n", "print(f\"Gap giữa PREFIX và PERSONAL_NAME: {s_name - e_prefix} ký tự\")\n", "\n", "entities1 = [\n", " {\"text\": \"ông\", \"label\": \"PREFIX\", \"start\": s_prefix, \"end\": e_prefix, \"score\": 0.85},\n", " {\"text\": \"Lê Văn Á\", \"label\": \"PERSONAL_NAME\", \"start\": s_name, \"end\": e_name, \"score\": 0.95},\n", "]\n", "\n", "for e in entities1:\n", " print(f\" text[{e['start']}:{e['end']}] = '{text1[e['start']:e['end']]}' → label: {e['label']}\")\n", "\n", "print(\"\\n--- Trước postprocessing ---\")\n", "for e in entities1:\n", " print(f\" [{e['label']}] '{e['text']}'\")\n", "\n", "result1 = apply_advanced_postprocessing(entities1, text1)\n", "\n", "print(\"\\n--- Sau postprocessing ---\")\n", "for e in result1:\n", " print(f\" [{e['label']}] '{e['text']}'\")\n", "\n", "assert len(result1) == 2, f\"Expected 2, got {len(result1)}\"\n", "assert result1[0][\"label\"] == \"PREFIX\"\n", "print(\"\\n✅ PREFIX 'ông' được giữ lại (có PERSONAL_NAME theo sau)\")" ] }, { "cell_type": "markdown", "id": "869d4a22", "metadata": {}, "source": [ "## Câu 2: Test TIME trong ngoặc [] — \"[9:40]: tôi muốn đổi số tài khoản thành 39752987599\"\n", "TIME `9:40` phải bị loại bỏ vì nằm trong `[...]`. ACCOUNT_NUMBER `39752987599` phải được giữ lại." ] }, { "cell_type": "code", "execution_count": 8, "id": "ba4f8b4a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " text[1:5] = '9:40' (context: '[9:40]') → TIME\n", " text[40:51] = '39752987599' (context: ' 39752987599') → ACCOUNT_NUMBER\n", "\n", "--- Trước postprocessing ---\n", " [TIME] '9:40'\n", " [ACCOUNT_NUMBER] '39752987599'\n", "\n", "--- Sau postprocessing ---\n", " [ACCOUNT_NUMBER] '39752987599'\n", "\n", "✅ TIME '9:40' bị loại bỏ (nằm trong [...])\n", "✅ ACCOUNT_NUMBER '39752987599' được giữ lại\n" ] } ], "source": [ "text2 = \"[9:40]: tôi muốn đổi số tài khoản thành 39752987599\"\n", "\n", "s_time = text2.index(\"9:40\")\n", "e_time = s_time + len(\"9:40\")\n", "s_acc = text2.index(\"39752987599\")\n", "e_acc = s_acc + len(\"39752987599\")\n", "\n", "entities2 = [\n", " {\"text\": \"9:40\", \"label\": \"TIME\", \"start\": s_time, \"end\": e_time, \"score\": 0.9},\n", " {\"text\": \"39752987599\", \"label\": \"ACCOUNT_NUMBER\", \"start\": s_acc, \"end\": e_acc, \"score\": 0.88},\n", "]\n", "\n", "for e in entities2:\n", " ctx_start = max(0, e[\"start\"] - 1)\n", " ctx_end = min(len(text2), e[\"end\"] + 1)\n", " print(f\" text[{e['start']}:{e['end']}] = '{text2[e['start']:e['end']]}' (context: '{text2[ctx_start:ctx_end]}') → {e['label']}\")\n", "\n", "print(\"\\n--- Trước postprocessing ---\")\n", "for e in entities2:\n", " print(f\" [{e['label']}] '{e['text']}'\")\n", "\n", "result2 = apply_advanced_postprocessing(entities2, text2)\n", "\n", "print(\"\\n--- Sau postprocessing ---\")\n", "for e in result2:\n", " print(f\" [{e['label']}] '{e['text']}'\")\n", "\n", "assert len(result2) == 1, f\"Expected 1, got {len(result2)}\"\n", "assert result2[0][\"label\"] == \"ACCOUNT_NUMBER\"\n", "print(\"\\n✅ TIME '9:40' bị loại bỏ (nằm trong [...])\")\n", "print(\"✅ ACCOUNT_NUMBER '39752987599' được giữ lại\")" ] } ], "metadata": { "kernelspec": { "display_name": "quantize", "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.11.15" } }, "nbformat": 4, "nbformat_minor": 5 }