Maritime activity knowledge extraction method and device based on large language model

By employing data cleaning, complex sentence decomposition, and feedback optimization strategies, the heterogeneity and complexity of maritime activity data were addressed, enabling efficient and accurate knowledge extraction suitable for maritime activity data analysis.

CN119088981BActive Publication Date: 2026-07-24NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NAT UNIV OF DEFENSE TECH
Filing Date
2024-08-28
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Traditional information extraction techniques face heterogeneity and complexity issues when processing maritime activity data, making it difficult to accurately identify and understand entities and relationships in maritime trajectory data.

Method used

By cleaning and reconstructing data, setting initial prompts and optimization strategies, using a large language model to break down complex sentences, and combining feedback optimization, simulated text question-and-answer pairs are generated, and prompts are optimized to improve the accuracy of knowledge extraction.

Benefits of technology

It achieves high integrity and high accuracy in marine knowledge extraction, reduces the cost of annotation and parameter modification, and improves the efficiency of the model in knowledge extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088981B_ABST
    Figure CN119088981B_ABST
Patent Text Reader

Abstract

The application relates to a marine activity knowledge extraction method and device based on a large language model for marine knowledge extraction. The method comprises the following steps: initially setting a prompt word and optimizing the initial prompt word by setting a prompt word optimization strategy, guiding the large language model to perform sentence transcription on reconstructed data by using the optimized prompt word, and obtaining a preliminary extraction result; labeling the preliminary extraction result according to a pre-set extraction error label system, taking the labeled text as a similar error text, performing sentence structure analysis on the similar error file, generating a simulation text question and answer pair, feeding back and modifying the optimized prompt word, guiding the large language model to perform knowledge extraction on marine activity data by using the modified prompt word, and obtaining marine knowledge. The method can realize marine knowledge extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing technology, and in particular to a method and apparatus for extracting maritime activity knowledge based on a large language model. Background Technology

[0002] In the field of marine activities, extracting valuable knowledge from massive amounts of data has become a key requirement in many research fields and industry practices. The complete analysis of maritime activity data is of immeasurable value for maintaining national security and implementing effective maritime surveillance.

[0003] Traditional information extraction techniques face numerous challenges when processing complex maritime activity data. The following two issues prompted the research and discussion of this invention: First, the heterogeneity of the data. On the internet, there is a lack of systematic summaries of maritime trajectory data, and the information presentation methods and structures on different websites can vary significantly. For example, ship movements published on news websites often present factual statements of maritime activities in rigorous natural language text, while AIS data (Automatic Identification System data) focuses more on mathematical symbols such as ship position, speed, and heading. Data in forum posts may even contain noise such as emoticons and symbols. Accurately identifying, filtering, and reconstructing data from different sources is itself a complex task, and heterogeneous data poses a significant challenge to accurate entity recognition and relation extraction in models.

[0004] Secondly, there is the complexity of meaning. Natural language text conforms to human language expression habits, but it is not conducive to machine parsing and understanding. On the one hand, complex sentences are common in natural language text, such as compound sentences and inverted sentences. These sentences often have high information density, which can easily lead to omissions during information extraction. On the other hand, natural language text also contains a large number of pronouns and abbreviations, which are often prone to ambiguity and confusion during information extraction. Therefore, accurately understanding the structure and semantics of the text is a significant challenge for the model. At the same time, maritime activity records are highly specialized, involving a large number of technical terms such as ship types and geographical locations. For models lacking sufficient corpus, understanding these terms is very difficult, inevitably leading to entity recognition errors during knowledge extraction and significantly increasing the complexity of knowledge extraction. Summary of the Invention

[0005] Therefore, it is necessary to provide a method and apparatus for extracting maritime activity knowledge based on a large language model, which can realize maritime knowledge extraction, in order to address the above-mentioned technical problems.

[0006] A method for extracting maritime activity knowledge based on a large language model, the method comprising:

[0007] Acquire maritime activity data; perform data cleaning and reconstruction on the maritime activity data to obtain reconstructed data;

[0008] Initial prompts were pre-set, and a prompt optimization strategy was implemented to optimize them. The optimized prompts were then used to guide the large language model to transcribe the reconstructed data into sentences. The reconstructed data was split into two or more simple sentences, including time-based complex sentences consisting of a main clause, multiple subordinate clauses, and a variety of conjunctions, as well as inverted sentences with abnormal subject positions. The simple sentences were then extracted to obtain preliminary extraction results.

