{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Comprehend.Types.EntityRecognizerEvaluationMetrics where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EntityRecognizerEvaluationMetrics = EntityRecognizerEvaluationMetrics'
{
EntityRecognizerEvaluationMetrics -> Maybe Double
recall :: Prelude.Maybe Prelude.Double,
EntityRecognizerEvaluationMetrics -> Maybe Double
precision :: Prelude.Maybe Prelude.Double,
EntityRecognizerEvaluationMetrics -> Maybe Double
f1Score :: Prelude.Maybe Prelude.Double
}
deriving (EntityRecognizerEvaluationMetrics
-> EntityRecognizerEvaluationMetrics -> Bool
(EntityRecognizerEvaluationMetrics
-> EntityRecognizerEvaluationMetrics -> Bool)
-> (EntityRecognizerEvaluationMetrics
-> EntityRecognizerEvaluationMetrics -> Bool)
-> Eq EntityRecognizerEvaluationMetrics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EntityRecognizerEvaluationMetrics
-> EntityRecognizerEvaluationMetrics -> Bool
$c/= :: EntityRecognizerEvaluationMetrics
-> EntityRecognizerEvaluationMetrics -> Bool
== :: EntityRecognizerEvaluationMetrics
-> EntityRecognizerEvaluationMetrics -> Bool
$c== :: EntityRecognizerEvaluationMetrics
-> EntityRecognizerEvaluationMetrics -> Bool
Prelude.Eq, ReadPrec [EntityRecognizerEvaluationMetrics]
ReadPrec EntityRecognizerEvaluationMetrics
Int -> ReadS EntityRecognizerEvaluationMetrics
ReadS [EntityRecognizerEvaluationMetrics]
(Int -> ReadS EntityRecognizerEvaluationMetrics)
-> ReadS [EntityRecognizerEvaluationMetrics]
-> ReadPrec EntityRecognizerEvaluationMetrics
-> ReadPrec [EntityRecognizerEvaluationMetrics]
-> Read EntityRecognizerEvaluationMetrics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EntityRecognizerEvaluationMetrics]
$creadListPrec :: ReadPrec [EntityRecognizerEvaluationMetrics]
readPrec :: ReadPrec EntityRecognizerEvaluationMetrics
$creadPrec :: ReadPrec EntityRecognizerEvaluationMetrics
readList :: ReadS [EntityRecognizerEvaluationMetrics]
$creadList :: ReadS [EntityRecognizerEvaluationMetrics]
readsPrec :: Int -> ReadS EntityRecognizerEvaluationMetrics
$creadsPrec :: Int -> ReadS EntityRecognizerEvaluationMetrics
Prelude.Read, Int -> EntityRecognizerEvaluationMetrics -> ShowS
[EntityRecognizerEvaluationMetrics] -> ShowS
EntityRecognizerEvaluationMetrics -> String
(Int -> EntityRecognizerEvaluationMetrics -> ShowS)
-> (EntityRecognizerEvaluationMetrics -> String)
-> ([EntityRecognizerEvaluationMetrics] -> ShowS)
-> Show EntityRecognizerEvaluationMetrics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EntityRecognizerEvaluationMetrics] -> ShowS
$cshowList :: [EntityRecognizerEvaluationMetrics] -> ShowS
show :: EntityRecognizerEvaluationMetrics -> String
$cshow :: EntityRecognizerEvaluationMetrics -> String
showsPrec :: Int -> EntityRecognizerEvaluationMetrics -> ShowS
$cshowsPrec :: Int -> EntityRecognizerEvaluationMetrics -> ShowS
Prelude.Show, (forall x.
EntityRecognizerEvaluationMetrics
-> Rep EntityRecognizerEvaluationMetrics x)
-> (forall x.
Rep EntityRecognizerEvaluationMetrics x
-> EntityRecognizerEvaluationMetrics)
-> Generic EntityRecognizerEvaluationMetrics
forall x.
Rep EntityRecognizerEvaluationMetrics x
-> EntityRecognizerEvaluationMetrics
forall x.
EntityRecognizerEvaluationMetrics
-> Rep EntityRecognizerEvaluationMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EntityRecognizerEvaluationMetrics x
-> EntityRecognizerEvaluationMetrics
$cfrom :: forall x.
EntityRecognizerEvaluationMetrics
-> Rep EntityRecognizerEvaluationMetrics x
Prelude.Generic)
newEntityRecognizerEvaluationMetrics ::
EntityRecognizerEvaluationMetrics
newEntityRecognizerEvaluationMetrics :: EntityRecognizerEvaluationMetrics
newEntityRecognizerEvaluationMetrics =
EntityRecognizerEvaluationMetrics' :: Maybe Double
-> Maybe Double
-> Maybe Double
-> EntityRecognizerEvaluationMetrics
EntityRecognizerEvaluationMetrics'
{ $sel:recall:EntityRecognizerEvaluationMetrics' :: Maybe Double
recall =
Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:precision:EntityRecognizerEvaluationMetrics' :: Maybe Double
precision = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:f1Score:EntityRecognizerEvaluationMetrics' :: Maybe Double
f1Score = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
entityRecognizerEvaluationMetrics_recall :: Lens.Lens' EntityRecognizerEvaluationMetrics (Prelude.Maybe Prelude.Double)
entityRecognizerEvaluationMetrics_recall :: (Maybe Double -> f (Maybe Double))
-> EntityRecognizerEvaluationMetrics
-> f EntityRecognizerEvaluationMetrics
entityRecognizerEvaluationMetrics_recall = (EntityRecognizerEvaluationMetrics -> Maybe Double)
-> (EntityRecognizerEvaluationMetrics
-> Maybe Double -> EntityRecognizerEvaluationMetrics)
-> Lens
EntityRecognizerEvaluationMetrics
EntityRecognizerEvaluationMetrics
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerEvaluationMetrics' {Maybe Double
recall :: Maybe Double
$sel:recall:EntityRecognizerEvaluationMetrics' :: EntityRecognizerEvaluationMetrics -> Maybe Double
recall} -> Maybe Double
recall) (\s :: EntityRecognizerEvaluationMetrics
s@EntityRecognizerEvaluationMetrics' {} Maybe Double
a -> EntityRecognizerEvaluationMetrics
s {$sel:recall:EntityRecognizerEvaluationMetrics' :: Maybe Double
recall = Maybe Double
a} :: EntityRecognizerEvaluationMetrics)
entityRecognizerEvaluationMetrics_precision :: Lens.Lens' EntityRecognizerEvaluationMetrics (Prelude.Maybe Prelude.Double)
entityRecognizerEvaluationMetrics_precision :: (Maybe Double -> f (Maybe Double))
-> EntityRecognizerEvaluationMetrics
-> f EntityRecognizerEvaluationMetrics
entityRecognizerEvaluationMetrics_precision = (EntityRecognizerEvaluationMetrics -> Maybe Double)
-> (EntityRecognizerEvaluationMetrics
-> Maybe Double -> EntityRecognizerEvaluationMetrics)
-> Lens
EntityRecognizerEvaluationMetrics
EntityRecognizerEvaluationMetrics
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerEvaluationMetrics' {Maybe Double
precision :: Maybe Double
$sel:precision:EntityRecognizerEvaluationMetrics' :: EntityRecognizerEvaluationMetrics -> Maybe Double
precision} -> Maybe Double
precision) (\s :: EntityRecognizerEvaluationMetrics
s@EntityRecognizerEvaluationMetrics' {} Maybe Double
a -> EntityRecognizerEvaluationMetrics
s {$sel:precision:EntityRecognizerEvaluationMetrics' :: Maybe Double
precision = Maybe Double
a} :: EntityRecognizerEvaluationMetrics)
entityRecognizerEvaluationMetrics_f1Score :: Lens.Lens' EntityRecognizerEvaluationMetrics (Prelude.Maybe Prelude.Double)
entityRecognizerEvaluationMetrics_f1Score :: (Maybe Double -> f (Maybe Double))
-> EntityRecognizerEvaluationMetrics
-> f EntityRecognizerEvaluationMetrics
entityRecognizerEvaluationMetrics_f1Score = (EntityRecognizerEvaluationMetrics -> Maybe Double)
-> (EntityRecognizerEvaluationMetrics
-> Maybe Double -> EntityRecognizerEvaluationMetrics)
-> Lens
EntityRecognizerEvaluationMetrics
EntityRecognizerEvaluationMetrics
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerEvaluationMetrics' {Maybe Double
f1Score :: Maybe Double
$sel:f1Score:EntityRecognizerEvaluationMetrics' :: EntityRecognizerEvaluationMetrics -> Maybe Double
f1Score} -> Maybe Double
f1Score) (\s :: EntityRecognizerEvaluationMetrics
s@EntityRecognizerEvaluationMetrics' {} Maybe Double
a -> EntityRecognizerEvaluationMetrics
s {$sel:f1Score:EntityRecognizerEvaluationMetrics' :: Maybe Double
f1Score = Maybe Double
a} :: EntityRecognizerEvaluationMetrics)
instance
Core.FromJSON
EntityRecognizerEvaluationMetrics
where
parseJSON :: Value -> Parser EntityRecognizerEvaluationMetrics
parseJSON =
String
-> (Object -> Parser EntityRecognizerEvaluationMetrics)
-> Value
-> Parser EntityRecognizerEvaluationMetrics
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EntityRecognizerEvaluationMetrics"
( \Object
x ->
Maybe Double
-> Maybe Double
-> Maybe Double
-> EntityRecognizerEvaluationMetrics
EntityRecognizerEvaluationMetrics'
(Maybe Double
-> Maybe Double
-> Maybe Double
-> EntityRecognizerEvaluationMetrics)
-> Parser (Maybe Double)
-> Parser
(Maybe Double -> Maybe Double -> EntityRecognizerEvaluationMetrics)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Recall")
Parser
(Maybe Double -> Maybe Double -> EntityRecognizerEvaluationMetrics)
-> Parser (Maybe Double)
-> Parser (Maybe Double -> EntityRecognizerEvaluationMetrics)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Precision")
Parser (Maybe Double -> EntityRecognizerEvaluationMetrics)
-> Parser (Maybe Double)
-> Parser EntityRecognizerEvaluationMetrics
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"F1Score")
)
instance
Prelude.Hashable
EntityRecognizerEvaluationMetrics
instance
Prelude.NFData
EntityRecognizerEvaluationMetrics