Giter Club home page Giter Club logo

Comments (4)

ryleyb avatar ryleyb commented on June 23, 2024 1

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.

vvcb avatar vvcb commented on June 23, 2024

@ryleyb , I ran into the same problem with medcat==1.7.0 and can confirm that your solution resolved it.

from medcat.

mart-r avatar mart-r commented on June 23, 2024

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.

KimBenjaminTang avatar KimBenjaminTang commented on June 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.