data-science-document-ai 1.42.5__py3-none-any.whl → 1.56.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {data_science_document_ai-1.42.5.dist-info → data_science_document_ai-1.56.1.dist-info}/METADATA +2 -2
  2. {data_science_document_ai-1.42.5.dist-info → data_science_document_ai-1.56.1.dist-info}/RECORD +34 -31
  3. src/constants.py +7 -10
  4. src/docai_processor_config.yaml +0 -56
  5. src/excel_processing.py +24 -14
  6. src/io.py +23 -0
  7. src/llm.py +0 -29
  8. src/pdf_processing.py +156 -51
  9. src/postprocessing/common.py +172 -28
  10. src/postprocessing/postprocess_partner_invoice.py +194 -59
  11. src/prompts/library/arrivalNotice/other/placeholders.json +70 -0
  12. src/prompts/library/arrivalNotice/other/prompt.txt +40 -0
  13. src/prompts/library/bundeskasse/other/placeholders.json +5 -5
  14. src/prompts/library/bundeskasse/other/prompt.txt +7 -5
  15. src/prompts/library/commercialInvoice/other/placeholders.json +125 -0
  16. src/prompts/library/commercialInvoice/other/prompt.txt +1 -1
  17. src/prompts/library/customsAssessment/other/placeholders.json +70 -0
  18. src/prompts/library/customsAssessment/other/prompt.txt +24 -37
  19. src/prompts/library/customsInvoice/other/prompt.txt +4 -3
  20. src/prompts/library/deliveryOrder/other/placeholders.json +80 -27
  21. src/prompts/library/deliveryOrder/other/prompt.txt +26 -40
  22. src/prompts/library/draftMbl/other/placeholders.json +33 -33
  23. src/prompts/library/draftMbl/other/prompt.txt +34 -44
  24. src/prompts/library/finalMbL/other/placeholders.json +80 -0
  25. src/prompts/library/finalMbL/other/prompt.txt +34 -44
  26. src/prompts/library/packingList/other/placeholders.json +98 -0
  27. src/prompts/library/partnerInvoice/other/prompt.txt +8 -7
  28. src/prompts/library/preprocessing/carrier/placeholders.json +0 -16
  29. src/prompts/library/shippingInstruction/other/placeholders.json +115 -0
  30. src/prompts/library/shippingInstruction/other/prompt.txt +26 -14
  31. src/prompts/prompt_library.py +0 -4
  32. src/setup.py +15 -16
  33. src/utils.py +120 -68
  34. src/prompts/library/draftMbl/hapag-lloyd/prompt.txt +0 -45
  35. src/prompts/library/draftMbl/maersk/prompt.txt +0 -19
  36. src/prompts/library/finalMbL/hapag-lloyd/prompt.txt +0 -44
  37. src/prompts/library/finalMbL/maersk/prompt.txt +0 -19
  38. {data_science_document_ai-1.42.5.dist-info → data_science_document_ai-1.56.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,70 @@
1
+ {
2
+ "type": "OBJECT",
3
+ "properties": {
4
+ "consignee": {
5
+ "type": "STRING",
6
+ "nullable": true,
7
+ "description": "The receiver or buyer of the goods. It can be find with the keywords like Importeur, Anmelder, Empfanger, Consignee, Buyer, Receiver, etc.."
8
+ },
9
+ "countryOfOrigin": {
10
+ "type": "STRING",
11
+ "nullable": true,
12
+ "description": "The country where the goods were manufactured or produced. It can be identified as Land van oorsprong, Ursprungsland in the document."
13
+ },
14
+ "MRN": {
15
+ "type": "STRING",
16
+ "nullable": true,
17
+ "description": "Movement Reference Number (MRN) is a unique identifier assigned to each customs declaration for goods being imported or exported within the European Union (EU). It is used to track and monitor the movement of goods across EU member states. It can be found with MRN, Reg. Nr., Reg. Kennzeigechen, etc.."
18
+ },
19
+ "shipper": {
20
+ "type": "STRING",
21
+ "nullable": true,
22
+ "description": "The seller or shipper of the goods. It is often indicated by the term Shipper, Speditore, Esportatore, Exporteur, Versender."
23
+ },
24
+ "totalValueOfGoods": {
25
+ "type": "STRING",
26
+ "nullable": true,
27
+ "description": "The total monetary value of the goods being shipped, usually declared for customs purposes. It can be found with Waarde, Warenwert, Factuurwaarde, Invoice Value, etc.."
28
+ },
29
+ "containers": {
30
+ "type": "ARRAY",
31
+ "items": {
32
+ "type": "OBJECT",
33
+ "properties": {
34
+ "containerNumber": {
35
+ "type": "STRING",
36
+ "nullable": true,
37
+ "description": "The unique identifier for each container. It always starts with 4 capital letters and followed by 7 digits. Example: TEMU7972458."
38
+ },
39
+ "goodsDescription": {
40
+ "type": "STRING",
41
+ "nullable": true,
42
+ "description": "A brief description of the goods contained within the container. It can be found with goods description, Bezeichnung, goederenomschrijving."
43
+ },
44
+ "grossWeight": {
45
+ "type": "STRING",
46
+ "nullable": true,
47
+ "description": "The gross weight of the container. Usually mentioned as G.W or GW, Bruto, or Gross Weight, etc.."
48
+ },
49
+ "nettWeight": {
50
+ "type": "STRING",
51
+ "nullable": true,
52
+ "description": "The net weight of the goods inside the container. Usually mentioned as N.W or NW, Net Weight, or Netto, Eigenmasse, etc.."
53
+ },
54
+ "packagingNumber": {
55
+ "type": "STRING",
56
+ "nullable": true,
57
+ "description": "The quantity of the goods. Usually, the quantity is in pallets, PLT, cartons, CTNS, pieces, PCS, packages, boxes, etc. Please prioritize the packaging types based on their size, as follows: Pallets (PLT) >> Cartons (CTNS) >> Pieces (PCS). Extract the Larger packaging types that will have a lower count."
58
+ },
59
+ "packagingType": {
60
+ "type": "STRING",
61
+ "nullable": true,
62
+ "description": "The packaging type is the unit of packagingNumber. Example; pallets, PLT, cartons, CTNS, pieces, PCS, packages, etc. Sometimes, the packaging type is available in the column name of the packagingNumber."
63
+ }
64
+ },
65
+ "required": ["containerNumber", "goodsDescription", "grossWeight", "nettWeight", "packagingNumber", "packagingType"]
66
+ }
67
+ }
68
+ },
69
+ "required": ["countryOfOrigin", "MRN", "totalValueOfGoods", "containers"]
70
+ }
@@ -1,42 +1,29 @@
1
- You are a document entity extraction specialist. Your task is to extract data from a customs assessment document.
2
- Customs assessment contain necessary information about imported / exported goods and containers.
1
+ <PERSONA> You are an efficient document entity data extraction specialist working for a Freight Forwarding company. <PERSONA>
3
2
 
4
- consignee: Legal Entity that is responsible for importing goods, name and address.
5
- shipper: Legal Entity that is responsible for sending goods, name and address.
6
- countryOfOrigin: Country of origin of goods.
7
- MRN: MRN code.
8
- totalValueOfGoods: Total value of goods.
9
- containers:
10
- containerNumber: Unique ID for tracking the shipping container.
11
- grossWeight: Total weight of the cargo, including the tare weight of the container.
12
- packagingNumber: Packaging number.
13
- nettWeight: Weight of the goods excluding packaging and containers.
14
- packagingType: Type of packaging used (e.g., cartons, pallets, barrels).
15
- goodsDescription: Goods description.
3
+ <TASK> Your task is to extract data from delivery order documents as per the given response schema structure. <TASK>
16
4
 
5
+ <CONTEXT>
6
+ The Freight Forwarding company receives Customs Assessment from customs partners.
7
+ These documents contain various details related to shipper, buyer, MRN, and container data such as container number, goods details at container level.
8
+ They may be written in different languages such as English, German, Vietnamese, Chinese, and other European languages, and can appear in a variety of formats and layouts.
9
+ Your role is to accurately extract specific entities from these Customs Assessment to support efficient processing and accurate record-keeping.
10
+ <CONTEXT>
17
11
 
18
- Your task is to extract the text value of the following entities and page numbers starting from 0 where the value was found in the document:
19
- SCHEMA_PLACEHOLDER
12
+ <INSTRUCTIONS>
13
+ - Populate fields as defined in the response schema.
14
+ - Multiple containers entries may exist — capture all instances under "containers".
15
+ - Use the data field description to understand the context of the data.
20
16
 
21
- Keywords for datapoints:
22
- - consignee: Importeur, Anmelder, Empfanger.
23
- - shipper: Speditore, Esportatore, Exporteur, Versender.
24
- - countryOfOrigin: Land van oorsprong, Ursprungsland.
25
- - MRN: MRN, Reg. Nr., Reg. Kennzeigechen.
26
- - totalValueOfGoods: Waarde, Warenwert, Factuurwaarde.
27
- - containers:
28
- - containerNumber: container number, cntr. nos., containernummern, cont. nr.
29
- - grossWeight: gross weight, Bruto.
30
- - nettWeight: Weight of the goods excluding packaging and containers, Netto, Eigenmasse.
31
- - packagingNumber: package number, Anzahl.
32
- - packagingType: Type of packaging used (e.g., cartons, pallets, barrels), number and kind of packages, description of goods.
33
- - goodsDescription: goods description, Bezeichnung, goederenomschrijving.
17
+ - MRN: Movement Reference Number (MRN) is a unique identifier assigned to each customs declaration for goods being imported or exported within the European Union (EU). It is used to track and monitor the movement of goods across EU member states. It can be found with MRN, Reg. Nr., Reg. Kennzeigechen, etc..
34
18
 
35
-
36
- You must apply the following rules:
37
- - The JSON schema must be followed during the extraction.
38
- - The values must only include text found in the document
39
- - Do not normalize any entity value.
40
- - nettWeight can't be equal to grossWeight.
41
- - Validate the JSON make sure it is a valid JSON ! No extra text, no missing comma!
42
- - Add an escape character (backwards slash) in from of all quotes in values
19
+ - containers: Details of each container on the Customs Assessment. Make sure to extract each container information separately.
20
+ - containerNumber: Container Number consists of 4 capital letters followed by 7 digits (e.g., TEMU7972458, CAIU 7222892). It can be identified as container number, cntr. nos., containernummern, cont. nr.
21
+ - goodsDescription: Extract only the description of the goods for the "goodsDescription" but not other information like packing, marks, etc.
22
+ - packagingNumber:
23
+ - Prioritize the "Pallets/PLTS/Cartons/CTNS/Package" over "PCS" count to extract the data for the "packagingNumber".
24
+ - example: If the table has "17CTNS", "9PLTS", "850", "850PCS", prioritize "9PLTS"
25
+ - Do not extract the pack Quantity field such as "50PCS/CTN", "5PC/Box" (these represent quantity per carton, not total shipped quantity).
26
+ - packagingType:
27
+ - Extract the unit associated with the "packagingNumber" in the table to extract the "packagingType"
28
+ - Sometimes it can be found on the column name of the "packagingNumber" in the table to extract the "packagingType"
29
+ <INSTRUCTIONS>
@@ -1,6 +1,6 @@
1
1
  <PERSONA> You are an efficient document entity data extraction specialist working for a Freight Forwarding company. <PERSONA>
2
2
 
3
- <TASK>Your task is to extract data and their page numbers starting from 0 from invoice documents as per the given response schema structure.<TASK>
3
+ <TASK> Your task is to extract data from invoice documents as per the given response schema structure. <TASK>
4
4
 
5
5
  <CONTEXT>
6
6
  The Freight Forwarding company receives invoices from Carrier (Shipping Lines) partners and Customs Brokers. These include Partner Invoices (COGS Invoices) and COGS Customs Invoices.
@@ -48,13 +48,13 @@ Your role is to accurately extract specific entities from these invoices to supp
48
48
  - issueDate: The date the document was issued.
49
49
  - dueDate: The date by which the payment should be made. Do Not calculate dueDate based on issueDate or any other date. Extract it directly from the invoice.
50
50
 
51
- - lineItem: Details of each COGS and Customs line item on the invoice. Make sure to extract each amount and currency separately.
51
+ - lineItem: Details of each COGS and Customs line item on the invoice from each page. Make sure to extract each amount and currency separately.
52
52
  - uniqueId: A unique id which associated with the lineItem as each line item can belong to a different shipment. Extract only if its available in the line item. Either a shipmentId starting with an S and followed by 6 or 8 numeric values or a mblNumber. If shipmentId or mblNumber does not exist, set it to containerNumber.
53
53
  - lineItemDescription: The name or description of the item. Usually, it will be a one line sentence.
54
54
  - unitPrice: Even if the quantity is not mentioned, you can still extract the unit price. Check the naming of the columns in a different languages, it can be "Unit Price", "Prezzo unitario", "Prix Unitaire", "Unitario", etc. Refer to "Prezzo unitario" field in the italian invoice example.
55
55
  - totalAmount: The total amount for the item. It can be in different currencies, so ensure to capture the currency as well for the totalAmountCurrency.
56
56
  - totalAmountEuro: Few line items contains a total amount in Euro. You can find it by looking for the term "Total EUR" or "Amount in Euro" in the line item but it's always in the EURO / € currency. Sometimes, it can be same as totalAmount if the line item is already in Euro.
57
- - quantity: The quantity of the item or service provided in the line item.
57
+ - quantity: The quantity of the item or service provided in the line item. Pay attention to 2 x 40HC or 2x40HC. It means, quantity is 2 and 40HC is containerSize but not 240.
58
58
  - containerNumber: Container Number always starts with 4 letters and is followed by 7 digits (e.g., ABCD1234567).
59
59
 
60
60
  - hblNumber and mblNumber:
@@ -92,6 +92,7 @@ Your role is to accurately extract specific entities from these invoices to supp
92
92
 
93
93
  IMPORTANT NOTE:
94
94
  - Ensure all extracted values are directly from the document. Do not make assumptions or modifications.
95
+ - CustomSized invoices contain line items in a table format in a attached page. Table with headings Shipment ID, Partner Line Item Description, Quantity, Amount, and VAT. Extract all the line items from each tables from each page.
95
96
  - Do not normalize or modify any entity values.
96
97
  - Pay attention to the line item details and paymentInformation, as they may vary significantly across different invoices.
97
98
 
@@ -1,29 +1,82 @@
1
1
  {
2
- "type": "OBJECT",
3
- "properties": {
4
- "EmptyContainerDepot": {"type": "STRING", "nullable": true},
5
- "Equipment": {"type": "ARRAY",
6
- "items": {
7
- "type": "OBJECT", "properties": {
8
- "CargoGrossWeight": {"type": "STRING", "nullable": true},
9
- "ContainerNumber": {"type": "STRING", "nullable": true},
10
- "ContainerType": {"type": "STRING", "nullable": true},
11
- "EmptyReturnReference": {"type": "STRING", "nullable": true},
12
- "Pin": {"type": "STRING", "nullable": true},
13
- "TareWeight": {"type": "STRING", "nullable": true}
14
- }, "required": []}
15
- },
16
- "pickUpTerminal": {"type": "STRING", "nullable": true},
17
- "TransportLeg": {"type": "ARRAY",
18
- "items": {
19
- "type": "OBJECT", "properties": {
20
- "eta": {"type": "STRING", "nullable": true},
21
- "etd": {"type": "STRING", "nullable": true},
22
- "portOfDischarge": {"type": "STRING", "nullable": true},
23
- "portOfLoading": {"type": "STRING", "nullable": true},
24
- "vesselName": {"type": "STRING", "nullable": true},
25
- "voyage": {"type": "STRING", "nullable": true}
26
- }, "required": []}
27
- },
28
- "required": []}
2
+ "type": "OBJECT",
3
+ "properties": {
4
+ "EmptyContainerDepot": {
5
+ "type": "STRING",
6
+ "nullable": true,
7
+ "description": "The depot where the empty container is returned."
8
+ },
9
+ "Equipment": {
10
+ "type": "ARRAY",
11
+ "items": {
12
+ "type": "OBJECT",
13
+ "properties": {
14
+ "CargoGrossWeight": {
15
+ "type": "STRING",
16
+ "nullable": true,
17
+ "description": "The gross weight of the Cargo. Usually mentioned as G.W or GW or Gross Weight, etc.."},
18
+ "ContainerNumber": {
19
+ "type": "STRING",
20
+ "nullable": true,
21
+ "description": "The container number associated with the document. They MUST consist of 4 letters followed by 7 digits (e.g., 'CMAU1234567', 'BMOU 575538/3', 'XLXU 1277652'). It can be found in the document as 'Container No.', 'Container Number', 'Cont. No.', 'Cont Nr.', 'Seefrachtcontainer-Nr.', or 'Containernummer'."},
22
+ "ContainerType": {
23
+ "type": "STRING",
24
+ "nullable": true,
25
+ "description": "The size or Type of the container associated with the containerNumber, such as 20ft, 40ft, 40HC, 20DC etc."},
26
+ "EmptyReturnReference": {
27
+ "type": "STRING",
28
+ "nullable": true,
29
+ "description": "The reference number or code for the return of the empty container."},
30
+ "Pin": {
31
+ "type": "STRING",
32
+ "nullable": true,
33
+ "description": "The PIN code associated with the container, often used for security or access purposes."},
34
+ "TareWeight": {
35
+ "type": "STRING",
36
+ "nullable": true,
37
+ "description": "The weight of the empty container itself, without any cargo inside. Usually mentioned as T.W or TW or Tare Weight, etc.."}
38
+ },
39
+ "required": ["CargoGrossWeight", "ContainerNumber", "EmptyReturnReference", "Pin", "TareWeight"]
40
+ }
41
+ },
42
+ "pickUpTerminal": {
43
+ "type": "STRING",
44
+ "nullable": true,
45
+ "description": "The terminal where the container or cargo is picked up."
46
+ },
47
+ "TransportLeg": {
48
+ "type": "ARRAY",
49
+ "items": {
50
+ "type": "OBJECT",
51
+ "properties": {
52
+ "eta": {
53
+ "type": "STRING",
54
+ "nullable": true,
55
+ "description": "Estimated Time of Arrival (ETA) is the expected date when the shipment will arrive at its destination."},
56
+ "etd": {
57
+ "type": "STRING",
58
+ "nullable": true,
59
+ "description": "Estimated Time of Departure (ETD) is the expected date when the shipment will leave the origin port."},
60
+ "portOfDischarge": {
61
+ "type": "STRING",
62
+ "nullable": true,
63
+ "description": "The port where the goods are discharged from the vessel. This is the destination port for the shipment."},
64
+ "portOfLoading": {
65
+ "type": "STRING",
66
+ "nullable": true,
67
+ "description": "The origin port where the goods are loaded onto the vessel. Find information like 'Ladehafen' or 'Port of Loading' in the invoice."},
68
+ "vesselName": {
69
+ "type": "STRING",
70
+ "nullable": true,
71
+ "description": "The name of the vessel carrying the container or shipment"},
72
+ "voyage": {
73
+ "type": "STRING",
74
+ "nullable": true,
75
+ "description": "The unique voyage number or identifier assigned to a vessel’s specific journey. This typically corresponds to the scheduled sailing associated with the shipment and can often be found near vessel information on shipping documents. such as voyage, voy. no, voyage-no."}
76
+ },
77
+ "required": ["eta", "etd", "portOfDischarge", "portOfLoading", "vesselName", "voyage"]
78
+ }
79
+ }
80
+ },
81
+ "required": ["Equipment", "TransportLeg"]
29
82
  }
@@ -1,50 +1,36 @@
1
- You are a document entity extraction specialist. Given a document, the explained datapoint need to extract.
1
+ <PERSONA> You are an efficient document entity data extraction specialist working for a Freight Forwarding company. <PERSONA>
2
2
 
3
+ <TASK> Your task is to extract data from Delivery Order documents as per the given response schema structure. <TASK>
4
+
5
+ <CONTEXT>
6
+ The Freight Forwarding company receives Delivery Order from Carrier (Shipping Lines) partners.
7
+ These documents contain various details related to shipments, equipment details, transport leg details, delivery / pickup details, vessel details, pick up terminal data.
8
+ They may be written in different languages such as English, German, Vietnamese, Chinese, and other European languages, and can appear in a variety of formats and layouts.
9
+ Your role is to accurately extract specific entities from these Delivery Orders to support efficient processing and accurate record-keeping.
10
+ <CONTEXT>
11
+
12
+ <INSTRUCTIONS>
13
+ - Populate fields as defined in the response schema.
14
+ - Multiple Equipment and TransportLeg entries may exist — capture all instances under "Equipment" and "TransportLeg".
15
+ - Use the data field description to understand the context of the data.
3
16
 
4
17
  EmptyContainerDepot: Empty container depot address.
5
- Equipment:
6
- CargoGrossWeight: Total weight of the cargo, including the tare weight of the container.
7
- ContainerNumber: Unique ID for tracking the shipping container.
18
+ Equipment: Details of each Equipment on the Delivery Order. Make sure to extract each Equipment information separately.
19
+ CargoGrossWeight: Total weight of the cargo, including the tare weight of the container. Weight(incl. tare), Cargo Weight, Weight (KG)
20
+ ContainerNumber: Container Number consists of 4 capital letters followed by 7 digits (e.g., TEMU7972458, CAIU 7222892).
8
21
  ContainerType: Type of the shipping container, usually related to it's size.
9
- EmptyReturnReference: A reference code for empty container return.
10
- Pin: Container release reference.
11
- TareWeight: Tare weight.
12
- pickUpTerminal: The specific terminal for cargo pickup.
13
- TransportLeg:
22
+ EmptyReturnReference: A reference code for empty container return. Find it as Drop off reference, turn-in reference in the document.
23
+ Pin: Container release reference or PIN code to pick up the container. Can be found as Release reference, pin
24
+ TareWeight: Weight of the empty container without cargo. It can be found as Tare weight, tare.
25
+
26
+ pickUpTerminal: The specific terminal for cargo pickup. It can also be found as pick up at depot, empty container depot, pickup depot, empty pickup location in the doc.
27
+
28
+ TransportLeg: Details of each TransportLeg on the Delivery Order. Make sure to extract each TransportLeg information separately.
14
29
  eta: The estimated time of arrival for a specific leg.
15
30
  etd: The estimated time of departure for a specific leg.
16
31
  portOfDischarge: The port where cargo is unloaded.
17
32
  portOfLoading: The port where cargo is loaded.
18
33
  vesselName: The name of the vessel.
19
- voyage: The journey or route code taken by the vessel.
20
-
21
- Your task is to extract the text value of the following entities and page numbers starting from 0 where the value was found in the document:
22
- SCHEMA_PLACEHOLDER
23
-
24
- Keywords for datapoints:
25
- - EmptyContainerDepot: Empty Container Depot
26
- - Equipment:
27
- - CargoGrossWeight: Weight(incl. tare), Cargo Weight, Weight (KG)
28
- - ContainerNumber: Container, Container Number, Container No.
29
- - ContainerType: Type, Size/type
30
- - EmptyReturnReference: Drop off reference, turn-in reference
31
- - Pin: Release reference, pin
32
- - TareWeight: Tare weight, tare
33
- - pickUpTerminal: pick up at depot, empty container depot, pickup depot, empty pickup location
34
- - TransportLeg:
35
- - eta: eta, ETA
36
- - etd: etd, ETD
37
- - portOfDischarge: to, PORT OF DISCHARGE
38
- - portOfLoading: from, PORT OF LOADING
39
- - vesselName: vessel
40
- - voyage: voyage, voy. no, voyage-no.
41
-
34
+ voyage: The journey or route code taken by the vessel. It is often identified as voyage, voy. no, voyage-no in the document.
42
35
 
43
- You must apply the following rules:
44
- - The JSON schema must be followed during the extraction.
45
- - The values must only include text found in the document
46
- - Do not normalize any entity value.
47
- - portOfLoading and portOfDischarge are name of the Ports. You can rely on the port names from all over the world.
48
- - portOfLoading and portOfDischarge distinctly denotes the name of the ports. If you find abbreviation of the port use it, if not you can use the full name of the port
49
- - Validate the JSON make sure it is a valid JSON ! No extra text, no missing comma!
50
- - Add an escape character (backwards slash) in from of all quotes in values
36
+ <INSTRUCTIONS>
@@ -4,77 +4,77 @@
4
4
  "blNumber": {
5
5
  "type": "string",
6
6
  "nullable": true,
7
- "description": ""
8
- },
9
- "voyage": {
10
- "type": "string",
11
- "nullable": true,
12
- "description": ""
13
- },
14
- "portOfLoading": {
15
- "type": "string",
16
- "nullable": true,
17
- "description": ""
18
- },
19
- "portOfDischarge": {
20
- "type": "string",
21
- "nullable": true,
22
- "description": ""
7
+ "description": "The Bill of Lading number associated with the document. Commonly known as 'Bill of Lading Number', 'BILL OF LADING NO.', 'BL Number', 'BL No.', 'B/L No.', 'BL-Nr.', 'B/L', 'HBL No.', or 'M-AWB Nummer' in the document."
23
8
  },
24
9
  "bookingNumber": {
25
10
  "type": "string",
26
11
  "nullable": true,
27
- "description": ""
12
+ "description": " Booking numbers are unique identifiers for shipments. They are often referred to as 'Booking Number', 'Booking No.', 'Booking Ref.', 'Booking Reference', 'Booking ID', 'SACO-Pos.' or 'Order Ref'"
28
13
  },
29
14
  "containers": {
30
15
  "type": "ARRAY",
31
16
  "items": {
32
17
  "type": "OBJECT",
33
18
  "properties": {
19
+ "containerNumber": {
20
+ "type": "string",
21
+ "nullable": true,
22
+ "description": "The container number associated with the document. They MUST consist of 4 letters followed by 7 digits (e.g., 'CMAU1234567', 'BMOU 575538/3', 'XLXU 1277652'). It can be found in the document as 'Container No.', 'Container Number', 'Cont. No.', 'Cont Nr.', 'Seefrachtcontainer-Nr.', or 'Containernummer."
23
+ },
34
24
  "containerType": {
35
25
  "type": "string",
36
26
  "nullable": true,
37
- "description": ""
27
+ "description": "The size or Type of the container associated with the containerNumber, such as 20ft, 40ft, 40HC, 20DC etc."
38
28
  },
39
29
  "grossWeight": {
40
30
  "type": "string",
41
31
  "nullable": true,
42
- "description": ""
32
+ "description": "The gross weight of the container. Usually mentioned as G.W or GW or Gross Weight, etc.."
43
33
  },
44
34
  "measurements": {
45
35
  "type": "string",
46
36
  "nullable": true,
47
- "description": ""
48
- },
37
+ "description": "The volume of the Container. Usually, it is measured in 'Cubic Meter (cbm)' or dimensions. But volume in 'cbm' is preferred."
38
+ },
49
39
  "packageQuantity": {
50
40
  "type": "string",
51
41
  "nullable": true,
52
- "description": ""
42
+ "description": "The quantity of the goods in the container. Usually quantity is in pallets, PLT, cartons, CTNS, pieces, PCS, packages, boxes, etc. Please prioritize the packaging types based on their size, as follows: Pallets (PLT) >> Cartons (CTNS) >> Pieces (PCS). Extract the Larger packaging types that will have a lower count."
53
43
  },
54
44
  "packageType": {
55
45
  "type": "string",
56
46
  "nullable": true,
57
- "description": ""
58
- },
59
- "containerNumber": {
60
- "type": "string",
61
- "nullable": true,
62
- "description": ""
63
- },
47
+ "description": "The packaging type is the unit of packageQuantity. Example; pallets, PLT, cartons, CTNS, pieces, PCS, packages, etc. Sometimes, the packaging type is available in the column name of the quantityShipped."
48
+ },
64
49
  "sealNumber": {
65
50
  "type": "string",
66
51
  "nullable": true,
67
- "description": ""
52
+ "description": "The seal number associated with the container Number and you can find like seal number, seal nos., shipper seal, seal.. But it is not same as the container number."
68
53
  }
69
54
  },
70
- "required": []
55
+ "required": ["containerNumber", "containerType", "grossWeight", "measurements", "packageQuantity", "packageType", "sealNumber"]
71
56
  }
