Fix line-by-line mode not working for BIO-F1

This commit is contained in:
Filip Gralinski 2021-10-09 18:28:14 +02:00
parent 3e4978fdbf
commit 8d8ca7f4b1
5 changed files with 13 additions and 4 deletions

View File

@ -162,9 +162,9 @@ isPreprocessable CharMatch = True
isPreprocessable MAP = False isPreprocessable MAP = False
isPreprocessable LogLoss = False isPreprocessable LogLoss = False
isPreprocessable Likelihood = False isPreprocessable Likelihood = False
isPreprocessable BIOF1 = False isPreprocessable BIOF1 = True
isPreprocessable BIOF1Labels = False isPreprocessable BIOF1Labels = True
isPreprocessable BIOWeightedF1 = False isPreprocessable BIOWeightedF1 = True
isPreprocessable TokenAccuracy = True isPreprocessable TokenAccuracy = True
isPreprocessable SegmentAccuracy = True isPreprocessable SegmentAccuracy = True
isPreprocessable MAE = False isPreprocessable MAE = False

View File

@ -382,6 +382,8 @@ main = hspec $ do
describe "Preprocessing operations" $ do describe "Preprocessing operations" $ do
it "F1 with preprocessing" $ do it "F1 with preprocessing" $ do
runGEvalTest "f1-with-preprocessing" `shouldReturnAlmost` 0.57142857142857 runGEvalTest "f1-with-preprocessing" `shouldReturnAlmost` 0.57142857142857
it "BIO-F1 with preprocessing" $ do
runGEvalTest "bio-f1-flags" `shouldReturnAlmost` 0.75
it "Regexp substition" $ do it "Regexp substition" $ do
runGEvalTest "accuracy-with-flags" `shouldReturnAlmost` 0.8 runGEvalTest "accuracy-with-flags" `shouldReturnAlmost` 0.8
let sampleChallenge = GEvalSpecification let sampleChallenge = GEvalSpecification

View File

@ -0,0 +1,3 @@
foo bar
bar
foo
1 foo bar
2 bar
3 foo

View File

@ -0,0 +1 @@
--metric BIO-F1:s<foo><B-FOO>s<bar><B-BAR>

View File

@ -0,0 +1,3 @@
foo bar
foo
foo
1 foo bar
2 foo
3 foo