WwYc commited on
Commit
03420da
β€’
1 Parent(s): 8797a1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -8,8 +8,8 @@ def generate_viz(text, target_class):
8
  print(f"Target Class: {target_class}")
9
  text_batch=[]
10
  text_batch.append(text)
11
- token_import = generate_visual(text_batch=text_batch, target_class=target_class)
12
- return token_import
13
 
14
  title = "Explain BERT πŸ˜„"
15
 
@@ -22,7 +22,7 @@ iface = gr.Interface(fn=generate_viz, inputs=[
22
  info="0 is negative, 1 is positive",
23
  ),
24
  ],
25
- outputs=[ gr.Text(label="Token_Importance"),],
26
  title=title,
27
  allow_flagging="never",
28
  cache_examples=True,
 
8
  print(f"Target Class: {target_class}")
9
  text_batch=[]
10
  text_batch.append(text)
11
+ token_import, html_page = generate_visual(text_batch=text_batch, target_class=target_class)
12
+ return token_import, html_page
13
 
14
  title = "Explain BERT πŸ˜„"
15
 
 
22
  info="0 is negative, 1 is positive",
23
  ),
24
  ],
25
+ outputs=[ gr.Text(label="Token_Importance"), gr.HTML(label="visualize sentence"),],
26
  title=title,
27
  allow_flagging="never",
28
  cache_examples=True,