Logo image
Grape: Grammar-Preserving Rule Embedding
Conference proceeding

Grape: Grammar-Preserving Rule Embedding

Qihao Zhu, Zeyu Sun, Wenjie Zhang, Yingfei Xiong and Lu Zhang
PROCEEDINGS OF THE THIRTY-FIRST INTERNATIONAL JOINT CONFERENCE ON ARTIFICIAL INTELLIGENCE, IJCAI 2022, pp.4545-4551
01/01/2022

Abstract

Computer Science Computer Science, Artificial Intelligence Computer Science, Theory & Methods Science & Technology Technology
Word embedding has been widely used in various areas to boost the performance of the neural models. However, when processing context-free languages, embedding grammar rules with word embedding loses two types of information. One is the structural relationship between the grammar rules, and the other one is the content information of the rule definition. In this paper, we make the first attempt to learn a grammar-preserving rule embedding. We first introduce a novel graph structure to represent the context-free grammar. Then, we apply a Graph Neural Network (GNN) to extract the structural information and use a gating layer to integrate content information. We conducted experiments on six widely-used benchmarks containing four context-free languages. The results show that our approach improves the accuracy of the base model by 0.8 to 6.4 percentage points. Furthermore, Grape also achieves 1.6 F1 score improvement on the method naming task which shows the generality of our approach.

Metrics

1 Record Views

Details

Logo image