File size: 801 Bytes
3500733
14a4fe8
3500733
a1dd328
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
from bertopic import BERTopic

model = BERTopic.load("AlexanderHolmes0/C1-Topic-Model-100")
model2 = BERTopic.load("AlexanderHolmes0/C2-Topic-Model-100")

with gr.Blocks() as demo:
   with gr.Tab("C1 Topic Model"):
        gr.load("models/AlexanderHolmes0/C1-Topic-Model-100")
        with gr.Row():
            gr.Plot(model.visualize_topics(width=650),min_width=650)
            gr.Plot(model.visualize_hierarchy(width=650,height=650),min_width=650)
   with gr.Tab("C2 Topic Model"): 
            gr.load("models/AlexanderHolmes0/C2-Topic-Model-100",alias = "C2 Topic Model")
            with gr.Row():
                gr.Plot(model2.visualize_topics(width=650),min_width=650)
                gr.Plot(model2.visualize_hierarchy(width=650,height=650),min_width=650)

demo.launch()