Fact-to-text is the NLP task of generating natural language sentences that express specific factual statements — converting structured facts (entity-attribute-value triples, factual records, or knowledge assertions) into grammatically correct, fluent sentences that accurately convey the stated facts.
What Is Fact-to-Text?
- Definition: Generating text that expresses given factual statements.
- Input: Structured facts (triples, key-value pairs, assertions).
- Output: Natural language sentence(s) stating those facts.
- Goal: Accurate, fluent verbalization of factual information.
How Fact-to-Text Differs from General Data-to-Text
- Scope: Facts are typically atomic statements (single assertions).
- Focus: Emphasis on factual accuracy over narrative flow.
- Input: Usually simpler structures (single or few triples).
- Output: Often single sentences or short passages.
- Evaluation: Factual correctness is the primary criterion.
Input Fact Types
Entity-Attribute-Value:
- (Barack Obama, birthDate, 1961-08-04).
- (Python, creator, Guido van Rossum).
- (Silicon, atomicNumber, 14).
RDF Triples:
- (dbr:Paris, dbo:country, dbr:France).
- (dbr:Einstein, dbo:field, dbr:Physics).
Simple Assertions:
- Company X was founded in 2020.
- Product Y costs $99.
Composite Facts:
- Multiple related facts about one entity.
- Example: Einstein was born in Ulm, Germany in 1879. He won the Nobel Prize in Physics in 1921.
Generation Approaches
Template-Based:
- Method: Predefined sentence patterns for each relation type.
- Example: "[Subject] was born on [Date] in [Place]."
- Benefit: Perfect factual accuracy guaranteed.
- Limitation: Repetitive, limited to known relation types.
Neural Generation:
- Method: Seq2Seq/Transformer maps facts to text.
- Training: Parallel corpus of (facts, sentences).
- Benefit: Natural, varied output.
- Challenge: Risk of hallucination (adding unstated facts).
LLM Prompting:
- Method: Provide facts in prompt, instruct to verbalize.
- Technique: "Express these facts in a natural sentence: [facts]."
- Benefit: Strong quality without fine-tuning.
- Challenge: May embellish beyond stated facts.
Constrained Generation:
- Method: Decode text while constraining to express given facts.
- Lexical Constraints: Required words/phrases in output.
- Semantic Constraints: Entailment checking during generation.
- Benefit: Balances fluency with factual accuracy.
Key Challenges
- Factual Faithfulness: Express ALL given facts, add NO extra facts.
- Natural Language: Output should read naturally, not robotically.
- Aggregation: Combine multiple facts into coherent sentences.
- Referring Expressions: Use appropriate pronouns and references.
- Numerical Precision: Preserve exact numbers, dates, quantities.
- Negation: Handle negative facts accurately.
- Rare Entities: Generalize to unseen entity names.
Evaluation Metrics
Factual Accuracy:
- Precision: % of stated facts actually in input.
- Recall: % of input facts expressed in text.
- F1: Harmonic mean of precision and recall.
Text Quality:
- BLEU, METEOR, BERTScore: Similarity to reference text.
- Fluency: Human-rated naturalness.
- Grammaticality: Error-free text.
Faithfulness:
- NLI-based: Does the generated text entail from the facts?
- Fact extraction: Extract facts from generated text, compare with input.
Applications
- Knowledge Base Completion: Verbalize new KB entries.
- Fact-Checking: Generate claims from facts for verification testing.
- Question Answering: Verbalize factual answers from KBs.
- Education: Generate factual quizzes and explanations.
- Data Journalism: Auto-generate factual news from data.
- Chatbots: Provide factual responses from structured backends.
Key Datasets
- WebNLG: RDF triples → text (standard benchmark).
- WikiBio: Wikipedia infobox facts → biography sentences.
- E2E NLG: Meaning representation facts → restaurant descriptions.
- KELM: Knowledge-enhanced language model corpus.
- GenWiki: Wikidata facts → Wikipedia sentences.
Tools & Models
- Models: T5, BART, GPT-4 for fact verbalization.
- Constrained Decoding: NeuroLogic, FUDGE for constrained generation.
- Evaluation: FactCC, DAE for faithfulness checking.
- KG Tools: RDFLib, SPARQLWrapper for fact extraction.
Fact-to-text is the atomic unit of data-to-text generation — getting individual facts right in natural language is the foundation for all more complex data narration tasks, from report generation to knowledge base verbalization to automated journalism.
Explore 500+ Semiconductor & AI Topics
From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.