Example Einstein Prompts
Following are some use cases and example Einstein prompts for each situation. These prompts are based on the sample data used during each test and provide insight about creating prompts to analyze and format your custom documents.
You can use these examples as starting points, test them against your documents, and modify them until you obtain the expected result.
Extract details from a US Driver’s License
The following Einstein prompt extracts data from a driver’s license ID document and outputs the information in JSON format.
-
Example document
-
Example Prompt
Identify key elements from the specified document and return them in JSON format. Do not create new information, provide answers only from the text provided. The JSON format is as follows: { "id_data": { "doc_number":<replace with value found for License ID or document ID>, "first_name": <replace with the first name of the person in the text>, "last_name": <replace with the last name of the person in the text>, "issue_date": <replace with the date of issue of this document>, "dob": <replace with date of birth found in the text also represented as dob>, "exp_date": <replace with expiration date, sometimes written as EXP>, "state_region": <replace with state or region where this document was issued>, "height": <replace with height specified if not found, say "not found">, "class": <replace with vehicle classification if found">, "eye_color": <replace with eye color if found">, "sex": <sex as specified>, "weight": <replace with the weight found>, "restrictions":<replace with any restrictions listed in the document>, "address": { "street": <replace with the street line of the address including any apartment numbers>, "city":<replace with the city in the address found>, "state": <replace with the state found in the address>, "zip": <replace with the zipcode found in the address> } } }
-
Output
{ "id_data": { "doc_number": "12345678", "first_name": "The Genius", "last_name": "Einstein", "issue_date": "10/30/2024", "dob": "03/14/1879", "exp_date": "10/31/2031", "state_region": "California", "height": "5'5\"", "class": "D", "eye_color": "BROWN", "sex": "M", "weight": "150 lb", "restrictions": "None", "address": { "street": "707 South Oakland Avenue", "city": "Pasadena", "state": "CA", "zip": "91106" } } }
Classify a Document With Multiple Pages
In this example, the source document is a PDF with multiple pages containing a timesheet summary document with multiple entries. The goal is to classify the content by identifying the name of the person in each page. For such a case, the following prompt returns a list in JSON format containing the name of the person and the corresponding page number.
-
Example document
-
Example Prompt
Classify each page of the following timesheet summary as a unique document type and also identify whether the page continues from the previous document type or it is a new one. Summarize all the employee's names in the timesheet summary document and the pages where their timesheet entry is found. Structure the output as a JSON where the employee name is the key and the page number is the value.
-
Output
{ "Jane Almeida": 1, "Charles Montes": 2, "Albert Vignoli": 3, "Max the Mule": 4 }
Extract Form Data as Key/Value Pairs Including Handwritten Values
The following example is a prompt that analyzes a medical certificate to extract key/value pairs and considers handwriting during the extraction.
-
Example document
-
Example Prompt
Analyze this form for a medical leave and extract its values. Don't extract document's title. Present the data as key-value pairs in a JSON formatted response. If you find a date, format it as YYYY/MM/DD. If you find a list of handwritten symptoms, return them as an array and label them "Reason for Absence". Do not create any facts of information, interpret only the information in the document. An example output JSON is: "Patient_Name": { "value": "Paul Grant" }
-
Output
{ "Patient_Name": { "value": "Paul Grant" }, "Date_of_Birth": { "value": "1988/11/02" }, "Case_Number": { "value": "12345678" }, "1st_Diagnosed_Date": { "value": "2021/04/12" }, "Last_Office_Visit": { "value": "2024/09/01" }, "1st_Exam_Date_for_this_Condition": { "value": "2021/01/23" }, "Next_Office_Visit": { "value": "2024/10/23" }, "Reason_for_Absence": { "value": [ "Unable to complete the TPS reports on Saturday", "Hyperventilation during the session" ] } }