language-models-are-knowledge-graphs-pytorch icon indicating copy to clipboard operation
language-models-are-knowledge-graphs-pytorch copied to clipboard

extract.py not running even with all requirements installed

Open connexionist opened this issue 3 years ago • 4 comments

When running python extract.py examples/bob_dylan.txt bert-large-cased-bob_dynlan.jsonl --language_model bert-large-cased --use_cuda true

on google collab the following error appears:

/usr/local/lib/python3.7/dist-packages/spacy/util.py:275: UserWarning: [W031] Model 'en_core_web_sm' (2.2.5) requires spaCy v2.2 and is incompatible with the current spaCy version (2.3.2). This may lead to unexpected results or runtime errors. To resolve this, download a newer compatible model or retrain your custom model with the current spaCy version. For more details and available updates, run: python -m spacy validate warnings.warn(warn_msg) 2021-04-22 19:14:11.225481: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0 Traceback (most recent call last): File "extract.py", line 3, in from mapper import Map, deduplication File "/content/mapper.py", line 5, in emb = GenericLookup("entity_word_embedding", save_dir=sqlite_path, table_name="embeddings") File "/usr/local/lib/python3.7/dist-packages/REL/db/generic.py", line 36, in init self.db = self.initialize_db(path_db, table_name, columns) File "/usr/local/lib/python3.7/dist-packages/REL/db/base.py", line 41, in initialize_db db = sqlite3.connect(fname, isolation_level=None) sqlite3.OperationalError: unable to open database file

connexionist avatar Apr 22 '21 19:04 connexionist

Hi connexionist, you can obtain from https://github.com/informagi/REL repository. You have construct from wikipedia dump this sqllite file from scratch.

okanvk avatar Apr 22 '21 19:04 okanvk

I already did pip install git+https://github.com/informagi/REL... what else is needed?

here is the google collab notebook link : https://colab.research.google.com/drive/1OBUHQrf7f_tDBavtapjxr0Dgv1eCr4Px#scrollTo=veJ7TqXZ0B1U

Thanks for your helpppppp :)

connexionist avatar Apr 22 '21 20:04 connexionist

You have to create "emb = GenericLookup("entity_word_embedding", save_dir=sqlite_path, table_name="embeddings")" this entity_word_embedding file, from REL documentation. https://github.com/informagi/REL/blob/master/tutorials/deploy_REL_new_Wiki/04_01_Extracting_a_new_Wikipedia_corpus.md it can help

okanvk avatar Apr 22 '21 20:04 okanvk

I have worked on this for all day long I will retry with your suggestion thank you so much!!

connexionist avatar Apr 22 '21 21:04 connexionist