Text semantic extraction method and device, electronic equipment and storage medium

By performing fine-grained semantic analysis and symbol grouping on railway accident report texts, the problem of high error rate and low efficiency in existing technologies is solved, and efficient and accurate text semantic extraction is achieved.

CN120654702APending Publication Date: 2025-09-16CHINA ACADEMY OF RAILWAY SCI CORP LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510799440.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-16
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

In the existing technology, railway traffic accident data analysis mainly relies on manual comparison or keyword comparison, which has a high error rate and low efficiency.

Method used

By performing fine-grained semantic analysis on railway accident report texts, extracting fine-grained keywords, and grouping them into symbols, multi-dimensional semantic extraction is achieved.

Benefits of technology

It improves the processing efficiency of railway traffic accident report texts, reduces the extraction error rate, and improves the accuracy and completeness of analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654702A_ABST
    Figure CN120654702A_ABST
Patent Text Reader

Abstract

The invention provides a text semantic extraction method and device, electronic equipment and a storage medium, and relates to the technical field of semantic extraction. The method comprises the following steps: acquiring a railway traffic accident report text; determining fine-grained subject terms according to the railway traffic accident report text; wherein the fine-grained subject terms are subject terms extracted after semantic analysis is carried out on the railway traffic accident report text; determining a text semantic extraction result according to the railway traffic accident report text and the fine-grained subject term; wherein the text semantic extraction result is a result obtained after symbol grouping is conducted on the fine-grained subject term and the railway traffic accident report text. According to the technical scheme, in the first layer, fine-grained semantic analysis is conducted on the railway traffic accident report text, vocabulary extraction is conducted, in the second layer, the extracted fine-grained subject terms and the railway traffic accident report text are further subjected to medium-grained symbol grouping, text extraction is further conducted, and the text semantic extraction result is obtained; and the extraction error rate is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of semantic extraction technology, and in particular to a text semantic extraction method, device, electronic device and storage medium. Background Art

[0002] With the development of informatization in the field of railway safety supervision business, the railway safety supervision management information system has been applied throughout the railway, storing and gathering a large amount of railway traffic accident data, including structured data such as accident level, line name and level, line level, responsible unit, as well as unstructured text data such as accident overview, casualties and direct economic losses, causes and nature of the accident, and rectification measures.

[0003] Currently, the analysis of stored railway traffic accident data is mainly carried out through extraction and classification by manual comparison or keyword comparison, so as to obtain the target vocabulary after extraction and classification. However, manual comparison or keyword comparison has a high error rate and low efficiency. Summary of the Invention

[0004] The present invention provides a text semantic extraction method, device, electronic device and storage medium, which are used to solve the defects of high error rate and low efficiency in the existing technology through manual comparison or keyword comparison, and realize multi-dimensional semantic extraction of text. At the first level, vocabulary extraction is performed by performing fine-grained semantic analysis on the railway traffic accident report text. At the second level, the extracted fine-grained keywords and railway traffic accident report text are further grouped into medium-grained symbols, and text extraction is further performed to obtain text semantic extraction results, thereby improving the processing efficiency of the railway traffic accident report text and reducing the extraction error rate.

[0005] The present invention provides a text semantic extraction method, comprising the following steps.

[0006] Get the text of the railway accident report.

[0007] Fine-grained subject words are determined based on the railway traffic accident report text; wherein the fine-grained subject words are subject words extracted after semantic analysis of the railway traffic accident report text.

[0008] A text semantic extraction result is determined based on the railway traffic accident report text and fine-grained subject words; wherein the text semantic extraction result is the result of symbol grouping the fine-grained subject words and the railway traffic accident report text.

[0009] According to a semantic extraction method of a text provided by the present invention, fine-grained subject words are determined based on a railway traffic accident report text, including: performing character decomposition on the railway traffic accident report text to obtain a first character decomposition result; wherein character decomposition refers to decomposing each character in the railway traffic accident report text; performing vocabulary aggregation on the first character decomposition result to obtain a first vocabulary aggregation result; wherein vocabulary aggregation refers to merging semantically similar characters in the character decomposition result; and determining fine-grained subject words based on the first vocabulary aggregation result and a first quantization threshold.

[0010] According to a semantic extraction method of a text provided by the present invention, fine-grained subject words are determined based on a first vocabulary aggregation result and a first quantization threshold, including: respectively calculating the first semantic distance between a preset vocabulary and each first candidate vocabulary in the first vocabulary aggregation result; and determining all first candidate vocabulary corresponding to all first semantic distances greater than or equal to the first quantization threshold in the first vocabulary aggregation result as fine-grained subject words.

[0011] According to a semantic extraction method of a text provided by the present invention, vocabulary aggregation is performed on a first character decomposition result to obtain a first vocabulary aggregation result, including: determining the word semantics of all characters in the first character decomposition result; determining the semantic similarity between all word semantics corresponding to all characters; and vocabulary aggregation is performed on all characters in the first character decomposition result according to the semantic similarity to obtain the first vocabulary aggregation result.

[0012] According to a text semantic extraction method provided by the present invention, a text semantic extraction result is determined based on a railway traffic accident report text and fine-grained subject words, comprising: performing character decomposition on the railway traffic accident report text and the fine-grained subject words to obtain a second character decomposition result; performing vocabulary aggregation on the second character decomposition result to obtain a second vocabulary aggregation result; and determining a text semantic extraction result based on the second vocabulary aggregation result and a second quantization threshold.

