|
53 | 53 | def build_visualizer(): |
54 | 54 | visualizer_markdown = """ |
55 | 55 | # 🔍 Arena Visualizer |
56 | | - This tool provides an interactive way to explore how people are using Chatbot Arena. |
57 | | - Using *[topic clustering](https://github.com/MaartenGr/BERTopic)*, we organized user-submitted prompts from Arena battles into broad and specific categories. |
58 | | - Dive in to uncover insights about the distribution and themes of these prompts! |
| 56 | + Arena visualizer provides interactive tools to explore and draw insights from our leaderboard data. |
59 | 57 | """ |
60 | 58 | gr.Markdown(visualizer_markdown, elem_id="visualizer_markdown") |
61 | | - expandText = "👇 Expand to see detailed instructions on how to use the visualizer" |
62 | | - with gr.Accordion(expandText, open=False): |
63 | | - instructions = """ |
64 | | - - Hover Over Segments: View the category name, the number of prompts, and their percentage. |
65 | | - - *On mobile devices*: Tap instead of hover. |
66 | | - - Click to Explore: |
67 | | - - Click on a main category to see its subcategories. |
68 | | - - Click on subcategories to see example prompts in the sidebar. |
69 | | - - Undo and Reset: Click the center of the chart to return to the top level. |
70 | | -
|
71 | | - Visualizer is created using Arena battle data collected from 2024/6 to 2024/8. |
72 | | - """ |
73 | | - gr.Markdown(instructions) |
74 | | - |
75 | | - frame = """ |
76 | | - <iframe class="visualizer" width="100%" |
77 | | - src="https://storage.googleapis.com/public-arena-no-cors/index.html"> |
| 59 | + with gr.Tabs(): |
| 60 | + with gr.Tab("Topic Explorer", id=0): |
| 61 | + topic_markdown = """ |
| 62 | + This tool provides an interactive way to explore how people are using Chatbot Arena. |
| 63 | + Using *[topic clustering](https://github.com/MaartenGr/BERTopic)*, we organized user-submitted prompts from Arena battles into broad and specific categories. |
| 64 | + Dive in to uncover insights about the distribution and themes of these prompts! """ |
| 65 | + gr.Markdown(topic_markdown) |
| 66 | + expandText = "👇 Expand to see detailed instructions on how to use the visualizer" |
| 67 | + with gr.Accordion(expandText, open=False): |
| 68 | + instructions = """ |
| 69 | + - Hover Over Segments: View the category name, the number of prompts, and their percentage. |
| 70 | + - *On mobile devices*: Tap instead of hover. |
| 71 | + - Click to Explore: |
| 72 | + - Click on a main category to see its subcategories. |
| 73 | + - Click on subcategories to see example prompts in the sidebar. |
| 74 | + - Undo and Reset: Click the center of the chart to return to the top level. |
| 75 | +
|
| 76 | + Visualizer is created using Arena battle data collected from 2024/6 to 2024/8. |
| 77 | + """ |
| 78 | + gr.Markdown(instructions) |
| 79 | + |
| 80 | + frame = """ |
| 81 | + <iframe class="visualizer" width="100%" |
| 82 | + src="https://storage.googleapis.com/public-arena-no-cors/index.html"> |
| 83 | + </iframe> |
| 84 | + """ |
| 85 | + gr.HTML(frame) |
| 86 | + with gr.Tab("Price Analysis", id=1): |
| 87 | + price_markdown = """ |
| 88 | + This scatterplot displays a selection of the arena's models, showing their arena score plotted against their cost. |
| 89 | + """ |
| 90 | + gr.Markdown(price_markdown) |
| 91 | + expandText = "👇 Expand to see detailed instructions on how to use the scatterplot" |
| 92 | + with gr.Accordion(expandText, open=False): |
| 93 | + instructions = """ |
| 94 | + - Hover Over Points: View the model's arena score, cost, organization, and license. |
| 95 | + - Click on Points: Click on a point to visit the website where the pricing details were sourced. |
| 96 | + - Use the Legend: Click an organization name on the right to display its models. To compare models, click multiple organization names. |
| 97 | +
|
| 98 | + The prices were obtained either from the model's organization's website or through the [together.ai](https://www.together.ai/) pricing model. The scatterplot was last updated using Arena battle data from 2024/12. |
| 99 | + """ |
| 100 | + gr.Markdown(instructions) |
| 101 | + frame = """ |
| 102 | + <iframe width="100%" scrolling="no" style="height: 800px; border: 1px solid lightgrey; border-radius: 10px;" |
| 103 | + src="https://storage.googleapis.com/public-arena-no-cors/scatterplot.html"> |
78 | 104 | </iframe> |
79 | 105 | """ |
80 | | - gr.HTML(frame) |
| 106 | + gr.HTML(frame) |
81 | 107 |
|
82 | 108 |
|
83 | 109 | def load_demo(context: Context, request: gr.Request): |
|
0 commit comments