<jupyter_start><jupyter_text>Imports<jupyter_code>import pandas as pd
import sys
sys.path.append(r"..\utils")

from training_utils import *<jupyter_output><empty_output><jupyter_text>Load Training Performance Data<jupyter_code># create a mocked-up dataframe
# replace with your real one, obviously

df = pd.DataFrame({'epoch': {0: 0.0,
  1: 0.0999755859375,
  2: 0.199951171875,
  3: 0.300048828125,
  4: 0.39990234375,
  5: 0.5,
  6: 0.60009765625,
  7: 0.7001953125,
  8: 0.7998046875,
  9: 0.89990234375,
  10: 1.0,
  11: 2.0,
  12: 3.0,
  13: 4.0,
  14: 5.0,
  15: 6.0},
 'f1': {0: 0.659946769352738,
  1: 0.13891310665504214,
  2: 0.6357395056885052,
  3: 0.6337796086508753,
  4: 0.6414591658981452,
  5: 0.5860724233983287,
  6: 0.657983905124947,
  7: 0.6230922362309222,
  8: 0.7192791365481731,
  9: 0.7282151589242054,
  10: 0.7201735357917569,
  11: 0.7736421284808381,
  12: 0.7900990099009901,
  13: 0.7327645385897814,
  14: 0.7768836869056328,
  15: 0.783102721524787},
 'em': {0: 0.49423060726017015,
  1: 0.5008843594710688,
  2: 0.6871894213762317,
  3: 0.7004969257980291,
  4: 0.7052977343552599,
  5: 0.6871051966647014,
  6: 0.7279541817569275,
  7: 0.7129621831045229,
  8: 0.7612229428114209,
  9: 0.7659395266571212,
  10: 0.7609702686768298,
  11: 0.7925545355007159,
  12: 0.8035879727111934,
  13: 0.7704876610797609,
  14: 0.7944917038659143,
  15: 0.8006401078076307}})<jupyter_output><empty_output><jupyter_text>Visualizations  Generate Performance Table<jupyter_code># Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'BERT-large Binary Classification on SQuAD v2',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)<jupyter_output><empty_output><jupyter_text>Generate Performance Plot<jupyter_code>kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'BERT-large Binary Classification Fine-Tuned Performance',
          'subtitle': 'SQuAD v2 (Answer / No Answer Detection)',
          'width': 1000,
          'height': 500}

viz_bert_performance(**kwargs)
import pandas as pd
from utils.training_utils import *

df = pd.DataFrame({'epoch': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10},
 'f1': {0: 0.6083132656266359,
  1: 0.6105789254477302,
  2: 0.565995774491271,
  3: 0.6373899732108688,
  4: 0.6110834742811659,
  5: 0.5693897113643626,
  6: 0.5729492798998121,
  7: 0.646300547413032,
  8: 0.5780035244117342,
  9: 0.5901841753266797},
 'em': {0: 0.684915354164912,
  1: 0.6849995788764424,
  2: 0.6712709508969932,
  3: 0.6807883432999242,
  4: 0.670765602627811,
  5: 0.6594794912827423,
  6: 0.6553524804177546,
  7: 0.6625958056093658,
  8: 0.6571211993598922,
  9: 0.6645329739745641}}   
)

# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'Adapter-Tenney Model on BERT 2/10ths epochs fine-tuned',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)
kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'AdapterPooler Tenney Model Performance (Binary Classification)',
          'subtitle': 'Trained on BERT-large fine-tuned with 2/10ths epoch SQuAD v2',
          'width': 1000,
          'height': 500,
          'bert_f1': 0.6357395056885052,
          'bert_acc': 0.6871894213762317}

viz_bert_performance(**kwargs)
import pandas as pd
from utils.training_utils import *

df = pd.DataFrame({'epoch': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10},
 'f1': {0: 0.02917288247969501,
  1: 0.2977034306776297,
  2: 0.062235255783642876,
  3: 0.6736019311454681,
  4: 0.6870216708289696,
  5: 0.3308955429833035,
  6: 0.6576530612244899,
  7: 0.7017186332450241,
  8: 0.08699839486356341,
  9: 0.6831136791534116},
 'em': {0: 0.5066958645666638,
  1: 0.5827507790785816,
  2: 0.5152025604312305,
  3: 0.5216878632190685,
  4: 0.6727869957045397,
  5: 0.5915943737892698,
  6: 0.6609113113787586,
  7: 0.630169291670176,
  8: 0.5209298408152953,
  9: 0.5888991830202982}})
# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'Xception Abbreviated Model on BERT 2/10 epochs fine-tuned',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)
kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'Xception Abbreviated Model Performance (Binary Classification)',
          'subtitle': 'Trained on BERT-large fine-tuned with 2/10ths epoch SQuAD v2',
          'width': 1000,
          'height': 500,
          'bert_f1': 0.6357395056885052,
          'bert_acc': 0.6871894213762317}

viz_bert_performance(**kwargs)
import pandas as pd
from utils.training_utils import *

df = pd.DataFrame({'epoch': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10},
 'f1': {0: 0.7650694133452755,
  1: 0.733424336973479,
  2: 0.7503510249929795,
  3: 0.7549619736598033,
  4: 0.708219868885527,
  5: 0.749206941593581,
  6: 0.7265555665121782,
  7: 0.7579671095419491,
  8: 0.7219288632061374,
  9: 0.7391596961830593},
 'em': {0: 0.7790785816558579,
  1: 0.7697296386759875,
  2: 0.7753726943485219,
  3: 0.777478312136781,
  4: 0.7563379095426598,
  5: 0.7736039754063843,
  6: 0.7664448749263034,
  7: 0.7805946264634044,
  8: 0.7649288301187569,
  9: 0.7714983576181251}})
# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'Adapter-Tenney Model on BERT 1 epoch fine-tuned',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)
kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'AdapterPooler Tenney Model Performance (Binary Classification)',
          'subtitle': 'Trained on BERT-large fine-tuned with 1 epoch SQuAD v2',
          'width': 1000,
          'height': 500,
          'bert_f1': 0.7201735357917569,
          'bert_acc': 0.7609702686768298}

viz_bert_performance(**kwargs)
import pandas as pd
from utils.training_utils import *

df = pd.DataFrame({'epoch': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10},
 'f1': {0: 0.7821891806390382,
  1: 0.6658081133290406,
  2: 0.7329639350636726,
  3: 0.5941528545119705,
  4: 0.6505182760501909,
  5: 0.7777587094559809,
  6: 0.6856000841485221,
  7: 0.7680574248541947,
  8: 0.7730987917555081,
  9: 0.5960721258757321},
 'em': {0: 0.7680451444453803,
  1: 0.7377242482944496,
  2: 0.7686347174260928,
  3: 0.70302366714394,
  4: 0.7302282489682472,
  5: 0.7818579971363598,
  6: 0.7482523372357449,
  7: 0.7822791206940116,
  8: 0.7848900867514529,
  9: 0.7037816895477133}})

# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'Xception Abbreviated Model on BERT 1 epoch fine-tuned',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)
kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'Xception Abbreviated Model Performance (Binary Classification)',
          'subtitle': 'Trained on BERT-large fine-tuned with 1 epoch SQuAD v2',
          'width': 1000,
          'height': 500,
          'bert_f1': 0.7201735357917569,
          'bert_acc': 0.7609702686768298}

viz_bert_performance(**kwargs)
import pandas as pd
from utils.training_utils import *

df = pd.DataFrame({'epoch': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10},
 'f1': {0: 0.7659111514052585,
  1: 0.7374733991100794,
  2: 0.7572797640987837,
  3: 0.7534385673405335,
  4: 0.7218923198733175,
  5: 0.7423790749110492,
  6: 0.6623586429725364,
  7: 0.7497396079916674,
  8: 0.7576601671309193,
  9: 0.7173629896803928},
 'em': {0: 0.7825317948286027,
  1: 0.7714141329065948,
  2: 0.7781521098290238,
  3: 0.7750357955024004,
  4: 0.7633285605996799,
  5: 0.7743619978101575,
  6: 0.735955529352312,
  7: 0.7773940874252506,
  8: 0.7801735029057526,
  9: 0.762402088772846}})

# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'Xception Full Model on BERT 1 epoch fine-tuned',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)
kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'Xception Full Model Performance (Binary Classification)',
          'subtitle': 'Trained on BERT-large fine-tuned with 1 epoch SQuAD v2',
          'width': 1000,
          'height': 500,
          'bert_f1': 0.7201735357917569,
          'bert_acc': 0.7609702686768298}

viz_bert_performance(**kwargs)
import pandas as pd
from utils.training_utils import *

