Development of a freely accessible deep learning platform for comprehensive chest X-ray reading: a retrospective multicenter study in the UK
The code in this repository refers to the paper published on "The Lancet Digital Health" journal.
- Clone this repository
- Register on x-raydar official webpage and accept our terms and conditions
- Download the network weights for the NLP system
- add robertax1.0.pt into src/model/
- add pytorch_model.bin into src/model/robertax_pretrained/
- Use the DICOM in \demo_data to test the model
In order to download the pretrained network weights you will need to first register on
https://www.x-raydar.info/
and accept our terms and conditions.
model, tokenizer = predict.build_model()
filename = '../demo_data/test1.txt'
with open(filename) as file:
report = file.read()
input_ids, attention_masks = predict.doc_to_torch([report], tokenizer)
predictions = predict.main(input_ids, attention_masks, model)