{"id":46486288,"url":"https://github.com/daviden1013/ie-viz","last_synced_at":"2026-03-06T09:31:03.804Z","repository":{"id":259600431,"uuid":"862583406","full_name":"daviden1013/ie-viz","owner":"daviden1013","description":"A visualization tool for NLP information extraction: Named entity recognition, Entity attribute extraction, and Relation extraction.","archived":false,"fork":false,"pushed_at":"2025-12-02T17:22:47.000Z","size":5277,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-05T13:39:32.303Z","etag":null,"topics":["flask-application","named-entity-recognition","nlp","relation-extraction","visualization","webapp"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daviden1013.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-24T21:00:03.000Z","updated_at":"2025-12-02T15:25:46.000Z","dependencies_parsed_at":"2024-10-26T20:45:06.167Z","dependency_job_id":"f62bf059-1ca0-4b04-a170-5c7ffd9e4dec","html_url":"https://github.com/daviden1013/ie-viz","commit_stats":null,"previous_names":["daviden1013/ie-viz"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/daviden1013/ie-viz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviden1013%2Fie-viz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviden1013%2Fie-viz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviden1013%2Fie-viz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviden1013%2Fie-viz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daviden1013","download_url":"https://codeload.github.com/daviden1013/ie-viz/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviden1013%2Fie-viz/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30168966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T07:56:45.623Z","status":"ssl_error","status_checked_at":"2026-03-06T07:55:55.621Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask-application","named-entity-recognition","nlp","relation-extraction","visualization","webapp"],"created_at":"2026-03-06T09:31:01.252Z","updated_at":"2026-03-06T09:31:03.198Z","avatar_url":"https://github.com/daviden1013.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\u003cimg src=doc_asset/readme_img/ie-viz.png width=800 \u003e\u003c/div\u003e\n\n![Python Version](https://img.shields.io/pypi/pyversions/ie-viz)\n![PyPI](https://img.shields.io/pypi/v/ie-viz)\n\nVisualization tool for NLP information extraction: Named entity recognition, Entity attribute extraction, and Relation extration.\n\n## Table of Contents\n- [Overview](#overview)\n- [Prerequisite](#prerequisite)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Examples](#examples)\n- [User Guide](#user-guide)\n\n## Overview\nThe **ie-viz** is a lightweight tool for in-line information extraction (IE) visualization. It supports customizable colors for named entity marking, tooltip for entity attributes display, and relation path that links related named entities. Current version has built-in light and dark themes while customization is available through the CSS. The **ie-viz** can be deployed as a Flask App that runs on a host:port. It can also be rendered as HTML and display in Browser or Interactive Python environments (e.g., Jupyter Notebook). \n\n| Features | Support |\n|----------|----------|\n| **Named Entity Marks** | :white_check_mark: with customizable colors and table view |\n| **Entity Attributes** | :white_check_mark: as tooltip and table view |\n| **Entity Relations** | :white_check_mark: as path linking entities and table view |\n| **Filtering**| :white_check_mark: by entity types |\n| **Theme** | :white_check_mark: light and dark themes |\n| **Deployment** | :white_check_mark: Flask APP or HTML rendering |\n\nThe filtering feature supports OR and AND logic for all available entity attributes. The table panel (collapsible) displays the selected entities, attributes, and relations.  \n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"doc_asset/readme_img/filter.PNG\" width=\"45%\"\u003e\n  \u003cimg src=\"doc_asset/readme_img/side_tables.PNG\" width=\"45%\"\u003e\n\u003c/p\u003e\n\n## Prerequisite\n- python ^3.11\n- flask \u003e=2.3\n\n## Installation\nPython package is available on PyPi.\n```cmd\npip install ie-viz\n```\n\n## Quick-start\nWe use a short sample News article synthesized by GPT-4o to demo this quick-start.\n\n```Python\ntext = \"\"\"\nOn Monday, the tech giant, Innovia Corp, announced the launch of its new flagship smartphone, the Innovia XPro. \nThe device, which comes in both 128GB and 256GB storage variants, is powered by the latest Octa-core Quantum processor \nand features a 6.5-inch AMOLED display. According to the CEO, Lisa Martin, this release marks a significant milestone for the company. \nThe phone is expected to compete directly with the recent release from its rival, Nexon Technologies, which unveiled the \nNexon Ultra series earlier this year.\n\"\"\"\n```\n\nEntities have attribute **type** as one of \"organization\", \"person\", or \"product\". \n- when **type** is *organization*, there is no other attributes\n- when **type** is *person*, the entity has an optional *Role* attribute\n- when **type** is *product*, the entity has an optional *Specifications* attribute\n\n```python\nentities = [\n            {'entity_id': '0', 'start': 28, 'end': 40, 'attr': {'Type': 'organization'}}, \n            {'entity_id': '1', 'start': 99, 'end': 111, 'attr': {'Type': 'product', 'Specifications': '128GB, 256GB, Octa-core Quantum processor, 6.5-inch AMOLED display'}}, \n            {'entity_id': '2', 'start': 296, 'end': 307, 'attr': {'Type': 'person', 'Role': 'CEO'}}, \n            {'entity_id': '3', 'start': 452, 'end': 470, 'attr': {'Type': 'organization'}}, \n            {'entity_id': '4', 'start': 492, 'end': 510, 'attr': {'Type': 'product'}}\n           ]\n```\n\nRelations (optional) are listed as as entity id pairs.\n```python\nrelations = [\n             {'entity_1_id': '0', 'entity_2_id': '1'}, \n             {'entity_1_id': '0', 'entity_2_id': '2'}, \n             {'entity_1_id': '3', 'entity_2_id': '4'}\n            ]\n```\n\nThe `serve()` function starts a Flask App that visualizes the entities, attributes, and relations. The `theme` parameter supports light and dark modes. The `color_attr_key` parameter specifies that entity color is based on entity \"Type\" attribute. \n```python\nfrom ie_viz import serve\n\nserve(text, entities, relations, theme=\"light\", color_attr_key=\"Type\")\n```\n\nA Flask App starts on the localhost port 5000 (default). The full rendered HTML is available [TechNews](demo/TechNews.html)\n```cmd\n* Serving Flask app 'ie_viz.utilities'\n * Debug mode: off\nWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.\n * Running on all addresses (0.0.0.0)\n * Running on http://127.0.0.1:5000\nPress CTRL+C to quit\n127.0.0.1 - - [02/Oct/2024 11:44:58] \"GET / HTTP/1.1\" 200 -\n```\n\n\u003cdiv align=\"left\"\u003e\u003cimg src=\"doc_asset/readme_img/TechNews.PNG\" width=800 \u003e\u003c/div\u003e\n\n## Examples\n\nBelow are Jupyter notebooks that demo some use cases:\n\n[Tech News: Organization, Product, and Person](demo/TechNews.ipynb)\n\n[Clinical Note: Medication, condition, and Adverse Reaction](demo/ClinicalNote.ipynb)\n\n## User guide\n\n\u003cdetails\u003e\n\u003csummary\u003e Input formats \u003c/summary\u003e\n\nBoth the `serve()` and `render()` functions accept the same data types for input. \n\nThe entities must be a list of dictionaries. Each dictionary must have `entity_id`, `start`, and `end` keys. The `attr` key is optional and can be used for entity attributes display or entity coloring. \n```python\nentities = [\n            {'entity_id': '\u003centity id\u003e', 'start': \u003cstart char\u003e, 'end': \u003cend char\u003e}, \n            {'entity_id': '\u003centity id\u003e', 'start': \u003cstart char\u003e, 'end': \u003cend char\u003e, 'attr': {'\u003cattribute key\u003e': '\u003cattribute value\u003e'}},\n            ...\n           ]\n```\n\nThe relations is optional. It must be a list of dictionaries with `entity_1_id` and `entity_2_id` keys. \n```python\nrelations = [\n             {'entity_1_id': '\u003centity id\u003e', 'entity_2_id': '\u003centity id\u003e'}, \n             {'entity_1_id': '\u003centity id\u003e', 'entity_2_id': '\u003centity id\u003e'}, \n             ...\n            ]\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e Entity colors \u003c/summary\u003e\n\nThere are two parameters to customize the entity colors, `color_attr_key` or `color_map_func`. If none of them are defined, a default color is assigned to all entities. \n\nThe `color_attr_key` is a easier way to define entity color. It specifies an attribute key to be used. All entities with the same attribute value will be assigned the same color. \n\n```python\nfrom ie_viz import serve\n\nserve(text, entities, color_attr_key=\"\u003cattribute key to assign color\u003e\")\n```\n\nNote that all entities must have that attribute key, or an error will be raised.\n\nThe `color_map_func` is a more flexible way to define colors. Users define a custom function that inputs an entity and returns a default color name or a hex color code (as string). \n\n```python \ndef color_map_func(entity) -\u003e str:\n    if entity['attr']['\u003cattribute key\u003e'] == \"\u003ca certain value\u003e\":\n        return \"gray\"\n    else:\n        return \"#03A9F4\"\n\nserve(text, entities, color_map_func=color_map_func)\n```\nNote that the `color_map_func` has higher priority than `color_attr_key`. When provided, the `color_attr_key` will be overwritten.\n\n\u003c/details\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaviden1013%2Fie-viz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaviden1013%2Fie-viz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaviden1013%2Fie-viz/lists"}