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

Through the method of extracting knowledge of maritime activities based on large language model, the problems of heterogeneity and complexity of maritime activity data are solved. Through data cleaning, prompt word optimization and feedback optimization, the accurate extraction and structured representation of maritime activity data are achieved, and the improvement of the improvement of the data is improved. The completeness and accuracy of the extraction are suitable for the extraction of knowledge of data on complex maritime activities.

CN119088981AActive Publication Date: 2024-12-06NAT UNIV OF DEFENSE TECH

Patent Information

Application Number
CN202411188977.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-12-06
Estimated Expiration
2044-08-28

AI Technical Summary

Technical Problem

Traditional information extraction technology faces data heterogeneity and meaning complexity when processing complex maritime activity data, which leads to difficulties in entity recognition and relationship extraction, especially when processing natural language texts, which are prone to omissions and ambiguity.

Method used

Using a knowledge extraction method for maritime activities based on large language models, through data cleaning and reconstruction, prompt word optimization, sentence transfer and feedback optimization, composite sentences are split, and knowledge extraction is extracted using pre-trained corpus and prompt word guidance model to generate structure .

Benefits of technology

It improves the accuracy and completeness of maritime activity data extraction, reduces the cost of model improvement, enhances the ability to understand text semantics, is suitable for learning zero-sample or few-sample, and has low annotation cost and parameter modification cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088981A_ABST
    Figure CN119088981A_ABST
Patent Text Reader

Abstract

The invention relates to a maritime activity knowledge extraction method and device based on a large language model. The maritime activity knowledge extraction method and device are used for maritime knowledge extraction. The method comprises the steps that an initial cue word is preset, a cue word optimization strategy is set to optimize the initial cue word, the optimized cue word is used for guiding a large language model to conduct statement transcription on reconstructed data, and a preliminary extraction result is obtained; labeling the preliminary extraction result according to a preset extraction error label system, taking a labeled text as a similar error text, carrying out statement structure analysis on the similar error text, generating a simulation text question and answer pair, carrying out feedback modification on the optimized prompt word, and obtaining a simulation result; and utilizing the modified cue word to guide a large language model to perform knowledge extraction on the marine activity data to obtain marine knowledge. By adopting the method, offshore knowledge extraction can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular to a method and device for extracting knowledge about maritime activities based on a large language model. Background Art

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

[0003] Traditional information extraction technology faces many challenges when processing complex maritime activity data. The following two issues have led to the research and discussion of this invention: The first is the heterogeneity of the data. On the Internet, there is a lack of a systematic summary of maritime trajectory data, and there may be large differences in the way and structure of information presentation on different websites. For example, ship movements published on news websites often make factual statements about maritime activities in the form of rigorous natural language text, while AIS data (Automatic Identification System data) focuses more on mathematical symbol information such as the position, speed, and heading of the ship. The data in forum posts may even contain noise such as emoticons and symbols. Accurately identifying, screening, and reconstructing data from different sources is itself a complex task. Heterogeneous data poses a great challenge to the model's accurate entity recognition and relationship extraction.

[0004] The second is the complexity of meaning. Natural language text conforms to human language expression habits, but is not conducive to machine parsing and understanding. On the one hand, complex sentences are more common in natural language texts, such as compound sentences, inverted sentences, etc. Such sentences often have high information density and are prone to omissions in the process of information extraction; on the other hand, natural language texts also contain a large number of pronouns and abbreviations, which are often prone to ambiguity and confusion in the process of information extraction. Therefore, accurately understanding the structure and semantics of the text is a considerable challenge for the model. At the same time, the records of maritime activities are highly professional, involving a large number of professional terms such as ship types and geographical locations. For models that lack corpus reserves, it is very difficult to understand, and it is inevitable that errors in entity recognition will occur during the knowledge extraction process, which significantly increases the complexity of knowledge extraction. Summary of the invention

[0005] Based on this, it is necessary to provide a method and device for extracting maritime activity knowledge based on a large language model that can realize maritime knowledge extraction in response to the above technical problems.

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

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

[0008] Initial prompt words are pre-set and prompt word optimization strategies are set to optimize the initial prompt words. The optimized prompt words are used to guide the large language model to transcribe the reconstructed data, and the time complex sentences composed of a main sentence, 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;

