# This file was auto-generated by Fern from our API Definition.

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from .sentiment_scores import SentimentScores
import typing_extensions
from .named_entity_list import NamedEntityList
from ..core.serialization import FieldMetadata
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class NlpDataEntity(UniversalBaseModel):
    """
    Natural Language Processing data for the article.
    """

    theme: typing.Optional[str] = pydantic.Field(default=None)
    """
    The themes or categories identified in the article.
    """

    summary: typing.Optional[str] = pydantic.Field(default=None)
    """
    A brief AI-generated summary of the article content.
    """

    sentiment: typing.Optional[SentimentScores] = None
    new_embedding: typing.Optional[typing.List[float]] = pydantic.Field(default=None)
    """
    A dense 1024-dimensional vector representation of the article content, generated using  the [multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large) model.
    
    **Note**: The `new_embedding` field is only available in the `v3_local_news_nlp_embeddings` subscription plan.
    """

    ner_per: typing_extensions.Annotated[typing.Optional[NamedEntityList], FieldMetadata(alias="ner_PER")] = (
        pydantic.Field(default=None)
    )
    """
    Named Entity Recognition for person entities (individuals' names).
    """

    ner_org: typing_extensions.Annotated[typing.Optional[NamedEntityList], FieldMetadata(alias="ner_ORG")] = (
        pydantic.Field(default=None)
    )
    """
    Named Entity Recognition for organization entities (company names, institutions).
    """

    ner_misc: typing_extensions.Annotated[typing.Optional[NamedEntityList], FieldMetadata(alias="ner_MISC")] = (
        pydantic.Field(default=None)
    )
    """
    Named Entity Recognition for miscellaneous entities (events, nationalities, products).
    """

    ner_loc: typing_extensions.Annotated[typing.Optional[NamedEntityList], FieldMetadata(alias="ner_LOC")] = (
        pydantic.Field(default=None)
    )
    """
    Named Entity Recognition for location entities (cities, countries, geographic features).
    """

    iptc_tags_name: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    IPTC media topic taxonomy paths identified in the article content. Each path represents a hierarchical category following the IPTC standard.
    """

    iptc_tags_id: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    IPTC media topic numeric codes identified in the article content. These codes correspond to the standardized IPTC media topic taxonomy.
    """

    iab_tags_name: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    IAB content taxonomy paths identified in the article content. Each path represents a hierarchical category following the IAB content standard.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