[0013] According to a text semantic extraction method provided by the present invention, a text semantic extraction result is determined based on a second vocabulary aggregation result and a second quantization threshold, including: respectively calculating the second semantic distance of each second candidate vocabulary in the preset vocabulary and the second vocabulary aggregation result; and determining all second candidate vocabulary corresponding to all second semantic distances greater than or equal to the second quantization threshold in the second vocabulary aggregation result as the text semantic extraction result.

[0014] According to a semantic extraction method of a text provided by the present invention, a second character decomposition result is subjected to vocabulary aggregation to obtain a second vocabulary aggregation result, including: determining a target symbol in the second character decomposition result; wherein the target symbol is a pre-set identification symbol with representative meaning; and all characters in the second character decomposition result are subjected to vocabulary aggregation according to the target symbol to obtain a second vocabulary aggregation result.

[0015] The present invention also provides a text semantic extraction device, which includes the following modules.

[0016] The text acquisition module is used to obtain the railway traffic accident report text.

[0017] The subject word determination module is used to determine fine-grained subject words based on the railway traffic accident report text; wherein the fine-grained subject words are subject words extracted after semantic analysis of the railway traffic accident report text.

[0018] The result determination module is used to determine the text semantic extraction result based on the railway traffic accident report text and fine-grained subject words; wherein the text semantic extraction result is the result of symbol grouping the fine-grained subject words and the railway traffic accident report text.

[0019] The present invention also provides an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for semantic extraction of any of the above-mentioned texts is implemented.

[0020] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-mentioned methods for extracting semantics from text.

[0021] The present invention also provides a computer program product, comprising a computer program, which implements any of the above-mentioned text semantic extraction methods when executed by a processor.

[0022] The present invention provides a text semantic extraction method, device, electronic device, and storage medium. The method comprises the following steps: obtaining a railway accident report text; determining fine-grained keywords based on the railway accident report text; wherein the fine-grained keywords are keywords extracted after semantic analysis of the railway accident report text; determining a text semantic extraction result based on the railway accident report text and the fine-grained keywords; wherein the text semantic extraction result is the result of symbol grouping the fine-grained keywords and the railway accident report text. The technical solution of the present invention is used to solve the defects of the existing technology of high error rate and low efficiency through manual comparison or keyword comparison, and realize multi-dimensional semantic extraction of text. The first layer is to perform vocabulary extraction by performing fine-grained semantic analysis on the railway accident report text. The second layer is to further group the extracted fine-grained keywords and the railway accident report text into medium-grained symbols and further perform text extraction to obtain a text semantic extraction result, thereby improving the processing efficiency of the railway accident report text and reducing the extraction error rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0024] Figure 1 This is one of the flow charts of the text semantic extraction method provided by the present invention.

[0025] Figure 2 This is the second flow chart of the text semantic extraction method provided by the present invention.

[0026] Figure 3 This is the third flow chart of the text semantic extraction method provided by the present invention.

[0027] Figure 4 This is the fourth flow chart of the text semantic extraction method provided by the present invention.

[0028] Figure 5 This is the fifth flow chart of the text semantic extraction method provided by the present invention.

[0029] Figure 6 This is the sixth flow chart of the text semantic extraction method provided by the present invention.

[0030] Figure 7 It is a structural diagram of the text semantic extraction device provided by the present invention.

[0031] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0032] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0033] The following combination Figures 1-6 The text semantic extraction method provided by the present invention is described. The text semantic extraction method provided by the present invention can be applied to the analysis of causal factors of railway traffic accidents with multi-level slicing and semantic extraction. The execution subject of the method can be an electronic device or a text semantic extraction device provided in the electronic device. The text semantic extraction device can be implemented by software, hardware or a combination of the two. Figure 1 This is one of the flow charts of the semantic extraction method of text provided by the present invention, such as Figure 1 As shown, the method includes the following steps 101, 102 and 103.

[0034] Step 101: Obtain the railway traffic accident report text.

[0035] In this step, the railway traffic accident report text may be, for example, a railway traffic accident text, which mainly describes the accident overview, cause, accident consequences, responsibility determination, casualties and direct economic losses, rectification measures and other information.

[0036] Specifically, a railway accident report text is obtained, and subsequent text analysis is performed based on the railway accident report text. The obtained railway accident report text includes at least one text content, which is not limited in this embodiment. At least one text content in the railway accident report text can be analyzed and processed simultaneously.

[0037] In a specific embodiment, before determining the fine-grained keywords based on the railway accident report text, the method further includes performing entity feature analysis on the railway accident report text. Figure 2 This is the second flow chart of the semantic extraction method of text provided by the present invention, such as Figure 2 As shown, the feature analysis process includes the following steps 201, 202 and 203.

[0038] Step 201: Obtain the railway traffic accident report text.

[0039] Step 202: Obtain a summarized accident scene.

[0040] In this step, the summarized accident scenarios are several typical accident scenarios introduced in advance based on external prior knowledge, such as railway road collapse, wrong route entry, etc., which are not limited in this embodiment.

[0041] Specifically, after obtaining the railway traffic accident report text, the entity feature analysis of the railway traffic accident report text is further performed, mainly to further introduce the inductive accident scene from the external prior knowledge.