[0009] The preliminary extraction results are labeled according to the pre-set extraction error labeling system. The labeled text is regarded as the same type of error text. The sentence structure of the same type of error files is analyzed to generate simulated text question-and-answer pairs. After deleting the modifiers in the simulated text question-and-answer pairs, the optimized prompt words are fed back and modified to obtain the modified prompt words.

[0010] The modified prompt words are used to guide the large language model to extract knowledge from maritime activity data, resulting in maritime knowledge. Maritime knowledge includes ship names, start times, end times, locations, event names, and other vessels.

[0011] In one embodiment, the maritime activity data is cleaned and reconstructed to obtain reconstructed data, including:

[0012] The maritime activity data undergoes data cleaning to remove missing items, duplicates, webpage tags, and garbled text, resulting in relatively clean records. Maritime activity data crawled from different sites is then integrated and categorized by vessel name. For each vessel, the data is arranged chronologically. Based on maritime expertise, the arranged maritime activity data is reconstructed, resulting in multiple reconstructed data categories, including "Arrival," "Departure," and "Participation." "Arrival" indicates a vessel is anchored at a location without mentioning subsequent activities or reasons for anchoring; "Departure" indicates a vessel has left a location without mentioning subsequent activities or reasons for leaving; and "Participation" indicates specific maritime activities the vessel participated in or navigation in a specific area.

[0013] In one embodiment, the pre-set initial prompts include background knowledge, user expectations, task flow, additional information, and task examples; wherein, the background knowledge includes the concept of time complex sentences, the user expectations include transcribing into simple sentences, the task flow includes determining the relationship between main and subordinate clauses, extracting events to form new sentences, replacing pronouns, and inferring the timeline, the additional information includes the priority of event understanding, and the task examples include input data and output data.

[0014] In one embodiment, the prompt word optimization strategy includes information guidance, full coverage design, and differentiated design; information guidance refers to emphasizing words or adverbs, as well as synonym repetition or paraphrasing; full coverage design refers to setting boundary conditions and exception handling mechanisms in the prompt words by considering and including various possible situations; differentiated design refers to formulating different processing methods for different situations.

[0015] In one embodiment, the pre-set error labeling system includes primary labels and secondary labels; primary labels include ship name error, time error, location error, and event error; secondary labels include implicit subject reasoning, implicit time reasoning, implicit location reasoning, insufficient inductive summary, insufficient knowledge background, and output format error.

[0016] A knowledge extraction device for maritime activities based on a large language model, the device comprising:

[0017] The data preprocessing module is used to acquire maritime activity data; it performs data cleaning and data reconstruction on the maritime activity data to obtain reconstructed data.

[0018] The initial knowledge extraction module is used to pre-set initial prompt words and optimize them using a prompt word optimization strategy. The optimized prompt words guide the large language model to transcribe the reconstructed data into sentences. It breaks down time-based complex sentences composed of a main clause, multiple subordinate clauses, and rich conjunctions, as well as inverted sentences with abnormal subject positions, into two or more simple sentences. The simple sentences are then extracted to obtain the initial extraction results.

[0019] The prompt word modification module is used to label the preliminary extraction results according to the pre-set extraction error label system, treat the labeled text as similar error text, perform sentence structure analysis on similar error files, generate simulated text question-and-answer pairs, delete the modifiers in the simulated text question-and-answer pairs, and then provide feedback modification to the optimized prompt words to obtain the modified prompt words.

[0020] The knowledge extraction module is used to guide the large language model to extract knowledge from maritime activity data using modified prompts, thereby obtaining maritime knowledge. Maritime knowledge includes ship names, start times, end times, locations, event names, and other vessels.

[0021] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:

[0022] Acquire maritime activity data; perform data cleaning and reconstruction on the maritime activity data to obtain reconstructed data;

[0023] Initial prompts were pre-set, and a prompt optimization strategy was implemented to optimize them. The optimized prompts were then used to guide the large language model to transcribe the reconstructed data into sentences. The reconstructed data was split into two or more simple sentences, including time-based complex sentences consisting of a main clause, multiple subordinate clauses, and a variety of conjunctions, as well as inverted sentences with abnormal subject positions. The simple sentences were then extracted to obtain preliminary extraction results.

[0024] The preliminary extraction results are labeled according to the pre-set extraction error labeling system. The labeled text is regarded as the same type of error text. The sentence structure of the same type of error files is analyzed to generate simulated text question-and-answer pairs. After deleting the modifiers in the simulated text question-and-answer pairs, the optimized prompt words are fed back and modified to obtain the modified prompt words.

