{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Comprehend.Types.EntityRecognizerMetadataEntityTypesListItem
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Comprehend.Types.EntityRecognizerMetadataEntityTypesListItem where

import Amazonka.Comprehend.Types.EntityTypesEvaluationMetrics
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Individual item from the list of entity types in the metadata of an
-- entity recognizer.
--
-- /See:/ 'newEntityRecognizerMetadataEntityTypesListItem' smart constructor.
data EntityRecognizerMetadataEntityTypesListItem = EntityRecognizerMetadataEntityTypesListItem'
  { -- | Detailed information about the accuracy of the entity recognizer for a
    -- specific item on the list of entity types.
    EntityRecognizerMetadataEntityTypesListItem
-> Maybe EntityTypesEvaluationMetrics
evaluationMetrics :: Prelude.Maybe EntityTypesEvaluationMetrics,
    -- | Type of entity from the list of entity types in the metadata of an
    -- entity recognizer.
    EntityRecognizerMetadataEntityTypesListItem -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
    -- | Indicates the number of times the given entity type was seen in the
    -- training data.
    EntityRecognizerMetadataEntityTypesListItem -> Maybe Int
numberOfTrainMentions :: Prelude.Maybe Prelude.Int
  }
  deriving (EntityRecognizerMetadataEntityTypesListItem
-> EntityRecognizerMetadataEntityTypesListItem -> Bool
(EntityRecognizerMetadataEntityTypesListItem
 -> EntityRecognizerMetadataEntityTypesListItem -> Bool)
-> (EntityRecognizerMetadataEntityTypesListItem
    -> EntityRecognizerMetadataEntityTypesListItem -> Bool)
-> Eq EntityRecognizerMetadataEntityTypesListItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EntityRecognizerMetadataEntityTypesListItem
-> EntityRecognizerMetadataEntityTypesListItem -> Bool
$c/= :: EntityRecognizerMetadataEntityTypesListItem
-> EntityRecognizerMetadataEntityTypesListItem -> Bool
== :: EntityRecognizerMetadataEntityTypesListItem
-> EntityRecognizerMetadataEntityTypesListItem -> Bool
$c== :: EntityRecognizerMetadataEntityTypesListItem
-> EntityRecognizerMetadataEntityTypesListItem -> Bool
Prelude.Eq, ReadPrec [EntityRecognizerMetadataEntityTypesListItem]
ReadPrec EntityRecognizerMetadataEntityTypesListItem
Int -> ReadS EntityRecognizerMetadataEntityTypesListItem
ReadS [EntityRecognizerMetadataEntityTypesListItem]
(Int -> ReadS EntityRecognizerMetadataEntityTypesListItem)
-> ReadS [EntityRecognizerMetadataEntityTypesListItem]
-> ReadPrec EntityRecognizerMetadataEntityTypesListItem
-> ReadPrec [EntityRecognizerMetadataEntityTypesListItem]
-> Read EntityRecognizerMetadataEntityTypesListItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EntityRecognizerMetadataEntityTypesListItem]
$creadListPrec :: ReadPrec [EntityRecognizerMetadataEntityTypesListItem]
readPrec :: ReadPrec EntityRecognizerMetadataEntityTypesListItem
$creadPrec :: ReadPrec EntityRecognizerMetadataEntityTypesListItem
readList :: ReadS [EntityRecognizerMetadataEntityTypesListItem]
$creadList :: ReadS [EntityRecognizerMetadataEntityTypesListItem]
readsPrec :: Int -> ReadS EntityRecognizerMetadataEntityTypesListItem
$creadsPrec :: Int -> ReadS EntityRecognizerMetadataEntityTypesListItem
Prelude.Read, Int -> EntityRecognizerMetadataEntityTypesListItem -> ShowS
[EntityRecognizerMetadataEntityTypesListItem] -> ShowS
EntityRecognizerMetadataEntityTypesListItem -> String
(Int -> EntityRecognizerMetadataEntityTypesListItem -> ShowS)
-> (EntityRecognizerMetadataEntityTypesListItem -> String)
-> ([EntityRecognizerMetadataEntityTypesListItem] -> ShowS)
-> Show EntityRecognizerMetadataEntityTypesListItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EntityRecognizerMetadataEntityTypesListItem] -> ShowS
$cshowList :: [EntityRecognizerMetadataEntityTypesListItem] -> ShowS
show :: EntityRecognizerMetadataEntityTypesListItem -> String
$cshow :: EntityRecognizerMetadataEntityTypesListItem -> String
showsPrec :: Int -> EntityRecognizerMetadataEntityTypesListItem -> ShowS
$cshowsPrec :: Int -> EntityRecognizerMetadataEntityTypesListItem -> ShowS
Prelude.Show, (forall x.
 EntityRecognizerMetadataEntityTypesListItem
 -> Rep EntityRecognizerMetadataEntityTypesListItem x)
