2.1.2. Classification
Last updated
Last updated
LLMs are good at performing classification tasks, assigning a class or category to text. You provide the AI model with a list of categories to choose from (or the model can generate its own categories) and the content you want analyzed. Text classification serves various applications, including fraud detection, sentiment analysis, and content monitoring, among others, thereby proving to be advantageous for legal professionals.
We work with several firms specializing in personal injury which spend countless hours producing medical chronology reports and medical summaries. Let's imagine we want craft a prompt that is able to identify a client's diagnosis from the discharge notes found within a client's health records from their visit to the ER following the accident. This is a pretty simple classification problem. Let's see how we might be able to achieve this with the following prompt template:
You can see that we've used what we learned earlier in this guide to create a prompt that has three different sections. We start our prompt by including an instruction – identify the patient's diagnosis. We then embed two examples demonstrating the type of medical summary the AI model can expect. The last section is our input, which consists of the medical summary and the output delimiter – "Diagnosis." Inputting this prompt into ChatGPT correctly returns the result: "Concussion" as been seen here.