[0025] The modified prompt words are used to guide the large language model to extract knowledge from maritime activity data, resulting in maritime knowledge. Maritime knowledge includes ship names, start times, end times, locations, event names, and other vessels.

[0026] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0027] Acquire maritime activity data; perform data cleaning and reconstruction on the maritime activity data to obtain reconstructed data;

[0028] Initial prompts were pre-set, and a prompt optimization strategy was implemented to optimize them. The optimized prompts were then used to guide the large language model to transcribe the reconstructed data into sentences. The reconstructed data was split into two or more simple sentences, including time-based complex sentences consisting of a main clause, multiple subordinate clauses, and a variety of conjunctions, as well as inverted sentences with abnormal subject positions. The simple sentences were then extracted to obtain preliminary extraction results.

[0029] The preliminary extraction results are labeled according to the pre-set extraction error labeling system. The labeled text is regarded as the same type of error text. The sentence structure of the same type of error files is analyzed to generate simulated text question-and-answer pairs. After deleting the modifiers in the simulated text question-and-answer pairs, the optimized prompt words are fed back and modified to obtain the modified prompt words.

[0030] The modified prompt words are used to guide the large language model to extract knowledge from maritime activity data, resulting in maritime knowledge. Maritime knowledge includes ship names, start times, end times, locations, event names, and other vessels.

[0031] The aforementioned method and apparatus for knowledge extraction from maritime activities based on a large language model first cleans and reconstructs the maritime activity data to reduce inconsistencies across different data sources, facilitating subsequent transcription and extraction. Then, prompt words and corresponding optimization strategies are set to guide the large language model in understanding the task scenario and user expectations, accurately identifying entities and relationships within the data, and acquiring structured knowledge. The prompt words guide the large language model in knowledge extraction. The large language model's pre-trained corpus is rich, enabling it to better understand text semantics and context in knowledge extraction tasks, extracting richer linguistic features and knowledge representations. The optimized prompt words guide the large language model in transcribing the reconstructed data, breaking down complex sentences (consisting of a main clause, multiple subordinate clauses, and numerous conjunctions) and inverted sentences with abnormal subject positions into two or more simple sentences, enhancing the large language model's understanding of the text. This allows models with smaller parameters and weaker semantic understanding capabilities to perform knowledge extraction tasks effectively. Finally, the "supervisor in the loop" feedback optimization concept is proposed, focusing on key issues and combining external knowledge with model optimization to reduce the improvement cost of large language models. Model improvement is achieved through the refinement of prompt words, thereby increasing the accuracy of large language models in knowledge extraction. This application utilizes large language models to extract knowledge from maritime activity data, extracting entities and relationships from text and organizing them into structured data for better analysis and research of the rich knowledge contained within the text. This allows for a better understanding and analysis of maritime activity data, providing strong support for effective maritime trajectory prediction. Compared to traditional sequence labeling methods, it offers high extraction completeness, high extraction accuracy, zero-shot or few-shot learning with low labeling costs, and low parameter modification costs. Attached Figure Description

[0032] Figure 1 This is a flowchart illustrating a method for extracting maritime activity knowledge based on a large language model in one embodiment.

[0033] Figure 2 This is a flowchart illustrating a transcribing example of a time complex sentence in one embodiment;

[0034] Figure 3 This is a flowchart illustrating the construction of compound sentence transcription prompts in one embodiment;

[0035] Figure 4 A flowchart illustrating an example of constructing prompt words for the information extraction module in another embodiment;

[0036] Figure 5 This is a schematic diagram of an error label extraction system in one embodiment;

[0037] Figure 6 This is a structural block diagram of a maritime activity knowledge extraction device based on a large language model in one embodiment.

[0038] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0040] In one embodiment, such as Figure 1 As shown, a method for extracting maritime activity knowledge based on a large language model is provided, including the following steps:

[0041] Step 102: Obtain maritime activity data; perform data cleaning and data reconstruction on the maritime activity data to obtain reconstructed data.

[0042] In a specific embodiment, firstly, missing items, duplicates, webpage tags, and garbled characters in the original data are removed to obtain relatively clean records; secondly, maritime history data crawled from different sites is integrated and categorized by vessel name to reduce inconsistencies between different data sources; then, for each vessel, the data is arranged in chronological order to facilitate subsequent transcription and extraction; finally, based on knowledge in the maritime field, the activity data is filtered, and maritime activities can be roughly divided into the following three categories:

[0043] (1) "Arrival" category: The ship is anchored in a certain place, and the text does not mention the ship's subsequent activities in that place or the reason for anchoring.

