Giter Site home page Giter Site logo

cltl / aproof-icf-classifier Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 2.0 1.19 MB

Classifier that can read medical reports and assign a functional level classification following the WHO ICF classification scheme.

License: MIT License

Dockerfile 1.11% Python 98.89%

aproof-icf-classifier's People

Contributors

piekvossen avatar sandertan avatar sarnoult avatar vanboefer avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

umcu bertholdm

aproof-icf-classifier's Issues

Add empty comment handling

The current code gives a 'Shape mismatch for blis.gemm: (0, 0) (480, 288) error in ln 121 of tok2vec.py: tokvecs = self.model.predict(docs)

Please consider adding support or more informative error handling (e.g. assert len(input)>0 'Encountered empty comment, please remove these in preprocessing' )

Running with local models from the hugging face .cache

Running with local models does not work even though the models are in the hugging face .cache:

/Users/piek/.cache/huggingface/transformers

E.g. there is. json file with the following info:

{"url": "https://huggingface.co/CLTL/icf-domains/resolve/main/special_tokens_map.json", "etag": ""e97d1993365bb21c88f390e8703e4c1af564821f"โ€}%

docker run -v /Users/piek/Desktop/r-COVID-19-TM/CovidHerstelZorg-ZonMW/data -e TRANSFORMERS_OFFLINE=1 piekvossen/a-proof-icf-classifier --in_csv example/input.csv --text_col text

Error message is below:

Loading input csv file: example/input.csv
Input csv file (example/input.csv) is successfuly loaded!
Anonymizing the text in "text" column. This might take a while.
Splitting the text in "text" column to sentences. This might take a while.
Generating domains predictions. This might take a while.
CUDA device not available; running on a CPU!
Cannot find the requested files in the cached path and outgoing traffic has been disabled. To enable model look-ups and downloads online, set 'local_files_only' to False.
Downloading the model from https://huggingface.co/CLTL/icf-domains
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/transformers/configuration_utils.py", line 546, in get_config_dict
resolved_config_file = cached_path(
File "/usr/local/lib/python3.8/site-packages/transformers/file_utils.py", line 1402, in cached_path
output_path = get_from_cache(
File "/usr/local/lib/python3.8/site-packages/transformers/file_utils.py", line 1620, in get_from_cache
raise FileNotFoundError(
FileNotFoundError: Cannot find the requested files in the cached path and outgoing traffic has been disabled. To enable model look-ups and downloads online, set 'local_files_only' to False.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./main.py", line 154, in
main(
File "./main.py", line 121, in main
sents['predictions'] = predict_domains(
File "/icfc/src/icf_classifiers.py", line 49, in predict_domains
model = MultiLabelClassificationModel(
File "/usr/local/lib/python3.8/site-packages/simpletransformers/classification/multi_label_classification_model.py", line 194, in init
self.config = config_class.from_pretrained(model_name, **self.args.config)
File "/usr/local/lib/python3.8/site-packages/transformers/configuration_utils.py", line 489, in from_pretrained
config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
File "/usr/local/lib/python3.8/site-packages/transformers/configuration_utils.py", line 570, in get_config_dict
raise EnvironmentError(msg)
OSError: Can't load config for 'CLTL/icf-domains'. Make sure that:

  • 'CLTL/icf-domains' is a correct model identifier listed on 'https://huggingface.co/models'

  • or 'CLTL/icf-domains' is the correct path to a directory containing a config.json file

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.