Question: Why am I unable to access the biocreative-ppi package from NLTK?
0
gravatar for maxwells_daemon
9 days ago by
maxwells_daemon10 wrote:

I am trying to utilize biocreative-ppi package from NLTK on Google Colaboratory and on my personal laptop. However, even though I am able to download the biocreative-ppi package from NLTK, I am not able to access the biocreative_ppi package. I have done the following:

Uninstalled and reinstalled the nltk package on my laptop and on Google Colaboratory Tried to download other packages from NLTK. I was successful at downloading brown Spelled biocreative_ppi as biocreative,bcppi, bc_ppi, etc. Here is the website for biocreative_ppi. As you can see, the package is not deprecated. It should still be available.

Here is the code from my Colaboratory notebook:

import subprocess
import nbformat
import json, os
import random
import spacy
import nltk
import nltk.corpus
nltk.download('brown')
nltk.corpus.brown
nltk.download('biocreative_ppi')
nltk.corpus.biocreative_ppi
[nltk_data] Downloading package brown to /root/nltk_data...
[nltk_data]   Unzipping corpora/brown.zip.
[nltk_data] Error loading biocreative_ppi: Package 'biocreative_ppi'
[nltk_data]     not found in index
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-4f6d73ab2d12> in <module>()
      2 nltk.corpus.brown
      3 nltk.download('biocreative_ppi')
----> 4 nltk.corpus.biocreative_ppi

/usr/local/lib/python3.6/dist-packages/nltk/lazyimport.py in __getattr__(self, name)
    120                   'Module load triggered by attribute %r read access' % name)
    121         module = self.__lazymodule_import()
--> 122         return getattr(module, name)
    123 
    124     def __setattr__(self, name, value):

AttributeError: module 'nltk.corpus' has no attribute 'biocreative'

The example above shows I can access brown. The following code will show I can successfully download biocreative_ppi but can't access it.

import subprocess
import nbformat
import json, os
import random
import spacy
import nltk
import nltk.corpus
nltk.download('biocreative_ppi')
nltk.corpus.biocreative_ppi
[nltk_data] Downloading package biocreative_ppi to /root/nltk_data...
[nltk_data]   Package biocreative_ppi is already up-to-date!
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-bcfe9c01d5cf> in <module>()
      1 nltk.download('biocreative_ppi')
----> 2 nltk.corpus.biocreative_ppi

/usr/local/lib/python3.6/dist-packages/nltk/lazyimport.py in __getattr__(self, name)
    120                   'Module load triggered by attribute %r read access' % name)
    121         module = self.__lazymodule_import()
--> 122         return getattr(module, name)
    123 
    124     def __setattr__(self, name, value):

AttributeError: module 'nltk.corpus' has no attribute 'biocreative_ppi'

I am aware that the biocreative_ppi dataset is also available through Kaggle and Biocreative's GitHub. However, I do not understand why I am able to download biocreative_ppi through nltk but can't access any of the subdirectories or files associated with biocreative_ppi. Please let me know if you can help me out. Thank you for your consideration, and I am open to any suggestions.

ADD COMMENTlink modified 9 days ago • written 9 days ago by maxwells_daemon10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1903 users visited in the last hour