[0044] (2) "Departure" category: The vessel departs from a certain place without mentioning any subsequent activities or reasons for departure.

[0045] (3) "Participation" category: Specific maritime activities in which the ship participates, or navigation in a certain area.

[0046] Step 104: Initial prompt words are pre-set and a prompt word optimization strategy is set to optimize the initial prompt words. The optimized prompt words are used to guide the large language model to transcribe the reconstructed data into sentences. The time complex sentences composed of one main clause, multiple subordinate clauses and rich conjunctions and the inverted sentences with abnormal subject positions in the reconstructed data are split into two or more simple sentences. The simple sentences are extracted to obtain preliminary extraction results.

[0047] By converting complex sentences in the original data into simple sentences, the understanding of text by large language models is enhanced, enabling models with fewer parameters and poorer semantic understanding to perform knowledge extraction tasks.

[0048] In natural language texts such as news reports and forum posts, complex sentences consisting of a main clause, multiple subordinate clauses, and numerous conjunctions, as well as inverted sentences with unusual subject positions, are prevalent. These complex sentences often have high information density, unclear object referents, and are prone to ambiguity, posing challenges to entity recognition and relation extraction. Specifically in English corpora, sentences containing adverbial clauses of time (temporal complex sentences) are the most common type of complex sentence. Temporal complex sentences typically contain descriptions of primary and secondary events in chronological order. By splitting such a sentence into two or more simple sentences, the complexity of model processing can be significantly reduced. Each simple sentence is relatively independent, with clear referents, and focuses on specific information. This method helps the model more accurately identify and understand entities and relations in the sentence, such as events, subjects, and time elements, thereby improving the quality and completeness of knowledge extraction. In implementation, the main clause and subordinate clauses of the temporal complex sentence are first identified, and then they are transcribed into separate sentences. For example... Figure 2 As shown, the time complex sentence “After a 10-day port call to Island-A, LCC 19 arrived in Province A, on Feb. 12 before returning to Province B on the 19th.” can be rewritten as three simple sentences: (1) “On Feb 2, LCC 19 port call to Island-A.” (2) “On Feb 12, LCC 19 arrived in Province A.” (3) “On Feb 19, LCC 19 returned to Province B.”

[0049] This application achieves the above sentence transcription using a large language model. To improve the accuracy of sentence transcription, this application sets prompt words to guide the training of the large language model to understand the task scenario and user expectations, achieving twice the result with half the effort. In the prompt words for transcribing time complex sentences, the transcription process needs to be clearly stated in concise language, supplemented by representative examples. Specifically, the prompt words need to include the following information:

[0050] (1) Background knowledge: What is a time complex sentence?

[0051] (2) User expectations: What form should the time complex sentence be transcribed into?

[0052] (3) Task Flow: ① Determine the sequence of the main clause and subordinate clauses. ② If the event in the subordinate clause precedes the event in the main clause, extract the event and form a new sentence that should precede the event in the main clause; if the event in the subordinate clause occurs after the event in the main clause, extract the event and form a new sentence that should follow the event in the main clause. ③ Ensure that any pronouns or referential expressions in the new sentence are replaced with the correct antecedents to maintain clarity and completeness of the information. ④ If there is any uncertainty regarding the exact date or order of the events, infer a reasonable timeline.

[0053] (4) Additional information: ① If the event in the subordinate clause can be understood as both a "starting event" and an "ending event", prioritize transcribing it as a "starting event". ② Ensure that the transcribed sentence conforms to the chronological logic.

[0054] (5) Task examples: representative inputs and outputs.

[0055] Examples of compound sentence transcription prompts used in this embodiment include: Figure 3 As shown.

[0056] Carefully crafted cue words guide large language models to accurately identify entities and relationships in data, acquiring structured knowledge, which is beneficial for performance evaluation and data analysis in subsequent tasks. This application combines a cue word construction strategy to guide large language models in knowledge extraction. The large language model has rich pre-training data, enabling it to better understand text semantics and context in knowledge extraction tasks, extracting richer linguistic features and knowledge representations. At the same time, it gains experience through unsupervised or semi-supervised methods, reducing reliance on large amounts of labeled data.

[0057] When guiding large language models to extract knowledge, the following three issues mainly need to be addressed:

[0058] (1) Long-distance dependency problem: If the text to be processed is too long, even if the task expectation is clear, the model still cannot answer as required. For example, if the extracted "time" format is specified as "YYYY-MM-DD" in a long prompt, the model still describes "time" in the form of natural language.