[0009] The preliminary extraction results are annotated according to a preset extraction error label system, and the annotated text is used as the same type of error text. The sentence structure of the same type of error file is analyzed to generate a simulated text question-answer pair, and after deleting the modifying components in the simulated text question-answer pair, the optimized prompt word is modified to obtain a modified prompt word;

[0010] The modified prompt words are used to guide the large language model to extract knowledge from the maritime activity data to obtain maritime knowledge; the maritime knowledge includes ship name, start time, end time, location, event name and other ships.

[0011] In one embodiment, data cleaning and data reconstruction are performed on the marine activity data to obtain reconstructed data, including:

[0012] The maritime activity data are cleaned, and missing items, duplicate items, web page tags, and garbled codes in the maritime activity data are deleted to obtain relatively pure records. The maritime activity data crawled from different sites are then integrated and classified according to the ship name. For each ship, the data are arranged in chronological order. Based on the professional knowledge of navigation, the arranged maritime activity data are reconstructed to obtain multiple categories of reconstructed data, including "arrival", "departure" and "participation" categories; among them, the "arrival" category indicates that the ship is anchored at a certain place, and the text does not mention the subsequent activities of the ship at that place and the reason for anchoring; the "departure" category indicates that the ship leaves a certain place, and does not mention the subsequent activities and the reason for leaving; the "participation" category indicates the specific maritime activities in which the ship participates, or sails in a certain area.

[0013] In one of the embodiments, the pre-set initial prompt words include background knowledge, user expectations, task flow, additional information and task examples; wherein, background knowledge includes the concept of time complex sentences, 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 event understanding priority, and the task examples include input data and output data.

[0014] In one of the embodiments, the prompt word optimization strategy includes information guidance, full coverage design and differentiated design; information guidance means emphasizing modal particles or adverbs and synonymous repetition or synonymous paraphrase; full coverage design means setting boundary conditions and exception handling mechanisms in the prompt words by considering and including various possible situations; differentiated design means formulating different handling methods for different situations.

[0015] In one of the embodiments, the pre-set extraction error label system includes primary labels and secondary labels; the primary labels include ship name errors, time errors, location errors and event errors; the secondary labels include implicit subject reasoning, implicit time reasoning, implicit location reasoning, insufficient summary and generalization, insufficient knowledge background and output format errors.

[0016] A device for extracting knowledge of marine activities based on a large language model, the device comprising:

[0017] A data preprocessing module is used to obtain marine activity data; clean and reconstruct the marine activity data to obtain reconstructed data;

[0018] The preliminary knowledge extraction module is used to pre-set the initial prompt words and set the prompt word optimization strategy to optimize the initial prompt words, use the optimized prompt words to guide the large language model to transcribe the reconstructed data, and split the time complex sentences composed of a main sentence, multiple subordinate clauses and rich conjunctions and the inverted sentences with abnormal subject positions in the reconstructed data into two or more simple sentences; extract the simple sentences to obtain preliminary extraction results;

[0019] The prompt word modification module is used to annotate the preliminary extraction results according to the preset extraction error label system, use the annotated text as the same type of error text, perform sentence structure analysis on the same type of error files, generate simulated text question-answer pairs, delete the modifying components in the simulated text question-answer pairs, and perform feedback modification on the optimized prompt words to obtain modified prompt words;

[0020] The knowledge extraction module is used to use the modified prompt words to guide the large language model to extract knowledge from the maritime activity data to obtain maritime knowledge; the maritime knowledge includes ship name, start time, end time, location, event name and other ships.

[0021] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

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

[0023] Initial prompt words are pre-set and prompt word optimization strategies are set to optimize the initial prompt words. The optimized prompt words are used to guide the large language model to transcribe the reconstructed data, and the time complex sentences composed of a main sentence, 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;

[0024] The preliminary extraction results are annotated according to a preset extraction error label system, and the annotated text is used as the same type of error text. The sentence structure of the same type of error file is analyzed to generate a simulated text question-answer pair, and after deleting the modifying components in the simulated text question-answer pair, the optimized prompt word is modified to obtain a modified prompt word;

[0025] The modified prompt words are used to guide the large language model to extract knowledge from the maritime activity data to obtain maritime knowledge; the maritime knowledge includes ship name, start time, end time, location, event name and other ships.

[0026] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

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

[0028] Initial prompt words are pre-set and prompt word optimization strategies are set to optimize the initial prompt words. The optimized prompt words are used to guide the large language model to transcribe the reconstructed data, and the time complex sentences composed of a main sentence, 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;

[0029] The preliminary extraction results are annotated according to a preset extraction error label system, and the annotated text is used as the same type of error text. The sentence structure of the same type of error file is analyzed to generate a simulated text question-answer pair, and after deleting the modifying components in the simulated text question-answer pair, the optimized prompt word is modified to obtain a modified prompt word;

[0030] The modified prompt words are used to guide the large language model to extract knowledge from the maritime activity data to obtain maritime knowledge; the maritime knowledge includes ship name, start time, end time, location, event name and other ships.

[0031] The above-mentioned method and device for extracting knowledge about maritime activities based on a large language model first cleans and reconstructs the maritime activity data to reduce the inconsistency of different data sources, which is convenient for subsequent transcription and extraction. Then, prompt words and corresponding optimization strategies are set to guide the large language model to understand the task scenario and user expectations, accurately identify entities and relationships in the data, and obtain structured knowledge. The prompt words are used to guide the large language model to extract knowledge. The large language model has rich pre-trained corpus and can better understand the text semantics and context in the knowledge extraction task, and extract richer language features and knowledge representation. The optimized prompt words are used to guide the large language model to transcribe the reconstructed data, and the time complex sentences composed of a main sentence, 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 to enhance the large language model's understanding of the text, so that models with small parameters and poor semantic understanding ability can also be competent for knowledge extraction. Finally, the feedback optimization idea of ​​"supervisor in the loop" is proposed, focusing on the main problems, combining external knowledge with model optimization, reducing the cost of improving the large language model, realizing model improvement through the improvement of prompt words, and improving the accuracy of the large language model in knowledge extraction. This application uses a large language model to extract knowledge from maritime activity data, which can extract entities and relationships in the text and organize them into structured data to better analyze and study the rich knowledge contained in the text. It can better understand and analyze maritime activity data and provide strong support for the implementation of effective maritime trajectory prediction. Compared with traditional sequence labeling methods, the extraction integrity is high; the extraction accuracy is high; zero-sample or few-sample learning, the labeling cost is low; the parameter modification cost is low. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 A schematic diagram of a flow chart of a method for extracting knowledge of maritime activities based on a large language model in one embodiment;

[0033] Figure 2 A schematic diagram of a flow chart of a transcription example of a time complex sentence in one embodiment;

[0034] Figure 3 A schematic diagram of a process for constructing a complex sentence transcription prompt word in one embodiment;

[0035] Figure 4 A schematic diagram of a flow chart of a prompt word construction example of an information extraction module in another embodiment;

[0036] Figure 5 A schematic diagram of a system for extracting error labels in one embodiment;

[0037] Figure 6 It is a structural block diagram of a marine activity knowledge extraction device based on a large language model in one embodiment;

[0038] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

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

[0041] Step 102, acquiring marine activity data; performing data cleaning and data reconstruction on the marine activity data to obtain reconstructed data.

[0042] In a specific embodiment, firstly, the missing items, duplicate items, web page tags, and garbled codes in the original data are deleted to obtain relatively clean records; secondly, the maritime history data crawled from different sites are integrated and classified according to the ship name to reduce the inconsistency of different data sources; then, for each ship, the data is arranged in chronological order to facilitate subsequent transcription and extraction; finally, based on the professional knowledge of navigation, the activity data is screened, and the maritime activities can be roughly divided into the following three categories:

[0043] (1) “Arrival” category: The vessel is at a certain place and the text does not mention the subsequent activities of the vessel at that place and the reason for the berthing.

[0044] (2) “Departure” category: The vessel leaves a place without mentioning subsequent activities and reasons for departure.

[0045] (3) “Participation” category: the specific maritime activities in which the vessel participates, or the area in which it sails.

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

[0047] Converting complex sentences in the original data into simple sentences can enhance the large language model's understanding of the text, so that models with smaller parameters and poorer semantic understanding capabilities can also perform knowledge extraction tasks.

