Skip to content

No module named 'arabert.preprocess_arabert' #65

Answered by WissamAntoun
jubaer145 asked this question in Q&A
Discussion options

You must be logged in to vote

I replaced it with this code

from arabert.preprocess import ArabertPreprocessor

model_name = "bert-base-arabertv2"
arabert_prep = ArabertPreprocessor(model_name=model_name, keep_emojis=False)

text = "ولن نبالغ إذا قلنا إن هاتف أو كمبيوتر المكتب في زمننا هذا ضروري"
arabert_prep.preprocess(text)
>>>"و+ لن نبالغ إذا قل +نا إن هاتف أو كمبيوتر ال+ مكتب في زمن +نا هذا ضروري"

Also, I recommend you don't use AraBERT-PyTorch-Demo.ipynb since this is a very old code. Please use one of the new examples in the colabs

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@jubaer145
Comment options

@Astudnew
Comment options

@WissamAntoun
Comment options

@manelAffi
Comment options

@WissamAntoun
Comment options

Answer selected by jubaer145
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants