Medical Transcripts Classification:
Prompt the Model

Introduction

Fine-tuning your model’s output involves experimentation with various prompts and settings. Understanding each component of a prompt is crucial:

  • Instruction: The directive for the model.
  • Examples: Contextual examples for the model to consider.
  • Input: The data the model processes.
  • Expected Output: The desired result from the model.

Part 3: Prompt the Model

  1. Open the dataset drawer, then in Load dataset, choose the hpe-ai/medical-cases-classification-tutorial dataset from the dropdown.
  2. Ensure the dataset previews correctly, then select Load.

Configure Initial Prompt

Experimenting with different prompts helps to determine the most effective setup. The information the model needs could be found in either the medical_specialty column or the transcription column. We’ll try both columns and see which works best.

Customize Your Prompt

  1. Try prompting the model first by specialty, then by transcript, using the structured data below:

  2. To preview the results, select Preview.

Generate Initial Output

  1. Select Generate to view the model’s initial responses.

Adjust Strategy

If the output doesn’t meet expectations, consider switching models for improved accuracy.

  1. Open the Select model drawer and then choose Llama-2-7b-chat-hf from the list. This is a larger model with better generation capabilities.
  2. Select Load and then Generate again to see improved results.

Optimize Model Properties

Optimize your setup by adjusting the prompt and generation properties:

  1. Navigate back to the model properties.
  2. Select a resource pool to view model generation properties.
  3. Adjust the Temperature to 0.
  4. Reduce the Max New Tokens to 10.
  5. Select Load.
  6. Select Generate again.

Save the Snapshot

After achieving satisfactory results, save this snapshot.

  1. Select Save Snapshot.
  2. Provide a snapshot name. Make it meaningful so you can distinguish it from other configurations you’ve tried.
  3. Select Save.

You can load this snapshot again at any time by navigating to your project’s Snapshots tab and selecting it. Then, you can repeat this process to produce a few similar snapshots to compare the outputs and find the best one.


Recap

  • You have linked the dataset and tailored the prompts to classify medical transcripts.
  • You have iterated on the model and its settings to enhance output quality.
  • You have saved your model configuration as a snapshot for future use or further refinement.