question_generation icon indicating copy to clipboard operation
question_generation copied to clipboard

ValueError: substring not found

Open bipinkc19 opened this issue 4 years ago • 13 comments

image

I cant disclose the text, but this is the error I get in every model

bipinkc19 avatar May 31 '21 16:05 bipinkc19

I have also faced the same issue, Can you check your text if it contains any trademark symbol in between any word.

for example: interface to Teamcenter™s Business when I removed that ™ from the above string it works fine, interface to Teamcenter's Business

neelkantnewra avatar Jun 01 '21 03:06 neelkantnewra

image If I remove the has and put some other word like free it works

bipinkc19 avatar Jun 01 '21 06:06 bipinkc19

How do we fix this image

bipinkc19 avatar Jun 01 '21 06:06 bipinkc19

Okay, I got that, I have commented on a specific problem. In my case, I am using a pdf file consisting of 50 pages, I checked it with some pages, it was throwing the same error, Maybe it is due to the model not able to generate the answer of specific text.

If you want an instant solution then I will suggest using try: exception at least you will get some question and answer.

This is just a temporary solution. I am looking into this issue. will update soon.

neelkantnewra avatar Jun 01 '21 07:06 neelkantnewra

May be when it can't generate the answers in some text and throws error like you said. Thank you for looking in to it.

bipinkc19 avatar Jun 01 '21 07:06 bipinkc19

I have done a pull request, lets see when it will be accepted, you can always try the approach of Exception handling.

neelkantnewra avatar Jun 01 '21 07:06 neelkantnewra

@neelkantnewra how was the inference times for 50 pg pdf? Also did you try fine tuning the model?

ghost avatar Jun 10 '21 08:06 ghost

@neelkantnewra how was the inference times for 50 pg pdf? Also did you try fine tuning the model?

I don't remember exactly, currently, I am busy with another project. Yes, we fine-tune it, else it will give the worse result.

neelkantnewra avatar Jun 11 '21 06:06 neelkantnewra

I had the same error, There are some special characters in input string which models are unable to process. So just remove special characters and it will work.

razauh avatar Sep 01 '21 06:09 razauh

I had the same error, There are some special characters in input string which models are unable to process. So just remove special characters and it will work.

That is one case, but when the model is not finding any suitable question-answer pair it through an empty dict and since it is empty we get a Value error. we can solve this by exception Handling as previously mentioned.

neelkantnewra avatar Sep 01 '21 06:09 neelkantnewra

@neelkantnewra how was the inference times for 50 pg pdf? Also did you try fine tuning the model?

I don't remember exactly, currently, I am busy with another project. Yes, we fine-tune it, else it will give the worse result.

@neelkantnewra Can you please guide us with the fine-tuning code on custom data?

sabhi27 avatar Oct 25 '21 08:10 sabhi27

When using the text "42 is the answer to life, universe and everything" same error occurs. How to solve this?

liesketrommelen avatar Nov 03 '21 11:11 liesketrommelen

@liesketrommelen You need to use transformers 3.0.0

rajats avatar Dec 07 '21 13:12 rajats