sparknlp_jsl.training_log_parser#

Module Contents#

Classes#

assertion_log_parser

ner_log_parser

class assertion_log_parser#
get_best_f1_scores(log_path: str, labels: List[str])#

Returns the best Micro and Macro F1 Scores.

Parameters:
  • log_path – path to the log file

  • labels – list of assertion labels

get_charts(log_file: str, labels: List[str], threshold=0.0)#

Plots the figures of metrics ( precision, recall, f1) vs epochs.

Parameters:
  • log_file – path to the log file

  • labels – list of assertion labels

loss_plot(log_path: str)#

Plots the figure of loss vs epochs.

Parameters:

log_path – path to the log file

parse_logfile(path: str, labels: List[str])#

Returns metrics and avg-metrics dataframes, graph name and a boolean for whether test set is provided or not.

Parameters:
  • path (str) – path to the log file

  • labels (list) – list of assertion labels

class ner_log_parser#
evaluate(true_seqs: List[str], pred_seqs: List[str], verbose=True)#

Evaluates the performance of the model.

if verbose, returns overall performance, as well as performance per chunk type; otherwise, simply returns overall precision, recall, f1 scores

Parameters:
  • true_seqs (list) – a list of true tags

  • pred_seqs (list) – a list of predicted tags

  • verbose (bool) – whether to print the results or not

evaluate_conll_file(fileIterator)#

prints overall performance, as well as performance per chunk type.

get_best_f1_scores(log_path: str)#

Returns the best Micro and Macro F1 Scores.

Parameters:

log_path – path to the log file

get_charts(log_file: str, threshold: float = 0.0)#

Plots the figures of metrics ( precision, recall, f1) vs epochs.

Parameters:

log_file – path to the log file

loss_plot(log_path: str)#

Plots the figure of loss vs epochs.

Parameters:

log_path – path to the log file

parse_logfile(path: str)#

Returns metrics and avg-metrics dataframes, graph name and a boolean for whether test set is provided or not.

Parameters:

path – path to the log file