Giter Site home page Giter Site logo

table2text_fp6s's Introduction

Table2Text

表格到文本生成模型代码 本代码共包含3个模型:交换神经网络的表格到文本生成模型(EmptyDecoder)、基于预训练模型的表格到文本生成模型(PretrainBaseRNNDecoder)、应用幻觉控制的表格到文本生成模型(MultiBranchWithLMDecoder)

使用tabbie模型进行预训练

tabbie模型 使用tabbie模型前需要进行微调,可参考tabbie的readme

数据处理

将训练数据的前10000行复制到新文件

head -n 10000 data/wikibio/full/train_input.txt > data/wikibio/full/1k/train_input.txt
python3 script/create_json_data.py --src_data data/wikibio/full/1k/train_input.txt --output_data data/pretrain/input_1k.jsonl --task_type train --data_num 72831
获取table embedding

为了方便训练,将使用tabbie对表格预先编码,然后存储在pt文件中,表格到文本生成模型训练时加载到内存中。

# 需要先在pretrain/cfg里的配置文件配置输入数据路径
CUDA_VISIBLE_DEVICES=0 python3 core/pretrain/pretrain_main.py --embedding_file_path experiments/wikibio/pretrain/embeddings/train_table_embedding_1k --data_num 1000 --save_step 500

预处理数据

处理WikiBio数据集

python3 main.py --preprocess --config cfg/preprocess.cfg --overwrite

训练:

python3 main.py --preprocess --config cfg/preprocess.cfg --overwrite
python3 main.py --train --config cfg/train_switch.cfg

测试:

python3 batch_translate.py --dataset wikibio --setname test --experiment switch5w --bsz 64 --bms 10 --start-step 5000 --gpu 0
python3 batch_compute_ngram_metrics.py --tables data/wikibio/full/test_tables.jl --references data/wikibio/test_output.txt --hypotheses experiments/switch5w/gens/test/

table2text_fp6s's People

Contributors

darkknightjojo avatar trellixvulnteam 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.