Browse Source

storing fixes

Aziz Ketari 4 years ago
parent
commit
bed2df774f
6 changed files with 8 additions and 3 deletions
  1. BIN
      .DS_Store
  2. 4 1
      README.md
  3. BIN
      scripts/.DS_Store
  4. 2 0
      scripts/storing.py
  5. BIN
      scripts/utils/.DS_Store
  6. 2 2
      scripts/utils/ner_fcn.py

BIN
.DS_Store


+ 4 - 1
README.md

@@ -44,7 +44,10 @@ gcloud services enable bigquery.googleapis.com
 ```
 
 - Install package requirements:
- 
+> Make sure you have a python version >=3.6.0. Otherwise you will face some version errors [Useful link](https://stackoverflow.com/questions/47273260/google-cloud-compute-engine-change-to-python-3-6)
+
+`ERROR: Package 'scispacy' requires a different Python: 3.5.3 not in '>=3.6.0'`
+
 ```
 cd ~/covid19_ISMIR
 pip3 install --user -r requirements.txt

BIN
scripts/.DS_Store


+ 2 - 0
scripts/storing.py

@@ -2,6 +2,8 @@ from google.cloud import storage, bigquery, datastore
 from google.oauth2 import service_account
 from utils.bq_fcn import bqCreateDataset, bqCreateTable, exportItems2BQ
 from utils.ner_fcn import loadModel, addTask, extractMedEntities
+from scispacy.umls_linking import UmlsEntityLinker
+from scispacy.abbreviation import AbbreviationDetector
 
 import logging
 logging.getLogger().setLevel(logging.INFO)

BIN
scripts/utils/.DS_Store


+ 2 - 2
scripts/utils/ner_fcn.py

@@ -79,10 +79,10 @@ def addTask(datastore_client, doc_title, entities_dict):
     task.update(
         entities_dict
     )
-    client.put(task)
+    datastore_client.put(task)
     # Then get by key for this entity
     logging.info("Uploaded {} to Datastore.".format(doc_title))
-    return client.get(key)
+    return datastore_client.get(key)
 
 
 def getCases(datastore_client, filter_dict, limit=10):