Abstract
Knowledge is captured in the form of entities and their relationships and stored in knowledge graphs. Knowledge graphs enhance the capabilities of applications in many different areas including Web search, recommendation, and natural language understanding. This is mainly because, entities enable machines to understand things that go beyond simple tokens. Many modern algorithms use learned entity embeddings from these structured representations. However, building a knowledge graph takes time and effort, hence very costly and nontrivial. On the other hand, many Web sources describe entities in some structured format and therefore, finding ways to get them into useful entity knowledge is advantageous. We propose an approach that processes entity centric textual knowledge sources to learn entity embeddings and in turn avoids the need for a traditional knowledge graph. We first extract triples into the new representation format that does not use traditional complex triple extraction methods defined by pre-determined relationship labels. Then we learn entity embeddings through this new type of triples. We show that the embeddings learned from our approach are: (i) high quality and comparable to a known knowledge graph-based embeddings and can be used to improve them further, (ii) better than a contextual language model-based entity embeddings, and (iii) easy to compute and versatile in domain-specific applications where a knowledge graph is not readily available.
Introduction
Modern AI applications—from web search to recommendation engines—rely on entity embeddings, which are numerical representations of "things" (people, places, concepts). Traditionally, these embeddings are learned from Knowledge Graphs (KGs) like Freebase or DBpedia. However, KGs suffer from a significant bottleneck: they are incredibly costly to build—with some estimates reaching billions of dollars—and are often incomplete.
To address this, we introduce the Entity Context Graph (ECG), a method to learn powerful entity embeddings directly from semi-structured web sources like Wikipedia or product reviews. By treating the text between entity mentions as a dynamic relationship, we bypass the need for a predefined schema or a curated graph.
Methodology
The proposed framework consists of two primary stages: extracting context triples from semi-structured text and learning embeddings using a specialized neural network.
Context Triple Extraction
Instead of searching for specific, pre-labeled relationships (e.g., born_in), the system identifies a Primary Entity (the subject of a page) and Secondary Entities mentioned within the descriptive text. The text surrounding the secondary entity is treated as the "relationship," forming a "context triple": (Primary Entity, Textual Context, Secondary Entity). This approach is highly flexible as it does not require a fixed set of relationship labels.
Embedding Learning with a CNN Encoder
To transform these text-heavy triples into vector representations, we adapt the TransE algorithm. While traditional TransE uses a simple lookup table for relationships, ECG employs a Multi-layer Convolutional Neural Network (CNN). This CNN encodes variable-length relationship text into a fixed-size vector. The model is trained to ensure that the translational property Head + Relation ≈ Tail holds true in the embedding space.
Datasets and Evaluation
The approach was evaluated across diverse datasets:
- General Knowledge: FB15k (Freebase sample) and WN18 (WordNet), using Wikipedia and WordNet definitions as sources.
- Domain-Specific: Amazon product reviews, where "users" and "product aspects" (e.g., battery life) were treated as entities, and review text served as the relationship context.
Key Results and Insights
- Link Prediction: On the FB15k dataset, the ECG approach achieved 70% Hits@10, significantly outperforming the original TransE's 47.1%.
- Entity Classification: ECG embeddings consistently outperformed ERNIE, a high-profile transformer-based model, in classification tasks (e.g., labeling city quality of life), demonstrating that graph-based context is superior to pure language modeling for entity-centric tasks.
- Text as a First-Class Relation: Raw text acts as a more flexible relationship than rigid labels. A single context triple can capture complex "n-ary" relationships (involving dates, locations, and roles) that would typically require multiple complex links in a traditional KG.
- Complementary Strengths: ECGs can improve existing KGs. Joint training on both structured KG triples and textual ECG triples yielded better results than using either in isolation.
Conclusion and Future Work
While the ECG approach shows high precision (Hits@10), the relatively high Mean Rank suggests sensitivity to noise in uncurated web text. Future work will explore incorporating attention mechanisms or dependency parsing to better identify relevant context within long sentences. Despite these challenges, the schema-less nature of ECG makes it a versatile tool for niche domains where traditional knowledge graphs are unavailable.
Summary updated