[0048] In natural language texts such as news reports and forum posts, there are widespread complex sentences consisting of a main clause, multiple subordinate clauses, and abundant conjunctions, as well as inverted sentences with abnormal subject positions. Such complex sentences often have high information density, unclear object reference, and are prone to ambiguity, which causes certain difficulties for entity recognition and relationship extraction. Specifically for English corpus, sentences containing time adverbial clauses (time complex sentences) are the most common complex sentences. For time complex sentences, they usually 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, has a clear reference, and focuses on specific information. This method helps the model to more accurately identify and understand entities and relationships in sentences, such as events, subjects, time and other elements, thereby improving the quality and completeness of knowledge extraction. In the implementation process, the main clause and subordinate clauses of the time complex sentence are first identified, and then they are transcribed into separate sentences. For example Figure 2 As shown in the figure, the time compound sentence “After a 10-day port call to Island-A, LCC 19 arrived in A Province, on Feb. 12 before returning to B Province on 19th.” can be transcribed into three simple sentences: (1) “On Feb 2, LCC 19 port call to Island-A.” (2) “On Feb 12, LCC 19 arrived in A Province.” (3) “On Feb 19, LCC 19 returned to B Province.”.

[0049] This application uses a large language model to achieve the above-mentioned sentence transcription. In order 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, so as to achieve twice the result with half the effort. In the prompt words for transcribing time complex sentences, it is necessary to use concise language to clarify the transcription process, supplemented by representative examples. Specifically, the prompt words need to contain the following information:

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

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

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

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

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

[0055] The compound sentence transcription prompt words used in this embodiment are as follows: Figure 3 shown.

[0056] Carefully constructing prompt words to guide the large language model to accurately identify entities and relationships in the data and obtain structured knowledge is conducive to effect evaluation and data analysis in subsequent tasks. This application combines the prompt word construction strategy to guide the large language model to extract knowledge. The large language model is expected to be rich in pre-training, and can better understand the text semantics and context in the knowledge extraction task, and extract richer language features and knowledge representation; at the same time, experience is obtained through unsupervised or semi-supervised methods to reduce dependence on large amounts of labeled data.

[0057] When guiding a large language model to extract knowledge, the following three problems need to be solved:

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

[0059] (2) Information fabrication problem: When some information about certain items is missing, the large language model makes unfounded inferences and fabricates information. For example, in some information, there is only the "month" and "date" of an event, but no "year" information. The large language model will fabricate the year to fill in the gap.

[0060] (3) Reasoning and filling problems: Some of the information that needs to be extracted in the text is not directly given, but reasonable inferences can be made through the context to guess the implicit information 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 based on this; the name of the activity is "Sea area Party", even if the location of the activity is not specified, it should be inferred that the event takes place in the Mediterranean.

[0061] To solve the above problems, on the one hand, it is necessary to use programming methods to process the information fed back by the model, and on the other hand, it is necessary to continuously optimize the prompt words through strategies. During the implementation process, this application designed the following three prompt word optimization strategies to solve the above problems:

[0062] (1) Information guidance: Whether it is "emphasis" methods such as modal particles and adverbs, or "repetition" methods such as synonymous repetition and synonymous paraphrase, 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 be cautious about instructions containing "carefully" and will generally be relatively strict about instructions containing "must".

[0063] (2) Comprehensive design: By considering and including various possible situations, setting boundary conditions and exception handling mechanisms in the prompt words, we can effectively reduce the error output of large language models when dealing with special situations, and ensure the accuracy and stability of knowledge extraction tasks. This strategy helps improve the robustness and applicability of the model. For example, when dealing with special time data that lacks "year" information, the "year" is uniformly marked as "YYYY".

[0064] (3) Differentiated design: Formulating different processing methods for different situations can better guide large language models to generate expected content and avoid confusing or erroneous outputs. This strategy helps improve the model's adaptability to diverse situations and improves the effectiveness and accuracy of knowledge extraction tasks. For example, some information can be inferred based on context, while some cannot.

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

[0066] Step 106, annotate the preliminary extraction results according to a preset extraction error label system, use the annotated text as similar error text, perform sentence structure analysis on similar error files, generate simulated text question-answer pairs, delete the modifying components in the simulated text question-answer pairs, and perform feedback modification on the optimized prompt words to obtain modified prompt words.

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