[0042] Step 203: Perform entity feature analysis on the railway traffic accident report text according to the summarized accident scenario to obtain feature analysis results.

[0043] In this step, entity features commonly included in the entity feature analysis may include, for example, initial time, control measures, operating activities, and consequence status, etc., which are not limited in this embodiment.

[0044] Specifically, after obtaining the summarized accident scene and the railway traffic accident report text, the railway traffic accident report text is subjected to entity feature analysis according to the summarized accident scene, and multiple scene entity range boundaries are summarized (multiple scene entity range boundaries may, for example, include large causal factor categories or aspects, and multiple related sub-aspects, which are not limited in this embodiment), thereby obtaining feature analysis results based on the summarized multiple scene entity range boundaries, and then determining fine-grained keywords based on the railway traffic accident report text after the feature analysis results.

[0045] Step 102: Determine fine-grained keywords based on the railway accident report text.

[0046] In this step, the fine-grained keywords are keywords extracted after semantic analysis of the railway accident report text.

[0047] Specifically, by performing semantic analysis on the railway traffic accident report text and performing vocabulary extraction on the railway traffic accident report text after semantic analysis, fine-grained subject words are obtained.

[0048] In a specific embodiment, fine-grained keywords are determined based on a railway traffic accident report text, including: performing character decomposition on the railway traffic accident report text to obtain a first character decomposition result; wherein character decomposition refers to decomposing each character in the railway traffic accident report text; performing vocabulary aggregation on the first character decomposition result to obtain a first vocabulary aggregation result; wherein vocabulary aggregation refers to merging semantically similar characters in the character decomposition result; and determining fine-grained keywords based on the first vocabulary aggregation result and a first quantization threshold.

[0049] In a specific embodiment, fine-grained subject words are determined based on the first vocabulary aggregation result and the first quantization threshold, including: respectively calculating the first semantic distance between the preset vocabulary and each first candidate vocabulary in the first vocabulary aggregation result; and determining all first candidate vocabulary corresponding to all first semantic distances greater than or equal to the first quantization threshold in the first vocabulary aggregation result as fine-grained subject words.

[0050] In this step, the first character decomposition result is the result of directly decomposing each character in the railway traffic accident report text. The first quantization threshold is a pre-set threshold for determining the first vocabulary aggregation result, which is not limited in this embodiment. The first vocabulary aggregation result is the result of vocabulary aggregation of the decomposed first character decomposition result. The preset vocabulary is a pre-set demand vocabulary, such as rainfall, etc., which is not limited in this embodiment. The first semantic distance is the distance between the similarity between each first candidate vocabulary in the first vocabulary aggregation result and the preset vocabulary.

[0051] Specifically, the railway traffic accident report text is decomposed based on the feature analysis results after the entity feature analysis, and each word in the railway traffic accident report text is word embedded, that is, each word or token is mapped to an embedding vector of a fixed size, thereby obtaining a first word decomposition result; then, each semantically similar word in the first decomposition result is aggregated, and the embedding vectors are merged to obtain a first vocabulary aggregation result, and then, based on the word similarity of each first candidate word and the preset word in the first vocabulary aggregation result, the first semantic distance between the preset word and each first candidate word in the first vocabulary aggregation result is analyzed, and it is determined whether each first semantic distance is greater than or equal to a first quantization threshold; all first candidate words corresponding to all first semantic distances greater than or equal to the first quantization threshold in the first vocabulary aggregation result are determined as fine-grained subject words.

[0052] Figure 3 This is the third flow chart of the semantic extraction method of text provided by the present invention, such as Figure 3 As shown, determining fine-grained keywords based on the railway traffic accident report text includes step 301, step 302, step 303, step 304 and step 305.

[0053] Step 301: Decompose the railway accident report text into characters to obtain a first character decomposition result.

[0054] In this step, character decomposition refers to decomposing each character in the railway accident report text.

[0055] Specifically, word embedding is performed on each word in the railway traffic accident report text, that is, each word or token is mapped to an embedding vector of a fixed size, thereby obtaining the first word decomposition result.

[0056] In this step, word embedding is the process of mapping words or phrases in the vocabulary to real-number word vectors based on language modeling and feature learning models. Word embedding involves mathematical embedding from the space of each word (each character) to a continuous vector space with a lower dimension. Bidirectional Encoder Representations from Transformers (BERT) is mainly used to extract features from the railway accident report text, namely the word embedding vectors, which serve as high-quality feature inputs for downstream models. The advantage of BERT is that in addition to capturing obvious differences such as polysemy, context-related words also express other forms of information, allowing for more precise feature representation, thereby improving model performance and enhancing the accuracy of the first-word decomposition results.

[0057] Step 302: Perform vocabulary aggregation on the first character decomposition result to obtain a first vocabulary aggregation result.

[0058] In this step, vocabulary aggregation refers to merging words with similar semantics in the word decomposition results.

[0059] Specifically, each semantically similar word in the first decomposition result is aggregated, and the embedding vectors are merged to obtain a first vocabulary aggregation result.

