Skip to main content
QUICK REVIEW

[Paper Review] Building Language Models for Text with Named Entities

Rizwan Parvez, Saikat Chakraborty|arXiv (Cornell University)|May 13, 2018
Topic ModelingComputer Science17 references7 citations
TL;DR

This paper proposes a discriminative neural language model that improves prediction of named entities by leveraging their entity type information, reducing vocabulary size and enhancing accuracy. By jointly modeling entity types and specific names, the approach achieves 52.2% lower perplexity in recipe generation and 22.06% lower perplexity in code generation than state-of-the-art models.

ABSTRACT

Text in many domains involves a significant amount of named entities. Predict- ing the entity names is often challenging for a language model as they appear less frequent on the training corpus. In this paper, we propose a novel and effective approach to building a discriminative language model which can learn the entity names by leveraging their entity type information. We also introduce two benchmark datasets based on recipes and Java programming codes, on which we evalu- ate the proposed model. Experimental re- sults show that our model achieves 52.2% better perplexity in recipe generation and 22.06% on code generation than the state-of-the-art language models.

Motivation & Objective

  • To address the challenge of poor named entity prediction in language models due to low-frequency entity names in training data.
  • To improve language modeling performance in domains rich in named entities, such as recipes and source code.
  • To design a model that leverages deterministic entity type information to reduce vocabulary size and improve prediction accuracy.
  • To establish new benchmarks for entity-rich text generation using curated recipe and code datasets.
  • To demonstrate that type-aware modeling captures intrinsic text patterns better than standard neural language models.

Proposed method

  • The model uses a two-stage architecture: a Type Model that predicts the entity type of the next word based on context.
  • The Type Model reduces vocabulary size by treating all entities of the same type as equivalent, improving generalization.
  • An Entity Composite Model then predicts the actual entity name using the predicted type as a prior, estimating conditional probability over candidate names.
  • The system performs joint inference over both models to generate contextually and type-consistent entity names.
  • Entity type information is extracted from ontologies or static type systems (e.g., in Java ASTs) to enable scalable and accurate type labeling.
  • The model is trained end-to-end with cross-entropy loss, using context and type as inputs to predict the next word.

Experimental results

Research questions

  • RQ1Can leveraging entity type information significantly improve language model performance on low-frequency named entities?
  • RQ2Does a type-aware language model outperform standard neural language models in entity-rich domains like recipes and code?
  • RQ3To what extent does type information help capture global structural patterns in code beyond local context?
  • RQ4How does performance improvement vary with the training frequency of named entities?
  • RQ5Can a joint modeling approach of type and entity name prediction achieve better perplexity than models with added type features?

Key findings

  • The proposed model achieves 52.2% lower perplexity on recipe generation compared to state-of-the-art models.
  • In code generation, the model reduces perplexity by 22.06% compared to the SOTA baseline.
  • For low-frequency ingredients like 'Apple' and 'Tomato', the model shows over 50 percentage point improvement in accuracy on the MCQ task.
  • The model’s performance gain is inversely proportional to entity training frequency, indicating stronger gains for rare entities.
  • The Type Model alone improves prediction accuracy due to reduced vocabulary size and better generalization.
  • Even with only local context, the model captures global code patterns effectively, achieving lower perplexity than SLP-Core (2.65 vs. 3.40).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.