From 66e788d6aa6f9966f54a7e8ad0b888da91e93220 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Thu, 21 Mar 2024 10:34:41 +0100 Subject: [PATCH] Add blueprint to LLM Embedding Ner example --- examples/python/llm_embedding_ner/main.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/examples/python/llm_embedding_ner/main.py b/examples/python/llm_embedding_ner/main.py index b371d238188d..094de3faa2da 100755 --- a/examples/python/llm_embedding_ner/main.py +++ b/examples/python/llm_embedding_ner/main.py @@ -14,6 +14,7 @@ from typing import Any import rerun as rr +import rerun.blueprint as rrb import torch import umap from transformers import AutoModelForTokenClassification, AutoTokenizer, pipeline @@ -165,7 +166,19 @@ def main() -> None: rr.script_add_args(parser) args = parser.parse_args() - rr.script_setup(args, "rerun_example_llm_embedding_ner") + rr.script_setup( + args, + "rerun_example_llm_embedding_ner", + blueprint=rrb.Horizontal( + rrb.Vertical( + rrb.TextDocumentView(origin="/text", name="Original Text"), + rrb.TextDocumentView(origin="/tokenized_text", name="Tokenized Text"), + rrb.TextDocumentView(origin="/named_entities", name="Named Entities"), + row_shares=[3, 2, 2], + ), + rrb.Spatial3DView(origin="/umap_embeddings", name="UMAP Embeddings"), + ), + ) run_llm_ner(args.text) rr.script_teardown(args)