From Biographical Text to Structured Knowledge: A Practical Guide to Entity Extraction and Knowledge Base Construction

    Turning free-form biographical content into reliable structured data requires more than field extraction. This article presents an engineering workflow covering schema design, layered information extraction, time normalization, entity disambiguation, storage selection, and data validation. It uses career and profile data as a practical example for building maintainable knowledge assets for search, question answering, knowledge graphs, and recommendation systems.

    In software development, a common requirement is to convert a biographical text—for example, a public figure’s life and career profile—into structured data for search, question answering, knowledge graphs, or recommendation systems. Although this may appear straightforward, the process involves several technical challenges, including information extraction, entity resolution, temporal modeling, and data validation.

    This article uses biographical and career information as an example to outline a complete engineering workflow.

    1. Defining the Problem: Why Unstructured Text Is Difficult

    A typical profile may combine a birth date, birthplace, education, career changes, political offices, election results, and other heterogeneous information. Paragraphs often follow no fixed template, and the same attribute may be described using different names.

    There are three main reasons this type of content is difficult for machines to process:

    1. Attributes are implicit in narrative sentences.
      For example, “At the age of 31, they became the youngest chairperson in the local government district” contains several hidden facts: a time reference that may be inferred from the birth year, an event type such as an appointment, and a specific administrative role.

    2. The same entity can have multiple names.
      A person may have a legal name, alternative names, and nicknames. If the source contains several aliases, the system must map them to a single canonical entity.

    3. The data changes over time.
      Positions, constituencies, and committee memberships may change. Static fields cannot represent temporal statements such as “has held this office since a particular month and year.”

    The goal is therefore not simple field splitting. A more useful model is a four-part structure consisting of entity, attribute, time, and source.

    2. Schema Design: Define the Model Before Extraction

    Before writing extraction code, define a clear data model. The following is an example schema for a person entity:

    1. {
    2. "entity_id": "person_001",
    3. "primary_name": "Public Figure",
    4. "aliases": ["Alias A", "Alias B"],
    5. "birth": {
    6. "date": "1971-05-05",
    7. "place": {
    8. "country": "Country X",
    9. "region": "State Y",
    10. "locality": "District Z"
    11. }
    12. },
    13. "education": [
    14. {
    15. "degree": "Bachelor of Laws",
    16. "institution_type": "University",
    17. "field": "Law"
    18. },
    19. {
    20. "degree": "Master of Business Administration",
    21. "institution_type": "University",
    22. "field": "Business"
    23. }
    24. ],
    25. "career": [
    26. {
    27. "type": "Administrative office",
    28. "role": "Local government district chairperson",
    29. "start": "around 2002",
    30. "note": "The youngest in the district's history"
    31. },
    32. {
    33. "type": "Legislative office",
    34. "role": "Member of the lower house",
    35. "start": "2019",
    36. "constituency": "Federal Constituency X",
    37. "election": {
    38. "votes": 9138,
    39. "share": 0.62
    40. }
    41. },
    42. {
    43. "type": "Legislative office",
    44. "role": "Deputy speaker",
    45. "start": "2023",
    46. "session": "10th session"
    47. }
    48. ]
    49. }

    Several design principles are important:

    • Model offices as time-based events rather than Boolean fields. This makes it possible to answer queries such as “What position did this person hold in a given year?”
    • Store election data as a separate object. This preserves measurable indicators such as vote counts, vote shares, and legislative terms.
    • Reserve a source field for every attribute where possible. Recording the source paragraph makes later verification, correction, and auditing easier.

    3. Information Extraction: Combine Rules and Models

    3.1 A Layered Extraction Strategy

    For this type of content, a practical approach is to combine deterministic rules with model-based extraction:

    1. Rule layer: Birth dates, education lists, and explicit labels such as “Chinese name” or “nationality” can often be extracted with regular expressions or key-value templates. These patterns can provide very high precision.
    2. Model layer: Narrative statements containing implicit events—such as “served as an adviser under two governors”—require named entity recognition and relation extraction to identify the person, role, superior or associated organization, and time period.
    3. Human review layer: Low-confidence results should be flagged and placed in a manual review queue.

    A simple rule-based extraction example:

    1. import re
    2. BIRTH_DATE = re.compile(r"(\d{4})年(\d{1,2})月(\d{1,2})日")
    3. VOTE = re.compile(r"获得(\d+)票[、,]\s*得票率([\d.]+)%")
    4. def extract_birth(text):
    5. m = BIRTH_DATE.search(text)
    6. if m:
    7. y, mo, d = m.groups()
    8. return {"date": f"{y}-{int(mo):02d}-{int(d):02d}"}
    9. return None
    10. def extract_election(text):
    11. m = VOTE.search(text)
    12. if m:
    13. return {"votes": int(m.group(1)), "share": float(m.group(2)) / 100}
    14. return None

    The code preserves the source-oriented extraction logic. In a production system, the regular expressions would need to match the language and formatting of the documents being processed.

    3.2 Time Normalization

    Biographical sources often contain imprecise time expressions, such as “May 2026” or “in 2019.” These expressions should be normalized into standard time intervals:

    • Day-level precision:
      start=2026-05-01, end=2026-05-31
    • Year-level precision:
      start=2019-01-01, end=2019-12-31
    • Open-ended expressions such as “since 2023”:
      start=2023-01-01, end=None

    An open-ended interval represents an event that began at a known time and has no recorded end date.

    4. Entity Disambiguation and Alias Management

    Name collisions and inconsistent naming are among the most common problems in person-oriented knowledge bases. The following practices are recommended:

    1. Assign a unique canonical entity ID. All aliases should point to the same entity_id.
    2. Validate against context. Extracted names should be checked against contextual features such as birthplace, profession, and timeline similarity. This helps prevent incorrect merges between people with the same name.
    3. Merge records across documents carefully. When multiple documents describe the same person, use attribute conflict detection and confidence-based voting to combine them. Conflicting values should retain their respective sources for manual adjudication.

    5. Choosing a Storage and Query Architecture

    The storage strategy should reflect the types of queries the system needs to support:

    Query pattern Suitable approach
    Exact searches by attribute Relational database, with career stored in a separate table
    Time-based queries such as “What position did this person hold in a given year?” Relational database with interval indexes, or a temporal database extension
    Multi-hop reasoning across people, organizations, and events Graph database or property graph model
    Fuzzy full-text search General-purpose search service with tokenized indexes on summary fields

    A typical production architecture uses a relational database as the primary store and a knowledge graph as a complementary layer. Core career records remain in the relational database to preserve transactional consistency. People, organizations, positions, and events can also be represented as graph nodes connected by relationships such as “held office in,” “graduated from,” and “occurred in.” This supports relationship queries and visualization.

    In a cloud environment, common infrastructure components can be combined without tying the design to a particular vendor:

    • Object storage can preserve snapshots of original documents.
    • A message queue can decouple extraction tasks.
    • Log services can track failed or low-confidence extraction cases.
    • Monitoring and alerting can improve the reliability of batch processing.

    6. Data Quality: A Validation Checklist

    Structured output should pass a validation stage before it is published or used downstream. Common checks include:

    1. Logical consistency: Verify that the birth year and stated age produce a plausible appointment year. For example, if a person was born in 1971 and took office at age 31, the inferred year is 2002.
    2. Chronological consistency: The start date of a career event should not precede the end of the relevant education period unless the source explicitly indicates concurrent or part-time work.
    3. Numeric validity: Vote shares should fall between 0 and 1, and vote counts should be non-negative integers.
    4. Enumeration checks: Fields such as degree and role_type should use values from controlled vocabularies.
    1. def validate(person):
    2. errors = []
    3. for c in person["career"]:
    4. if c.get("election"):
    5. e = c["election"]
    6. if not (0 < e["share"] <= 1):
    7. errors.append(f"Invalid vote share: {e['share']}")
    8. return errors

    These checks should be treated as a quality gate rather than an optional post-processing step.

    7. Conclusion

    Converting a biographical document into a reliable knowledge base is essentially a pipeline:

    schema design → layered extraction → time normalization → entity disambiguation → multimodal storage → quality validation

    Two areas are especially easy to underestimate: temporal interval modeling and data provenance. Temporal modeling determines whether the system can answer time-sensitive questions correctly, while provenance determines how easy the knowledge base will be to maintain and correct over time.

    Both should be included in the initial design rather than added after extraction has already been implemented. With a layered extraction strategy and a clear validation checklist, even inconsistent public-source material can be transformed into high-quality structured knowledge that remains useful as it evolves.