df = pd.DataFrame({'epoch': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10},
 'f1': {0: 0.5997011101622545,
  1: 0.5813648293963255,
  2: 0.5388254297911619,
  3: 0.5808653528569856,
  4: 0.5116941707230203,
  5: 0.45694288213973255,
  6: 0.5854243945014183,
  7: 0.661233993015134,
  8: 0.6975132137596396,
  9: 0.7095588235294117},
 'em': {0: 0.6841573317611387,
  1: 0.6775878042617705,
  2: 0.663353828013139,
  3: 0.679356523203908,
  4: 0.6535837614756169,
  5: 0.6340436284005727,
  6: 0.6799460961846205,
  7: 0.7058873073359724,
  8: 0.7059715320475027,
  9: 0.7072349027204582}})

# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'Xception Full Model on BERT 2/10ths epoch fine-tuned',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)
kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'Xception Full Model Performance (Binary Classification)',
          'subtitle': 'Trained on BERT-large fine-tuned with 2/10ths epochs SQuAD v2',
          'width': 1000,
          'height': 500,
          'bert_f1': 0.6357395056885052,
          'bert_acc': 0.6871894213762317}

viz_bert_performance(**kwargs)
import pandas as pd
from utils.training_utils import *

df = pd.DataFrame({'epoch': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10},
 'f1': {0: 0.5635470180924727,
  1: 0.5644638264564464,
  2: 0.5194621372965322,
  3: 0.39083807758506556,
  4: 0.4998196031268791,
  5: 0.27218934911242604,
  6: 0.17898594990836894,
  7: 0.042476127757655587,
  8: 0.045364891518737675,
  9: 0.07194944093339815},
 'em': {0: 0.6708498273393414,
  1: 0.671944748589236,
  2: 0.6568685252253011,
  3: 0.6124821022487998,
  4: 0.6497094247452202,
  5: 0.5752547797523794,
  6: 0.5472079508127685,
  7: 0.5101490777394088,
  8: 0.5108228754316516,
  9: 0.517645077065611}})
# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'Xception Abbreviated - CLS Residual on BERT 2/10ths epoch fine-tuned',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)
kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'Xception Abbreviated CLS-Residual Performance (Binary Classification)',
          'subtitle': 'Trained on BERT-large fine-tuned with 2/10ths epochs SQuAD v2',
          'width': 1000,
          'height': 500,
          'bert_f1': 0.6357395056885052,
          'bert_acc': 0.6871894213762317}

viz_bert_performance(**kwargs)
import pandas as pd
from utils.training_utils import *

df = pd.DataFrame({'epoch': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10},
 'f1': {0: 0.780073499387505,
  1: 0.7696915244085055,
  2: 0.7676244075829384,
  3: 0.7764868815880588,
  4: 0.7687471935339021,
  5: 0.6920436817472699,
  6: 0.6122171945701358,
  7: 0.5097506788447297,
  8: 0.7640101892285298,
  9: 0.6784386617100372},
 'em': {0: 0.7731828518487324,
  1: 0.7409247873326034,
  2: 0.7357028552177208,
  3: 0.7553272130042955,
  4: 0.7831213678093153,
  5: 0.7506106291585951,
  6: 0.7112776888739156,
  7: 0.6654594458013982,
  8: 0.7815210982902383,
  9: 0.5337319969679104}})
# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'Xception Abbreviated - CLS Residual on BERT 1 epoch fine-tuned',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)
kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'Xception Abbreviated CLS-Residual Performance (Binary Classification)',
          'subtitle': 'Trained on BERT-large fine-tuned with 1 epoch SQuAD v2',
          'width': 1000,
          'height': 500,
          'bert_f1': 0.7201735357917569,
          'bert_acc': 0.7609702686768298}

viz_bert_performance(**kwargs)
import pandas as pd
from utils.training_utils import *

df = pd.DataFrame({'epoch': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10},
 'f1': {0: 0.6027339642481598,
  1: 0.601538623669512,
  2: 0.6054099568466478,
  3: 0.609178541492037,
  4: 0.6227827335178919,
  5: 0.6227483273288729,
  6: 0.6118262689691261,
  7: 0.6106296334969198,
  8: 0.6209660842754368,
  9: 0.6235234729934376},
 'em': {0: 0.6817990398382886,
  1: 0.6815463657036974,
  2: 0.684241556472669,
  3: 0.6858418259917459,
  4: 0.6901372862797945,
  5: 0.6913164322412195,
  6: 0.6876105449338836,
  7: 0.6859260507032764,
  8: 0.6893792638760212,
  9: 0.6859260507032764}})
# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'AdapterPooling MeanAvg on BERT 2/10ths epoch fine-tuned',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)
kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'Adapter Pooling Mean Avg Model Performance (Binary Classification)',
          'subtitle': 'Trained on BERT-large fine-tuned with 2/10ths epochs SQuAD v2',
          'width': 1000,
          'height': 500,
          'bert_f1': 0.6357395056885052,
          'bert_acc': 0.6871894213762317}

viz_bert_performance(**kwargs)
import pandas as pd
from utils.training_utils import *

df = pd.DataFrame({'epoch': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10},
 'f1': {0: 0.7651738625189953,
  1: 0.7614654002713704,
  2: 0.7600145006344028,
  3: 0.7583425009167583,
  4: 0.760144927536232,
  5: 0.7590579710144928,
  6: 0.7598839318099383,
  7: 0.759666001089127,
  8: 0.7598435937073748,
  9: 0.7568318666049096},
 'em': {0: 0.7787416828097363,
  1: 0.7778994356944328,
  2: 0.7769729638675987,
  3: 0.7779836604059631,
  4: 0.7769729638675987,
  5: 0.7759622673292343,
  6: 0.7769729638675987,
  7: 0.7769729638675987,
  8: 0.7775625368483113,
  9: 0.7789101322327971}})
# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'AdapterPooling MeanAvg on BERT 1 epochs fine-tuned',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)
kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'AdapterPooling MeanAvg Performance (Binary Classification)',
          'subtitle': 'Trained on BERT-large fine-tuned with 1 epoch SQuAD v2',
          'width': 1000,
          'height': 500,
          'bert_f1': 0.7201735357917569,
          'bert_acc': 0.7609702686768298}

viz_bert_performance(**kwargs)
import pandas as pd
from utils.training_utils import *

df = pd.DataFrame({'epoch': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10},
 'f1': {0: 0.763261206975258,
  1: 0.7604730039416996,
  2: 0.760891497752912,
  3: 0.7608735547806936,
  4: 0.7603381731299395,
  5: 0.7602758620689656,
  6: 0.7601768281451464,
  7: 0.7598229109020476,
  8: 0.7600332133960698,
  9: 0.7602695467552848},
 'em': {0: 0.7816053230017688,
  1: 0.7799208287711614,
  2: 0.7804261770403437,
  3: 0.780510401751874,
  4: 0.7803419523288133,
  5: 0.7804261770403437,
  6: 0.7806788511749347,
  7: 0.7806788511749347,
  8: 0.7809315253095258,
  9: 0.7812684241556472}})
# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'Tenney Small on BERT 1 epochs fine-tuned',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)
kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'Tenney Small Performance (Binary Classification)',
          'subtitle': 'Trained on BERT-large fine-tuned with 1 epoch SQuAD v2',
          'width': 1000,
          'height': 500,
          'bert_f1': 0.7201735357917569,
          'bert_acc': 0.7609702686768298}

viz_bert_performance(**kwargs)
import pandas as pd
from utils.training_utils import *

df = pd.DataFrame({'epoch': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10},
 'f1': {0: 0.6484124672298283,
  1: 0.6475002436409707,
  2: 0.6491586421554324,
  3: 0.6491381828805142,
  4: 0.6473864191499755,
  5: 0.6452371618972952,
  6: 0.6435021594032195,
  7: 0.6425410561510472,
  8: 0.6422451994091581,
  9: 0.642455343925787},
 'em': {0: 0.6950223195485555,
  1: 0.695359218394677,
  2: 0.6962014655099806,
  3: 0.6965383643561021,
  4: 0.6960330160869199,
  5: 0.6951065442600859,
  6: 0.6940958477217215,
  7: 0.6938431735871304,
  8: 0.6940116230101911,
  9: 0.6948538701254948}})
# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'Tenney Small on BERT 2/10ths epochs fine-tuned',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)
kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'Tenney Small Performance (Binary Classification)',
          'subtitle': 'Trained on BERT-large fine-tuned with 2/10ths epochs SQuAD v2',
          'width': 1000,
          'height': 500,
          'bert_f1': 0.6357395056885052,
          'bert_acc': 0.6871894213762317}

viz_bert_performance(**kwargs)
import pandas as pd
from utils.training_utils import *

