Skip to content
Newer
Older
100644 23 lines (17 sloc) 650 Bytes
44632af @Athas Pretty up things and remove unused code.
Athas authored
1 {-# LANGUAGE FlexibleContexts #-}
c075fb8 @Athas Read from files instead of static lists.
Athas authored
2 module Twss( TrainingData
3 , readTrainingData
4 , isTwss
5 , isTwssProbability )
6 where
5819825 @egonSchiele tons of bug fixes to make stuff compile and work correctly
authored
7 import qualified Classify
c075fb8 @Athas Read from files instead of static lists.
Athas authored
8 import Control.Monad
658f4cd @egonSchiele first commit
authored
9
c075fb8 @Athas Read from files instead of static lists.
Athas authored
10 threshold :: Floating t => t
44632af @Athas Pretty up things and remove unused code.
Athas authored
11 threshold = 0.5
658f4cd @egonSchiele first commit
authored
12
c075fb8 @Athas Read from files instead of static lists.
Athas authored
13 type TrainingData = [String]
44632af @Athas Pretty up things and remove unused code.
Athas authored
14
c075fb8 @Athas Read from files instead of static lists.
Athas authored
15 readTrainingData :: FilePath -> IO TrainingData
16 readTrainingData = liftM lines . readFile
658f4cd @egonSchiele first commit
authored
17
c075fb8 @Athas Read from files instead of static lists.
Athas authored
18 isTwssProbability :: Floating t => [String] -> [String] -> String -> t
19 isTwssProbability pos neg prompt = Classify.getTwssProbability pos neg prompt
658f4cd @egonSchiele first commit
authored
20
c075fb8 @Athas Read from files instead of static lists.
Athas authored
21 isTwss :: TrainingData -> TrainingData -> String -> Bool
22 isTwss pos neg prompt = Classify.isTwss pos neg prompt (threshold :: Double)
Something went wrong with that request. Please try again.