[0068] When using the initial prompt words to guide the large language model to extract the reconstructed data, the preliminary extraction results are not accurate enough, because the observable data is limited, but the multi-source heterogeneous information in the real world is infinite, which inevitably leads to the prompt words and examples used in the model at the beginning of the design cannot cover all possibilities, and the generalization of the knowledge extraction method is difficult to guarantee. In traditional machine learning and deep learning methods, the model is usually unable to perform real-time feedback and optimization after training, and the large-scale annotation data and computing resources required to adjust the model parameters often consume a lot of manpower and material resources, which is difficult to meet the needs of continuous, efficient, and low-cost iterative optimization of the model. To this end, this application proposes a feedback optimization idea of ​​"supervisor in the loop", focusing on the main problems, combining external knowledge (experience) with model optimization, reducing the cost of model improvement, and achieving quality and efficiency improvement of the extraction effect.

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

[0070] (1) Use the validation set to evaluate the preliminary extraction results, according to the "extraction error label system" (such as Figure 5 As shown), the text is incorrectly labeled.

[0071] (2) Filter out texts with similar labels as similar error texts and classify them for subsequent analysis.

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

[0073] (4) Delete the modifying components of the original sample question-answer pairs and the components with similar structures to the simulated text, append the simulated text question-answer pairs to the samples, and limit the total size of the prompt words and samples as much as possible.

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

[0075] (6) The modified prompt words and examples are fed back into the large language model training process, and the model is improved by improving the prompt words, thereby improving the accuracy of the large language model in knowledge extraction.

[0076] The above work can be done manually or with the help of a large language model with strong semantic understanding ability. However, whether it is a human or a large model with stronger semantic understanding ability, the reason is that the current model has limited semantic understanding ability and needs to learn from "mistakes". By improving the prompt words, the experience summarized and analyzed by the external "supervisor" is introduced into the knowledge extraction framework to "learn" the method of solving problems.

[0077] Table 1 shows the examples of simulated text question-answer pairs generated after summarizing common errors. In this example, the user input is: "March 1, 1989 Steamboat Willie departed shipyard to participate in sea area party with Steamboat Lily. September 7, Steamboat Willie departed Southern shipyard for a two-week sea cruise. Dec 29, anchored off placeA, placeB, placeC, placeD and placeE after a four-month cruise in the Pacific AoR." (On March 1, 1989, Steamboat Willie and Steamboat Lily left the dock to participate in the "sea area party" event; on September 7, Steamboat Willie left Southern Shipyard for a two-week sea voyage; on December 29, after a four-month Pacific cruise, they anchored at places A, B, C, D and E). 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 name of the event is “Sea area Party”, so it is 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 gives the start time (September 7) and duration (two weeks). Based on this, we can infer that the end time is around September 21.

[0080] (3) Implicit Subject Inference: The ship activity event in the third sentence has no subject, but this is a common elliptical expression in natural language texts. 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 docked in multiple Southeast Asian countries (placeA, placeB, placeC, placeD and placeE). 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 “ocean area” expressions 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 reserves.

[0083] It can be seen that it is very necessary to provide this background knowledge as a sample to the large language model for feedback optimization, which can greatly improve the accuracy of marine knowledge extraction by the large language model.

[0084] Table 1

[0085]

[0086] Finally, the extraction results include information of six categories of items: ["ship name", "start time", "end time", "location", "event name", "other ships"], specifically:

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

[0088] (2) Start time: The start time of the event. For the purpose of 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 the purpose of unified expression, it is referred to in the standard format of “YYYY-MM-DD”.

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

[0091] (5) Event name: the content or nature of the event. For example, for the word “trainingavailability(TRAV)” that appears in the text, whether the extraction result contains “training availability” or “TRAV”, it should be considered to be extracted correctly.

[0092] (6) Other vessels: vessels other than the subject vessel involved in the incident.