[0060] In this step, the aggregation process to obtain the first vocabulary aggregation result is primarily achieved using word segmentation software or tools. For example, the Jieba word segmentation and aggregation tool can be used. Jieba offers three word segmentation modes: 1) Precision mode: This splits the sentence most precisely, suitable for text analysis. 2) Full mode: This scans all words in the sentence that can form a word. This is fast, but cannot resolve ambiguity. 3) Search engine mode: Building on the precision mode, long words are further segmented to improve recall, making it suitable for search engine word segmentation. Each semantically similar word in the first decomposition result is then segmented and clustered, and its embedding vectors are merged to obtain the first vocabulary aggregation result. In actual application, the specific mode to use should be selected based on actual needs. If you encounter problems such as unsatisfactory word segmentation results or missing dictionaries, you can take the following measures: 1) Use a more comprehensive dictionary: Jieba word segmentation software comes with its own dictionary file, but it may not include vocabulary from certain specialized fields. You can download and use a more comprehensive dictionary file to improve word segmentation accuracy. 2) Custom Dictionary: Use the jieba.load_userdict(file_name) method to load a custom dictionary file. Words in the custom dictionary will be matched before the default dictionary. 3) Optimize Word Segmentation Strategies: Flexibly select different word segmentation modes and strategies based on actual needs. 4) Integrate with Other Libraries: Jieba word segmentation can be combined with other natural language processing libraries (such as the Natural Language Toolkit (NLTK) and Spacy (a software package that provides rich industrial-grade natural language processing capabilities)) to improve processing performance.

[0061] In a specific embodiment, vocabulary aggregation is performed on the first character decomposition result to obtain a first vocabulary aggregation result, including: determining the word semantics of all characters in the first character decomposition result; determining the semantic similarity between all word semantics corresponding to all characters; and vocabulary aggregation is performed on all characters in the first character decomposition result according to the semantic similarity to obtain a first vocabulary aggregation result.

[0062] Step 303: Calculate the first semantic distance between the preset vocabulary and each first candidate vocabulary in the first vocabulary aggregation result.

[0063] Specifically, the word similarity between each first candidate word in the first vocabulary aggregation result and the preset word is calculated respectively, and the first semantic distance between the preset word and each first candidate word in the first vocabulary aggregation result is obtained by analysis.

[0064] In this step, the calculation of the first semantic distance for word similarity can be performed, for example, by analyzing the similarity between each first candidate word in the first vocabulary collection result and the preset word based on cosine similarity, thereby obtaining the first semantic distance. Cosine similarity measures the similarity between each first candidate word in the first vocabulary collection result and the preset word by measuring the cosine value of the angle between them, with a value range of [−1, 1]. For example, 1) when each first candidate word in the first vocabulary collection result and the preset word have the same orientation, the cosine similarity value is 1; 2) when the angle between each first candidate word in the first vocabulary collection result and the preset word is 90°, the cosine similarity value is 0; 3) when each first candidate word in the first vocabulary collection result and the preset word point in completely opposite directions, the cosine similarity value is −1. The cosine similarity value is independent of the length of each first candidate word in the first vocabulary collection result and is only related to the orientation of each first candidate word in the first vocabulary collection result. When the length of texts differs greatly but the content is similar, if word frequency or word vector is used as a feature, the Euclidean distance between them in the feature space may be large; however, the angle between them may be small, so the similarity is high. In addition, cosine similarity still maintains the characteristic of taking values ​​between [−1, 1] when the feature dimension is high. Cosine similarity is formalized as follows: Given two vectors and , For example, it can be each first candidate word in the first vocabulary collection result, For example, it can be a predefined vocabulary, and the geometric definition of the dot product is , algebraically defined as , Indicates the total number of first candidate words in the first vocabulary aggregation result, Indicates the number of the first candidate word in the first vocabulary collection result. When each first candidate word and the preset word in the first vocabulary collection result are given, the cosine similarity of each first candidate word and the preset word in the first vocabulary collection result is given by the vector dot product and the vector scalar length, that is, the first semantic distance The calculation of is shown in formula (1).

[0065] (1) In formula (1), Indicates the first word collection result First candidate words, Indicates the default vocabulary A vocabulary.

[0066] Step 304: Determine whether each first semantic distance is greater than or equal to a first quantization threshold.

[0067] Specifically, it is determined whether each first semantic distance is greater than or equal to a first quantization threshold. If the first semantic distance in the first vocabulary aggregation result is greater than or equal to the first quantization threshold, step 305 is continued.

[0068] Step 305: Determine all first candidate words corresponding to all first semantic distances greater than or equal to a first quantization threshold in the first vocabulary aggregation result as fine-grained topic words.

[0069] Specifically, when the first semantic distance in the first vocabulary aggregation result is greater than or equal to the first quantization threshold, all first candidate words corresponding to all first semantic distances greater than or equal to the first quantization threshold in the first vocabulary aggregation result are determined as fine-grained topic words.

[0070] In a specific embodiment, all first candidate words corresponding to all first semantic distances less than the first quantization threshold in the first vocabulary aggregation result are determined as first abnormal candidate words, and the first abnormal candidate words can be fed back to business personnel, who further analyze and process the first abnormal candidate words.

[0071] For example, taking the weather environment as an example, for example, if the weather environment is raining, Figure 4 This is the fourth flow chart of the semantic extraction method of text provided by the present invention, such as Figure 4 As shown, it includes step 401, step 402, step 403 and step 404.

[0072] Step 401: The area has experienced continuous rainfall recently.

[0073] Specifically, the text of a railway traffic accident report may be, for example, "There has been continuous rainfall in this area recently."

[0074] Step 402: It has recently rained continuously in this area.

