Fast Methods for Kernel-Based Text Analysis
Paper · 2003 · Taku Kudo and Yuji Matsumoto
Summary
SVMs with polynomial kernels work well for NLP classification because they implicitly consider conjunctions of features, so nobody has to hand-pick them. The drawback is speed. Each decision sums kernel values over every support example, which makes these analyzers far too slow for large text collections. Kudo and Matsumoto restrict attention to binary (set-valued) feature vectors and propose two faster classifiers for the kernel (1 + |X ∩ Y|)^d.
- PKI builds an inverted index from each feature to the support examples that contain it. It gives exactly the same output as the baseline.
- PKE rewrites the kernel in an explicit form with closed-form weights for subsets of each size. This turns the SVM into a linear model over feature combinations. Combinations whose weights are nearly zero are discarded, and the remaining ones are found with an adapted version of the PrefixSpan pattern-mining algorithm.
Tested on three tasks, namely Japanese dependency parsing, English BaseNP chunking and Japanese word segmentation, PKI delivers roughly 2–13× speedups and PKE roughly 30–300×, while accuracy stays practically the same. This makes kernel-quality models usable in high-throughput settings.
Key points
-
The baseline classifier (PKB) costs O(|X|·|SV|). PKI reduces this to O(|X|·B + |SV|), where B is the average number of support examples per feature. PKE costs O(|X|^d) and does not depend on the number of support vectors.
-
Experimental setup:
Task Training examples Support vectors EBC 135,692 11,690 JWS 265,413 57,672 JDP 110,355 34,996 EBC is a multi-class task, so it uses pairwise classifiers combined by majority voting.
-
EBC results: PKE is about 97–105× faster than PKB, with F1 between 93.79 and 93.85 (PKB: 93.84). PKI is 8.3× faster.
-
JWS results: PKE is up to 358× faster, with accuracy of 97.93–97.95% (PKB: 97.94%).
-
JDP results: PKE is 32–67× faster, with accuracy of 88.91–89.29% (PKB: 89.29%). PKI is 12.6× faster.
-
Pruning by feature frequency affects the two Japanese tasks differently:
- JWS: it shrinks the model but costs accuracy (down to 97.83%).
- JDP: it cuts the expanded model from about 8.3M to 2.45M combinations without losing accuracy.
-
The method generalizes Isozaki & Kazawa's XQK, which handles only quadratic kernels and expands combinations exhaustively.
Interesting ideas
- I1. Compile a trained kernel model into a linear one. Precomputing one weight per feature conjunction moves the cost from prediction time to training time. This pays off for any deployed model with many support vectors and sparse binary inputs.
- I2. Use an inverted index over support vectors. The idea is borrowed from information retrieval and needs no approximation. It is a cheap first speedup whenever features are sparse, such as lexical features.
- I3. Treat weight enumeration as frequent-pattern mining. Sorting a set turns it into a sequence, so a sequence miner like PrefixSpan can enumerate useful combinations without a blind exhaustive search. Other pattern-mining tools could be repurposed for model compression in the same way.
- I4. Prune by weight magnitude and report the full trade-off. Dropping near-zero weights via the σ thresholds gives a tunable size/speed/accuracy knob. Reporting speed, model size and accuracy at several thresholds is a good evaluation template for any approximation method.
- I5. Extend the approach to structured kernels. The authors suggest the same expansion could apply to string and tree kernels by pairing them with sub-tree mining.
Institutions
📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 9,086 worksArtificial Intelligence · 8,889 worksArts and Humanities · 9,296 worksLanguage and Linguistics · 9,206 works
Cite
Cite as Taku Kudo and Yuji Matsumoto. 2003. Fast Methods for Kernel-Based Text Analysis. Proceedings of the 41st Annual Meeting of the Association for Computational Linguistics.
@inproceedings{kudo2003fast,
title = {{Fast Methods for Kernel-Based Text Analysis}},
author = {Taku Kudo and Yuji Matsumoto},
booktitle = {Proceedings of the 41st Annual Meeting of the Association for Computational Linguistics},
year = {2003},
doi = {10.3115/1075096.1075100},
url = {https://doi.org/10.3115/1075096.1075100}
}References
- Junichi Aoe. 1989. An efficient digital search algorithm by using a double-array structure. IEEE Transactions on Software Engineering, 15(9). find
- Michael Collins and Nigel Duffy. 2001. Convolution kernels for natural language. In Advances in Neural Information Processing Systems 14, Vol.1 (NIPS 2001), pages 625–632. find
- Hideki Isozaki and Hideto Kazawa. 2002. Efficient support vector classifiers for named entity recognition. In Proceedings of the COLING-2002, pages 390–396. find
- Hisashi Kashima and Teruo Koyanagi. 2002. Svm kernels for semi-structured data. In Proceedings of the ICML-2002, pages 291–298. find
- Taku Kudo and Yuji Matsumoto. 2000. Japanese Dependency Structure Analysis based on Support Vector Machines. In Proceedings of the EMNLP/VLC-2000, pages 18–25. find
- Taku Kudo and Yuji Matsumoto. 2001. Chunking with support vector machines. In Proceedings of the the NAACL, pages 192–199.
- Taku Kudo and Yuji Matsumoto. 2002. Japanese dependency analyisis using cascaded chunking. In Proceedings of the CoNLL-2002, pages 63–69. find
- Sadao Kurohashi and Makoto Nagao. 1997. Kyoto University text corpus project. In Proceedings of the ANLP-1997, pages 115–118. find
- Huma Lodhi, Craig Saunders, John Shawe-Taylor, Nello Cristianini, and Chris Watkins. 2002. Text classification using string kernels. Journal of Machine Learning Research, 2. find
- Tetsuji Nakagawa, Taku Kudo, and Yuji Matsumoto. 2002. Revision learning and its application to part-of-speech tagging. In Proceedings of the ACL 2002, pages 497–504. find
- Jian Pei, Jiawei Han, and et al. 2001. Prefixspan: Mining sequential patterns by prefix-projected growth. In Proc. of International Conference of Data Engineering, pages 215– 224. find
- Lance A. Ramshaw and Mitchell P. Marcus. 1995. Text chunking using transformation-based learning. In Proceedings of the VLC, pages 88–94.
- Vladimir N. Vapnik. 1995. The Nature of Statistical Learning Theory. Springer. find
- Mohammed Zaki. 2002. Efficiently mining frequent trees in a forest. In Proceedings of the 8th International Conference on Knowledge Discovery and Data Mining KDD, pages 71– 80. find
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/kudo-2003-fast-methods-kernel-based-text/