dar-tau commited on
Commit
f7076c5
1 Parent(s): a7e4d41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -17,7 +17,7 @@ def analyze_sentence(index):
17
  attn_map_shape = row['attention_maps_shape'][1:]
18
  seq_len = attn_map_shape[1]
19
  attn_maps = np.array(row['attention_maps']).reshape(*attn_map_shape).clip(0, 1)
20
- fig = plt.figure(figsize=(0.2 + 0.55 * len(tokenized), 0.5 * len(tokenized)))
21
  sns.heatmap(attn_maps.sum(0)[1:, 1:])
22
  plt.xticks(np.arange(seq_len - 1) + 0.5, tokenized[1:], rotation=90);
23
  plt.yticks(np.arange(seq_len - 1) + 0.5, tokenized[1:], rotation=0);
 
17
  attn_map_shape = row['attention_maps_shape'][1:]
18
  seq_len = attn_map_shape[1]
19
  attn_maps = np.array(row['attention_maps']).reshape(*attn_map_shape).clip(0, 1)
20
+ fig = plt.figure(figsize=(0.5 + 0.5 * len(tokenized), 0.4 * len(tokenized)))
21
  sns.heatmap(attn_maps.sum(0)[1:, 1:])
22
  plt.xticks(np.arange(seq_len - 1) + 0.5, tokenized[1:], rotation=90);
23
  plt.yticks(np.arange(seq_len - 1) + 0.5, tokenized[1:], rotation=0);