Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: module 'regex' has no attribute 'Pattern'

I'm getting this error while trying to run this code in google colab:

!pip install dataprep
from dataprep.eda import create_report

Error:

NumExpr defaulting to 2 threads.
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-db62224f8a79> in <module>()
----> 1 from dataprep.eda import create_report

10 frames
/usr/local/lib/python3.7/dist-packages/nltk/tokenize/casual.py in TweetTokenizer()
    355 
    356     @property
--> 357     def WORD_RE(self) -> regex.Pattern:
    358         """Core TweetTokenizer regex"""
    359         # Compiles the regex for this and all future instantiations of TweetTokenizer.

AttributeError: module 'regex' has no attribute 'Pattern'

Thing is pretty strange, as this code worked fine yesterday. Any ideas?

Error

like image 469
misterbobot Avatar asked Oct 18 '25 07:10

misterbobot


1 Answers

This looks like a known issue in NLTK. Perhaps update the NLTK version.

like image 194
ogdenkev Avatar answered Oct 19 '25 20:10

ogdenkev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!