[0059] (2) Information fabrication problem: Some items lack information, and the large language model makes unfounded speculations and feeds back information out of thin air. For example, many pieces of information only contain the "month" and "date" of the event, but lack the "year" information. The large language model will fabricate a year to fill in the missing information.

[0060] (3) Inference and Filling Problems: Some information that needs to be extracted is not directly given in the text, but can be reasonably inferred from the context to guess the information implied in the text. For example, when a ship participates in an activity, the start time and duration are specified, and the end time needs to be inferred from this; the name of the activity is "Sea area Party", and even if the location of the activity is not specified, it should be inferred that the event took place in the Mediterranean.

[0061] To solve the above problems, it is necessary to use programming techniques to further process the information fed back by the model, and more importantly, to continuously optimize the prompt words through strategies. In the implementation process, this application designs the following three prompt word optimization strategies to address the above problems:

[0062] (1) Information guidance: Whether it is the "emphasis" method such as modal particles and adverbs, or the "repetition" method such as synonym repetition and synonym paraphrasing, they can effectively guide the focus of the large language model and have a significant impact on the model's feedback. For example, the large language model will generally handle instructions containing "carefully" with caution, and will generally impose relatively strict constraints on the conditions of instructions containing "must".

[0063] (2) Comprehensive Design: By considering and including all possible situations, and setting boundary conditions and exception handling mechanisms in the prompt words, the erroneous output of large language models when handling special cases can be effectively reduced, ensuring the accuracy and stability of knowledge extraction tasks. This strategy helps improve the robustness and applicability of the model. For example, when processing special time data lacking "year" information, the "year" is uniformly labeled as "YYYY".

[0064] (3) Differentiated Design: Developing different processing methods for different situations can better guide the large language model to generate content that meets expectations and avoid confusion or erroneous output. This strategy helps improve the model's adaptability to diverse situations and enhances the effectiveness and accuracy of knowledge extraction tasks. For example, some information can be inferred from the context, while others cannot.

[0065] Figure 4 Examples of the three strategies described above in the prompts of the information extraction module are shown.

[0066] Step 106: Label the preliminary extraction results according to the pre-set extraction error labeling system, treat the labeled text as similar error text, perform sentence structure analysis on similar error files, generate simulated text question-and-answer pairs, delete the modifiers in the simulated text question-and-answer pairs, and then provide feedback to modify the optimized prompt words to obtain the modified prompt words.

[0067] Step 108: Use the modified prompt words to guide the large language model to extract knowledge from the maritime activity data to obtain maritime knowledge; maritime knowledge includes ship name, start time, end time, location, event name and other vessels.

[0068] Using initial prompts to guide a large language model in extracting data from reconstructed data yields inaccurate preliminary results. This is because observable data is finite, while the heterogeneous information from multiple sources in the real world is infinite. This inevitably leads to the inability of the prompts and examples used in the initial model design to cover all possibilities, making it difficult to guarantee the generalization of the knowledge extraction method. In traditional machine learning and deep learning methods, models typically cannot be fed back and optimized in real time after training. The large-scale labeled data and computing resources required to adjust model parameters often consume significant human and material resources, making it difficult to meet the need for continuous, efficient, and low-cost iterative optimization of the model. To address this, this application proposes a "supervisor in the loop" feedback optimization approach, focusing on key issues and combining external knowledge (experience) with model optimization to reduce model improvement costs and achieve improved extraction efficiency and quality.

[0069] During implementation, the feedback optimization process mainly involves the following four steps:

[0070] (1) Evaluate the initial extraction results using the validation set, according to the "extraction error label system" (e.g., ...). Figure 5 As shown, these are text annotation error labels.

[0071] (2) Select texts with similar tags as similar error texts and classify them for subsequent analysis.

[0072] (3) For similar erroneous texts, analyze the similarities in sentence structure and generate simulated text question-and-answer pairs that fully reflect their characteristics. Such representative sentences do not exist in the original text.

[0073] (4) Remove the modifiers of the original sample question-and-answer pairs and the components similar to the structure of the simulated text, and add the simulated text question-and-answer pairs to the sample, so as to limit the total size of the prompts and samples as much as possible.

[0074] (5) For errors that occur more than the threshold, analyze their characteristics and add the handling measures to the prompt words.

[0075] (6) Feed the modified prompts and examples back into the training process of the large language model. Improve the model by perfecting the prompts and improve the accuracy of the large language model in knowledge extraction.

