data-science-document-ai 1.58.0__py3-none-any.whl → 1.59.0__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.
- {data_science_document_ai-1.58.0.dist-info → data_science_document_ai-1.59.0.dist-info}/METADATA +1 -1
- {data_science_document_ai-1.58.0.dist-info → data_science_document_ai-1.59.0.dist-info}/RECORD +18 -18
- src/postprocessing/common.py +0 -35
- src/prompts/library/bookingConfirmation/evergreen/placeholders.json +7 -7
- src/prompts/library/bookingConfirmation/evergreen/prompt.txt +45 -29
- src/prompts/library/bookingConfirmation/hapag-lloyd/prompt.txt +3 -3
- src/prompts/library/bookingConfirmation/maersk/placeholders.json +5 -5
- src/prompts/library/bookingConfirmation/maersk/prompt.txt +48 -56
- src/prompts/library/bookingConfirmation/msc/placeholders.json +9 -9
- src/prompts/library/bookingConfirmation/msc/prompt.txt +57 -60
- src/prompts/library/bookingConfirmation/oocl/placeholders.json +12 -12
- src/prompts/library/bookingConfirmation/oocl/prompt.txt +38 -13
- src/prompts/library/bookingConfirmation/other/placeholders.json +11 -11
- src/prompts/library/bookingConfirmation/other/prompt.txt +36 -12
- src/prompts/library/bookingConfirmation/yangming/placeholders.json +12 -12
- src/prompts/library/bookingConfirmation/yangming/prompt.txt +45 -57
- src/utils.py +2 -6
- {data_science_document_ai-1.58.0.dist-info → data_science_document_ai-1.59.0.dist-info}/WHEEL +0 -0
|
@@ -7,66 +7,54 @@ The Freight Forwarding company receives Booking Confirmation from Yangming Carri
|
|
|
7
7
|
These Booking Confirmations contain various details related to booking, container pick up and drop off depot details, vessel details, as well as other transport Legs data.
|
|
8
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
9
|
Your role is to accurately extract specific entities from these Booking Confirmations to support efficient processing and accurate record-keeping.
|
|
10
|
-
<CONTEXT>
|
|
11
|
-
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
mblNumber: The Master Bill of Lading number.
|
|
18
|
-
pickUpReference: A reference code for cargo pickup.
|
|
19
|
-
pickUpTerminal: The specific terminal for cargo pickup.
|
|
20
|
-
siCutOff: The deadline for submitting shipping instructions.
|
|
21
|
-
vgmCutOff: The deadline for submitting the Verified Gross Mass of the cargo.
|
|
22
|
-
transportLegs:
|
|
23
|
-
eta: The estimated time of arrival for a specific leg.
|
|
24
|
-
etd: The estimated time of departure for a specific leg.
|
|
25
|
-
imoNumber: The International Maritime Organization number for a specific leg.
|
|
26
|
-
portOfDischarge: The port where cargo is unloaded for a specific leg.
|
|
27
|
-
portOfLoading: The port where cargo is loaded for a specific leg.
|
|
28
|
-
vesselName: The name of the vessel for a specific leg.
|
|
29
|
-
voyage: The journey or route taken by the vessel for a specific leg.
|
|
11
|
+
To provide context on the journey of a containers for both Export and Import shipments,
|
|
12
|
+
For Export shipment: An empty container is picked up from a depot (pickupDepotCode) using a pickUpReference and goods loaded into it at a warehouse. Then the loaded container / cargo is transported back to a Container Yard or gateInTerminal before the cyCutOff date for further shipping processes. Then the POL of the First TransportLeg may start from the gateInTerminal or a different POL too.
|
|
13
|
+
For Import Shipment: The loaded container / cargo arrives at a port of discharge then picked up at pickUpTerminal using pickUpReference. After delivery, an empty container is returned to a depot (dropOffDepotCode).
|
|
14
|
+
<CONTEXT>
|
|
30
15
|
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
<INSTRUCTIONS>
|
|
17
|
+
- Populate fields as defined in the response schema.
|
|
18
|
+
- Use the data field description to understand the context of the data.
|
|
33
19
|
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
- cyCutOff: FCL delivery cut-off
|
|
37
|
-
- gateInReference: Our Reference
|
|
38
|
-
- gateInTerminal: Export terminal delivery address
|
|
39
|
-
- mblNumber: BL/SWB No(s).
|
|
40
|
-
- pickUpReference: Export door positioning address(es)
|
|
41
|
-
- siCutOff: shipping instruction closing
|
|
42
|
-
- vgmCutOff: VGM cut-off
|
|
43
|
-
- eta: eta, ETA
|
|
44
|
-
- etd: etd, ETD
|
|
45
|
-
- imoNumber: IMO No, IMO number
|
|
46
|
-
- portOfDischarge: to
|
|
47
|
-
- portOfLoading: from
|
|
48
|
-
- vesselName: vessel
|
|
49
|
-
- voyage: Voy. no
|
|
20
|
+
- gateInTerminalCode: The specific terminal where cargo is gated in. It is mentioned as Delivery Terminal. This sometimes can be the same as portOfLoading of the First transportLeg.
|
|
21
|
+
- cyCutOff: The deadline for cargo to be delivered to the Container Yard. It can be found at Cargo Cut Off or FCL delivery cut-off.
|
|
50
22
|
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
23
|
+
- transportLegs: Multiple Transport Legs entries may exist, capture all instances under "transportLegs". Make sure the order of the legs are important.
|
|
24
|
+
- eta: The estimated time of arrival for a specific leg.
|
|
25
|
+
- etd: The estimated time of departure for a specific leg. It can also be referred as ETS (Estimated Time of Sailing).
|
|
26
|
+
- imoNumber: The International Maritime Organization number for a specific leg.
|
|
27
|
+
- portOfDischarge: The port where cargo is unloaded for a specific leg.
|
|
28
|
+
- portOfLoading: The port where cargo is loaded for a specific leg.
|
|
29
|
+
- vesselName: The name of the vessel for a specific leg.
|
|
30
|
+
- voyage: The journey or route taken by the vessel for a specific leg.
|
|
54
31
|
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
- Vessel name is in 'By' column and under the key Vessel
|
|
32
|
+
IMPORTANT explanation for the transportLegs part as follows:
|
|
33
|
+
- There is at least one leg in each document.
|
|
58
34
|
- 'eta' must be equal or later than 'etd'!
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
-
|
|
35
|
+
- Multiple legs are possible. When there are multiple legs,
|
|
36
|
+
- Sequential Sorting: You must manually re-order legs based on etd then eta, regardless of their order in the source text.
|
|
37
|
+
- "Transhipment" indicates the presence of a multi-leg journey.
|
|
38
|
+
- Transhipment Date is usually empty therefore you may keep ETA of the first leg and ETD of the second leg as null if there is a transhipment.
|
|
39
|
+
- Transhipment Handling: Treat any mentioned "Transhipment" as the bridge between two legs (Discharge for Leg A and Loading for Leg B).
|
|
40
|
+
- The Connectivity Rule: For any sequence of legs, the Port of Discharge of the previous leg must match the Port of Loading of the following leg.
|
|
41
|
+
- First Transhipment is the Port of Discharge for the first transportLegs and Port of Loading for the second transportLegs.
|
|
42
|
+
- Second Transhipment is the Port of Discharge for the second transportLegs and Port of Loading for the third transportLegs.
|
|
43
|
+
- Timeline Integrity: Ensure a "No Time Travel" policy: The eta of a previous leg must be earlier than or equal to the etd of the following leg.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
Structure of Multiple Leg Sequence & Mapping
|
|
47
|
+
Leg 1 (Initial):
|
|
48
|
+
- `portOfLoading`: Sailing.
|
|
49
|
+
- `portOfDischarge`: Transhipment (if exists), otherwise DISCHARGE.
|
|
50
|
+
- `etd`: Sailing Date ETS.
|
|
51
|
+
- `eta`: Transhipment Date (if exists), otherwise keep it null in case of multi-legs. Else, DISCHARGE Date for single leg.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
Leg 2 (Intermediate): Trigger: Only if PORT OF TRANSHIPMENT exists.
|
|
55
|
+
- `portOfLoading`: portOfDischarge of Leg 1 (Transhipment).
|
|
56
|
+
- `portOfDischarge`: DISCHARGE.
|
|
57
|
+
- `etd`: Transhipment Date if exists else keep it null
|
|
58
|
+
- `eta`: DISCHARGE Date. Do not extract Destination Date here.
|
|
59
|
+
|
|
60
|
+
<INSTRUCTIONS>
|
src/utils.py
CHANGED
|
@@ -361,10 +361,7 @@ def extract_top_pages(pdf_bytes, num_pages=4):
|
|
|
361
361
|
|
|
362
362
|
|
|
363
363
|
async def get_tms_mappings(
|
|
364
|
-
input_list: List[str],
|
|
365
|
-
embedding_type: str,
|
|
366
|
-
llm_ports: Optional[List[str]] = None,
|
|
367
|
-
input_key: str = None,
|
|
364
|
+
input_list: List[str], embedding_type: str, llm_ports: Optional[List[str]] = None
|
|
368
365
|
) -> Dict[str, Any]:
|
|
369
366
|
"""Get TMS mappings for the given values.
|
|
370
367
|
|
|
@@ -373,7 +370,6 @@ async def get_tms_mappings(
|
|
|
373
370
|
embedding_type (str): Type of embedding to use
|
|
374
371
|
(e.g., "container_types", "ports", "depots", "lineitems", "terminals").
|
|
375
372
|
llm_ports (list[str], optional): List of LLM ports to use. Defaults to None.
|
|
376
|
-
input_key (str, optional): Key to use for input list in payload. Defaults to None.
|
|
377
373
|
|
|
378
374
|
Returns:
|
|
379
375
|
dict or string: A dictionary or a string with the mapping results.
|
|
@@ -393,7 +389,7 @@ async def get_tms_mappings(
|
|
|
393
389
|
input_list = [input_list]
|
|
394
390
|
|
|
395
391
|
# Always send a dict with named keys
|
|
396
|
-
payload = {
|
|
392
|
+
payload = {embedding_type: input_list}
|
|
397
393
|
|
|
398
394
|
if llm_ports:
|
|
399
395
|
payload["llm_ports"] = llm_ports if isinstance(llm_ports, list) else [llm_ports]
|
{data_science_document_ai-1.58.0.dist-info → data_science_document_ai-1.59.0.dist-info}/WHEEL
RENAMED
|
File without changes
|