コード例 #1
0
 def test_complete_agreement(self):
     '''
     Calculate mean permuted pairwise WindowDiff on a theoretical dataset
     containing complete agreement.
     '''
     self.assertAlmostEquals(
         summarize(
             window_diff(COMPLETE_AGREEMENT,
                         lamprier_et_al_2007_fix=False)),
         (0.0, 0.0, 0.0, 0.0, 48))
     self.assertAlmostEquals(
         summarize(
             window_diff(COMPLETE_AGREEMENT, lamprier_et_al_2007_fix=True)),
         (0.0, 0.0, 0.0, 0.0, 48))
コード例 #2
0
 def test_dataset_kwargs(self):
     '''
     Calculate mean permuted pairwise Pk on a theoretical dataset
     containing complete agreement.
     '''
     self.assertAlmostEquals(summarize(pk(dataset=COMPLETE_AGREEMENT)),
                             (0.0, 0.0, 0.0, 0.0, 48))
コード例 #3
0
 def test_large_disagreement(self):
     '''
     Calculate mean permuted pairwise Pk on a theoretical dataset
     containing large disagreement.
     '''
     self.assertAlmostEquals(summarize(pk(LARGE_DISAGREEMENT)),
                             (1.0, 0.0, 0.0, 0.0, 8))
コード例 #4
0
 def test_kazantseva2012_g5(self):
     '''
     Calculate permuted pairwise WindowDiff on Group 5 from the dataset
     collected in [KazantsevaSzpakowicz2012]_.
     '''
     self.assertAlmostEquals(
         summarize(
             window_diff(KAZANTSEVA2012_G5, lamprier_et_al_2007_fix=False)),
         (Decimal('0.42514977232721135'), Decimal('0.14960495739111837'),
          Decimal('0.02238164327599834'), Decimal('0.02159361560546617'),
          48))
     self.assertAlmostEquals(
         summarize(
             window_diff(KAZANTSEVA2012_G5, lamprier_et_al_2007_fix=True)),
         (Decimal('0.3981624488837195'), Decimal('0.1499358110615409'),
          Decimal('0.022480747438682093'), Decimal('0.021641370219386377'),
          48))
コード例 #5
0
 def test_large_disagreement(self):
     '''
     Calculate mean permuted pairwise WindowDiff on a theoretical dataset
     containing large disagreement.
     '''
     val = summarize(
         window_diff(LARGE_DISAGREEMENT, lamprier_et_al_2007_fix=False))
     self.assertAlmostEquals(
         val, (Decimal('1'), Decimal('0'), Decimal('0'), Decimal('0'), 8))
コード例 #6
0
 def test_complete_agreement(self):
     '''
     Calculate mean permuted pairwise WindowDiff on a theoretical dataset
     containing complete agreement.
     '''
     self.assertAlmostEquals(summarize(window_diff(COMPLETE_AGREEMENT,
                                                   lamprier_et_al_2007_fix=False)),
                            (0.0,
                             0.0,
                             0.0,
                             0.0,
                             48))
     self.assertAlmostEquals(summarize(window_diff(COMPLETE_AGREEMENT,
                                                   lamprier_et_al_2007_fix=True)),
                            (0.0,
                             0.0,
                             0.0,
                             0.0,
                             48))
コード例 #7
0
 def test_kazantseva2012_g5(self):
     '''
     Calculate permuted pairwise WindowDiff on Group 5 from the dataset
     collected in [KazantsevaSzpakowicz2012]_.
     '''
     self.assertAlmostEquals(summarize(window_diff(KAZANTSEVA2012_G5,
                                                   lamprier_et_al_2007_fix=False)),
                            (Decimal('0.42514977232721135'),
                             Decimal('0.14960495739111837'),
                             Decimal('0.02238164327599834'),
                             Decimal('0.02159361560546617'),
                             48))
     self.assertAlmostEquals(summarize(window_diff(KAZANTSEVA2012_G5,
                                                   lamprier_et_al_2007_fix=True)),
                            (Decimal('0.3981624488837195'),
                             Decimal('0.1499358110615409'),
                             Decimal('0.022480747438682093'),
                             Decimal('0.021641370219386377'),
                             48))
コード例 #8
0
 def test_kazantseva2012_g2(self):
     '''
     Calculate mean permuted pairwise WindowDiff on Group 2 from the dataset
     collected in [KazantsevaSzpakowicz2012]_.
     '''
     self.assertAlmostEquals(summarize(window_diff(KAZANTSEVA2012_G2,
                                                   lamprier_et_al_2007_fix=False)),
                            (Decimal('0.3257163091933661553914718469'),
                             Decimal('0.1586420969856167116081811670'),
                             Decimal('0.02516731493599381893573908435'),
                             Decimal('0.01448197584815743151147537110'),
                             120))
     self.assertAlmostEquals(summarize(window_diff(KAZANTSEVA2012_G2,
                                                   lamprier_et_al_2007_fix=True)),
                            (Decimal('0.2745037663246318112728760428'),
                             Decimal('0.1093940158628282748721971010'),
                             Decimal('0.01196705070659672423205913742'),
                             Decimal('0.009986261690691502298962284136'),
                             120))
