Comments (4)
Thank you for letting us know of this issue! We've not encountered this before.
And after having looked at this in some detail, I can confirm that it is indeed a general issue not just something to do with your specific installation.
This has something to do with how the weighted average function is pickled within the model pack (or more specifically, the config).
The easiest workaround would be:
cat.config.linking.filters.weighted_average_function = lambda step: max(0.1, 1 - (step ** 2 * 0.0004))
This will ensure there's a valid method there to be called.
PS:
I'll be looking into the specific issue and a general resolution.
PPS:
Seems to work fine on python 3.10. So there's some issue with the differences between python 3.10 and python 3.11.
from medcat.
Works gracefully after downgrading to Python 3.10. BTW I'll leave the issue open until a general resolution is available.
Thanks!
I'm glad downgrading to Python 3.10 worked for you (I expected it would).
However, overall this still remains an issue for us with python 3.11. Downgrading may not always be an option. And even if it is, it may not be desirable (e.g the speed improvements in 3.11). So we do not wish to have that as a general recommendation.
With that said, I've prepared a PR (#411) that should fix this on the fly. Though I'm still not fully sure what the underlying issue is. I've managed to identify that there is some issue with dumping functools.partial
methods using dill
with older python versions (3.10 and below) and subsequently loading them in later ones (3.11 and onwards). And the fix I've proposed really only addresses the default value. I don't expect many models to have vastly different weighted average functions set, but it would be better if we were able to solve it in a more general manner.
from medcat.
Works gracefully after downgrading to Python 3.10.
BTW I'll leave the issue open until a general resolution is available.
Thanks!
from medcat.
Closing as #411 was merged in. Internal discussion suggests we're unlikely to come to a more robust solution with a reasonable time investment.
from medcat.
Related Issues (20)
- 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
- new install attempt with SNOMED model throws spacy/thinc config validation error HOT 4
- 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
- Service unavailable HOT 4
- Writing SNOMED dataframe - cannot access local variable in preprocess_snomed file HOT 4
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.