VinAIResearch/PhoBERT

AssertionError, I have this error when run with fairseq, RobertaModel

trinh-hoang-hiep opened this issue · 1 comments

doc = phoBERT.extract_features_aligned_to_words('Nghe nhiều về ông nhưng đến hôm_nay tôi mới có dịp về ấp Long_Châu 1 xã Thạnh_Mỹ_Tây Châu_Phú_An_Giang để gặp ông .')
OK, but
doc = phoBERT.extract_features_aligned_to_words('nghe nhiều về ông nhưng đến hôm_nay tôi mới có dịp về ấp long_châu 1 xã thạnh_mỹ_tây châu_phú_an_giang để gặp ông .')
Traceback (most recent call last):
File "", line 1, in
File "/home/hoang/anaconda3/lib/python3.6/site-packages/fairseq/models/roberta/hub_interface.py", line 133, in extract_features_aligned_to_words
alignment = alignment_utils.align_bpe_to_words(self, bpe_toks, spacy_toks_ws)
File "/home/hoang/anaconda3/lib/python3.6/site-packages/fairseq/models/roberta/alignment_utils.py", line 39, in align_bpe_to_words
assert "".join(bpe_tokens) == "".join(other_tokens)
AssertionError

and

doc = phoBERT.extract_features_aligned_to_words('chuyên_môn_hoá là xu_hướng của phát_triển việc tốt cũng chuyên_môn_hoá thì quả là tốt quá .')
OK, but in
doc = phoBERT.extract_features_aligned_to_words('Chuyên_môn_hoá là xu_hướng của phát_triển việc tốt cũng chuyên_môn_hoá thì quả là tốt quá.')
Traceback (most recent call last):
File "", line 1, in
File "/home/hoang/anaconda3/lib/python3.6/site-packages/fairseq/models/roberta/hub_interface.py", line 133, in extract_features_aligned_to_words
alignment = alignment_utils.align_bpe_to_words(self, bpe_toks, spacy_toks_ws)
File "/home/hoang/anaconda3/lib/python3.6/site-packages/fairseq/models/roberta/alignment_utils.py", line 39, in align_bpe_to_words
assert "".join(bpe_tokens) == "".join(other_tokens)
AssertionError