[0075] Specifically, the text of the railway traffic accident report "There has been continuous rainfall in this area recently" is decomposed into characters, and the first character decomposition result is "this, area, section, recent, period, continuous, continue, fall, rain".

[0076] Step 403: The area has experienced recent continuous rainfall.

[0077] Specifically, words with similar semantics in the first word decomposition result "this, place, section, recent, period, continuous, rainfall" are merged, and the first vocabulary convergence result is obtained as "this, place, recent, continuous, rainfall".

[0078] Step 404, rainfall.

[0079] Specifically, after obtaining the first vocabulary convergence result as "this, place, recent, continuous, rainfall", calculate the similarity between "this", "place", "recent", "continuous", "rainfall" and the preset vocabulary "rainfall" respectively, and obtain the corresponding first semantic distances respectively. In the case where the first semantic distances in the first vocabulary convergence result are greater than or equal to the first quantization threshold, all the first candidate words corresponding to the first semantic distances greater than or equal to the first quantization threshold in the first vocabulary convergence result are determined as fine-grained topic words. That is, the first semantic distance between the first candidate word "rainfall" and the preset vocabulary "rainfall" in the first vocabulary convergence result is greater than or equal to the first quantization threshold. Therefore, "rainfall" is determined as the fine-grained topic word.

[0080] Step 103, determine the text semantic extraction result according to the railway traffic accident report text and the fine-grained topic words.

[0081] In this step, the text semantic extraction result is the result after symbol grouping of the fine-grained topic words and the railway traffic accident report text. That is, further perform symbol grouping on the railway traffic accident report text and the fine-grained topic words, and then perform text extraction on the symbol-grouped railway traffic accident report text and fine-grained topic words to obtain the text semantic extraction result.

[0082] Specifically, after obtaining the fine-grained topic words, further determine the text semantic extraction result according to the railway traffic accident report text and the fine-grained topic words.

[0083] In a specific embodiment, determining the text semantic extraction result according to the railway traffic accident report text and the fine-grained topic words includes: performing word decomposition on the railway traffic accident report text and the fine-grained topic words to obtain a second word decomposition result; performing vocabulary convergence on the second word decomposition result to obtain a second vocabulary convergence result; determining the text semantic extraction result according to the second vocabulary convergence result and the second quantization threshold.

[0084] In a specific embodiment, determining the text semantic extraction result according to the second vocabulary convergence result and the second quantization threshold includes: calculating the second semantic distances between the preset vocabulary and each second candidate word in the second vocabulary convergence result respectively; determining all the second candidate words corresponding to the second semantic distances greater than or equal to the second quantization threshold in the second vocabulary convergence result as the text semantic extraction result.

[0085] In this step, the second character decomposition result is the result of decomposing each character in the railway traffic accident report text and the fine-grained subject words. The second quantization threshold is a pre-set threshold for judging the first vocabulary aggregation result. The second quantization threshold can be the same as the first quantization threshold or different, and this embodiment does not limit this. The second vocabulary aggregation result is the result of vocabulary aggregation of the decomposed second character decomposition result. The preset vocabulary is a pre-set demand vocabulary, for example, it can be rainfall, etc., and this embodiment does not limit this. The second semantic distance is the distance between the similarity of each second candidate vocabulary in the second vocabulary aggregation result and the preset vocabulary.

[0086] Specifically, after obtaining the fine-grained keywords, the railway traffic accident report text and the fine-grained keywords are decomposed into characters, and each character in the railway traffic accident report text and the fine-grained keywords is embedded, that is, each word or tag is mapped to an embedding vector of a fixed size, thereby obtaining a second character decomposition result; then, for the second character decomposition result, each individual character in the second character decomposition result is grouped and aggregated according to symbols such as commas and periods, and the embedding vectors of each character in each group are merged to obtain a second vocabulary aggregation result; then, based on the word similarity between each second candidate vocabulary in the second vocabulary aggregation result and the preset vocabulary, the second semantic distance between the preset vocabulary and each second candidate vocabulary in the second vocabulary aggregation result is analyzed, and whether each second semantic distance is greater than or equal to the second quantization threshold is determined respectively; all second candidate vocabulary corresponding to all second semantic distances greater than or equal to the first quantization threshold in the second vocabulary aggregation result are determined as text semantic extraction results.

[0087] The benefit of this setting is that it improves the accuracy and completeness of the text semantic extraction results of railway traffic accident report texts.

[0088] Figure 5 This is the fifth flow chart of the semantic extraction method of text provided by the present invention, such as Figure 5 As shown, determining the text semantic extraction result based on the railway traffic accident report text and fine-grained keywords includes step 501, step 502, step 503, step 504 and step 505.

[0089] Step 501: Perform word decomposition on the railway traffic accident report text and fine-grained keywords to obtain a second word decomposition result.

[0090] Step 502: Perform vocabulary aggregation on the second character decomposition result to obtain a second vocabulary aggregation result.

[0091] In a specific embodiment, vocabulary aggregation is performed on the second character decomposition result to obtain a second vocabulary aggregation result, including: determining a target symbol in the second character decomposition result; wherein the target symbol is a pre-set identification symbol with representative meaning; and vocabulary aggregation is performed on all characters in the second character decomposition result according to the target symbol to obtain a second vocabulary aggregation result.

[0092] In this step, the target symbol is a pre-set identification symbol with representative meaning. The target symbol may be, for example, an identification symbol such as a comma or a period, which is not limited in this embodiment.

