Query encoding (QE) is proposed as a fast and robust solution to CQA. In the encoding process, most existing QE methods first parse the logical query into an executable computational direct-acyclic graph (DAG), then use neural networks to parameterize the operators, and finally, recursively execute these neuralized operators. However, the parameterization-and-execution paradigm may be potentially over-complicated, as it can be structurally simplified by a single neural network encoder. Meanwhile, sequence encoders, like LSTM and Transformer, proved to be effective for encoding semantic graphs in related tasks. Motivated by this, we propose sequential query encoding (SQE) as an alternative to encode queries for CQA. Instead of parameterizing and executing the computational graph, SQE first uses a search-based algorithm to linearize the computational graph to a sequence of tokens and then uses a sequence encoder to compute its vector representation. Then this vector representation is used as a query embedding to retrieve answers from the embedding space according to similarity scores. Despite its simplicity, SQE demonstrates state-of-the-art neural query encoding performance on FB15k, FB15k-237, and NELL on an extended benchmark including twenty-nine types of in-distribution queries. Further experiment shows that SQE also demonstrates comparable knowledge inference capability on out-of-distribution queries, whose query types are not observed during the training process.
翻译:查询编码( QE) 是为 CQA 提议的一个快速和稳健的解决方案 。 在编码过程中, 多数现有的 QE 方法首先将逻辑查询解析为可执行的计算直接循环图形( DAG), 然后使用神经网络来参数化操作者, 最后, 循环执行这些神经化操作者。 然而, 参数化和执行模式可能过于复杂, 因为它可以通过单一的神经网络编码器进行结构简化。 同时, 排序编码器, 如 LSTM 和变换器, 证明在相关任务中对编码语义查询有效。 受此驱动, 我们提出顺序查询编码( SQE ), 作为CQA 代码查询的替代。 而不是参数化和执行计算图表, SQE 首先使用基于搜索的算法将计算图表线化成一个符号序列, 然后使用序列编码器来解析其矢量表示其矢量代表。 然后, 这个矢量表示在S- 23 轨迹中进行查询, 包括SQLLE 测试的简单性测试, 在SQLO 中, 在SQLE 中显示类似的SQLE 的测试中, 。</s>