Modeling and Retrieval of a Film and TV Personality Database: A Practical Guide

    This article walks through the data modeling and retrieval practices behind a film and TV personality database, using a cast aggregation page for the 1974 sci-fi film Kronos as the source material. It covers entity and relationship extraction, fault-tolerant handling of inconsistent time expressions, multi-route retrieval with weighted ranking, data quality governance for truncated and ambiguous records, a layered deployment architecture, and validation through a small labeled query set. Readers will learn how to turn unstructured entertainment text into a data model that supports multi-dimensional search and relationship reasoning.

    1. What a Cast List Page Reveals About Data Structure

    The source material is an aggregated cast page for the 1974 sci-fi film Kronos. Its layout is typical: the heading claims 24 entries, but the body expands only four profiles. Each profile includes name, original-language name, birth and death dates, birthplace, professional roles, active years, and a sequence of representative works, ending with a truncated fragment of text. Read count and entry count are displayed side by side, which indicates an index page generated by aggregating entries rather than a manually written long-form article.

    From an engineering standpoint, this kind of page has three clear characteristics:

    1. High entity density but inconsistent structure. Local and translated names coexist, original and Chinese titles coexist, and field order varies between entries.
    2. Time is a core dimension. Birth, death, debut year, work release year, and active-year ranges all appear at different granularities (exact day, exact year, or fuzzy values such as “after the 90s”).
    3. Content is incomplete. Truncation, missing fields, and absent disambiguation for identical names are the norm, so parsing must be designed to tolerate errors rather than assume clean input.

    The real problem, then, is not “how to display a cast list” but how to reliably convert unstructured film and TV personality text into a data model that supports multi-dimensional retrieval and relationship reasoning.

    2. Entity and Relationship Extraction: Define Before Implementing

    Entity boundaries must be settled before modeling. The film and TV domain typically abstracts five core entity types:

    • Person: natural persons such as actors, directors, and screenwriters.
    • Title: films, series, and franchises.
    • Character: the specific role a person plays in a title. A character is not the same as a person.
    • Organization: production companies, theaters, schools, and similar groups.
    • Event: state changes tied to a point in time, such as death, emigration, or debut.

    The relationship layer includes: appearing in (Person—Title, with role attributes), playing (a Person—Character—Title ternary relationship), employment (Person—Organization, with position and time), and creation (Person—Title, with a creation type such as screenwriter or director).

    A common mistake is collapsing “played a character” into a binary edge between person and title, which later makes it impossible to answer questions like “how many distinct characters did this actor play within the same franchise.” A schematic structure like the following is recommended:

    1. Person(id, name_local, name_translated, birth_date, death_date, birthplace, gender)
    2. Title(id, title_local, title_translated, type, release_year, series_id)
    3. Character(id, name, series_id)
    4. Role(person_id, character_id, title_id, role_type, start_year, end_year, is_series)
    5. Credit(person_id, title_id, credit_type) # director/screenwriter/actor

    Separating Role from Credit matters because performance contributions need a character dimension while off-screen contributions do not; merging them into one table produces a large number of null values.

    3. Modeling the Time Dimension with Fault Tolerance

    Time expressions in the source text are highly inconsistent: “October 4, 1935”, “August 17, 1946 - May 27, 2021”, “from the 1960s onward”, “moved into television after the 90s”, and “continued acting through 2022”. Forcing all of these into a DATE field either loses fuzzy information or writes incorrect values.

    A more robust engineering approach is dual-column storage: one normalized time column (nullable) and one raw text column, plus a precision marker.

    1. ALTER TABLE Person ADD COLUMN birth_date_raw TEXT;
    2. ALTER TABLE Person ADD COLUMN birth_precision TEXT; -- day/year/decade/unknown

    The precision marker drives retrieval strategy: exact dates support age calculation and sorting, while decade-level information supports filtering by active period. Interval-based relationships (active years, employment periods) are best expressed as a closed interval [start, end], with a null end meaning “present”. This turns “who was active in a given year” into a standard interval-containment query.

    4. Retrieval and Ranking: From String Matching to Multi-Route Recall

    The essential need behind an aggregation page is fast entry lookup, so the retrieval layer should combine multi-route recall with unified ranking:

    • Exact route: normalized equality matching on original and translated names (trim whitespace, unify case, normalize full-width and half-width characters).
    • Fuzzy route: edit distance or n-gram similarity to handle translation variants and input noise.
    • Relationship route: match the title first, then expand to its cast, which fits the “I remember the film but forgot the actor” scenario.
    • Time route: filter by year or decade to narrow the candidate set.

    Ranking should not rely on text similarity alone; it can blend signals such as entry completeness, number of relationships, and temporal proximity:

    1. score = 0.55 * text_sim
    2. + 0.20 * completeness
    3. + 0.15 * relation_degree
    4. + 0.10 * recency

    Here completeness can be approximated as “filled fields / expected fields”, and relation_degree takes the number of titles linked to the person with logarithmic compression, so prolific actors do not permanently dominate the top results.

    5. Data Quality Governance: Common Pitfalls of Aggregation Pages

    The source material already exposes several typical defects, with corresponding remedies:

    1. Truncated content. Run completeness checks before ingestion; entries with abnormal field length or unclosed sentences go into a pending-completion queue and are not shown publicly.
    2. Identical names and translation ambiguity. Use “local name + birth date + birthplace” as the uniqueness combination for a person to avoid merging different people with the same name.
    3. Confusion between titles and series. Model a series as its own entity and attach individual seasons and episodes via series_id, so “Season 1” is not treated as a standalone film.
    4. Inconsistent counting. The page claims 24 entries but expands only 4, showing that the count and the content come from different sources. Counts should be aggregated in real time by the data layer, never hard-coded.
    5. Multi-valued professions. One person can be an actor, screenwriter, and novelist at once, so the profession field must be multi-valued rather than a single enumeration.

    A runnable minimal solution usually has four layers: an ingestion layer for multi-source crawling and deduplication; a parsing layer for entity recognition, field extraction, and normalization; a storage layer using a relational database for strongly consistent relationship queries and a search engine for fuzzy recall; and a service layer exposing entry details, relationship graphs, and filtering APIs. As data volume grows, cold data can be moved to object storage, a message queue can decouple parsing from ingestion, and logging and monitoring with alerting can track the parsing failure rate.

    On Baidu AI Cloud, these layers can map to general-purpose capabilities such as object storage, message queues, container platforms, and logging and monitoring; the design can be ported without binding to specific interfaces.

    7. Validation and Iteration

    Build a small labeled set covering four query types: exact match, translation variants, fuzzy input, and interval filtering, and measure recall and top-hit rate for each. After every change to weights or cleaning rules, run regression tests to avoid “fixing one entry while breaking a batch of retrievals.” The payoff of a data project ultimately shows up in two continuously observable metrics, retrieval hit rate and entry completeness, not in whether the page looks rich.