[0093] Specifically, after obtaining the second word decomposition result, the individual words of the second word decomposition result are grouped according to identification symbols such as commas and periods; and the embedding vectors of each word in each group are merged to obtain the second vocabulary aggregation result.

[0094] Step 503: Calculate the second semantic distance between the preset vocabulary and each second candidate vocabulary in the second vocabulary aggregation result.

[0095] Specifically, the word similarity between each second candidate word in the second vocabulary aggregation result and the preset word is calculated respectively, and the second semantic distance between the preset word and each second candidate word in the second vocabulary aggregation result is obtained by analysis.

[0096] Step 504: Determine whether each second semantic distance is greater than or equal to a second quantization threshold.

[0097] Specifically, it is determined whether each second semantic distance is greater than or equal to a second quantization threshold. If the second semantic distance in the second vocabulary aggregation result is greater than or equal to the second quantization threshold, step 505 is continued.

[0098] Step 505: Determine all second candidate words corresponding to all second semantic distances greater than or equal to the second quantization threshold in the second vocabulary aggregation result as text semantic extraction results.

[0099] Specifically, when the second semantic distance in the second vocabulary aggregation result is greater than or equal to the second quantization threshold, all second candidate words corresponding to all second semantic distances in the second vocabulary aggregation result that are greater than or equal to the second quantization threshold are determined as text semantic extraction results.

[0100] In a specific embodiment, all second candidate words corresponding to all second semantic distances less than the second quantization threshold in the second vocabulary aggregation result are determined as second abnormal candidate words, and the second abnormal candidate words can be fed back to business personnel, who further analyze and process the second abnormal candidate words.

[0101] For example, taking the weather environment as an example, for example, the weather environment is raining, Figure 6 This is the sixth flow chart of the semantic extraction method of text provided by the present invention, such as Figure 6 As shown, taking rainfall as an example, the process includes step 601 , step 602 , step 603 and step 604 .

[0102] Step 601. During the electrification construction in XX, 17 contact network support foundations were set up in the area. Since October this year, continuous heavy rainfall has caused the water level of Fenhe River to rise sharply, and the contact network foundation has been soaked and washed away by the river water for a long time.

[0103] Specifically, the text of a railway traffic accident report can be, for example, "During the electrification construction in XX, 17 contact network support foundations were set up in the area. Since October this year, continuous heavy rainfall has caused the water level of the Fen River to surge, and the contact network foundation has been soaked and washed away by the river water for a long time." A fine-grained keyword can be, for example, "rainfall."

[0104] Step 602: During the electrical and gas construction in XX year, 17 contact grids, support columns, and foundations were installed. Since October of this year, continuous heavy rain has caused the water level of the Fen River to rise sharply, and the contact grids and foundations have been soaked and washed by the river water for a long time.

[0105] Specifically, the text of the railway accident report "During the electrification construction in XX, 17 contact network support foundations were set up in the period from XX to XX. Since October this year, continuous heavy rainfall has caused the water level of the Fen River to surge, and the contact network foundation has been soaked and washed away by the river water for a long time" and the fine-grained keyword "rainfall" were decomposed into characters, and the second character decomposition result was obtained as "During the electrification construction in XX, 17 contact network support foundations were set up in the period from XX to XX. Since October this year, continuous heavy rainfall has caused the water level of the Fen River to surge, and the contact network foundation has been soaked and washed away by the river water for a long time."

[0106] Step 603: During the electrification construction in XX, 17 contact network support foundations were set up in the period from XX to XX. Since October this year, continuous heavy rainfall has caused the water level of Fenhe River to surge, and the contact network foundation has been soaked and washed away by the river water for a long time.

[0107] Specifically, the decomposition result of the second word is "During the electrification construction in XX year, 17 contact network support pillars and foundations were set within the period of to. Since October of this year, continuous heavy rainfall has caused the water level of Fenhe River to surge, and the contact network foundation has been soaked and washed by river water for a long time." By merging with symbols such as commas and periods, the second vocabulary aggregation result is "During the electrification construction in XX year, 17 contact network support pillars and foundations were set within the period of to. Since October of this year, continuous heavy rainfall has caused the water level of Fenhe River to surge, and the contact network foundation has been soaked and washed by river water for a long time."

[0108] Step 604: Continuous heavy rainfall causes the water level of the Fen River to rise sharply.

[0109] Specifically, after obtaining the second vocabulary aggregation result of "During the electrification construction in XX year, 17 contact network pillar foundations were set up within a period of time, since October this year, continuous heavy rainfall caused the water level of the Fen River to rise sharply, and the contact network foundation was soaked and washed away by the river water for a long time.", the similarities between "During the electrification construction in XX year", "17 contact network pillar foundations were set up within a period of time", "since October this year", "continuous heavy rainfall caused the water level of the Fen River to rise sharply", and "the contact network foundation was soaked and washed away by the river water for a long time" and the preset vocabulary "rainfall" are calculated respectively, and the corresponding second semantic distances are obtained respectively. When the second semantic distance in the second vocabulary aggregation result is greater than or equal to the second quantization threshold, all second candidate words corresponding to all second semantic distances greater than or equal to the second quantization threshold in the second vocabulary aggregation result are determined as text semantic extraction results, that is, the second semantic distance between the second candidate word "continuous heavy rainfall caused the water level of the Fen River to rise sharply" in the second vocabulary aggregation result and the preset vocabulary "rainfall" is greater than or equal to the second quantization threshold. Therefore, "continuous heavy rainfall caused the water level of the Fen River to rise sharply" is determined as the text semantic extraction result.

