Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixed substring not found error #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Hemanth21k
Copy link

Fixed substring not found error by keeping skip_special_tokens=True for ans_tokenizer.decode in _extract answers.

Fixed substring not found error by keeping skip_special_tokens=True for ans_tokenizer.decode in _extract answers.
@Hemanth21k Hemanth21k changed the title Update pipelines.py Fixed substring not found error Oct 11, 2021
Copy link

@deangeckt deangeckt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, opened an issue about this as well (can close after this): #90

also i'd add:
in _prepare_inputs_for_qg_from_answers_hl()
if answer_text not in sent:
continue

@iamdarkangel
Copy link

@Hemanth21k Thanks a lot for this answer. Spent a lot of time debugging the issue but was unable to debug it until I found this. Keep on doing the good job.

@@ -87,7 +87,7 @@ def _extract_answers(self, context):
max_length=32,
)

dec = [self.ans_tokenizer.decode(ids, skip_special_tokens=False) for ids in outs]
dec = [self.ans_tokenizer.decode(ids, skip_special_tokens=True) for ids in outs]
answers = [item.split('<sep>') for item in dec]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm wondering if you set skip_special_tokens=True, will item.split('<sep>') still work? Will <sep> be skipped in decode?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants