wenhuchen / kgpt Goto Github PK
View Code? Open in Web Editor NEWCode and Data for EMNLP2020 Paper "KGPT: Knowledge-Grounded Pre-Training for Data-to-Text Generation"
License: MIT License
Code and Data for EMNLP2020 Paper "KGPT: Knowledge-Grounded Pre-Training for Data-to-Text Generation"
License: MIT License
Hi, I have a problem when I am trying to evaluate all the fine-tuned models using graph encoder. It gives me the following errors:
torch.nn.modules.module.ModuleAttributeError: 'GraphGatedTransformerDecoder' object has no attribute 'beam_search' │
And then I inspect the Model.py, I find out that there is indeed no 'beam_search' under 'GraphGatedTransformerDecoder'. But I see that in all the eval_graph_*_all.sh files, you set the '--beam_size 2' which means that it is using beam_search. I am really confused about this. Thanks!
bash scripts/webnlg/eval_sequence_webnlg.sh 0 challenge checkpoint_webnlg/checkpoint_finetune_sequence_head8_layer6_GPT2_maxfact12/model_ep20.pt We didn't change the code. File "/home/xushoukai/KGPT-webnlg/code/Model.py", line 113, in get_hypothesis
hyp.append(self.next_ys[j+1][k])
IndexError: tensors used as indices must be long, byte or bool tensors
When I use
"bash scripts/webnlg/eval_sequence_webnlg.sh 0 test checkpoint_webnlg/checkpoint_finetune_sequence_head8_layer6_GPT2_maxfact12_from_ep14/model_ep30.pt"
to reproduce the results ,and I find when I set beam_size >1 (using beam_search),then every word decode as "!",but when I used beam_size = 1 (using greedy_decode), it's back to normal.
I want to know how I should use beam_ Search for decoding
When I tried to run:
bash scripts/webnlg/finetune_graph_e2enlg_from_wikidata.sh 0 checkpoint_wikidata/checkpoint_sequence_head8_layer6_GPT2_maxfact12/model_ep14.pt
It gave me the following error.
Traceback (most recent call last): File "code/run.py", line 176, in <module> load_my_state_dict(model, reloaded) File "code/run.py", line 82, in load_my_state_dict own_state[name].copy_(param) KeyError: 'module.embedding.word_embeddings.weight'
Do you know why this error happens, thanks!
Hi, when I try to run the "run.py", I get the following error.
Segmentation fault (core dumped)
both the Sequence Encoder and Graph Encoder
Anyone have a solution to this error please let me know
Hey, downloaded your pretrained weights from recent Google Drive link and ran script specified in reproducing results. Got this error:
Traceback (most recent call last):
File "code/run.py", line 453, in <module>
result = model.module.beam_search(data[:-2], tokenizer, n_bm=args.beam_size, banwords=banwords, max_token_seq_len=args.max_dec_len)
File "/home/ilya/repos/KGPT/code/Model.py", line 646, in beam_search
active_inst_idx_list = beam_decode_step(self, inst_dec_beams, len_dec_seq, active_inst_idx_list,
File "/home/ilya/repos/KGPT/code/Model.py", line 883, in beam_decode_step
dec_partial_seq = [inst_dec_beams[idx].get_current_state()
File "/home/ilya/repos/KGPT/code/Model.py", line 883, in <listcomp>
dec_partial_seq = [inst_dec_beams[idx].get_current_state()
File "/home/ilya/repos/KGPT/code/Model.py", line 34, in get_current_state
return self.get_tentative_hypothesis()
File "/home/ilya/repos/KGPT/code/Model.py", line 103, in get_tentative_hypothesis
hyps = [self.get_hypothesis(k) for k in keys]
File "/home/ilya/repos/KGPT/code/Model.py", line 103, in <listcomp>
hyps = [self.get_hypothesis(k) for k in keys]
File "/home/ilya/repos/KGPT/code/Model.py", line 114, in get_hypothesis
hyp.append(self.next_ys[j+1][k])
IndexError: tensors used as indices must be long, byte or bool tensors
hi, thanks for publish this great work!
i have some question about data use
looking forward to your replay, any help would be appreciated!
Nice job! I have several questions as follow:
(1) I found some differences between code and paper, e.g., property embedding hasn't been used, and various parameter values (batch size/learning rate) are not the same in different experimental setup (training/challenge/a few shots). I wonder whether the SOTA released in the original paper can be implemented by following the settings in the scripts.
(2) I run the sequence-encoder-few-shot-1% experiment at WEGNLG dataset. Only the batch size is modified to 16 due to insufficient resources, and the epoch becomes 4000 correspondingly for the same total steps. I achieve 19.9 BLEU (paper: 24.7). Is there any important information or tricks i miss?
(3) The proposed model has achieved significant performance under zero-shot and few-shot settings. Could you show more details about how many training instances could obtain a competitive results against other baselines (Fully-Supervised Results)?
Thanks a lot!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.