providing the text without Diacritics

#1
by JadwalAlmaa - opened

hello guys thank you very much for providing this data but I have a small note if you can provide the same texts in pure form (without Diacritics)
thank you very much

Arabic Machine Learning org

Hello @JadwalAlmaa , You can easily remove all the diacritics in text with simple pre-processing script.

Here is a python example:

def remove_diacritics(text):
    # Arabic diacritics
    arabic_diacritics = re.compile("""
                                 ู‘    | # Shadda
                                 ูŽ    | # Fatha
                                 ู‹    | # Tanwin Fath
                                 ู    | # Damma
                                 ูŒ    | # Tanwin Damm
                                 ู    | # Kasra
                                 ู    | # Tanwin Kasr
                                 ู’    | # Sukun
                                 ู€     # Tatwil/Kashida
                             """, re.VERBOSE)
    text = re.sub(arabic_diacritics, '', text)
    return text

Sign up or log in to comment