[0093] The above-mentioned method for extracting knowledge about maritime activities based on a large language model first cleans and reconstructs the maritime activity data to reduce the inconsistency of different data sources, which is convenient for subsequent transcription and extraction. Then, prompt words and corresponding optimization strategies are set to guide the large language model to understand the task scenario and user expectations, accurately identify entities and relationships in the data, and obtain structured knowledge. The prompt words are used to guide the large language model to extract knowledge. The large language model has rich pre-trained corpus and can better understand the text semantics and context in the knowledge extraction task, and extract richer language features and knowledge representation. The optimized prompt words are used to guide the large language model, and the time complex sentences composed of a main sentence, multiple subordinate clauses and rich conjunctions in the reconstructed data and the inverted sentences with abnormal subject positions are split into two or more simple sentences to enhance the large language model's understanding of the text, so that models with small parameters and poor semantic understanding ability can also be competent for knowledge extraction. Finally, the feedback optimization idea of ​​"supervisor in the loop" is proposed, focusing on the main problems, combining external knowledge with model optimization, reducing the cost of improving the large language model, realizing model improvement through the improvement of prompt words, and improving the accuracy of the large language model in knowledge extraction. This application uses a large language model to extract knowledge from maritime activity data, which can extract entities and relationships in the text and organize them into structured data to better analyze and study the rich knowledge contained in the text. It can better understand and analyze maritime activity data and provide strong support for the implementation of effective maritime trajectory prediction. Compared with traditional sequence labeling methods, the extraction integrity is high; the extraction accuracy is high; zero-sample or few-sample learning, the labeling cost is low; the parameter modification cost is low.

[0094] In one embodiment, data cleaning and data reconstruction are performed on the marine activity data to obtain reconstructed data, including:

[0095] The maritime activity data are cleaned, and missing items, duplicate items, web page tags, and garbled codes in the maritime activity data are deleted to obtain relatively pure records. The maritime activity data crawled from different sites are then integrated and classified according to the ship name. For each ship, the data are arranged in chronological order. Based on the professional knowledge of navigation, the arranged maritime activity data are reconstructed to obtain multiple categories of reconstructed data, including "arrival", "departure" and "participation" categories; among them, the "arrival" category indicates that the ship is anchored at a certain place, and the text does not mention the subsequent activities of the ship at that place and the reason for anchoring; the "departure" category indicates that the ship leaves a certain place, and does not mention the subsequent activities and the reason for leaving; the "participation" category indicates the specific maritime activities in which the ship participates, or sails in a certain area.

[0096] In one of the embodiments, the pre-set initial prompt words include background knowledge, user expectations, task flow, additional information and task examples; wherein, background knowledge includes the concept of time complex sentences, 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 event understanding priority, and the task examples include input data and output data.

[0097] In one of the embodiments, the prompt word optimization strategy includes information guidance, full coverage design and differentiated design; information guidance means emphasizing modal particles or adverbs and synonymous repetition or synonymous paraphrase; full coverage design means setting boundary conditions and exception handling mechanisms in the prompt words by considering and including various possible situations; differentiated design means formulating different handling methods for different situations.

[0098] In one of the embodiments, the pre-set extraction error label system includes primary labels and secondary labels; the primary labels include ship name errors, time errors, location errors and event errors; the secondary labels include implicit subject reasoning, implicit time reasoning, implicit location reasoning, insufficient summary and generalization, insufficient knowledge background and output format errors.

[0099] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed 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 part of the sub-steps or stages of other steps.

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

[0101] The data preprocessing module 602 is used to obtain marine activity data; clean and reconstruct the marine activity data to obtain reconstructed data;

[0102] The preliminary knowledge extraction module 604 is used to pre-set initial prompt words and set a prompt word optimization strategy to optimize the initial prompt words, use the optimized prompt words to guide the large language model to transcribe the reconstructed data, and split the time complex sentence composed of a main sentence, multiple subordinate clauses and rich conjunctions and the inverted sentence with abnormal subject position in the reconstructed data into two or more simple sentences; extract the simple sentences to obtain preliminary extraction results;

[0103] The prompt word modification module 606 is used to annotate the preliminary extraction results according to a preset extraction error label system, use the annotated text as the same type of error text, perform sentence structure analysis on the same type of error text, generate a simulated text question-answer pair, delete the modifying components in the simulated text question-answer pair, and perform feedback modification on the optimized prompt word to obtain a modified prompt word;

[0104] The knowledge extraction module 608 is used to use the modified prompt words to guide the large language model to extract knowledge from the marine activity data to obtain marine knowledge; the marine knowledge includes ship name, start time, end time, location, event name and other ships.

[0105] For the specific definition of the marine activity knowledge extraction device based on the large language model, please refer to the definition of the marine activity knowledge extraction method based on the large language model in the above text, which will not be repeated here. Each module in the above-mentioned marine activity knowledge extraction device based on the large language model can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0106] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for extracting knowledge of marine activities based on a large language model is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

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

