{-# 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.EntityRecognizerMetadata where
import Amazonka.Comprehend.Types.EntityRecognizerEvaluationMetrics
import Amazonka.Comprehend.Types.EntityRecognizerMetadataEntityTypesListItem
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EntityRecognizerMetadata = EntityRecognizerMetadata'
{
EntityRecognizerMetadata
-> Maybe [EntityRecognizerMetadataEntityTypesListItem]
entityTypes :: Prelude.Maybe [EntityRecognizerMetadataEntityTypesListItem],
EntityRecognizerMetadata -> Maybe EntityRecognizerEvaluationMetrics
evaluationMetrics :: Prelude.Maybe EntityRecognizerEvaluationMetrics,
EntityRecognizerMetadata -> Maybe Int
numberOfTrainedDocuments :: Prelude.Maybe Prelude.Int,
EntityRecognizerMetadata -> Maybe Int
numberOfTestDocuments :: Prelude.Maybe Prelude.Int
}
deriving (EntityRecognizerMetadata -> EntityRecognizerMetadata -> Bool
(EntityRecognizerMetadata -> EntityRecognizerMetadata -> Bool)
-> (EntityRecognizerMetadata -> EntityRecognizerMetadata -> Bool)
-> Eq EntityRecognizerMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EntityRecognizerMetadata -> EntityRecognizerMetadata -> Bool
$c/= :: EntityRecognizerMetadata -> EntityRecognizerMetadata -> Bool
== :: EntityRecognizerMetadata -> EntityRecognizerMetadata -> Bool
$c== :: EntityRecognizerMetadata -> EntityRecognizerMetadata -> Bool
Prelude.Eq, Int -> EntityRecognizerMetadata -> ShowS
[EntityRecognizerMetadata] -> ShowS
EntityRecognizerMetadata -> String
(Int -> EntityRecognizerMetadata -> ShowS)
-> (EntityRecognizerMetadata -> String)
-> ([EntityRecognizerMetadata] -> ShowS)
-> Show EntityRecognizerMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EntityRecognizerMetadata] -> ShowS
$cshowList :: [EntityRecognizerMetadata] -> ShowS
show :: EntityRecognizerMetadata -> String
$cshow :: EntityRecognizerMetadata -> String
showsPrec :: Int -> EntityRecognizerMetadata -> ShowS
$cshowsPrec :: Int -> EntityRecognizerMetadata -> ShowS
Prelude.Show, (forall x.
EntityRecognizerMetadata -> Rep EntityRecognizerMetadata x)
-> (forall x.
Rep EntityRecognizerMetadata x -> EntityRecognizerMetadata)
-> Generic EntityRecognizerMetadata
forall x.
Rep EntityRecognizerMetadata x -> EntityRecognizerMetadata
forall x.
EntityRecognizerMetadata -> Rep EntityRecognizerMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EntityRecognizerMetadata x -> EntityRecognizerMetadata
$cfrom :: forall x.
EntityRecognizerMetadata -> Rep EntityRecognizerMetadata x
Prelude.Generic)
newEntityRecognizerMetadata ::
EntityRecognizerMetadata
newEntityRecognizerMetadata :: EntityRecognizerMetadata
newEntityRecognizerMetadata =
EntityRecognizerMetadata' :: Maybe [EntityRecognizerMetadataEntityTypesListItem]
-> Maybe EntityRecognizerEvaluationMetrics
-> Maybe Int
-> Maybe Int
-> EntityRecognizerMetadata
EntityRecognizerMetadata'
{ $sel:entityTypes:EntityRecognizerMetadata' :: Maybe [EntityRecognizerMetadataEntityTypesListItem]
entityTypes =
Maybe [EntityRecognizerMetadataEntityTypesListItem]
forall a. Maybe a
Prelude.Nothing,
$sel:evaluationMetrics:EntityRecognizerMetadata' :: Maybe EntityRecognizerEvaluationMetrics
evaluationMetrics = Maybe EntityRecognizerEvaluationMetrics
forall a. Maybe a
Prelude.Nothing,
$sel:numberOfTrainedDocuments:EntityRecognizerMetadata' :: Maybe Int
numberOfTrainedDocuments = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:numberOfTestDocuments:EntityRecognizerMetadata' :: Maybe Int
numberOfTestDocuments = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
entityRecognizerMetadata_entityTypes :: Lens.Lens' EntityRecognizerMetadata (Prelude.Maybe [EntityRecognizerMetadataEntityTypesListItem])
entityRecognizerMetadata_entityTypes :: (Maybe [EntityRecognizerMetadataEntityTypesListItem]
-> f (Maybe [EntityRecognizerMetadataEntityTypesListItem]))
-> EntityRecognizerMetadata -> f EntityRecognizerMetadata
entityRecognizerMetadata_entityTypes = (EntityRecognizerMetadata
-> Maybe [EntityRecognizerMetadataEntityTypesListItem])
-> (EntityRecognizerMetadata
-> Maybe [EntityRecognizerMetadataEntityTypesListItem]
-> EntityRecognizerMetadata)
-> Lens
EntityRecognizerMetadata
EntityRecognizerMetadata
(Maybe [EntityRecognizerMetadataEntityTypesListItem])
(Maybe [EntityRecognizerMetadataEntityTypesListItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerMetadata' {Maybe [EntityRecognizerMetadataEntityTypesListItem]
entityTypes :: Maybe [EntityRecognizerMetadataEntityTypesListItem]
$sel:entityTypes:EntityRecognizerMetadata' :: EntityRecognizerMetadata
-> Maybe [EntityRecognizerMetadataEntityTypesListItem]
entityTypes} -> Maybe [EntityRecognizerMetadataEntityTypesListItem]
entityTypes) (\s :: EntityRecognizerMetadata
s@EntityRecognizerMetadata' {} Maybe [EntityRecognizerMetadataEntityTypesListItem]
a -> EntityRecognizerMetadata
s {$sel:entityTypes:EntityRecognizerMetadata' :: Maybe [EntityRecognizerMetadataEntityTypesListItem]
entityTypes = Maybe [EntityRecognizerMetadataEntityTypesListItem]
a} :: EntityRecognizerMetadata) ((Maybe [EntityRecognizerMetadataEntityTypesListItem]
-> f (Maybe [EntityRecognizerMetadataEntityTypesListItem]))
-> EntityRecognizerMetadata -> f EntityRecognizerMetadata)
-> ((Maybe [EntityRecognizerMetadataEntityTypesListItem]
-> f (Maybe [EntityRecognizerMetadataEntityTypesListItem]))
-> Maybe [EntityRecognizerMetadataEntityTypesListItem]
-> f (Maybe [EntityRecognizerMetadataEntityTypesListItem]))
-> (Maybe [EntityRecognizerMetadataEntityTypesListItem]
-> f (Maybe [EntityRecognizerMetadataEntityTypesListItem]))
-> EntityRecognizerMetadata
-> f EntityRecognizerMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[EntityRecognizerMetadataEntityTypesListItem]
[EntityRecognizerMetadataEntityTypesListItem]
[EntityRecognizerMetadataEntityTypesListItem]
[EntityRecognizerMetadataEntityTypesListItem]
-> Iso
(Maybe [EntityRecognizerMetadataEntityTypesListItem])
(Maybe [EntityRecognizerMetadataEntityTypesListItem])
(Maybe [EntityRecognizerMetadataEntityTypesListItem])
(Maybe [EntityRecognizerMetadataEntityTypesListItem])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[EntityRecognizerMetadataEntityTypesListItem]
[EntityRecognizerMetadataEntityTypesListItem]
[EntityRecognizerMetadataEntityTypesListItem]
[EntityRecognizerMetadataEntityTypesListItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
entityRecognizerMetadata_evaluationMetrics :: Lens.Lens' EntityRecognizerMetadata (Prelude.Maybe EntityRecognizerEvaluationMetrics)
entityRecognizerMetadata_evaluationMetrics :: (Maybe EntityRecognizerEvaluationMetrics
-> f (Maybe EntityRecognizerEvaluationMetrics))
-> EntityRecognizerMetadata -> f EntityRecognizerMetadata
entityRecognizerMetadata_evaluationMetrics = (EntityRecognizerMetadata
-> Maybe EntityRecognizerEvaluationMetrics)
-> (EntityRecognizerMetadata
-> Maybe EntityRecognizerEvaluationMetrics
-> EntityRecognizerMetadata)
-> Lens
EntityRecognizerMetadata
EntityRecognizerMetadata
(Maybe EntityRecognizerEvaluationMetrics)
(Maybe EntityRecognizerEvaluationMetrics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerMetadata' {Maybe EntityRecognizerEvaluationMetrics
evaluationMetrics :: Maybe EntityRecognizerEvaluationMetrics
$sel:evaluationMetrics:EntityRecognizerMetadata' :: EntityRecognizerMetadata -> Maybe EntityRecognizerEvaluationMetrics
evaluationMetrics} -> Maybe EntityRecognizerEvaluationMetrics
evaluationMetrics) (\s :: EntityRecognizerMetadata
s@EntityRecognizerMetadata' {} Maybe EntityRecognizerEvaluationMetrics
a -> EntityRecognizerMetadata
s {$sel:evaluationMetrics:EntityRecognizerMetadata' :: Maybe EntityRecognizerEvaluationMetrics
evaluationMetrics = Maybe EntityRecognizerEvaluationMetrics
a} :: EntityRecognizerMetadata)
entityRecognizerMetadata_numberOfTrainedDocuments :: Lens.Lens' EntityRecognizerMetadata (Prelude.Maybe Prelude.Int)
entityRecognizerMetadata_numberOfTrainedDocuments :: (Maybe Int -> f (Maybe Int))
-> EntityRecognizerMetadata -> f EntityRecognizerMetadata
entityRecognizerMetadata_numberOfTrainedDocuments = (EntityRecognizerMetadata -> Maybe Int)
-> (EntityRecognizerMetadata
-> Maybe Int -> EntityRecognizerMetadata)
-> Lens
EntityRecognizerMetadata
EntityRecognizerMetadata
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerMetadata' {Maybe Int
numberOfTrainedDocuments :: Maybe Int
$sel:numberOfTrainedDocuments:EntityRecognizerMetadata' :: EntityRecognizerMetadata -> Maybe Int
numberOfTrainedDocuments} -> Maybe Int
numberOfTrainedDocuments) (\s :: EntityRecognizerMetadata
s@EntityRecognizerMetadata' {} Maybe Int
a -> EntityRecognizerMetadata
s {$sel:numberOfTrainedDocuments:EntityRecognizerMetadata' :: Maybe Int
numberOfTrainedDocuments = Maybe Int
a} :: EntityRecognizerMetadata)
entityRecognizerMetadata_numberOfTestDocuments :: Lens.Lens' EntityRecognizerMetadata (Prelude.Maybe Prelude.Int)
entityRecognizerMetadata_numberOfTestDocuments :: (Maybe Int -> f (Maybe Int))
-> EntityRecognizerMetadata -> f EntityRecognizerMetadata
entityRecognizerMetadata_numberOfTestDocuments = (EntityRecognizerMetadata -> Maybe Int)
-> (EntityRecognizerMetadata
-> Maybe Int -> EntityRecognizerMetadata)
-> Lens
EntityRecognizerMetadata
EntityRecognizerMetadata
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerMetadata' {Maybe Int
numberOfTestDocuments :: Maybe Int
$sel:numberOfTestDocuments:EntityRecognizerMetadata' :: EntityRecognizerMetadata -> Maybe Int
numberOfTestDocuments} -> Maybe Int
numberOfTestDocuments) (\s :: EntityRecognizerMetadata
s@EntityRecognizerMetadata' {} Maybe Int
a -> EntityRecognizerMetadata
s {$sel:numberOfTestDocuments:EntityRecognizerMetadata' :: Maybe Int
numberOfTestDocuments = Maybe Int
a} :: EntityRecognizerMetadata)
instance Core.FromJSON EntityRecognizerMetadata where
parseJSON :: Value -> Parser EntityRecognizerMetadata
parseJSON =
String
-> (Object -> Parser EntityRecognizerMetadata)
-> Value
-> Parser EntityRecognizerMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EntityRecognizerMetadata"
( \Object
x ->
Maybe [EntityRecognizerMetadataEntityTypesListItem]
-> Maybe EntityRecognizerEvaluationMetrics
-> Maybe Int
-> Maybe Int
-> EntityRecognizerMetadata
EntityRecognizerMetadata'
(Maybe [EntityRecognizerMetadataEntityTypesListItem]
-> Maybe EntityRecognizerEvaluationMetrics
-> Maybe Int
-> Maybe Int
-> EntityRecognizerMetadata)
-> Parser (Maybe [EntityRecognizerMetadataEntityTypesListItem])
-> Parser
(Maybe EntityRecognizerEvaluationMetrics
-> Maybe Int -> Maybe Int -> EntityRecognizerMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Parser
(Maybe (Maybe [EntityRecognizerMetadataEntityTypesListItem]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EntityTypes" Parser
(Maybe (Maybe [EntityRecognizerMetadataEntityTypesListItem]))
-> Maybe [EntityRecognizerMetadataEntityTypesListItem]
-> Parser (Maybe [EntityRecognizerMetadataEntityTypesListItem])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [EntityRecognizerMetadataEntityTypesListItem]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe EntityRecognizerEvaluationMetrics
-> Maybe Int -> Maybe Int -> EntityRecognizerMetadata)
-> Parser (Maybe EntityRecognizerEvaluationMetrics)
-> Parser (Maybe Int -> Maybe Int -> EntityRecognizerMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EntityRecognizerEvaluationMetrics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EvaluationMetrics")
Parser (Maybe Int -> Maybe Int -> EntityRecognizerMetadata)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> EntityRecognizerMetadata)
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 -> EntityRecognizerMetadata)
-> Parser (Maybe Int) -> Parser EntityRecognizerMetadata
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 EntityRecognizerMetadata
instance Prelude.NFData EntityRecognizerMetadata