-> (forall x.
    Rep EntityRecognizerMetadataEntityTypesListItem x
    -> EntityRecognizerMetadataEntityTypesListItem)
-> Generic EntityRecognizerMetadataEntityTypesListItem
forall x.
Rep EntityRecognizerMetadataEntityTypesListItem x
-> EntityRecognizerMetadataEntityTypesListItem
forall x.
EntityRecognizerMetadataEntityTypesListItem
-> Rep EntityRecognizerMetadataEntityTypesListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EntityRecognizerMetadataEntityTypesListItem x
-> EntityRecognizerMetadataEntityTypesListItem
$cfrom :: forall x.
EntityRecognizerMetadataEntityTypesListItem
-> Rep EntityRecognizerMetadataEntityTypesListItem x
Prelude.Generic)

-- |
-- Create a value of 'EntityRecognizerMetadataEntityTypesListItem' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'evaluationMetrics', 'entityRecognizerMetadataEntityTypesListItem_evaluationMetrics' - Detailed information about the accuracy of the entity recognizer for a
-- specific item on the list of entity types.
--
-- 'type'', 'entityRecognizerMetadataEntityTypesListItem_type' - Type of entity from the list of entity types in the metadata of an
-- entity recognizer.
--
-- 'numberOfTrainMentions', 'entityRecognizerMetadataEntityTypesListItem_numberOfTrainMentions' - Indicates the number of times the given entity type was seen in the
-- training data.
newEntityRecognizerMetadataEntityTypesListItem ::
  EntityRecognizerMetadataEntityTypesListItem
newEntityRecognizerMetadataEntityTypesListItem :: EntityRecognizerMetadataEntityTypesListItem
newEntityRecognizerMetadataEntityTypesListItem =
  EntityRecognizerMetadataEntityTypesListItem' :: Maybe EntityTypesEvaluationMetrics
-> Maybe Text
-> Maybe Int
-> EntityRecognizerMetadataEntityTypesListItem
EntityRecognizerMetadataEntityTypesListItem'
    { $sel:evaluationMetrics:EntityRecognizerMetadataEntityTypesListItem' :: Maybe EntityTypesEvaluationMetrics
evaluationMetrics =
        Maybe EntityTypesEvaluationMetrics
forall a. Maybe a
Prelude.Nothing,
      $sel:type':EntityRecognizerMetadataEntityTypesListItem' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:numberOfTrainMentions:EntityRecognizerMetadataEntityTypesListItem' :: Maybe Int
numberOfTrainMentions =
        Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Detailed information about the accuracy of the entity recognizer for a
-- specific item on the list of entity types.
entityRecognizerMetadataEntityTypesListItem_evaluationMetrics :: Lens.Lens' EntityRecognizerMetadataEntityTypesListItem (Prelude.Maybe EntityTypesEvaluationMetrics)
entityRecognizerMetadataEntityTypesListItem_evaluationMetrics :: (Maybe EntityTypesEvaluationMetrics
 -> f (Maybe EntityTypesEvaluationMetrics))
-> EntityRecognizerMetadataEntityTypesListItem
-> f EntityRecognizerMetadataEntityTypesListItem
entityRecognizerMetadataEntityTypesListItem_evaluationMetrics = (EntityRecognizerMetadataEntityTypesListItem
 -> Maybe EntityTypesEvaluationMetrics)
-> (EntityRecognizerMetadataEntityTypesListItem
    -> Maybe EntityTypesEvaluationMetrics
    -> EntityRecognizerMetadataEntityTypesListItem)
-> Lens
     EntityRecognizerMetadataEntityTypesListItem
     EntityRecognizerMetadataEntityTypesListItem
     (Maybe EntityTypesEvaluationMetrics)
     (Maybe EntityTypesEvaluationMetrics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerMetadataEntityTypesListItem' {Maybe EntityTypesEvaluationMetrics
evaluationMetrics :: Maybe EntityTypesEvaluationMetrics
$sel:evaluationMetrics:EntityRecognizerMetadataEntityTypesListItem' :: EntityRecognizerMetadataEntityTypesListItem
-> Maybe EntityTypesEvaluationMetrics
evaluationMetrics} -> Maybe EntityTypesEvaluationMetrics
evaluationMetrics) (\s :: EntityRecognizerMetadataEntityTypesListItem
s@EntityRecognizerMetadataEntityTypesListItem' {} Maybe EntityTypesEvaluationMetrics
a -> EntityRecognizerMetadataEntityTypesListItem
s {$sel:evaluationMetrics:EntityRecognizerMetadataEntityTypesListItem' :: Maybe EntityTypesEvaluationMetrics
evaluationMetrics = Maybe EntityTypesEvaluationMetrics
a} :: EntityRecognizerMetadataEntityTypesListItem)