72
57
  },
58
+ "portOfDischarge": {
59
+ "type": "string",
60
+ "nullable": true,
61
+ "description": "The port where the containers are discharged from the vessel. This is the destination port for the shipment. Find information like port of discharge, pod, delivery, to."
62
+ },
63
+ "portOfLoading": {
64
+ "type": "string",
65
+ "nullable": true,
66
+ "description": "The origin port where the containers are loaded onto the vessel. Find information like 'Ladehafen', 'Port of Loading', 'pol', or 'from.' in the document."
67
+ },
68
+ "voyage": {
69
+ "type": "string",
70
+ "nullable": true,
71
+ "description": "The unique voyage number or identifier assigned to a vessel’s specific journey. This typically corresponds to the scheduled sailing associated with the shipment and can often be found near vessel information on shipping documents. such as voyage, voy. no, voyage-no."
72
+ },
73
73
  "vessel": {
74
74
  "type": "string",
75
75
  "nullable": true,
76
- "description": ""
76
+ "description": "The name of the vessel carrying the container or shipment"
77
77
  }
78
78
  },
79
- "required": []
79
+ "required": ["blNumber", "bookingNumber", "containers", "portOfDischarge", "portOfLoading", "voyage", "vessel"]
80
80
  }
@@ -1,44 +1,34 @@
1
- You are a document entity extraction specialist. Given a document, the explained datapoint need to extract.
2
-
3
- blNumber: Bill of Lading number.
4
- voyage: The journey or route code taken by the vessel.
5
- portOfLoading: The port where cargo is loaded.
6
- portOfDischarge: The port where cargo is unloaded.
7
- bookingNumber: A unique identifier for the booking.
8
- containers:
9
- containerType: Type of the shipping container, usually related to it's size.
10
- grossWeight: Total weight of the cargo, including the tare weight of the container.
11
- measurements: Dimensions of the cargo (length, width, height) for freight calculations.
12
- packageQuantity: package quantity.
13
- packageType: Type of packaging used (e.g., cartons, pallets, barrels).
14
- containerNumber: Unique ID for tracking the shipping container.
15
- sealNumber: Number of the container's seal.
16
- vessel: The name of the vessel.
17
-
18
-
19
- Your task is to extract the text value of the following entities and page numbers starting from 0 where the value was found in the document:
20
-
21
- Keywords for datapoints:
22
- - blNumber: Bill of Lading number, bill of landing no., swb-no., b/l no.
23
- - voyage: voyage, voy. no, voyage-no.
24
- - portOfLoading: port of loading, pol, from.]
25
- - portOfDischarge: port of discharge, pod, delivery, to
26
- - bookingNumber: Our reference, booking no., carrier reference
27
- - containers:
28
- - containerType: x 40' container
29
- - grossWeight: gross weight
30
- - measurements: Dimensions of the cargo (length, width, height) for freight calculations
31
- - packageQuantity: package quantity, number and kind of packages
32
- - packageType: Type of packaging used (e.g., cartons, pallets, barrels), number and kind of packages, description of goods
33
- - containerNumber: container number, cntr. nos.
34
- - sealNumber: seal number, seal nos., shipper seal, seal.
35
- - vessel: vessel
36
-
37
-
38
- You must apply the following rules:
39
- - The JSON schema must be followed during the extraction.
40
- - The values must only include text found in the document
41
- - Do not normalize any entity value.
42
- - If 'sealNumber' is not found don't add it to the result.
43
- - Validate the JSON make sure it is a valid JSON ! No extra text, no missing comma!
44
- - Add an escape character (backwards slash) in from of all quotes in values
1
+ <PERSONA> You are an efficient document entity data extraction specialist working for a Freight Forwarding company. <PERSONA>
2
+
3
+ <TASK> Your task is to extract data from draftMBL documents as per the given response schema structure. <TASK>
4
+
5
+ <CONTEXT>
6
+ The Freight Forwarding company receives draftMBL from Carrier (Shipping Lines) partners.
7
+ These documents contain various details related to shipments, booking details, vessel details, POL, POD and containers data.
8
+ They may be written in different languages such as English, German, Vietnamese, Chinese, and other European languages, and can appear in a variety of formats and layouts.
9
+ Your role is to accurately extract specific entities from these draftMBLs to support efficient processing and accurate record-keeping.
10
+ <CONTEXT>
11
+
12
+
13
+ <INSTRUCTIONS>
14
+ - Populate fields as defined in the response schema.
15
+ - Multiple Containers entries may exist, capture all instances under "containers".
16
+ - Use the data field description to understand the context of the data.
17
+
18
+ - bookingNumber:
19
+ - Booking numbers are unique identifiers for shipments. They are often referred to as "Booking Number", "Booking No.", "Booking Ref.", "Booking Reference", "Booking ID", "SACO-Pos.", "Order Ref", "Unsere Referenz", or "Unsere Position"
20
+ - If there is a unique_id that starts with "S" followed by 6 or 8 digits, it is a shipmentID, not a bookingNumber.
21
+
22
+ - blNumber:
23
+ - Commonly known as "Bill of Lading Number", "BILL OF LADING NO.", "BL Number", "BL No.", "B/L No.", "BL-Nr.", "B/L", "HBL No.", or "M-AWB Nummer".
24
+ - Bill of Lading Number is known as mblNumber. Not a shipmentID even if it starts with "S".
25
+ - blNumber from Hapag-Lloyd always starts with HLC.... (e.g., "HLCUTS12303AWNT3) and named as SEA WAYBILL or "SWB-NR.
26
+
27
+ - vesselName:
28
+ - Vessel Name is the name of the ship carrying the cargo. It can be referred to as "Vessel", "Ship Name", "Schiff", "Schiffsname", "Nave", or "Vessel/Flight No.".
29
+
30
+ - containers: Details of each container on the draftMBL. Make sure to extract each container information separately.
31
+ - containerNumber: Container Number consists of 4 capital letters followed by 7 digits (e.g., TEMU7972458, CAIU 7222892).
32
+ - sealNumber: Seal numbers are unique identifiers for shipping seals. They are usually mentioned as seal numbers in the document but they are definitely not container numbers.
33
+
34
+ <INSTRUCTIONS>