kamigaito / SLAHAN

SLAHAN is an implementation of Kamigaito et al., 2020, "Syntactically Look-A-Head Attention Network for Sentence Compression", In Proc. of AAAI2020.
MIT License
19 stars 3 forks source link

Errors are reported when using my own data #6

Open PhyllisJi opened 2 years ago

PhyllisJi commented 2 years ago

lstm: /root/SLAHAN-master/compressor/include/s2s/corpus/batch.hpp:268: void s2s::batch::elmo2batch(unsigned int, unsigned int, const std::vector&, const std::vector<std::vector >&): Assertion `false' failed.

How can I fix it?

kamigaito commented 2 years ago

This error indicates that the number of tokens in a sentence is not the same between the feature vectors (from BERT or ELMO) and the received text. Thus, checking the number of spaces or control codes in the text may solve the problem. Note that you can see the number of tokens in the issued sentence at the line before the assertion error like the format NUM_OF_TOKENS_IN_FEATURE, NUM_OF_TOKENS_IN_TEXT.