[0108] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database 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. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0109] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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 above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for extracting knowledge about marine activities based on a large language model, characterized in that: The method comprises: Acquiring marine activity data; performing data cleaning and data reconstruction on the marine activity data to obtain reconstructed data; Initial prompt words are pre-set and a prompt word optimization strategy is set to optimize the initial prompt words, and the optimized prompt words are used to guide the large language model to perform sentence transcription on the reconstructed data, and the time complex sentence composed of a main sentence, multiple subordinate clauses and abundant conjunctions and the inverted sentence with abnormal subject position in the reconstructed data are split into two or more simple sentences; the simple sentences are extracted to obtain preliminary extraction results; The preliminary extraction results are annotated according to a preset extraction error label system, the annotated text is used as a similar error text, a sentence structure analysis is performed on the similar error file, a simulated text question-answer pair is generated, and after deleting the modifying components in the simulated text question-answer pair, the optimized prompt word is modified by feedback to obtain a modified prompt word; The modified prompt words are used to guide the large language model to extract knowledge from the marine activity data to obtain marine knowledge; the marine knowledge includes ship name, start time, end time, location, event name and other ships.

2. The method according to claim 1, characterized in that The marine activity data is cleaned and reconstructed to obtain reconstructed data, including: The marine activity data are cleaned, and missing items, duplicate items, web page tags, and garbled codes in the marine activity data are deleted to obtain relatively pure records. The marine activity data crawled from different sites are integrated and classified according to the ship name. For each ship, the data are arranged in chronological order. Based on the knowledge of the professional field of navigation, the arranged marine activity data are reconstructed to obtain multiple categories of reconstructed data, including "arrival", "departure" and "participation" categories; among them, the "arrival" category indicates that the ship is moored at a certain place, and the text does not mention the subsequent activities of the ship at that place and the reason for the mooring; the "departure" category indicates that the ship leaves a certain place, and does not mention the subsequent activities and the reason for leaving; the "participation" category indicates the specific marine activities in which the ship participates, or sails in a certain area.

3. The method according to claim 1, characterized in that The pre-set initial prompt words 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 event understanding priority, and the task examples include input data and output data.

4. 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 means emphasizing modal particles or adverbs and synonymous repetition or synonymous paraphrase; 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.

5. The method according to claim 1, characterized in that: The preset extraction error label system includes primary labels and secondary labels; the primary labels include ship name errors, time errors, location errors and event errors; the secondary labels include implicit subject reasoning, implicit time reasoning, implicit location reasoning, insufficient summary and generalization, insufficient knowledge background and output format errors.

6. A device for extracting knowledge about marine activities based on a large language model, characterized in that: The device comprises: A data preprocessing module is used to obtain marine activity data; clean and reconstruct the marine activity data to obtain reconstructed data; The preliminary knowledge extraction module is used to pre-set initial prompt words and set a prompt word optimization strategy to optimize the initial prompt words, use the optimized prompt words to guide the large language model to transcribe the reconstructed data, and split the time complex sentence composed of a main sentence, multiple subordinate clauses and rich conjunctions and the inverted sentence with abnormal subject position in the reconstructed data into two or more simple sentences; extract the simple sentences to obtain preliminary extraction results; A prompt word modification module is used to annotate the preliminary extraction results according to a preset extraction error label system, use the annotated text as a similar error text, perform sentence structure analysis on the similar error file, generate a simulated text question-answer pair, delete the modifying components in the simulated text question-answer pair, and perform feedback modification on the optimized prompt word to obtain a modified prompt word; The knowledge extraction module is used to use the modified prompt words to guide the large language model to extract knowledge from the marine activity data to obtain marine knowledge; the marine knowledge includes ship name, start time, end time, location, event name and other ships.

7. 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, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Low-resource entity relation joint extraction method based on large-scale language model

    CN116933792A

  • Method, system and equipment for generating training data of large model in maritime affair field and storage medium

    CN118503698A

Cited By

  • Knowledge graph creating method and device and computer readable medium

    CN120450021A

  • Super-relation extraction method based on collaboration of multiple large language models and application of super-relation extraction method

    CN120450089A

  • Hyper-relation extraction method based on collaboration of multiple large language models and its application

    CN120450089B

  • Big language model-based biomedical relationship extraction method and system

    CN121009198A