[0110] In a specific embodiment, after obtaining the text semantic extraction results, taking into account the characteristics of different business scenarios, the text semantic extraction results are fed back to the management personnel for review to determine whether the text semantic extraction results meet the business needs. The first quantization threshold or the second quantization threshold can be adjusted in time according to the situation of meeting the business needs until the text semantic extraction results meet the ideal business needs. This embodiment does not specifically limit the adjustment of the first quantization threshold or the second quantization threshold, and can be adjusted up or down according to business needs.

[0111] The present invention provides a method for extracting semantics from text, which includes obtaining a railway accident report text; determining fine-grained keywords based on the railway accident report text; wherein the fine-grained keywords are keywords extracted after semantic analysis of the railway accident report text; determining a text semantic extraction result based on the railway accident report text and the fine-grained keywords; wherein the text semantic extraction result is the result of symbol grouping the fine-grained keywords and the railway accident report text. Based on the above embodiments, the technical solution of the present invention is used to solve the defects of the existing technology of high error rate and low efficiency through manual comparison or keyword comparison, and realize multi-dimensional semantic extraction of text. At the first level, vocabulary extraction is performed by performing fine-grained semantic analysis on the railway accident report text. At the second level, the extracted fine-grained keywords and the railway accident report text are further grouped into medium-grained symbols, and further text extraction is performed to obtain a text semantic extraction result, thereby improving the processing efficiency of the railway accident report text and reducing the extraction error rate.

[0112] The text semantic extraction device provided by the present invention is described below. The text semantic extraction device described below and the text semantic extraction method described above can be referenced to each other.

[0113] Figure 7 This is a schematic diagram of the structure of the text semantic extraction device provided by the present invention, referring to Figure 7 As shown, the text semantic extraction device 700 includes: a text acquisition module 701, a keyword determination module 702 and a result determination module 703.

[0114] The text acquisition module 701 is used to acquire the railway traffic accident report text.

[0115] The subject word determination module 702 is used to determine fine-grained subject words based on the railway traffic accident report text; wherein the fine-grained subject words are subject words extracted after semantic analysis of the railway traffic accident report text.

[0116] The result determination module 703 is used to determine the text semantic extraction result based on the railway traffic accident report text and fine-grained subject words; wherein the text semantic extraction result is the result of symbol grouping the fine-grained subject words and the railway traffic accident report text.

[0117] In an example embodiment, the keyword determination module 702 is specifically used to: perform character decomposition on the railway traffic accident report text to obtain a first character decomposition result; wherein character decomposition refers to decomposing each character in the railway traffic accident report text; perform vocabulary aggregation on the first character decomposition result to obtain a first vocabulary aggregation result; wherein vocabulary aggregation refers to merging semantically similar characters in the character decomposition result; and determine fine-grained keywords based on the first vocabulary aggregation result and a first quantization threshold.

[0118] In an example embodiment, the topic word determination module 702 determines fine-grained topic words based on the first vocabulary aggregation result and the first quantization threshold, and is specifically used to: calculate the first semantic distance between the preset vocabulary and each first candidate word in the first vocabulary aggregation result; and determine all first candidate words corresponding to all first semantic distances greater than or equal to the first quantization threshold in the first vocabulary aggregation result as fine-grained topic words.

[0119] In an exemplary embodiment, the topic word determination module 702 performs vocabulary aggregation on the first character decomposition result to obtain a first vocabulary aggregation result, which is specifically used to: determine the word semantics of all characters in the first character decomposition result; determine the semantic similarity between all word semantics corresponding to all characters; and perform vocabulary aggregation on all characters in the first character decomposition result according to the semantic similarity to obtain a first vocabulary aggregation result.

[0120] In an exemplary embodiment, the result determination module 703 is specifically used to: perform character decomposition on the railway traffic accident report text and fine-grained keywords to obtain a second character decomposition result; perform vocabulary aggregation on the second character decomposition result to obtain a second vocabulary aggregation result; and determine the text semantic extraction result based on the second vocabulary aggregation result and the second quantization threshold.

[0121] In an example embodiment, the result determination module 703 determines the text semantic extraction result based on the second vocabulary aggregation result and the second quantization threshold, and is specifically used to: respectively calculate the second semantic distance of each second candidate vocabulary in the preset vocabulary and the second vocabulary aggregation result; and determine all second candidate vocabulary corresponding to all second semantic distances greater than or equal to the second quantization threshold in the second vocabulary aggregation result as the text semantic extraction result.

[0122] In an exemplary embodiment, the result determination module 703 performs vocabulary aggregation on the second character decomposition result to obtain a second vocabulary aggregation result, which is specifically used to: determine a target symbol in the second character decomposition result; wherein the target symbol is a pre-set identification symbol with representative meaning; and perform vocabulary aggregation on all characters in the second character decomposition result according to the target symbol to obtain a second vocabulary aggregation result.

[0123] The device of this embodiment can be used to execute the method of any embodiment in the text semantic extraction method embodiment. Its specific implementation process and technical effects are similar to those in the text semantic extraction method embodiment. For details, please refer to the detailed description in the text semantic extraction method embodiment, which will not be repeated here.