[0076] The above tasks can be completed manually or with the assistance of large language models with strong semantic understanding capabilities. However, regardless of whether a human or a large model with stronger semantic understanding capabilities acts as the "supervisor," the reason is that the current model's semantic understanding ability is limited, and it needs to learn from "errors." By improving the prompt words, the experience summarized and analyzed by the external "supervisor" is introduced into the knowledge extraction framework to "learn" methods for solving problems.

[0077] Table 1 shows a sample of the simulated text question-and-answer pairs generated after summarizing common errors. In this sample, the user input is: "March 1, 1989 Steamboat Willie departed shipyard to participate in seaarea Party with Steamboat Lily. September 7, Steamboat Willie departed Southern shipyard for a two-week sea cruise. December 29, anchored off place A, place B, place C, place D and place E after a four-month cruise in the Pacific AoR." This simulated input contains the following five representative error-prone sentence structures:

[0078] (1) Implicit location reasoning: The first sentence does not contain a location, but the event name is "Sea area Party", so it is highly likely to take place in the sea area.

[0079] (2) Implicit time reasoning: The second sentence does not specify the end time of the event, but it gives the start time (September 7) and duration (two-week). Based on this, it can be inferred that the end time is around September 21.

[0080] (3) Implied subject inference: The third sentence about the ship activity event has no subject, but this is a common ellipsis in natural language text. Based on the context, we can infer that the subject of the event is still "Steamboat Willie".

[0081] (4) Insufficient summarization: The third sentence mentions that the ship is anchored in several Southeast Asian countries (place A, place B, place C, place D and place E). To facilitate subsequent trajectory analysis, it can be summarized as "Southeast Asia". For this type of text, the large language model can be guided to make a summary.

[0082] (5) Insufficient knowledge background: The third sentence states that the ship activity event occurred in the “Pacific AoR” (Pacific Ocean Area). Similar expressions of “ocean area” are relatively common in maritime activity texts, but the model may not be able to accurately identify it as a “location” due to insufficient knowledge.

[0083] It is evident that providing this background knowledge as an example to the large language model for feedback optimization is essential, as it can significantly improve the accuracy of knowledge extraction from the large language model.

[0084] Table 1

[0085]

[0086] Finally, the extraction results include information from six categories: ["ship name", "start time", "end time", "location", "event name", and "other ships"]. Specifically:

[0087] (1) Ship name: subject of the incident.

[0088] (2) Start time: The start time of the event. For uniform expression, it is referred to in the standard format of "YYYY-MM-DD".

[0089] (3) End time: The end time of the event. For uniform expression, it is referred to in the standard format of "YYYY-MM-DD".

[0090] (4) Location: The location where the event occurred. Since geographical location can be subdivided into multiple levels of labels, the format is difficult to standardize. Therefore, as long as the extraction result contains the lowest level of standard geographical location mentioned in the text, it should be considered as a correct extraction. For example, for “coast of NationalityA” in the text, as long as the extraction result contains “NationalityA”, it should be considered as a correct extraction.

[0091] (5) Event Name: The content or nature of the event. For example, if “trainingavailability (TRAV)” appears in the text, it should be considered a correct extraction regardless of whether the extraction results contain “training availability” or “TRAV”.

[0092] (6) Other vessels: vessels that participate in the event, in addition to the main vessel.

[0093] The aforementioned method for knowledge extraction from maritime activities based on a large language model first cleans and reconstructs the maritime activity data to reduce inconsistencies across different data sources, facilitating subsequent transcription and extraction. Then, prompt words and corresponding optimization strategies are set to guide the large language model in understanding the task scenario and user expectations, accurately identifying entities and relationships in the data, and acquiring structured knowledge. The prompt words guide the large language model in knowledge extraction. The large language model's pre-trained corpus is rich, enabling it to better understand text semantics and context in knowledge extraction tasks, extracting richer linguistic features and knowledge representations. Utilizing optimized prompt words to guide the large language model, time-based complex sentences composed of a main clause, multiple subordinate clauses, and rich conjunctions, as well as inverted sentences with abnormal subject positions, are broken down into two or more simple sentences in the reconstructed data. This enhances the large language model's understanding of the text, allowing models with smaller parameters and weaker semantic understanding capabilities to perform knowledge extraction tasks effectively. Finally, the "supervisor in the loop" feedback optimization concept is proposed, focusing on key issues and combining external knowledge with model optimization to reduce the improvement cost of large language models. Model improvement is achieved through the refinement of prompt words, thereby increasing the accuracy of large language models in knowledge extraction. This application utilizes large language models to extract knowledge from maritime activity data, extracting entities and relationships from text and organizing them into structured data for better analysis and research of the rich knowledge contained within the text. This allows for a better understanding and analysis of maritime activity data, providing strong support for effective maritime trajectory prediction. Compared to traditional sequence labeling methods, it offers high extraction completeness, high extraction accuracy, zero-shot or few-shot learning with low labeling costs, and low parameter modification costs.

