patil-suraj / question_generation

Neural question generation using transformers
MIT License
1.1k stars 346 forks source link

unexepect <pad> #93

Open cdhx opened 2 years ago

cdhx commented 2 years ago

hi, thanks for publish this amazing tool !

i run the demo and find some problem

it is said that

ValueError: substring not found 

I find that it is because in line 142 there is a ".index", and the answer is not in input sentence, so it cannot find the answer in sentence https://github.com/patil-suraj/question_generation/blob/master/pipelines.py#L142

I further output the intermediate result,and find that

input: 42 is the answer to life, the universe and everything.
sents, answers: ['42 is the answer to life, the universe and everything.'] [['<pad> 42']]
answer: [['<pad> 42']]

the model give the answer " 42" which is not in the input sentence " 42 is the answer to life, the universe and everything."

I wonder why there is a and how to solve it

thx

gabriead commented 2 years ago

I stumbled upon the same error. Any update on that?