Category : nltk

I am looking for a solution in python that will convert any English word to its original form. example: I have these types of words [‘allocation’ , ‘successfully’,’building’,’schedular’,’searched’,’minimal’] output should be [‘allocate’,’success’ , ‘build’ , ‘schedule’, ‘search’, ‘minimum’] PS: Lemmatization in python is not giving the expected output Source: Python-3x..

Read more

Screenshot of the error After installing nltk using pip3 install nltk I am unable to import nltk in python shell in macOS File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/nltk/__init__.py", line 137, in <module> from nltk.text import * File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/nltk/text.py", line 29, in <module> from nltk.tokenize import sent_tokenize File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/nltk/tokenize/__init__.py", line 65, in <module> from ..

Read more

I was trying to substitute every thing else with a blank using the code : corpus_test = [] ps = PorterStemmer() for i in range(len(texts)): review = re.sub(‘[^a-zA-Z]’,’ ‘,texts[‘title’][i]) review = review.lower() review = review.split() review = [ps.stem(word) for word in review if not word in stopwords.words(‘english’)] review = ‘ ‘.join(review) corpus_test.append(review) But I got ..

Read more

I’m trying to load the comtrans module from NLTK into a Google Colab notebook, but it’s giving me the following error: [nltk_data] Downloading package comtrans to /root/nltk_data… [nltk_data] Package comtrans is already up-to-date! ————————————————————————— LookupError Traceback (most recent call last) /usr/local/lib/python3.7/dist-packages/nltk/corpus/util.py in __load(self) 79 except LookupError as e: —> 80 try: root = nltk.data.find(‘{}/{}’.format(self.subdir, zip_name)) ..

Read more

Using python, I am trying to extract keywords from pdf files. The keywords are provided by the user. Output needs to be a table with the page number and the frequency of occurrence of the particular keyword along with the total for that pdf file. The code is as follows: """ PDF data Exrtractor""" import ..

Read more