Comments (4)
To answer my own question, I did the other suggested example in the tutorial, and added an extra couple lines to fix that issue:
from medcat.vocab import Vocab
from medcat.cdb import CDB
from medcat.cat import CAT
from medcat.meta_cat import MetaCAT
unzip = '<path>/mc_modelpack_snomed_int_16_mar_2022_25be3857ba34bdd5/'
# Load the vocab model you downloaded
vocab = Vocab.load(unzip+'vocab.dat')
# Load the cdb model you downloaded
cdb = CDB.load(unzip+'cdb.dat')
#needed to add these two lines
cdb.config.linking.filters.cuis = set()
cdb.config.general.spacy_model = unzip+'spacy_model'
# Download the mc_status model from the models section below and unzip it
mc_status = MetaCAT.load(unzip+'meta_Status/')
cat = CAT(cdb=cdb, config=cdb.config, vocab=vocab, meta_cats=[mc_status])
from medcat.
@ryleyb , I ran into the same problem with medcat==1.7.0 and can confirm that your solution resolved it.
from medcat.
The problem is the fact that the model you guys are trying to run is from medcat v1.2. However, version 1.3 introduced some changes (mostly to do with data validation) that mean the default of {}
(which is parsed as a dictionary) is not correct where a set is expected.
I've created a PR (#313) that will allow one to fix the issue for a model pack without in-code manual intervention.
from medcat.
The problem also occured for me today but using this code snipppet also fixed it for me.
To answer my own question, I did the other suggested example in the tutorial, and added an extra couple lines to fix that issue:
from medcat.vocab import Vocab from medcat.cdb import CDB from medcat.cat import CAT from medcat.meta_cat import MetaCAT unzip = '<path>/mc_modelpack_snomed_int_16_mar_2022_25be3857ba34bdd5/' # Load the vocab model you downloaded vocab = Vocab.load(unzip+'vocab.dat') # Load the cdb model you downloaded cdb = CDB.load(unzip+'cdb.dat') #needed to add these two lines cdb.config.linking.filters.cuis = set() cdb.config.general.spacy_model = unzip+'spacy_model' # Download the mc_status model from the models section below and unzip it mc_status = MetaCAT.load(unzip+'meta_Status/') cat = CAT(cdb=cdb, config=cdb.config, vocab=vocab, meta_cats=[mc_status])
from medcat.
Related Issues (20)
- Dependencies for 3.0 with scispacy HOT 4
- Turning on spelling and abbreviations HOT 1
- Warning: The CDB was exported by an unknown version of MedCAT. HOT 9
- Upgrade spacy dependency HOT 3
- Loosen dependency constraints HOT 1
- How to use CUI filtering
- Version 1.6.1 is not on pypi HOT 1
- remove elasticsearch dependency HOT 5
- Show nested ents results in error HOT 2
- Modifing the weights of words in the models HOT 3
- i am running NER-L tutorial but while running this cell, model and dataset are not downloading. HOT 1
- Model resources no longer available. HOT 4
- TypeError: Snomed._refset_df2dict() takes 1 positional argument but 2 were given HOT 1
- Concept not found if token order is slightly changed contrary to mentioned note in paper HOT 3
- Install MedCAT with pytorch cpu HOT 2
- Error: [E050] when trying to load sample annotate entity project
- MedCAT model used in validation HOT 3
- Stopwords do not load properly HOT 4
- How do I download the models? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from medcat.