[0094] In one embodiment, the maritime activity data is cleaned and reconstructed to obtain reconstructed data, including:

[0095] The maritime activity data undergoes data cleaning to remove missing items, duplicates, webpage tags, and garbled text, resulting in relatively clean records. Maritime activity data crawled from different sites is then integrated and categorized by vessel name. For each vessel, the data is arranged chronologically. Based on maritime expertise, the arranged maritime activity data is reconstructed, resulting in multiple reconstructed data categories, including "Arrival," "Departure," and "Participation." "Arrival" indicates a vessel is anchored at a location without mentioning subsequent activities or reasons for anchoring; "Departure" indicates a vessel has left a location without mentioning subsequent activities or reasons for leaving; and "Participation" indicates specific maritime activities the vessel participated in or navigation in a specific area.

[0096] In one embodiment, the pre-set initial prompts include background knowledge, user expectations, task flow, additional information, and task examples; wherein, the background knowledge includes the concept of time complex sentences, the user expectations include transcribing into simple sentences, the task flow includes determining the relationship between main and subordinate clauses, extracting events to form new sentences, replacing pronouns, and inferring the timeline, the additional information includes the priority of event understanding, and the task examples include input data and output data.

[0097] In one embodiment, the prompt word optimization strategy includes information guidance, full coverage design, and differentiated design; information guidance refers to emphasizing words or adverbs, as well as synonym repetition or paraphrasing; full coverage design refers to setting boundary conditions and exception handling mechanisms in the prompt words by considering and including various possible situations; differentiated design refers to formulating different processing methods for different situations.

[0098] In one embodiment, the pre-set error labeling system includes primary labels and secondary labels; primary labels include ship name error, time error, location error, and event error; secondary labels include implicit subject reasoning, implicit time reasoning, implicit location reasoning, insufficient inductive summary, insufficient knowledge background, and output format error.

[0099] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0100] In one embodiment, such as Figure 6 As shown, a knowledge extraction device for maritime activities based on a large language model is provided, including: a data preprocessing module 602, a preliminary knowledge extraction module 604, a prompt word modification module 606, and a knowledge extraction module 608, wherein:

[0101] Data preprocessing module 602 is used to acquire maritime activity data; perform data cleaning and data reconstruction on the maritime activity data to obtain reconstructed data;

[0102] The knowledge preliminary extraction module 604 is used to pre-set initial prompt words and set a prompt word optimization strategy to optimize the initial prompt words. The optimized prompt words guide the large language model to perform sentence transcribing on the reconstructed data. It splits the time complex sentences composed of one main clause, multiple subordinate clauses and rich conjunctions and the inverted sentences with abnormal subject positions in the reconstructed data into two or more simple sentences; and extracts the simple sentences to obtain the preliminary extraction results.

[0103] The prompt word modification module 606 is used to label the preliminary extraction results according to the pre-set extraction error label system, treat the labeled text as similar error text, perform sentence structure analysis on similar error files, generate simulated text question-and-answer pairs, delete the modifiers in the simulated text question-and-answer pairs, and then provide feedback modification to the optimized prompt words to obtain the modified prompt words.

[0104] The knowledge extraction module 608 is used to guide the large language model to extract knowledge from maritime activity data using modified prompt words, thereby obtaining maritime knowledge. Maritime knowledge includes ship names, start times, end times, locations, event names, and other vessels.

