Evaluation¶
evaluation Module¶
Module for the evaluation of sequence alignment accuracy.
-
yalign.evaluation.F_score(xs, ys, beta=0.01)¶ Returns the F score described here: http://en.wikipedia.org/wiki/F1_score for list xs against to the list ys.
Make beta smaller to give more weight to the precision.
-
yalign.evaluation.alignment_percentage(document_a, document_b, model)¶ Returns the percentage of alignments of document_a and document_b using the model provided.
- document_a and document_b are two lists of Sentences to align.
- model can be a YalignModel or a path to a yalign model.
-
yalign.evaluation.classifier_precision(document_a, document_b, model)¶ Runs a ten-fold validation on the classifier and returns a value between 0 and 100. Higher is better.
-
yalign.evaluation.correlation(classifier, dataset=None)¶ Calculates the correlation of the attributes of a classifier.
- For more information see:
-
yalign.evaluation.evaluate(parallel_corpus, model, N=100)¶ Returns statistics for N document alignment trials. The documents are generated from the parallel corpus.
- parallel_corpus: A file object
- model: A YalignModel
- N: Number of trials
-
yalign.evaluation.precision(xs, ys)¶ Precision of list xs to list ys.
-
yalign.evaluation.recall(xs, ys)¶ Recall of list xs to list ys.