bigcode/bot-issues-visualization
0
1import streamlit as st2import json3from datasets import load_dataset4 5st.set_page_config(page_title="Bot Issues", layout="wide")6st.title("Bot Issues")7 8@st.cache()9def load_data():10 ds = load_dataset("loubnabnl/bot_issues", split="train")11 return ds12 13def print_issue(events):14 for event in events:15 st.markdown("""---""")16 masked_author = f"masked as {event['masked_author']}" if "masked_author" in event else ""17 st.markdown(f"**Author:** {event['author']} {masked_author}, {event['action']} {event['type']} with title: {event['title']}")18 st.markdown("Text:")19 st.code(f"{event['text']}", language="html")20 21samples = load_data()22col1, _ = st.columns([2, 4])23with col1:24 index_example = st.number_input(f"Index of the chosen conversation from the existing {len(samples)}", min_value=0, max_value=len(samples)-1, value=0, step=1)25 26st.write(f"Issue size: {samples[index_example]['text_size_bots']}\n\n")27print_issue(samples[index_example]["old_events"])28 29 