df = pd.DataFrame({'epoch': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10},
 'f1': {0: 0.794728653793356,
  1: 0.7922723091076358,
  2: 0.7896631287494231,
  3: 0.7884562020164646,
  4: 0.7869795047760363,
  5: 0.786032689450223,
  6: 0.7853091585309159,
  7: 0.7853023255813953,
  8: 0.784518049869743,
  9: 0.7840655249441549},
 'em': {0: 0.8110839720373958,
  1: 0.8098206013644403,
  2: 0.8080518824223027,
  3: 0.8073780847300598,
  4: 0.8065358376147562,
  5: 0.8059462646340436,
  6: 0.8055251410763918,
  7: 0.8056093657879222,
  8: 0.8049355680956792,
  9: 0.8045986692495578}})
# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'Tenney Small on BERT 3 epochs fine-tuned',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)
kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'Tenney Small Performance (Binary Classification)',
          'subtitle': 'Trained on BERT-large fine-tuned with 3 epochs SQuAD v2',
          'width': 1000,
          'height': 500,
          'bert_f1': 0.79009900990099,
          'bert_acc': 0.8035879727}

viz_bert_performance(**kwargs)
import pandas as pd
import sys
sys.path.append(r"..\utils")

from training_utils import *

df = pd.DataFrame({'epoch': {
  0: 0.1,
  1: 0.2,
  2: 0.3,
  3: 0.4,
  4: 0.5,
  5: 0.6,
  6: 0.7,
  7: 0.8,
  8: 0.9,
  9: 1.0,
  10: 2.0,
  11: 3.0,
  12: 4.0,
  13: 5.0,
  14: 6.0},
'f1': {0: 0.597,
    1: 0.681,
    2: 0.702,
    3: 0.754,
    4: 0.76,
    5: 0.755,
    6: 0.759,
    7: 0.777,
    8: 0.777,
    9: 0.777,
    10: 0.792,
    11: 0.788,
    12: 0.787,
    13: 0.778,
    14: 0.796},
'em': {0: 0.54,
  1: 0.636,
  2: 0.654,
  3: 0.709,
  4: 0.715,
  5: 0.708,
  6: 0.717,
  7: 0.727,
  8: 0.73,
  9: 0.728,
  10: 0.747,
  11: 0.74,
  12: 0.734,
  13: 0.723,
  14: 0.743 }})
# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'BERT-large Q&A on SQuAD v2',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)
kwargs = {'df': df,
          'xaxis_title': 'Training Epochs',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': 'BERT-large Q&A Fine-Tuned Performance',
          'subtitle': 'SQuAD v2 Span Annotation',
          'width': 1000,
          'height': 500}

viz_bert_performance(**kwargs)
import pandas as pd
import sys
sys.path.append(r"..\utils")

from training_utils import *

df = pd.DataFrame({'epoch': {
  1: 10.,
  2: 20.,
  3: 30.,
  4: 40.,
  5: 50.,
  6: 60.,
  7: 70.,
  8: 80.,
  9: 90.,
  10: 100.},
'f1': {
    1: 0.716,
    2: 0.713,
    3: 0.724,
    4: 0.720,
    5: 0.721,
    6: 0.733,
    7: 0.734,
    8: 0.740,
    9: 0.742,
    10: 0.745},
'em': {
  1: 0.765,
  2: 0.764,
  3: 0.772,
  4: 0.769,
  5: 0.775,
  6: 0.780,
  7: 0.782,
  8: 0.783,
  9: 0.786,
  10: 0.788}})
kwargs = {'df': df,
          'xaxis_title': '% of Data',
          'yaxis_title': 'Performance Metric (Dev)',
          'legend_title': 'Metric',
          'title': '1 Epoch Embeddings',
          'subtitle': 'Adapter 386 w/ Skip',
          'width': 1000,
          'height': 500, 
          'xaxis_format' : "~s"}

viz_bert_performance(**kwargs)
# Generate table output of F1 / EM performance per epoch
kwargs = {'df': df, 
          'title': 'Tenney Small on BERT 3 epochs fine-tuned',
          'cmap': 'BuGn'}

viz_table_scores(**kwargs)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14733157559778162, 'fraction_numerical': 0.3027547958905355, 'mean_word_length': 3.083720066827548, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '486023', 'license': 'MIT', 'n_tokens_mistral': 13516, 'n_tokens_neox': 9423, 'n_words': 2179, 'path': 'code/tensorflow/notebooks/Performance Reporting.ipynb', 'repo_name': 'siduojiang/BERTVision', 'size': '21998'}