[0124] Figure 8 Schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 8 As shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830, and a communications bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other via the communications bus 840. The processor 810 may invoke logic instructions in the memory 830 to execute a text semantic extraction method, which includes: obtaining a railway traffic accident report text; determining fine-grained subject terms based on the railway traffic accident report text; wherein the fine-grained subject terms are subject terms extracted after semantic analysis of the railway traffic accident report text; and determining a text semantic extraction result based on the railway traffic accident report text and the fine-grained subject terms; wherein the text semantic extraction result is the result of symbolically grouping the fine-grained subject terms and the railway traffic accident report text.

[0125] Furthermore, the logic instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0126] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the text semantic extraction method provided by the above methods, which includes: obtaining a railway traffic accident report text; determining fine-grained keywords based on the railway traffic accident report text; wherein the fine-grained keywords are keywords extracted after semantic analysis of the railway traffic accident report text; determining a text semantic extraction result based on the railway traffic accident report text and the fine-grained keywords; wherein the text semantic extraction result is the result of symbol grouping the fine-grained keywords and the railway traffic accident report text.

[0127] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a semantic extraction method for the text provided by the above-mentioned methods, the method comprising: obtaining a railway traffic accident report text; determining fine-grained subject words based on the railway traffic accident report text; wherein the fine-grained subject words are subject words extracted after semantic analysis of the railway traffic accident report text; determining a text semantic extraction result based on the railway traffic accident report text and the fine-grained subject words; wherein the text semantic extraction result is a result of symbolic grouping of the fine-grained subject words and the railway traffic accident report text.

[0128] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0129] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for semantic extraction of text, characterized in that: include: Get the text of railway traffic accident report; Determining fine-grained subject words based on the railway traffic accident report text; wherein the fine-grained subject words are subject words extracted after semantic analysis of the railway traffic accident report text; A text semantic extraction result is determined based on the railway traffic accident report text and the fine-grained subject words; wherein the text semantic extraction result is the result of symbol grouping the fine-grained subject words and the railway traffic accident report text.

2. The text semantic extraction method according to claim 1, characterized in that: The determining of fine-grained keywords based on the railway traffic accident report text includes: Performing character decomposition on the railway traffic accident report text to obtain a first character decomposition result; wherein the character decomposition refers to decomposing each character in the railway traffic accident report text; Performing vocabulary aggregation on the first word decomposition result to obtain a first vocabulary aggregation result; wherein vocabulary aggregation refers to merging semantically similar words in the word decomposition result; The fine-grained topic words are determined according to the first vocabulary aggregation result and a first quantization threshold.

3. The text semantic extraction method according to claim 2, characterized in that: The determining the fine-grained topic words according to the first vocabulary aggregation result and the first quantization threshold includes: Calculating first semantic distances between a preset vocabulary and each first candidate vocabulary in the first vocabulary aggregation result respectively; All the first candidate words corresponding to all the first semantic distances greater than or equal to the first quantization threshold in the first vocabulary aggregation result are determined as the fine-grained topic words.

4. The text semantic extraction method according to claim 2, characterized in that: The performing vocabulary aggregation on the first word decomposition result to obtain a first vocabulary aggregation result includes: determining the word semantics of all words in the first word decomposition result; Determining semantic similarity between all the word semantics corresponding to all the words; Performing vocabulary aggregation on all characters in the first character decomposition result according to the semantic similarity to obtain the first vocabulary aggregation result.

5. The text semantic extraction method according to claim 1, characterized in that: Determining a text semantic extraction result based on the railway traffic accident report text and the fine-grained keyword includes: Performing word decomposition on the railway traffic accident report text and the fine-grained subject words to obtain a second word decomposition result; performing vocabulary aggregation on the second word decomposition result to obtain a second vocabulary aggregation result; The text semantic extraction result is determined according to the second vocabulary aggregation result and a second quantization threshold.

6. The method for extracting semantics from text according to claim 5, wherein: Determining the text semantic extraction result according to the second vocabulary aggregation result and the second quantization threshold includes: respectively calculating a second semantic distance between the preset vocabulary and each second candidate vocabulary in the second vocabulary aggregation result; All second candidate words corresponding to all second semantic distances greater than or equal to the second quantization threshold in the second vocabulary aggregation result are determined as the text semantic extraction result.

7. The text semantic extraction method according to claim 5, characterized in that: The performing vocabulary aggregation on the second character decomposition result to obtain a second vocabulary aggregation result includes: Determining a target symbol in the second character decomposition result; wherein the target symbol is a pre-set identification symbol with representative meaning; All characters in the second character decomposition result are subjected to vocabulary aggregation according to the target symbol to obtain the second vocabulary aggregation result.

8. A text semantic extraction device, characterized in that: include: A text acquisition module is used to obtain the railway traffic accident report text; A subject word determination module, configured to determine fine-grained subject words based on the railway traffic accident report text; wherein the fine-grained subject words are subject words extracted after semantic analysis of the railway traffic accident report text; A result determination module is used to determine a text semantic extraction result based on the railway traffic accident report text and the fine-grained subject words; wherein the text semantic extraction result is the result of symbol grouping the fine-grained subject words and the railway traffic accident report text.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method for extracting text semantics as claimed in any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for extracting text semantics as claimed in any one of claims 1 to 7 is implemented.