{-# 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.ClassifierMetadata where
import Amazonka.Comprehend.Types.ClassifierEvaluationMetrics
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ClassifierMetadata = ClassifierMetadata'
{
ClassifierMetadata -> Maybe Int
numberOfLabels :: Prelude.Maybe Prelude.Int,
ClassifierMetadata -> Maybe ClassifierEvaluationMetrics
evaluationMetrics :: Prelude.Maybe ClassifierEvaluationMetrics,
ClassifierMetadata -> Maybe Int
numberOfTrainedDocuments :: Prelude.Maybe Prelude.Int,
ClassifierMetadata -> Maybe Int
numberOfTestDocuments :: Prelude.Maybe Prelude.Int
}
deriving (ClassifierMetadata -> ClassifierMetadata -> Bool
(ClassifierMetadata -> ClassifierMetadata -> Bool)
-> (ClassifierMetadata -> ClassifierMetadata -> Bool)
-> Eq ClassifierMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClassifierMetadata -> ClassifierMetadata -> Bool
$c/= :: ClassifierMetadata -> ClassifierMetadata -> Bool
== :: ClassifierMetadata -> ClassifierMetadata -> Bool
$c== :: ClassifierMetadata -> ClassifierMetadata -> Bool
Prelude.Eq, Int -> ClassifierMetadata -> ShowS
[ClassifierMetadata] -> ShowS
ClassifierMetadata -> String
(Int -> ClassifierMetadata -> ShowS)
-> (ClassifierMetadata -> String)
-> ([ClassifierMetadata] -> ShowS)
-> Show ClassifierMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClassifierMetadata] -> ShowS
$cshowList :: [ClassifierMetadata] -> ShowS
show :: ClassifierMetadata -> String
$cshow :: ClassifierMetadata -> String
showsPrec :: Int -> ClassifierMetadata -> ShowS
$cshowsPrec :: Int -> ClassifierMetadata -> ShowS
Prelude.Show, (forall x. ClassifierMetadata -> Rep ClassifierMetadata x)
-> (forall x. Rep ClassifierMetadata x -> ClassifierMetadata)
-> Generic ClassifierMetadata
forall x. Rep ClassifierMetadata x -> ClassifierMetadata
forall x. ClassifierMetadata -> Rep ClassifierMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClassifierMetadata x -> ClassifierMetadata
$cfrom :: forall x. ClassifierMetadata -> Rep ClassifierMetadata x
Prelude.Generic)
newClassifierMetadata ::
ClassifierMetadata
newClassifierMetadata :: ClassifierMetadata
newClassifierMetadata =
ClassifierMetadata' :: Maybe Int
-> Maybe ClassifierEvaluationMetrics
-> Maybe Int
-> Maybe Int
-> ClassifierMetadata
ClassifierMetadata'
{ $sel:numberOfLabels:ClassifierMetadata' :: Maybe Int
numberOfLabels =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:evaluationMetrics:ClassifierMetadata' :: Maybe ClassifierEvaluationMetrics
evaluationMetrics = Maybe ClassifierEvaluationMetrics
forall a. Maybe a
Prelude.Nothing,
$sel:numberOfTrainedDocuments:ClassifierMetadata' :: Maybe Int
numberOfTrainedDocuments = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:numberOfTestDocuments:ClassifierMetadata' :: Maybe Int
numberOfTestDocuments = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
classifierMetadata_numberOfLabels :: Lens.Lens' ClassifierMetadata (Prelude.Maybe Prelude.Int)
classifierMetadata_numberOfLabels :: (Maybe Int -> f (Maybe Int))
-> ClassifierMetadata -> f ClassifierMetadata
classifierMetadata_numberOfLabels = (ClassifierMetadata -> Maybe Int)
-> (ClassifierMetadata -> Maybe Int -> ClassifierMetadata)
-> Lens
ClassifierMetadata ClassifierMetadata (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassifierMetadata' {Maybe Int
numberOfLabels :: Maybe Int
$sel:numberOfLabels:ClassifierMetadata' :: ClassifierMetadata -> Maybe Int
numberOfLabels} -> Maybe Int
numberOfLabels) (\s :: ClassifierMetadata
s@ClassifierMetadata' {} Maybe Int
a -> ClassifierMetadata
s {$sel:numberOfLabels:ClassifierMetadata' :: Maybe Int
numberOfLabels = Maybe Int
a} :: ClassifierMetadata)
classifierMetadata_evaluationMetrics :: Lens.Lens' ClassifierMetadata (Prelude.Maybe ClassifierEvaluationMetrics)
classifierMetadata_evaluationMetrics :: (Maybe ClassifierEvaluationMetrics
-> f (Maybe ClassifierEvaluationMetrics))
-> ClassifierMetadata -> f ClassifierMetadata
classifierMetadata_evaluationMetrics = (ClassifierMetadata -> Maybe ClassifierEvaluationMetrics)
-> (ClassifierMetadata
-> Maybe ClassifierEvaluationMetrics -> ClassifierMetadata)
-> Lens
ClassifierMetadata
ClassifierMetadata
(Maybe ClassifierEvaluationMetrics)
(Maybe ClassifierEvaluationMetrics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassifierMetadata' {Maybe ClassifierEvaluationMetrics
evaluationMetrics :: Maybe ClassifierEvaluationMetrics
$sel:evaluationMetrics:ClassifierMetadata' :: ClassifierMetadata -> Maybe ClassifierEvaluationMetrics
evaluationMetrics} -> Maybe ClassifierEvaluationMetrics
evaluationMetrics) (\s :: ClassifierMetadata
s@ClassifierMetadata' {} Maybe ClassifierEvaluationMetrics
a -> ClassifierMetadata
s {$sel:evaluationMetrics:ClassifierMetadata' :: Maybe ClassifierEvaluationMetrics
evaluationMetrics = Maybe ClassifierEvaluationMetrics
a} :: ClassifierMetadata)
classifierMetadata_numberOfTrainedDocuments :: Lens.Lens' ClassifierMetadata (Prelude.Maybe Prelude.Int)
classifierMetadata_numberOfTrainedDocuments :: (Maybe Int -> f (Maybe Int))
-> ClassifierMetadata -> f ClassifierMetadata
classifierMetadata_numberOfTrainedDocuments = (ClassifierMetadata -> Maybe Int)
-> (ClassifierMetadata -> Maybe Int -> ClassifierMetadata)
-> Lens
ClassifierMetadata ClassifierMetadata (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassifierMetadata' {Maybe Int
numberOfTrainedDocuments :: Maybe Int
$sel:numberOfTrainedDocuments:ClassifierMetadata' :: ClassifierMetadata -> Maybe Int
numberOfTrainedDocuments} -> Maybe Int
numberOfTrainedDocuments) (\s :: ClassifierMetadata
s@ClassifierMetadata' {} Maybe Int
a -> ClassifierMetadata
s {$sel:numberOfTrainedDocuments:ClassifierMetadata' :: Maybe Int
numberOfTrainedDocuments = Maybe Int
a} :: ClassifierMetadata)
classifierMetadata_numberOfTestDocuments :: Lens.Lens' ClassifierMetadata (Prelude.Maybe Prelude.Int)
classifierMetadata_numberOfTestDocuments :: (Maybe Int -> f (Maybe Int))
-> ClassifierMetadata -> f ClassifierMetadata
classifierMetadata_numberOfTestDocuments = (ClassifierMetadata -> Maybe Int)
-> (ClassifierMetadata -> Maybe Int -> ClassifierMetadata)
-> Lens
ClassifierMetadata ClassifierMetadata (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassifierMetadata' {Maybe Int
numberOfTestDocuments :: Maybe Int
$sel:numberOfTestDocuments:ClassifierMetadata' :: ClassifierMetadata -> Maybe Int
numberOfTestDocuments} -> Maybe Int
numberOfTestDocuments) (\s :: ClassifierMetadata
s@ClassifierMetadata' {} Maybe Int
a -> ClassifierMetadata
s {$sel:numberOfTestDocuments:ClassifierMetadata' :: Maybe Int
numberOfTestDocuments = Maybe Int
a} :: ClassifierMetadata)
instance Core.FromJSON ClassifierMetadata where
parseJSON :: Value -> Parser ClassifierMetadata
parseJSON =
String
-> (Object -> Parser ClassifierMetadata)
-> Value
-> Parser ClassifierMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ClassifierMetadata"
( \Object
x ->
Maybe Int
-> Maybe ClassifierEvaluationMetrics
-> Maybe Int
-> Maybe Int
-> ClassifierMetadata
ClassifierMetadata'
(Maybe Int
-> Maybe ClassifierEvaluationMetrics
-> Maybe Int
-> Maybe Int
-> ClassifierMetadata)
-> Parser (Maybe Int)
-> Parser
(Maybe ClassifierEvaluationMetrics
-> Maybe Int -> Maybe Int -> ClassifierMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumberOfLabels")
Parser
(Maybe ClassifierEvaluationMetrics
-> Maybe Int -> Maybe Int -> ClassifierMetadata)
-> Parser (Maybe ClassifierEvaluationMetrics)
-> Parser (Maybe Int -> Maybe Int -> ClassifierMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ClassifierEvaluationMetrics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EvaluationMetrics")
Parser (Maybe Int -> Maybe Int -> ClassifierMetadata)
-> Parser (Maybe Int) -> Parser (Maybe Int -> ClassifierMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumberOfTrainedDocuments")
Parser (Maybe Int -> ClassifierMetadata)
-> Parser (Maybe Int) -> Parser ClassifierMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumberOfTestDocuments")
)
instance Prelude.Hashable ClassifierMetadata
instance Prelude.NFData ClassifierMetadata