<jupyter_start><jupyter_text>2nd case<jupyter_code>c1st = np.array(m['context_ids'])[6, :].tolist()
q1st = np.array(m['qn_ids'])[6, :].tolist()
a1st = np.array(m['attn_output'])[6, :-1, :-1]
c1st = [id2word[i] for i in c1st]
q1st = [id2word[i] for i in q1st]
sd1st = np.array(m['start_dist'])[6, :]
ed1st = np.array(m['end_dist'])[6, :]
sp = m['pred_start_batch'][6]
ep = m['pred_end_batch'][6]
q1st.index('<pad>'), c1st.index('<pad>'), a1st.shape
q1st[:8]
colormap = plt.cm.viridis
plt.figure(figsize=(50,10))
sns.heatmap(a1st.T[:8, :147],square=True, cmap=colormap, linecolor='white')
plt.show()
plt.figure(figsize=(50,5))
plt.plot(sd1st[:147], label='start')
plt.plot(ed1st[:147], label='end')
plt.legend(loc='upper right')
sp, ep
c1st[60:63+1]
c1st[55:66]<jupyter_output><empty_output><jupyter_text>3rd case<jupyter_code>c1st = np.array(m['context_ids'])[12, :].tolist()
q1st = np.array(m['qn_ids'])[12, :].tolist()
a1st = np.array(m['attn_output'])[12, :-1, :-1]
c1st = [id2word[i] for i in c1st]
q1st = [id2word[i] for i in q1st]
sd1st = np.array(m['start_dist'])[12, :]
ed1st = np.array(m['end_dist'])[12, :]
sp = m['pred_start_batch'][12]
ep = m['pred_end_batch'][12]
q1st.index('<pad>'), c1st.index('<pad>'), a1st.shape
q1st[:10]
colormap = plt.cm.viridis
plt.figure(figsize=(50,10))
sns.heatmap(a1st.T[:10, :147],square=True, cmap=colormap, linecolor='white')
plt.show()
plt.figure(figsize=(50,5))
plt.plot(sd1st[:147], label='start')
plt.plot(ed1st[:147], label='end')
plt.legend(loc='upper right')
sp, ep
c1st[71:73+1]
c1st[65:81]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.24681933842239187, 'fraction_numerical': 0.07824427480916031, 'mean_word_length': 7.988571428571428, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '335878', 'license': 'Apache-2.0', 'n_tokens_mistral': 812, 'n_tokens_neox': 758, 'n_words': 107, 'path': 'code/BCN_Results_Analysis.ipynb', 'repo_name': 'songzee/SQUAD_Qestion-Answer_System_Tensorflow', 'size': '1572'}