-- | Type of entity from the list of entity types in the metadata of an
-- entity recognizer.
entityRecognizerMetadataEntityTypesListItem_type :: Lens.Lens' EntityRecognizerMetadataEntityTypesListItem (Prelude.Maybe Prelude.Text)
entityRecognizerMetadataEntityTypesListItem_type :: (Maybe Text -> f (Maybe Text))
-> EntityRecognizerMetadataEntityTypesListItem
-> f EntityRecognizerMetadataEntityTypesListItem
entityRecognizerMetadataEntityTypesListItem_type = (EntityRecognizerMetadataEntityTypesListItem -> Maybe Text)
-> (EntityRecognizerMetadataEntityTypesListItem
    -> Maybe Text -> EntityRecognizerMetadataEntityTypesListItem)
-> Lens
     EntityRecognizerMetadataEntityTypesListItem
     EntityRecognizerMetadataEntityTypesListItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerMetadataEntityTypesListItem' {Maybe Text
type' :: Maybe Text
$sel:type':EntityRecognizerMetadataEntityTypesListItem' :: EntityRecognizerMetadataEntityTypesListItem -> Maybe Text
type'} -> Maybe Text
type') (\s :: EntityRecognizerMetadataEntityTypesListItem
s@EntityRecognizerMetadataEntityTypesListItem' {} Maybe Text
a -> EntityRecognizerMetadataEntityTypesListItem
s {$sel:type':EntityRecognizerMetadataEntityTypesListItem' :: Maybe Text
type' = Maybe Text
a} :: EntityRecognizerMetadataEntityTypesListItem)

-- | Indicates the number of times the given entity type was seen in the
-- training data.
entityRecognizerMetadataEntityTypesListItem_numberOfTrainMentions :: Lens.Lens' EntityRecognizerMetadataEntityTypesListItem (Prelude.Maybe Prelude.Int)
entityRecognizerMetadataEntityTypesListItem_numberOfTrainMentions :: (Maybe Int -> f (Maybe Int))
-> EntityRecognizerMetadataEntityTypesListItem
-> f EntityRecognizerMetadataEntityTypesListItem
entityRecognizerMetadataEntityTypesListItem_numberOfTrainMentions = (EntityRecognizerMetadataEntityTypesListItem -> Maybe Int)
-> (EntityRecognizerMetadataEntityTypesListItem
    -> Maybe Int -> EntityRecognizerMetadataEntityTypesListItem)
-> Lens
     EntityRecognizerMetadataEntityTypesListItem
     EntityRecognizerMetadataEntityTypesListItem
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerMetadataEntityTypesListItem' {Maybe Int
numberOfTrainMentions :: Maybe Int
$sel:numberOfTrainMentions:EntityRecognizerMetadataEntityTypesListItem' :: EntityRecognizerMetadataEntityTypesListItem -> Maybe Int
numberOfTrainMentions} -> Maybe Int
numberOfTrainMentions) (\s :: EntityRecognizerMetadataEntityTypesListItem
s@EntityRecognizerMetadataEntityTypesListItem' {} Maybe Int
a -> EntityRecognizerMetadataEntityTypesListItem
s {$sel:numberOfTrainMentions:EntityRecognizerMetadataEntityTypesListItem' :: Maybe Int
numberOfTrainMentions = Maybe Int
a} :: EntityRecognizerMetadataEntityTypesListItem)

instance
  Core.FromJSON
    EntityRecognizerMetadataEntityTypesListItem
  where
  parseJSON :: Value -> Parser EntityRecognizerMetadataEntityTypesListItem
parseJSON =
    String
-> (Object -> Parser EntityRecognizerMetadataEntityTypesListItem)
-> Value
-> Parser EntityRecognizerMetadataEntityTypesListItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EntityRecognizerMetadataEntityTypesListItem"
      ( \Object
x ->
          Maybe EntityTypesEvaluationMetrics
-> Maybe Text
-> Maybe Int
-> EntityRecognizerMetadataEntityTypesListItem
EntityRecognizerMetadataEntityTypesListItem'
            (Maybe EntityTypesEvaluationMetrics
 -> Maybe Text
 -> Maybe Int
 -> EntityRecognizerMetadataEntityTypesListItem)
-> Parser (Maybe EntityTypesEvaluationMetrics)
-> Parser
     (Maybe Text
      -> Maybe Int -> EntityRecognizerMetadataEntityTypesListItem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe EntityTypesEvaluationMetrics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EvaluationMetrics")
              Parser
  (Maybe Text
   -> Maybe Int -> EntityRecognizerMetadataEntityTypesListItem)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int -> EntityRecognizerMetadataEntityTypesListItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
              Parser (Maybe Int -> EntityRecognizerMetadataEntityTypesListItem)
-> Parser (Maybe Int)
-> Parser EntityRecognizerMetadataEntityTypesListItem
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
"NumberOfTrainMentions")
      )

instance
  Prelude.Hashable
    EntityRecognizerMetadataEntityTypesListItem

instance
  Prelude.NFData
    EntityRecognizerMetadataEntityTypesListItem