Wendy-Xiao / summ_guided_disco_parser

The official code for the NAACL paper: Predicting Discourse Trees from pre-trained Transformer-based Neural Summarizers
MIT License
9 stars 0 forks source link

function named "map_edu_sent" is not defined in jupyter notebook. #2

Open WatsonWangZh opened 2 years ago

WatsonWangZh commented 2 years ago

NameError Traceback (most recent call last)

in 15 sent_text = of.readlines() 16 ---> 17 all_data.append(build_dataset(edu_text,sent_text,file.split('.')[0])) 18 torch.save(all_data,'./train/train.pt') in build_dataset(edu_text, sent_text, fid) 4 sentences = [s.strip().lower() for s in sent_text if s.strip()!=''] 5 edus=[edu.strip().lower() for edu in edu_text] ----> 6 edu_sent_mapping=map_edu_sent(edus,sentences) 7 data={} 8 data['disco_txt'] = [word_tokenize(edu) for edu in edus] NameError: name 'map_edu_sent' is not defined
Wendy-Xiao commented 2 years ago

As it's in the notebook, I don't know what is the exact block you ran, but you can find the function right in the notebook. You can run that block before you run the current block. The function is defined in that case.

WatsonWangZh commented 2 years ago

Thanks for ur reply. I have cloned the missing version.

WatsonWangZh commented 2 years ago

Could you write a showcase to demostrate how to use the build_gt_tree.py file?

WatsonWangZh commented 2 years ago

it seems no save operation in that python file.

Wendy-Xiao commented 2 years ago

You can find the code to build gt trees in the jupyter notebook, under the section 'Build Ground-Truth Tree'. build_gt_tree.py only contains the functions to use.

WatsonWangZh commented 2 years ago

Thanks for your reply. It's my fault. By the way, is the 'rst-dt_revised/ALL/' folder containing all the train and test files from 'RSTtrees-WSJ-main-1.0' folder?