Prompt Engineering and Schema Design

Trillo DocAI provides the flexibility of designing prompts based on specific use cases. These prompts can be further improved to achieve better responses. These prompts are designed as part of schema files , which are then processed by the DocAI .

Here is a sample schema file to extract Patient/Doctor information, ICD and CPT Codes from a sample medical transcription:

{
   "name":"MedicalRecord",
   "pageSummaries":true,
   "summaryOfPageSummaries":true,
   "overallSummary":false,
   "pageSchema":{
      "task" : "Find following entities from the content.",
      "taskSuffix" : "Return each each entity value as json and include confidence score.",
      "entities":[
         {
            "text":"dates",
            "name":"dates",
            "description":"Default cardinality is many"
         },
         {
            "text":"Patient",
            "cardinality":1,
            "name":"patientName"
         },
         {
            "text":"Doctor",
            "name":"doctorNames"
         },
         {
            "text":"ICD Code",
            "name":"icdcode"
         },
         {
            "text":"CPT Code",
            "name":"cptcode"
         },
         ..........
      ]
   }
}

Last updated