Exemplo n.º 1
0
 def test_bag_alignment_is_optimal(self):
     assert get_metric_drop(
         ["Thomas Jefferson", "Thomas Davidson Arquette"], [["David Thomas", "Thomas Jefferson"]]
     ) == (0.0, 0.7)
     assert get_metric_drop(
         ["Thomas David Arquette"], [["David Thomas", "Thomas Jefferson"]]
     ) == (0.0, 0.4)
Exemplo n.º 2
0
 def test_span_order_is_ignored(self):
     assert get_metric_drop(["athlete", "unprofessional"], [["unprofessional", "athlete"]]) == (
         1.0,
         1.0,
     )
     assert get_metric_drop(
         ["algebra", "arithmetic"], [["arithmetic", "algebra", "geometry"]]
     ) == (0.0, 0.67)
Exemplo n.º 3
0
 def test_long_answers(self):
     assert (
         get_metric_drop(
             "David Thomas",
             [
                 "Thomas David Arquette Thomas David Arquette Thomas \
                 David Arquette Thomas David Arquette"
             ],
         )
         == (0.0, 0.8)
     )
Exemplo n.º 4
0
 def test_long_gold_spans(self):
     assert get_metric_drop(
         ["Thomas David Arquette"], [["David Thomas was eating an apple and fell to the ground"]]
     ) == (0.0, 0.33)
Exemplo n.º 5
0
 def test_multiple_gold_spans(self):
     assert get_metric_drop(
         ["Thomas David Arquette"],
         [["David Thomas"], ["Thomas Jefferson"], ["David Thomas"], ["Thomas David"]],
     ) == (0.0, 0.8)
Exemplo n.º 6
0
 def test_word_order_is_not_ignored(self):
     assert get_metric_drop(["athlete unprofessional"], [["unprofessional athlete"]]) == (
         0.0,
         1.0,
     )
Exemplo n.º 7
0
 def test_casing_is_ignored(self):
     assert get_metric_drop("This was a triumph", ["tHIS Was A TRIUMPH"]) == (1.0, 1.0)
Exemplo n.º 8
0
 def test_articles_are_ignored(self):
     assert get_metric_drop("td", ["the td"]) == (1.0, 1.0)
     assert get_metric_drop("the a NOT an ARTICLE the an a", ["NOT ARTICLE"]) == (1.0, 1.0)