2

I'm pretty new to AllenNLP and I'm currently using its pre-trained question answering model. I wonder if it has a passage length limit to ensure its performance? I know BERT will have a maximum length of 512 and will truncate longer passages.

I have tried longer passages on AllenNLP and it seems working but I just want to confirm. Thank you.

mattstack
  • 21
  • 3

1 Answers1

2

Yes, this model does limit the length of the passage (context) and also potentially the question. You can read more about how it does this in the API docs: https://docs.allennlp.org/models/master/models/rc/dataset_readers/transformer_squad/.

But to summarize, the passage will be parsed into multiple input instances by sliding over a window of stride tokens when the passage + question contain more than length_limit tokens.

petew
  • 586
  • 4
  • 12
  • Thank you for your answer! May I know if AllenNLP can do open domain Question Answering or multi passage Question Answering? I wonder how I should utilize AllenNLP if my passage have like 10K words. Thank you! – mattstack Nov 19 '20 at 03:36