Abstract
Keywords are a subset of words or phrases from a document that can describe the meaning of the document. Many text mining applications can take advantage of them. Unfortunately, a large portion of documents still do not have keywords assigned. On the other hand, manual assignment of high-quality keywords is expensive, time-consuming, and error-prone. Therefore, most algorithms and systems aimed to help people perform automatic keywords extraction have been proposed. Conditional Random Fields (CRF) model is a state-of-the-art sequence labeling method, which can use the features of documents more sufficiently and effectively. At the same time, keywords extraction can be considered as string labeling. In this paper, keywords extraction based on CRF is proposed and implemented. Experimental results show that the CRF model outperforms other machine learning methods such as support vector machine, multiple linear regression model etc. in the task of keywords extraction.
Introduction
Automatic Keyword Extraction (AKE) is a critical task in natural language processing, facilitating document indexing, summarization, and categorization. While manual tagging remains the gold standard, its cost and inconsistency necessitate automated solutions. Traditional AKE methods often treat the problem as a binary classification task—deciding whether a candidate word is a keyword or not. However, this approach frequently ignores the sequential dependencies and contextual relationships between words. This paper proposes reframing AKE as a sequence labeling problem, utilizing Conditional Random Fields (CRFs) to capture both local linguistic features and global document structure.
Methodology
The CRF Model
Unlike generative models such as Hidden Markov Models (HMMs), CRFs are discriminative undirected graphical models. They allow for the inclusion of a large number of overlapping, non-independent features without the need for strict independence assumptions. In the context of AKE, the model predicts a sequence of labels (e.g., Beginning, Inside, or Outside of a keyword) for a given sequence of words.
System Architecture and Implementation
The proposed system follows a structured pipeline: preprocessing, feature extraction, model training, and labeling. For Chinese text, preprocessing involves word segmentation and Part-of-Speech (POS) tagging using the SegTag tool. The keyword extraction was implemented using the CRF++ toolkit, employing a labeling scheme (KW_B for beginning, KW_I for inside, KW_S for non-keywords) to identify multi-word phrases.
Feature Engineering
The model utilizes three primary feature categories:
- Local Context: Includes the current word, its length, POS tags, and a five-word surrounding window.
- Global Context: Indicators for word appearance in specific document sections (title, abstract, headings, first/last paragraphs, and references). A key feature is DEP, representing the position of a word's first appearance.
- Hybrid Features: Bigrams of neighboring words to capture local phrase structures.
Experimental Setup
The study utilized a corpus of 600 academic economics documents from the Information Center for Social Sciences of RUC. Each document contains a title, abstract, full text, and references, with an average of 7.83 manually assigned keywords. Performance was evaluated using 10-fold cross-validation against several baselines, including Support Vector Machines (SVM), Multiple Linear Regression (MLR), and Logistic Regression.
Results and Discussion
The CRF model demonstrated superior performance, achieving an F1-measure of 0.5125, significantly higher than the SVM (0.4653) and Logistic Regression (0.4067). While the SVM exhibited higher precision (0.8017), its recall was notably low (0.3327). The CRF model provided a more balanced performance (Precision: 0.6637, Recall: 0.4196).
Furthermore, the CRF model proved highly data-efficient. When trained on only 50 documents, it achieved an F1-score of 0.4732, outperforming most other models trained on the full dataset. The inclusion of global features, particularly the DEP feature, was found to be highly predictive, improving baseline performance by over 4 percentage points. The authors also noted that while the quality of the word segmentation lexicon impacts results, the CRF model remains robust even with general dictionaries.
Conclusion
This research demonstrates that treating keyword extraction as a sequence labeling task using CRFs is highly effective. By leveraging both local and global document context, the CRF model outperforms traditional classification-based machine learning methods. Future work will focus on incorporating semantic relations to improve recall and testing the model on less structured corpora like web pages and emails.
Summary updated