Giter Site home page Giter Site logo

nl2lf's Introduction

NL2LF

(持续更新中...)

The Resources for "Natural Language to Logical Form" Research;
"自然语言转逻辑形式"研究资料收集: 本阶段主要以NL2SQL的研究为主, 主要包括评测公开数据集、相关论文和部分代码实现、相关博客或公众号文章。

NL2SQL
一、主要评测数据集 dataset
二、主要论文方法及代码实现 papers&code
    1. WikiSQL
    2. Spider
三、相关资源扩展 extend-resources
    1. RelatedWorks
    2. SQL2Seq
    3. 图神经网络 GNN

NL2SQL & Text2SQL

一、主要评测数据集(DataSet)









二、主要论文方法及代码实现(Papers&Code)

论文主要以WikiSQL和Spider为评测数据,相应排行榜详见任务主页。
下面主要整理具有代表性的方法,持续更新补充...
注: score表示 | model | Dev accuracy | Test accuracy |,WikiSQL表示执行准确率,Spider表示逻辑准确率,且不包括值预测。

1. WikiSQL:

Weakly Supervised

采用弱监督方法,即不使用sql的逻辑形式作为监督信号。

Paper

Code

Score

Hard-EM 84.4 83.9
MeRL 74.9 74.8
MAPO 72.2 72.1

ExecutionGuided

Execution Guided 可以在解码阶段通过执行错误对生成sql的项进行修正,从而过滤了一些不符合实际的sql语句。主要分为三类执行错误:1)句法解析错误,即生成的sql语法错误。2)执行失败。常见的run-time error, 例如SUM( ) 和比较string类型的数据;3)假设执行结果不为空,则空查询的条件错误。例如条件值实际并不存在于预测的列中, 因此会去 Beam Search 实际包含条件值的列。

Paper

Code

Score

Coarse2Fine + EG 84.0 83.8
Coarse2Fine 79.0 78.5
Pointer-SQL + EG 78.4 78.3
Pointer-SQL 72.5 71.9

SQLNet Framework

设计了一种满足SQL语法的框架, 在这样的语法框架内,只需要预测并填充相应的槽位。 语法框架为:

SELECT $AGG $COLUMN
WHERE $COLUMN $OP $VALUE
(AND $COLUMN $OP $VALUE)*

在这基础上去完成不同的联合任务的分类预测:

  1. select-column, 选择的列
  2. select-aggregation, 聚合操作类型
  3. where-number, where条件语句的数量
  4. where-column, where条件中的列
  5. where-operator, where条件操作类型('<','=','>')
  6. where-value, where条件值

Paper

Code

Score

BERT-XSQL-Attention + EG 92.3 91.8
BERT-XSQL-Attention 89.5 88.7
BERT-SQLova-LSTM 87.2 86.2
BERT-SQLova-LSTM + EG 90.2 89.6
GloVe-SQLNet-BiLSTM 69.8 68.0

Model Interactive

基于用户交互的语义解析,更偏向于落地实践。在生成sql后,通过自然语句生成来进一步要求用户进行意图澄清,从而对sql进行修正。

Blog

Paper

Code


2. Spider:

GNN Encoding Seq2Seq

利用多表关联信息来建立一个表名、列名为节点,表内、表间关系为边的图。 通过GNN方法计算每一个节点(table item)的隐藏状态。 在seq2seq模型的encoding阶段,每个query word 向量对每个 table item隐藏向量进行attention计算, 并将attention权重作为每个query word的图表示。 在decoding阶段,结合语法规则,如果输出应为table item,则将输出向量与所有table item隐藏向量进行全连接打分,计算其关联程度。

Paper

Code

Score

BERTRAND + GNN 57.9 54.6
Global-GNN 52.7 47.4
GNN 40.7 39.4
GNN w/edge vectors 32.1 -

RATSQL

Paper

Score

RATSQL v2 + BERT (DB content used) 65.8 61.9
RASQL + BERT 60.8 55.7
RAT-SQL 60.6 53.7

IRNet MSRA work
Blog

Paper

Code

Score

IRNet-v2 + BERT 63.9 55.0
IRNet + BERT-Base 61.9 54.7
IRNet-v2 55.4 48.5
IRNet 53.2 46.7

EditSQL

Paper

Code

Score

EditSQL + BERT 57.6 53.4
EditSQL 36.4 32.9

SQLNet Framework

Paper

Code

Score

GrammarSQL 34.8 33.8
SyntaxSQLNet + augment 24.8 27.2
RCSQL 28.5 24.3
SyntaxSQLNet 18.9 19.7
SQLNet 10.9 12.4

三、相关资源扩展 (extend resources)

1. RelatedWorks

Blog

Paper

2. SQL2Seq

Paper

Code

3. 图神经网络(GNN)

Blog

Paper

Code

nl2lf's People

Contributors

baeseulki avatar

Watchers

James Cloos avatar paper2code - bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.