コード例 #9
0
 def test_kazantseva2012_g5(self):
     '''
     Calculate permuted pairwise Pk on Group 5 from the dataset
     collected in [KazantsevaSzpakowicz2012]_.
     '''
     self.assertAlmostEquals(
         summarize(pk(KAZANTSEVA2012_G5)),
         (Decimal('0.35530058282396693'), Decimal('0.11001760846099215'),
          Decimal('0.012103874171476172'), Decimal('0.015879673965138168'),
          48))
コード例 #10
0
 def test_kazantseva2012_g2(self):
     '''
     Calculate mean permuted pairwise WindowDiff on Group 2 from the dataset
     collected in [KazantsevaSzpakowicz2012]_.
     '''
     self.assertAlmostEquals(
         summarize(
             window_diff(KAZANTSEVA2012_G2, lamprier_et_al_2007_fix=False)),
         (Decimal('0.3257163091933661553914718469'),
          Decimal('0.1586420969856167116081811670'),
          Decimal('0.02516731493599381893573908435'),
          Decimal('0.01448197584815743151147537110'), 120))
     self.assertAlmostEquals(
         summarize(
             window_diff(KAZANTSEVA2012_G2, lamprier_et_al_2007_fix=True)),
         (Decimal('0.2745037663246318112728760428'),
          Decimal('0.1093940158628282748721971010'),
          Decimal('0.01196705070659672423205913742'),
          Decimal('0.009986261690691502298962284136'), 120))
コード例 #11
0
ファイル: pk_test.py プロジェクト: UKPLab/emnlp2015-ih-ig
 def test_dataset_kwargs(self):
     '''
     Calculate mean permuted pairwise Pk on a theoretical dataset
     containing complete agreement.
     '''
     self.assertAlmostEquals(summarize(pk(dataset=COMPLETE_AGREEMENT)),
                            (0.0,
                             0.0,
                             0.0,
                             0.0,
                             48))
コード例 #12
0
 def test_multiple_boundary_types(self):
     '''
     Test multiple boundary types with auto boundary type identification.
     '''
     value = summarize(boundary_similarity(MULTIPLE_BOUNDARY_TYPES))
     self.assertEqual((Decimal('0.50'),
                       Decimal('0.25'),
                       Decimal('0.0625'),
                       Decimal('0.1767766952966368811002110906'),
                       2),
                      value)
コード例 #13
0
ファイル: pk_test.py プロジェクト: UKPLab/emnlp2015-ih-ig
 def test_kazantseva2012_g5(self):
     '''
     Calculate permuted pairwise Pk on Group 5 from the dataset
     collected in [KazantsevaSzpakowicz2012]_.
     '''
     self.assertAlmostEquals(summarize(pk(KAZANTSEVA2012_G5)),
                            (Decimal('0.35530058282396693'),
                             Decimal('0.11001760846099215'),
                             Decimal('0.012103874171476172'),
                             Decimal('0.015879673965138168'),
                             48))
コード例 #14
0
 def test_kazantseva2012_g2(self):
     '''
     Calculate mean permuted pairwise Pk on Group 2 from the dataset
     collected in [KazantsevaSzpakowicz2012]_.
     '''
     self.assertAlmostEquals(
         summarize(pk(KAZANTSEVA2012_G2)),
         (Decimal('0.2882256923776327507173609771'),
          Decimal('0.1454395656787966169084191445'),
          Decimal('0.02115266726483699483402909754'),
          Decimal('0.01327675514600517730547602481'), 120))
コード例 #15
0
ファイル: pk_test.py プロジェクト: UKPLab/emnlp2015-ih-ig
 def test_large_disagreement(self):
     '''
     Calculate mean permuted pairwise Pk on a theoretical dataset
     containing large disagreement.
     '''
     self.assertAlmostEquals(summarize(pk(LARGE_DISAGREEMENT)),
                            (1.0,
                             0.0,
                             0.0,
                             0.0,
                             8))
コード例 #16
0
ファイル: pk_test.py プロジェクト: UKPLab/emnlp2015-ih-ig
 def test_kazantseva2012_g2(self):
     '''
     Calculate mean permuted pairwise Pk on Group 2 from the dataset
     collected in [KazantsevaSzpakowicz2012]_.
     '''
     self.assertAlmostEquals(summarize(pk(KAZANTSEVA2012_G2)),
                            (Decimal('0.2882256923776327507173609771'),
                             Decimal('0.1454395656787966169084191445'),
                             Decimal('0.02115266726483699483402909754'),
                             Decimal('0.01327675514600517730547602481'),
                             120))
コード例 #17
0
 def test_large_disagreement(self):
     '''
     Calculate mean permuted pairwise WindowDiff on a theoretical dataset
     containing large disagreement.
     '''
     val = summarize(window_diff(LARGE_DISAGREEMENT,
                                 lamprier_et_al_2007_fix=False))
     self.assertAlmostEquals(val,
                            (Decimal('1'),
                             Decimal('0'),
                             Decimal('0'),
                             Decimal('0'),
                             8))