textblob-ar icon indicating copy to clipboard operation
textblob-ar copied to clipboard

FileNotFoundError: [Errno 2] No such file or directory: 'data/bbc-arabic-wordlist.csv'

Open MMamdouh96 opened this issue 5 years ago • 7 comments

MMamdouh96 avatar May 23 '19 08:05 MMamdouh96

... 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'

Sue-Fwl avatar Oct 28 '20 12:10 Sue-Fwl

Please, add these files to the repository to run the code bbc-arabic-wordlist.csv OSAc-wordlist.csv

enssaf avatar Oct 31 '20 21:10 enssaf

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.

Sue-Fwl avatar Nov 01 '20 11:11 Sue-Fwl

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)

enssaf avatar Nov 01 '20 18:11 enssaf

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()))

Sue-Fwl avatar Nov 04 '20 13:11 Sue-Fwl

The function still doesn't work for me

mennatallah644 avatar Jun 23 '21 12:06 mennatallah644

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()))

heba-alnouri avatar Apr 08 '22 14:04 heba-alnouri