textblob-ar
textblob-ar copied to clipboard
FileNotFoundError: [Errno 2] No such file or directory: 'data/bbc-arabic-wordlist.csv'
... The error is still visible when calling TextCorrection:
from textblob_ar import TextBlob
from textblob_ar.correction import TextCorrection
text = 'الاذدهاز'
TextCorrection().correct(text)
{'الاذهان', 'الازدهار', 'الادهان', 'الاندهاش'}
TextCorrection().correct(text, top=True)
wl1 = Counter(self.words(open('data/bbc-arabic-wordlist.csv').read()))
FileNotFoundError: [Errno 2] No such file or directory: 'data/bbc-arabic-wordlist.csv'
Please, add these files to the repository to run the code bbc-arabic-wordlist.csv OSAc-wordlist.csv
I found the two lists, you can download them from sourceforge https://sourceforge.net/projects/ar-text-mining/files/Arabic-Corpora/ https://sourceforge.net/projects/ar-text-mining/files/Arabic-Corpora/OSAc-wordlist.7z/download https://sourceforge.net/projects/ar-text-mining/files/Arabic-Corpora/bbc-arabic-wordlist.7z/download
But the function still didn't work for me.
Thank you it works with little modification to the code from textblob_ar import TextBlob from textblob_ar.correction import TextCorrection text = 'الاذدهاز' TextCorrection().correction(text) TextCorrection().correction(text, top=True)
Thank you it works with little modification to the code from textblob_ar import TextBlob from textblob_ar.correction import TextCorrection text = 'الاذدهاز' TextCorrection().correction(text) TextCorrection().correction(text, top=True)
It needed a little more modification for me, I had to add the encoding type of the files in the correction.py script
wl1 = Counter(self.words(open('bbc-arabic-wordlist.csv', encoding='utf-8').read()))
The function still doesn't work for me
try write the path as:
The Issue is with the file location, to make sure you took it correctly click on the file and click on Copy Relative Path
or try this:
wl1 = Counter(self.words(open('textblob_ar/data/bbc-arabic-wordlist.csv',encoding="utf-8").read()))