I am a person from healthcare and new to this forum, I am doing research related to classifying automated electrocardiogram reports(ECG) with pre-defined labels, After reading about zero shot classification,I feel this can support my research,And i really want to know what type transformers will support for this work. And also the steps to be taken, Thank you
While I do not have a specific answer to your question, I would like to make a couple of observations that might help in getting you more replies.
Your question is a little bit too open-ended for the forum perhaps, but regardless, it would greatly help other readers if you could specify:
- Why you feel zero shot learning could support your research (if you have access to labels as you seem to say, you may not need zero-shot learning but you could do some actual training!)
- What exactly your ECG data look like. Are they pictures, numbers in a sequence, Excel tables, free text? This makes a huge difference to model choice and right now your question is really not specific enough to be able to help you. Most HuggingFace models are meant to be used with sequential data (such as free text), although there are exceptions.
- What output you would expect from the model. Is this a binary output (such as “healthy”/“unhealthy”), a multi-class output, or a fully fledged worded report written by a machine? This will also influence your model choice quite a lot.
- A more precise indication of what you aim to get out of this question. Regarding the “steps to be taken” (and not knowing your level of knowledge in machine learning) this request could require a full book / course to be written, or maybe just a few high level bullet points (however these are unlikely to help if you don’t have coding experience and prior machine learning understanding). Again I’m having to make too many assumptions, which is why probably this question hasn’t received many replies, together with being too broad / vague. Adding the info I mentioned in the bullet points above might help others understand your use case better.
Hope this helps.
Thank you for your time and reply
My ECG data is a free text like below
I want to classify the free text into 4 defined labels
Since i have few training data with pre-defined labels, i thought of using zero shot classification or few shot classification
The output is to say Eg : Normal ECG , Abnormal ECG, Myocardial infarction
The aim is to classify the free text into 4 common labels
And I don’t have coding experience, trying to find the way to do and get help from experts in the forum
so here are my initial thoughts:
Firstly, your “free text” is actually part of an image (what you posted is an image to a computer, not text), so before we even consider training a model, you’d need to find a way to convert the image into text. Something like OCR (this is a free online software but there is much better around) would do the job, however you’d need to check the quality of the results, as there are things in your image which you could add noise such as |V1 |V4 etc., as well as the ECG itself, so this is the very first step.
Once you’re confident that the images are correctly (within a reasonable margin, as there will be some mistakes) converted into text by your software of choice, and assuming you do not need the actual ECG trace for your prediction but just the text, I’d suggest starting from a simple multi-class classification model. Considering your 3 classes are very specific, I wouldn’t think that zero shot would work particularly well, so even if you have just a few training data I’d suggest using them all for fine-tuning. However, large models require large amounts of data to perform well, unless you’re using more niche techniques like Bayesian learning which are way outside the scope of this answer. Here is an example of what your code could look like if you want to use transformers (which is what this forum is about) for multi class classification, however there are also other simpler NLP models available (such as SVM, random forest, Bayes classifier, logistic regression etc.), for example available from the scikit-learn python library. However, any coding activity will involve taking inspiration from others code, and making your own modifications to suit your use case, and without any coding experience I believe it would be extremely hard to “go blind” and copy others code without understanding it and getting it to work. That’s why I believe this project, for a beginner who has never coded before, would require an amount of supervision which is well outside the scope of a single question on this forum in my view. Depending on your time and dedication, I believe that a good point to start to get more familiar with these things would be to do a crash course on Python (learning the basics of the python language) and also a machine learning course. There are plenty of free resources available online but there will be a learning curve.
Regarding machine learning for beginners (but with some coding and maths understanding) I would recommend Andrew Ng’s courses on Coursera (online attendance is free). Course 1 will explain all the basics of machine learning, and Course 5 will discuss language models, which are relevant to NLP and will enable you to start writing your own sequence to sequence models.
Let’s see if others have further useful suggestions, but to manage expectation, in my opinion this is a task which requires a non negligible amount of learning before it can be attempted by someone with zero prior coding experience.