from typing import Literalfrom chatlas import ChatOpenAIfrom pydantic import BaseModel, Fieldimport pandas as pdtext ="The new quantum computing breakthrough could revolutionize the tech industry."class Classification(BaseModel): name: Literal["Politics", "Sports", "Technology", "Entertainment", "Business", "Other" ] = Field(description="The category name") score: float= Field( description="The classification score for the category, ranging from 0.0 to 1.0." )class Classifications(BaseModel):"""Array of classification results. The scores should sum to 1.""" classifications: list[Classification]chat = ChatOpenAI()data = chat.extract_data(text, data_model=Classifications)pd.DataFrame(data["classifications"])