zoukankan      html  css  js  c++  java
  • 首届中文NL2SQL挑战赛-step6

    *1、同时跑矫正和不矫正的dev

    *2 、max col分为设置为2和3

         ops只用 大于 小于 等于


    *3、w相关模型单独跑   

       效果差

    4、提高wc的acc,试图用wc去矫正wv

    *5、修改模型,不能argmax了,因为可以同列啊!!

     6  ngram修改

    模型从头整理:

    *1 提交的model重新跑,但同时打印矫正or不矫正  (有SNP、SAP)

      dev上,从0.59提升到0.60,也就是修改后的矫正效果better了

    *2、改WCP,不再argmax

      WCP的loss函数也要改,不能再用sigmoid 二元交叉熵了

    *3、增强数据

         file_dir = '/home/lvsl/competitations/nl2sql/sqlova_1/data/zhuiyisql/test_our_model/artifitial/'
      file_w = open(file_dir + 'artifial_dev_noor_right.json','w')   

      之所以可以过滤掉重复的,是因为table中很多就是一列都是相同的,但是了,,哎

      artifitial文件下的数据,都是处理过错误情况了

    4、AND OR MODEL

      my_dir = '/home/lvsl/competitations/nl2sql/sqlova_1/data/zhuiyisql/test_our_model/'
      write_file = my_dir + 'train_or_without_huo_right.json'  都是ops=2,且句子中没有或的,基本都是conds的列相同的

      #conds选择大于1列时 1) 不同列 and:16260 or3709 or有或:3585 or没有或:124 (0.033,) 
      #conds选择大于1列时 1) 相同列 and:72 or5052 or有或:89 or没有或:4963 -- and待修正

    5 矫正的时候注意: 

      一定为or的两种情况  ; 列相同时op一定相同

      同列的op相同如何考虑

      大于小于的准确率是否直接匹配修正,“都"

      

    6 除了没修正还有个大问题,就是数据库总是更低。

    修改predict

    修改百度百科的bert
     
    分类句子

    2000 改wcp和loss后,train final 28000 dev跑两种
    500 op max col加上 -差
    best model用修正,调eg,想ngram最后在表中找不到时修正,中午前提交更好结果

     

    train noor right:
    24343中列相同的125
    dev noor right:
    2551中列相同的9
    train
    41521 5109
    dev:
    4395 520

    train.json上面一列和多列的占比
    41521 25093
    artifitia上:50177 23575

    4161 4091
    tb rows ... 2552
    tb rows my ... 2552
    0.6017248137985104
    2252 2507 2017 2454 1917

    当conds的列的type为real的时候,op一定不为!=

    当conds的列的type不为real的时候,op一定为 ==

            for i,cond in enumerate(sql['sql']['conds']):
                if tb_ids[sql["table_id"]]["types"][cond[0]] == "real":
                    real_dic[cond[1]] += 1
                if tb_ids[sql["table_id"]]["types"][cond[0]] != "real":
                    not_real_dic[cond[1]] += 1

    {0: 10075, 1: 2730, 2: 1103, 3: 4}  3:4--关键字:除了,不等于
    {0: 104, 1: 32, 2: 44751, 3: 27}   

    {0: 1182, 1: 398, 2: 128, 3: 1}    3:1--错误数据,question只有‘1111’
    {0: 15, 1: 10, 2: 4474, 3: 0}

    不是real的时候op=3 :错误数据或者不是。。。除了。。

    not real... text {'table_id': 'aa1075753b0611e9b445f40f24344a08', 'question': '请问滦县人民医院有什么岗位需要招人吗?', 'sql': {'agg': [0], 'cond_conn_op': 0, 'sel': [5], 'conds': [[2, 3, '滦县人民医院']]}, 'query': {'agg': [0], 'cond_conn_op': 0, 'sel': [5], 'conds': [[2, 3, '滦县人民医院']]}, 'question_tok': ['请', '问', '滦', '县', '人', '民', '医', '院', '有', '什', '么', '岗', '位', '需', '要', '招', '人', '吗', '?'], 'wvi_corenlp': [[2, 7]]}
    not real... text {'table_id': 'f4497835453d11e9a3b4f40f24344a08', 'question': '在山东省抽查结果不合格的公司都有哪些呢?', 'sql': {'agg': [0], 'cond_conn_op': 1, 'sel': [1], 'conds': [[6, 3, '不合格'], [2, 2, '山东省']]}, 'query': {'agg': [0], 'cond_conn_op': 1, 'sel': [1], 'conds': [[6, 3, '不合格'], [2, 2, '山东省']]}, 'question_tok': ['在', '山', '东', '省', '抽', '查', '结', '果', '不', '合', '格', '的', '公', '司', '都', '有', '哪', '些', '呢', '?'], 'wvi_corenlp': [[8, 10], [1, 3]]}

    不是real的时候,question当成real去大于小于

    not real... text {'question': '一共有几家公司预计是13年的市价盈利比率在6倍以上', 'table_id': '69d2a666334311e9acbf542696d6e445', 'sql': {'agg': [4], 'cond_conn_op': 0, 'sel': [1], 'conds': [[8, 0, '6']]}, 'query': {'agg': [4], 'cond_conn_op': 0, 'sel': [1], 'conds': [[8, 0, '6']]}, 'question_tok': ['一', '共', '有', '几', '家', '公', '司', '预', '计', '是', '1', '3', '年', '的', '市', '价', '盈', '利', '比', '率', '在', '6', '倍', '以', '上'], 'wvi_corenlp': [[21, 21]]}
    real.. {'question': '1111', 'table_id': '69ce143d334311e9a60a542696d6e445', 'sql': {'agg': [0], 'cond_conn_op': 0, 'sel': [0], 'conds': [[3, 3, '1111']]}, 'query': {'agg': [0], 'cond_conn_op': 0, 'sel': [0], 'conds': [[3, 3, '1111']]}, 'question_tok': ['1', '1', '1', '1'], 'wvi_corenlp': [[0, 3]]}
    not real... text {'question': ' ((城市) 小于 14城合计) 城市 的 总共 是多少', 'table_id': 'e0ac070c333a11e9849c542696d6e445', 'sql': {'agg': [4], 'cond_conn_op': 0, 'sel': [0], 'conds': [[0, 1, '14城合计']]}, 'query': {'agg': [4], 'cond_conn_op': 0, 'sel': [0], 'conds': [[0, 1, '14城合计']]}, 'question_tok': [' ', '(', '(', '城', '市', ')', ' ', '小', '于', ' ', '1', '4', '城', '合', '计', ')', ' ', '城', '市', ' ', '的', ' ', '总', '共', ' ', '是', '多', '少'], 'wvi_corenlp': [[10, 14]]}
    not real... text {'question': '哪些公司的应收周转率大于41.61%或者归母净利润小于10亿', 'table_id': 'c5ab812834b411e9a8bf542696d6e445', 'sql': {'agg': [0], 'cond_conn_op': 2, 'sel': [0], 'conds': [[1, 0, '41.61'], [3, 1, '10']]}, 'query': {'agg': [0], 'cond_conn_op': 2, 'sel': [0], 'conds': [[1, 0, '41.61'], [3, 1, '10']]}, 'question_tok': ['哪', '些', '公', '司', '的', '应', '收', '周', '转', '率', '大', '于', '4', '1', '.', '6', '1', '%', '或', '者', '归', '母', '净', '利', '润', '小', '于', '1', '0', '亿'], 'wvi_corenlp': [[12, 16], [27, 28]]}
  • 相关阅读:
    flask-script插件
    狗书(flask基础)
    2018.1.18纪事
    py3.6 + xadmin的自学网站搭建
    使用selenium抓取淘宝的商品信息
    pyquery操作
    requests模块
    python3里的Urllib库
    随便写点
    How many ways?? HDU
  • 原文地址:https://www.cnblogs.com/rosyYY/p/11228266.html
Copyright © 2011-2022 走看看