AGENT SKILL

visualization

Use LangExtract visualization to save, reload, inspect, and render AnnotatedDocument JSONL outputs without model inference.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
visualization
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use LangExtract visualization to save, reload, inspect, and render AnnotatedDocument JSONL outputs without model inference.
disable-model-invocation
true

02 资源文件 3

03 SKILL.md 正文

LangExtract Visualization

Use this sub-skill when the user already has LangExtract AnnotatedDocument objects or saved JSONL output and wants to persist, reload, inspect, or render an interactive HTML visualization without calling a model.

Route first

  • To create new extraction results with lx.extract(), read ../extraction/SKILL.md first.
  • For model IDs, API keys, Vertex/OpenAI batch settings, Ollama, or provider credentials, read ../providers/SKILL.md.
  • For frontend code changes beyond the HTML generated by LangExtract, treat the request as unsupported by this repo skill and explain that custom UI work is a gap.

Common workflows

  1. Save one or more annotated documents to JSONL. Use lx.io.save_annotated_documents([doc], output_dir=..., output_name=..., show_progress=...). The default filename is data.jsonl; when output_dir=None, LangExtract writes under a relative test_output/ directory. Prefer an explicit output directory in agent-written code.
  2. Reload JSONL for later inspection. Use lx.io.load_annotated_documents_jsonl(path, show_progress=...) and materialize the iterator only when the file is small enough. Use langextract.data_lib conversions when you need JSON dictionaries rather than dataclass objects.
  3. Visualize a document or JSONL file. Use lx.visualize(doc_or_jsonl_path) or langextract.visualization.visualize(...) with animation_speed, show_legend, and gif_optimized as needed. A JSONL path visualizes the first document in the file; load and select a document yourself for multi-document outputs.
  4. Write HTML safely. In a notebook, the return value may be an IPython.display.HTML object with .data; in plain Python it is a string. Use payload = html.data if hasattr(html, "data") else html before writing.
  5. Check grounding before blaming visualization. Only extractions with a usable char_interval can be highlighted. Missing or invalid intervals usually mean the extraction was ungrounded or manually constructed with bad offsets.

Read references/workflows.md for verified signatures, JSONL round trips, selection patterns, and HTML writing details. Read references/troubleshooting.md for save/load/visualization failures and their fixes.

Bundled helper

Run scripts/save_and_visualize.py when you need a no-model smoke helper that creates a handcrafted AnnotatedDocument, saves JSONL, reloads it, generates HTML, and writes all outputs under a caller-selected directory:

python scripts/save_and_visualize.py --output-dir ./lx-viz-demo

The helper does not require API keys, provider credentials, network access, or source-repository files.

Verification anchors

This guidance is based on the public README save/visualization snippets, long-document and medication visualization examples, implementation behavior in langextract/io.py, langextract/visualization.py, langextract/data_lib.py, langextract/progress.py, and langextract/core/data.py, installed-package signature inspection, and the safe native candidate families io_test.py, data_lib_test.py, visualization_test.py, and progress_test.py.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351