[0105] Specific limitations regarding the large language model-based maritime activity knowledge extraction device can be found in the limitations of the large language model-based maritime activity knowledge extraction method described above, and will not be repeated here. Each module in the aforementioned large language model-based maritime activity knowledge extraction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0106] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for extracting maritime activity knowledge based on a large language model. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0107] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0108] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0109] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0110] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for extracting maritime activity knowledge based on a large language model, characterized in that, The method includes: Acquire maritime activity data; perform data cleaning and data reconstruction on the maritime activity data to obtain reconstructed data; Initial prompts are pre-set, and a prompt optimization strategy is implemented to optimize the initial prompts. The optimized prompts are used to guide the large language model to transcribe the reconstructed data into sentences. The reconstructed data is split into time-complex sentences consisting of one main clause, multiple subordinate clauses, and rich conjunctions, as well as inverted sentences with abnormal subject positions, into two or more simple sentences. The simple sentences are then extracted to obtain preliminary extraction results. The preliminary extraction results are labeled according to the pre-set extraction error labeling system. The labeled text is regarded as the same type of error text. The sentence structure of the same type of error text is analyzed to generate simulated text question-and-answer pairs. After deleting the modifiers in the simulated text question-and-answer pairs, the optimized prompt words are fed back and modified to obtain the modified prompt words. The modified prompt words are used to guide a large language model to extract knowledge from the maritime activity data, resulting in maritime knowledge. The maritime knowledge includes ship names, start times, end times, locations, event names, and other vessels. The maritime activity data is cleaned and reconstructed to obtain reconstructed data, including: The maritime activity data is cleaned by removing missing items, duplicates, web page tags, and garbled characters to obtain relatively clean records. Maritime activity data crawled from different sites is then integrated and categorized by vessel name. For each vessel, the data is arranged chronologically. Based on maritime expertise, the arranged maritime activity data is reconstructed, resulting in multiple reconstructed data categories, including "Arrival," "Departure," and "Participation." "Arrival" indicates that the vessel is anchored at a location without mentioning subsequent activities or reasons for anchoring. "Departure" indicates that the vessel has left a location without mentioning subsequent activities or reasons for leaving. "Participation" indicates specific maritime activities the vessel participated in or navigation in a certain area.

2. The method according to claim 1, characterized in that, The pre-set initial prompts include background knowledge, user expectations, task flow, additional information, and task examples; wherein, the background knowledge includes the concept of time-based complex sentences, the user expectations include transcribing into simple sentences, the task flow includes determining the relationship between main and subordinate clauses, extracting events to form new sentences, replacing pronouns, and inferring the timeline, the additional information includes the priority of event understanding, and the task examples include input data and output data.

3. The method according to claim 1, characterized in that, The prompt word optimization strategy includes information guidance, full coverage design, and differentiated design; the information guidance refers to emphasizing words or adverbs, as well as synonym repetition or paraphrasing; the full coverage design means setting boundary conditions and exception handling mechanisms in the prompt words by considering and including various possible situations; the differentiated design means formulating different handling methods for different situations.

4. The method according to claim 1, characterized in that, The pre-set error labeling system includes primary labels and secondary labels; the primary labels include ship name error, time error, location error, and event error; the secondary labels include implicit subject reasoning, implicit time reasoning, implicit location reasoning, insufficient inductive summary, insufficient knowledge background, and output format error.

5. A knowledge extraction device for maritime activities based on a large language model, characterized in that, The device includes: A data preprocessing module is used to acquire maritime activity data; to perform data cleaning and data reconstruction on the maritime activity data to obtain reconstructed data, including: The maritime activity data is cleaned by removing missing items, duplicates, web page tags, and garbled characters to obtain relatively clean records. Maritime activity data crawled from different sites is then integrated and categorized by vessel name. For each vessel, the data is arranged chronologically. Based on maritime expertise, the arranged maritime activity data is reconstructed, resulting in multiple reconstructed data categories, including "Arrival," "Departure," and "Participation." "Arrival" indicates that the vessel is anchored at a location without mentioning subsequent activities or reasons for anchoring; "Departure" indicates that the vessel has left a location without mentioning subsequent activities or reasons for leaving; and "Participation" indicates specific maritime activities the vessel participated in or navigation in a certain area. The initial knowledge extraction module is used to pre-set initial prompt words and optimize them using a prompt word optimization strategy. The optimized prompt words guide the large language model to transcribe the reconstructed data into sentences. This process splits complex sentences (consisting of a main clause, multiple subordinate clauses, and numerous conjunctions) and inverted sentences with abnormal subject positions into two or more simple sentences. The module then extracts the initial knowledge from these simple sentences to obtain preliminary extraction results. The prompt word modification module is used to label the preliminary extraction results according to the pre-set extraction error label system, treat the labeled text as similar error text, perform sentence structure analysis on the similar error text, generate simulated text question-and-answer pairs, delete the modifiers in the simulated text question-and-answer pairs, and then provide feedback modification to the optimized prompt words to obtain the modified prompt words. The knowledge extraction module is used to guide the large language model to extract knowledge from the maritime activity data using the modified prompt words, thereby obtaining maritime knowledge; the maritime knowledge includes ship name, start time, end time, location, event name, and other vessels.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.