Method, device, storage medium and electronic device for constructing word vector matrix in logistics industry

By constructing a fence sequence and a diagram of upstream and downstream corporates, the logistics industry's word vector matrix is ​​generated, and the problem of neglecting semantic information in the existing technology of vocabulary indicates the problem of semantic information and improves the accuracy of semantic characteristics.

CN114595307BActive Publication Date: 2025-01-24BEIJING ZHONGJIAOXING ROAD INTERNET OF VEHICLES TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210134797.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-14
Publication Date
2025-01-24
Estimated Expiration
2042-02-14

AI Technical Summary

Technical Problem

The vocabulary representation method in the existing logistics industry ignores the semantic information of vocabulary and cannot represent the correlation between vocabulary, resulting in a decrease in the accuracy of semantic representation.

Method used

By constructing a fence sequence and upstream and downstream relationship maps, the multiple groups of context vocabulary of each enterprise are generated, and the target vector vectors are mapped from the words of the fence to the quantity of the fence to generate model training to generate the logistics industry vector matrix.

Benefits of technology

By constructing an enterprise upstream and downstream relationship, the unique semantic vector of the logistics vocabulary is expressed, and the accuracy of the calculation accuracy of the similarity between the logistics vocabulary and the physical similarity of the physical vocabulary is improved, and the accuracy of the semantic representation is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114595307B_ABST
    Figure CN114595307B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, storage medium and electronic device for constructing a word vector matrix for the logistics industry. The method includes: constructing a fence sequence and an enterprise upstream and downstream relationship diagram based on vehicle stop point data and enterprise fence data; constructing a word vector for each fence in the fence sequence; generating multiple groups of context words for each enterprise based on the enterprise upstream and downstream relationship diagram; mapping the target word vector corresponding to each group of context words in the multiple groups of context words for each enterprise from the word vector of each fence; performing model training based on the target word vector corresponding to each group of context words to generate a logistics industry word vector matrix. Since the present application constructs the upstream and downstream relationship of enterprises, and then constructs the semantic relationship of words in enterprise labels, a semantic vector representation unique to logistics words is generated by means of natural language processing, so as to better calculate the similarity between logistics words and the similarity of entities represented by corresponding words, while improving the accuracy of semantic representation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing technology, and in particular to a method, device, storage medium and electronic device for constructing a word vector matrix for the logistics industry. Background Art

[0002] In recent years, in order to apply natural language to semantic analysis, sentiment analysis, information retrieval and other fields, people usually express words (abbreviated as words) as one-dimensional or multi-dimensional word vectors, and then use computing equipment to further process the word vectors.

[0003] In the logistics industry, the existing cargo vocabulary is represented by one-hot. For example, vegetables, fruits, and steel are represented by one-hot as (1, 0, 0), (0, 1, 0), and (0, 0, 1), respectively. The similarity between the three is 0. However, in actual freight scenarios, from the perspective of cargo types, the similarity between vegetables and fruits is much higher than the similarity between vegetables and steel, and between fruits and steel. Therefore, the existing vocabulary vector representation method in the logistics industry ignores the semantic information of the vocabulary and cannot express the correlation between words, thereby reducing the accuracy of semantic representation. Summary of the invention

[0004] The embodiments of the present application provide a method, device, storage medium and electronic device for constructing a word vector matrix in the logistics industry. In order to have a basic understanding of some aspects of the disclosed embodiments, a simple summary is given below. This summary is not a general review, nor is it intended to determine the key / important components or describe the scope of protection of these embodiments. Its only purpose is to present some concepts in a simple form as a preface to the detailed description that follows.

[0005] In a first aspect, an embodiment of the present application provides a method for constructing a word vector matrix for the logistics industry, the method comprising:

[0006] Construct fence sequences and enterprise upstream and downstream relationship diagrams based on vehicle stop data and enterprise fence data;

[0007] Construct a word vector for each fence in the fence sequence;

[0008] Generate multiple sets of context words for each enterprise based on the enterprise upstream and downstream relationship graph;

[0009] Map the target word vector corresponding to each set of context words in each enterprise's multiple sets of context words from the word vector of each fence;

[0010] The model is trained based on the target word vectors corresponding to each group of context words to generate a word vector matrix for the logistics industry.

[0011] Optionally, a fence sequence and an enterprise upstream and downstream relationship diagram are constructed based on the vehicle stop data and enterprise fence data, including:

[0012] Obtain vehicle stop data and business fence data;

[0013] Associating vehicle stop data with enterprise fence data to convert the vehicle stop data into a fence sequence;

[0014] Generate an upstream and downstream relationship diagram of enterprises based on the fence sequence.

[0015] Optionally, generate an enterprise upstream and downstream relationship diagram based on the fence sequence, including:

[0016] Determine the relationship between adjacent fences in the fence sequence and generate a relationship graph;

[0017] Identify identical relationships in the relationship graph and relationships whose number of relationships is less than a preset threshold;

[0018] The same relationships are merged, and the relationships with a number of relationships less than a preset threshold are eliminated to obtain an upstream and downstream relationship diagram of the enterprise.

[0019] Optionally, construct a word vector for each fence in the fence sequence, including:

[0020] According to the vocabulary of the business entity corresponding to each fence in the fence sequence, determine the point of interest type label and the cargo type label corresponding to the business entity;

[0021] Match the initial vectors of each word in the POI type label and the cargo label from the preset word vector space;

[0022] The initial vectors of each word in the POI type label and the cargo label are fused to generate the word vector of each fence.

[0023] Optionally, multiple groups of words are generated for each enterprise based on the enterprise upstream and downstream relationship diagram, including:

[0024] Perform a breadth search on each enterprise node in the enterprise upstream and downstream relationship graph in the upstream and downstream direction to obtain the depth tree of each enterprise;

[0025] According to each path from the root node to the leaf node in the depth tree of each enterprise, determine the lexical context relationship corresponding to each path;

[0026] The words in each word context are arranged and combined to generate multiple groups of context words for each enterprise.

[0027] Optionally, after model training based on the target word vectors corresponding to each group of words, a logistics industry word vector matrix is ​​generated, including:

[0028] Input the target word vector corresponding to each group of context words into the preset word embedding model and output multiple target values;

[0029] Generate a logistics industry word vector matrix based on multiple target values.

[0030] Optionally, generate a logistics industry word vector matrix based on multiple target values, including:

[0031] Sum multiple target values ​​to generate the model loss value;

[0032] When the model loss value reaches the preset threshold, the output word embedding training model's middle layer parameter matrix;

[0033] The parameter matrix of the middle layer is determined as the word vector matrix of the logistics industry.

[0034] In a second aspect, an embodiment of the present application provides a device for constructing a word vector matrix for a logistics industry, the device comprising:

[0035] A data construction module is used to construct a fence sequence and an enterprise upstream and downstream relationship diagram based on vehicle stop data and enterprise fence data;

[0036] A word vector construction module is used to construct a word vector for each fence in the fence sequence;

[0037] A vocabulary generation module is used to generate multiple sets of contextual vocabulary for each enterprise based on the enterprise upstream and downstream relationship graph;

[0038] A word vector mapping module, used for mapping the word vector of each fence to a target word vector corresponding to each set of context words in multiple sets of context words of each enterprise;

[0039] The word vector matrix generation module is used to perform model training based on the target word vectors corresponding to each group of context words and generate a word vector matrix for the logistics industry.

[0040] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.

[0041] In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.

[0042] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0043] In an embodiment of the present application, a logistics industry word vector matrix construction device first constructs a fence sequence and an enterprise upstream and downstream relationship diagram based on vehicle stop point data and enterprise fence data, then constructs a word vector for each fence in the fence sequence, and then generates multiple groups of context words for each enterprise based on the enterprise upstream and downstream relationship diagram, and then maps the target word vector corresponding to each group of context words in each enterprise's multiple groups of context words from the word vector of each fence, and finally performs model training based on the target word vector corresponding to each group of context words to generate a logistics industry word vector matrix. Since the present application constructs the upstream and downstream relationship of enterprises, and then constructs the semantic relationship of words in enterprise labels, a semantic vector representation unique to logistics words is generated by means of natural language processing, so as to better calculate the similarity between logistics words and the similarity of entities represented by corresponding words, while improving the accuracy of semantic representation.

[0044] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0046] Figure 1 It is a flowchart of a method for constructing a word vector matrix for the logistics industry provided in an embodiment of the present application;

[0047] Figure 2 It is a schematic diagram of an enterprise depth tree provided in an embodiment of the present application;

[0048] Figure 3 It is a schematic diagram of an enterprise relationship path provided by an embodiment of the present application;

[0049] Figure 4 It is a schematic diagram of an enterprise vocabulary context provided by an embodiment of the present application;

[0050] Figure 5 It is a schematic diagram of a word embedding training model provided in an embodiment of the present application;

[0051] Figure 6 It is a structural schematic diagram of a device for constructing a word vector matrix for the logistics industry provided in an embodiment of the present application;

[0052] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The following description and the drawings sufficiently illustrate specific embodiments of the invention to enable those skilled in the art to practice them.

[0054] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are only examples of devices and methods consistent with some aspects of the present invention as detailed in the attached claims.

[0056] In the description of the present invention, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. In addition, in the description of the present invention, unless otherwise specified, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

[0057] The present application provides a method, device, storage medium and electronic device for constructing a word vector matrix in the logistics industry to solve the problems existing in the above-mentioned related technical problems. In the technical solution provided by the present application, since the present application constructs the semantic relationship of the vocabulary in the enterprise label by constructing the upstream and downstream relationship of the enterprise, and generates a semantic vector representation unique to the logistics vocabulary by means of natural language processing, it can better calculate the similarity between logistics vocabulary and the similarity of entities represented by the corresponding vocabulary, and at the same time improve the accuracy of the semantic representation. The following exemplary embodiments are used for detailed description.

[0058] The following will be combined with the attached Figure 1 -Attached Figure 5 , a detailed introduction to the method for constructing a word vector matrix for the logistics industry provided in an embodiment of the present application is given. The method can be implemented by a computer program and can be run on a device for constructing a word vector matrix for the logistics industry based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application.

[0059] See also Figure 1 , which is a flow chart of a method for constructing a word vector matrix for the logistics industry according to an embodiment of the present application. Figure 1 As shown, the method of the embodiment of the present application may include the following steps:

[0060] S101, constructing a fence sequence and an enterprise upstream and downstream relationship diagram according to the vehicle stop point data and the enterprise fence data;

[0061] The vehicle stop point data is the vehicle stop location information reported by the vehicle electronic device according to a preset period, including at least the latitude and longitude of the vehicle stop point. The enterprise fence data is the electronic fence data constructed for the enterprise.

[0062] In an embodiment of the present application, vehicle stop point data and enterprise fence data are first obtained, then the vehicle stop point data and enterprise fence data are associated to convert the vehicle stop point data into a fence sequence, and finally an enterprise upstream and downstream relationship diagram is generated according to the fence sequence.

[0063] Furthermore, when generating an enterprise upstream and downstream relationship diagram based on a fence sequence, first determine the relationship between adjacent fences in the fence sequence to generate a relationship diagram, then identify the same relationships in the relationship diagram and the relationships whose number of relationships is less than a preset threshold, and finally merge the same relationships and eliminate the relationships whose number of relationships is less than the preset threshold to obtain an enterprise upstream and downstream relationship diagram.

[0064] In one possible implementation, the vehicle stop point data and the enterprise fence data are associated to convert the vehicle stop point sequence into a fence sequence, and then the same relationships are merged according to the relationship between adjacent fences, and the upstream and downstream relationship diagram of the enterprise is obtained after removing the relationships with a number lower than a threshold k.

[0065] S102, constructing a word vector for each fence in the fence sequence;

[0066] Among them, the corporate entity corresponding to each fence in the fence sequence contains multiple labels. This application constructs two types of fence labels for each fence, one is POI type label, such as mining area, farmland, port, construction site, etc., and the other is cargo label, such as seafood, steel, mineral powder, container, etc.

[0067] In an embodiment of the present application, when constructing the word vector of each fence in a fence sequence, first, based on the vocabulary of the business entity corresponding to each fence in the fence sequence, the point of interest type label and the cargo type label corresponding to the business entity are determined, and then the initial vectors of each vocabulary in the point of interest type label and the cargo label are matched from the preset word vector space, and finally, the initial vectors of each vocabulary in the point of interest type label and the cargo label are fused to generate the word vector of each fence.

[0068] It should be noted that the generation of tags is carried out by keyword vocabulary mapping, and each word is represented by a one-hot vector.

[0069] S103, generating multiple groups of context words for each enterprise according to the enterprise upstream and downstream relationship graph;

[0070] In an embodiment of the present application, when generating multiple groups of vocabulary for each enterprise based on the enterprise upstream and downstream relationship graph, first, a breadth search is performed on each enterprise node in the enterprise upstream and downstream relationship graph in the upstream and downstream directions to obtain a depth tree for each enterprise, and then, based on each path from the root node to the leaf node in the depth tree of each enterprise, the vocabulary context relationship corresponding to each path is determined respectively, and finally, the vocabulary on each vocabulary context relationship is arranged and combined to generate multiple groups of context vocabulary for each enterprise.

[0071] Furthermore, after model training is performed based on the target word vectors corresponding to each group of vocabulary, when generating the logistics industry word vector matrix, the target word vector corresponding to each group of context vocabulary is first input into the preset word embedding model, multiple target values ​​are output, and finally the logistics industry word vector matrix is ​​generated based on the multiple target values.

[0072] In a possible implementation, a breadth search algorithm is used to perform a 2-degree search on each enterprise node in the enterprise upstream and downstream relationship graph in the upstream and downstream direction. Each enterprise will generate a tree with a depth of 3, such as Figure 2 As shown in Figure 1. Since the enterprise itself contains types and product labels, a set of relationships between terms can be indirectly established for each path from the root node to the leaf node in the tree. For example Figure 3 As shown, taking the path enterprise relationship A=>Enterprise B=>Enterprise C as an example, the context vocabulary of the path can be generated, such as Figure 4 As shown, 2*3*3=18 vocabulary combinations are finally generated. In particular, in order to solve the OOV (Out-Of-Vocabulary) problem caused by the lack of upstream and downstream, two words are reserved: the starting point and the end point. For the vocabulary relationships without upstream and downstream, two words are used to supplement them respectively.

[0073] S104, mapping a target word vector corresponding to each set of context words in multiple sets of context words of each enterprise from the word vector of each fence;

[0074] In one possible implementation, after obtaining the word vector of each fence according to step S102 and obtaining multiple groups of context words for each enterprise according to step S103, the target word vector corresponding to each group of context words in the multiple groups of context words for each enterprise can be mapped from the word vector of each fence to perform model training.

[0075] S105, performing model training based on the target word vectors corresponding to each group of context words to generate a logistics industry word vector matrix.

[0076] In an embodiment of the present application, the target word vector corresponding to each group of context words is first input into a preset word embedding model, multiple target values ​​are output, and finally a logistics industry word vector matrix is ​​generated based on the multiple target values.

[0077] Specifically, when generating a word vector matrix for the logistics industry based on multiple target values, the multiple target values ​​are first summed to generate a model loss value. Then, when the model loss value reaches a preset threshold, the parameter matrix of the middle layer of the word embedding training model is output. Finally, the parameter matrix of the middle layer is determined as the word vector matrix for the logistics industry.

[0078] Among them, the preset word embedding model can be a CBOW model.

[0079] In one possible implementation, for example Figure 5 As shown in the figure, CBOW is used as the word embedding training model. The input is the one-hot vector corresponding to each group of context words, and the output is the target value yj. The context window size is 3, wt-1 and wt+1 are the context words, and wt is the word to be predicted. Finally, the output of multiple yj can be summed to determine whether the summed value reaches the preset value. When it reaches the preset value, the parameter matrix of the middle layer (Hidden layer) is output.

[0080] Furthermore, after obtaining the logistics industry word vector matrix, semantic similarity recommendation can be performed based on the matrix. First, a fence sequence and an enterprise upstream and downstream relationship diagram are constructed based on the vehicle stop point data to be matched and the enterprise fence data. Then, a word vector for each fence in the fence sequence is constructed. Secondly, multiple groups of context words for each enterprise are generated based on the enterprise upstream and downstream relationship diagram. Then, multiple word vectors to be converted corresponding to each group of context words in the multiple groups of context words for each enterprise are mapped from the word vector of each fence. Then, the multiple word vectors to be converted are converted into multiple target vectors based on the logistics industry word vector matrix, and the multiple target vectors are combined in pairs. Finally, the similarity between each group of target vectors is calculated to obtain multiple similarities. After sorting the multiple similarities, multiple items corresponding to high similarities with a preset percentage are selected for recommendation.

[0081] For example, vegetables, fruits, and steel are represented by one-hot target word vectors of (1, 0, 0), (0, 1, 0), and (0, 0, 1), respectively, and their mutual similarity is 0. The new vector representations of the three words can be converted into (0.9, 0.1), (0.8, 0.1), and (0.1, 0.9) by using the logistics industry word vector matrix. It can be seen that the similarity between vegetables and fruits is higher than that between vegetables and steel, and between fruits and steel. Finally, recommendations are made through similarity calculation.

[0082] In an embodiment of the present application, a logistics industry word vector matrix construction device first constructs a fence sequence and an enterprise upstream and downstream relationship diagram based on vehicle stop point data and enterprise fence data, then constructs a word vector for each fence in the fence sequence, and then generates multiple groups of context words for each enterprise based on the enterprise upstream and downstream relationship diagram, and then maps the target word vector corresponding to each group of context words in each enterprise's multiple groups of context words from the word vector of each fence, and finally performs model training based on the target word vector corresponding to each group of context words to generate a logistics industry word vector matrix. Since the present application constructs the upstream and downstream relationship of enterprises, and then constructs the semantic relationship of words in enterprise labels, a semantic vector representation unique to logistics words is generated by means of natural language processing, so as to better calculate the similarity between logistics words and the similarity of entities represented by corresponding words, while improving the accuracy of semantic representation.

[0083] The following are embodiments of the device of the present invention, which can be used to implement the method embodiments of the present invention. For details not disclosed in the device embodiments of the present invention, please refer to the method embodiments of the present invention.

[0084] See also Figure 6 , which shows a schematic diagram of the structure of a logistics industry word vector matrix construction device provided by an exemplary embodiment of the present invention. The logistics industry word vector matrix construction device can be implemented as all or part of an electronic device through software, hardware, or a combination of both. The device 1 includes a data construction module 10, a word vector construction module 20, a vocabulary generation module 30, a word vector mapping module 40, and a word vector matrix generation module 50.

[0085] A data construction module 10, for constructing a fence sequence and an enterprise upstream and downstream relationship diagram according to the vehicle stop point data and the enterprise fence data;

[0086] A word vector construction module 20, used to construct a word vector for each fence in the fence sequence;

[0087] A vocabulary generation module 30, for generating multiple sets of contextual vocabulary for each enterprise according to the enterprise upstream and downstream relationship diagram;

[0088] A word vector mapping module 40, used to map the word vector of each fence to a target word vector corresponding to each group of context words in the multiple groups of context words of each enterprise;

[0089] The word vector matrix generation module 50 is used to perform model training based on the target word vector corresponding to each group of context words to generate a logistics industry word vector matrix.

[0090] It should be noted that the logistics industry word vector matrix construction device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when executing the logistics industry word vector matrix construction method. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the logistics industry word vector matrix construction device provided in the above embodiment and the logistics industry word vector matrix construction method embodiment belong to the same concept. The implementation process is detailed in the method embodiment, which will not be repeated here.

[0091] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0092] In an embodiment of the present application, a logistics industry word vector matrix construction device first constructs a fence sequence and an enterprise upstream and downstream relationship diagram based on vehicle stop point data and enterprise fence data, then constructs a word vector for each fence in the fence sequence, and then generates multiple groups of context words for each enterprise based on the enterprise upstream and downstream relationship diagram, and then maps the target word vector corresponding to each group of context words in each enterprise's multiple groups of context words from the word vector of each fence, and finally performs model training based on the target word vector corresponding to each group of context words to generate a logistics industry word vector matrix. Since the present application constructs the upstream and downstream relationship of enterprises, and then constructs the semantic relationship of words in enterprise labels, a semantic vector representation unique to logistics words is generated by means of natural language processing, so as to better calculate the similarity between logistics words and the similarity of entities represented by corresponding words, while improving the accuracy of semantic representation.

[0093] The present invention also provides a computer-readable medium having program instructions stored thereon, which, when executed by a processor, implement the method for constructing a word vector matrix for the logistics industry provided by the above-mentioned various method embodiments. The present invention also provides a computer program product containing instructions, which, when executed on a computer, enables the computer to execute the method for constructing a word vector matrix for the logistics industry provided by the above-mentioned various method embodiments.

[0094] See also Figure 7 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown, the electronic device 1000 may include: at least one processor 1001 , at least one network interface 1004 , a user interface 1003 , a memory 1005 , and at least one communication bus 1002 .

[0095] The communication bus 1002 is used to realize the connection and communication between these components.

[0096] The user interface 1003 may include a display screen (Display) and a camera (Camera), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.

[0097] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0098] Among them, the processor 1001 may include one or more processing cores. The processor 1001 uses various interfaces and lines to connect various parts within the entire electronic device 1000, and executes various functions and processes data of the electronic device 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Optionally, the processor 1001 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1001 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1001, and it can be implemented separately through a chip.

[0099] Among them, the memory 1005 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1005 may optionally be at least one storage device located away from the aforementioned processor 1001. As Figure 7 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a logistics industry word vector matrix construction application.

[0100] exist Figure 7 In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 1001 can be used to call the logistics industry word vector matrix stored in the memory 1005 to build an application, and specifically perform the following operations:

[0101] Construct fence sequences and enterprise upstream and downstream relationship diagrams based on vehicle stop data and enterprise fence data;

[0102] Construct a word vector for each fence in the fence sequence;

[0103] Generate multiple sets of context words for each enterprise based on the enterprise upstream and downstream relationship graph;

[0104] Map the target word vector corresponding to each set of context words in each enterprise's multiple sets of context words from the word vector of each fence;

[0105] The model is trained based on the target word vectors corresponding to each group of context words to generate a word vector matrix for the logistics industry.

[0106] In one embodiment, when the processor 1001 constructs a fence sequence and an enterprise upstream and downstream relationship diagram according to the vehicle stop point data and the enterprise fence data, the processor 1001 specifically performs the following operations:

[0107] Obtain vehicle stop data and business fence data;

[0108] Associating vehicle stop data with enterprise fence data to convert the vehicle stop data into a fence sequence;

[0109] Generate an upstream and downstream relationship diagram of enterprises based on the fence sequence.

[0110] In one embodiment, when the processor 1001 generates an enterprise upstream and downstream relationship graph according to the fence sequence, the processor 1001 specifically performs the following operations:

[0111] Determine the relationship between adjacent fences in the fence sequence and generate a relationship graph;

[0112] Identify identical relationships in the relationship graph and relationships whose number of relationships is less than a preset threshold;

[0113] The same relationships are merged, and the relationships with a number of relationships less than a preset threshold are eliminated to obtain an upstream and downstream relationship diagram of the enterprise.

[0114] In one embodiment, when executing the construction of the word vector of each fence in the fence sequence, the processor 1001 specifically performs the following operations:

[0115] According to the vocabulary of the business entity corresponding to each fence in the fence sequence, determine the point of interest type label and the cargo type label corresponding to the business entity;

[0116] Match the initial vectors of each word in the POI type label and the cargo label from the preset word vector space;

[0117] The initial vectors of each word in the POI type label and the cargo label are fused to generate the word vector of each fence.

[0118] In one embodiment, when the processor 1001 generates multiple groups of words for each enterprise according to the enterprise upstream and downstream relationship graph, the processor 1001 specifically performs the following operations:

[0119] Perform a breadth search on each enterprise node in the enterprise upstream and downstream relationship graph in the upstream and downstream direction to obtain the depth tree of each enterprise;

[0120] According to each path from the root node to the leaf node in the depth tree of each enterprise, determine the lexical context relationship corresponding to each path;

[0121] The words in each word context are arranged and combined to generate multiple groups of context words for each enterprise.

[0122] In one embodiment, after executing model training based on the target word vectors corresponding to each group of words, the processor 1001 generates a logistics industry word vector matrix by specifically performing the following operations:

[0123] Input the target word vector corresponding to each group of context words into the preset word embedding model and output multiple target values;

[0124] Generate a logistics industry word vector matrix based on multiple target values.

[0125] In one embodiment, when the processor 1001 generates a logistics industry word vector matrix according to multiple target values, the following operations are specifically performed:

[0126] Sum multiple target values ​​to generate the model loss value;

[0127] When the model loss value reaches the preset threshold, the output word embedding training model's middle layer parameter matrix;

[0128] The parameter matrix of the middle layer is determined as the word vector matrix of the logistics industry.

[0129] In an embodiment of the present application, a logistics industry word vector matrix construction device first constructs a fence sequence and an enterprise upstream and downstream relationship diagram based on vehicle stop point data and enterprise fence data, then constructs a word vector for each fence in the fence sequence, and then generates multiple groups of context words for each enterprise based on the enterprise upstream and downstream relationship diagram, and then maps the target word vector corresponding to each group of context words in each enterprise's multiple groups of context words from the word vector of each fence, and finally performs model training based on the target word vector corresponding to each group of context words to generate a logistics industry word vector matrix. Since the present application constructs the upstream and downstream relationship of enterprises, and then constructs the semantic relationship of words in enterprise labels, a semantic vector representation unique to logistics words is generated by means of natural language processing, so as to better calculate the similarity between logistics words and the similarity of entities represented by corresponding words, while improving the accuracy of semantic representation.

[0130] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program for constructing the word vector matrix of the logistics industry can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0131] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A method for constructing a word vector matrix for the logistics industry, characterized in that: The method comprises: Construct fence sequences and enterprise upstream and downstream relationship diagrams based on vehicle stop data and enterprise fence data; Construct a word vector for each fence in the fence sequence; wherein, The constructing a word vector for each fence in the fence sequence includes: Determine, according to the vocabulary of the business entity corresponding to each fence in the fence sequence, a point of interest type label and a cargo type label corresponding to the business entity; Matching the initial vectors of each word in the POI type label and the cargo label from a preset word vector space; The initial vectors of each word in the POI type label and the cargo label are merged to generate a word vector for each fence; Generate multiple groups of context words for each enterprise based on the enterprise upstream and downstream relationship diagram; wherein, The generating of multiple groups of context words for each enterprise according to the enterprise upstream and downstream relationship graph includes: Search each enterprise node in the enterprise upstream and downstream relationship graph in the upstream and downstream direction to obtain a depth tree of each enterprise; According to each path in the depth tree of each enterprise, respectively determine the lexical context relationship corresponding to each path; Arrange and combine the words in each of the word context relationships to generate multiple groups of context words for each enterprise; Mapping the target word vector corresponding to each group of context words in the multiple groups of context words of each enterprise from the word vector of each fence; Model training is performed based on the target word vectors corresponding to each group of context words to generate a logistics industry word vector matrix.

2. The method according to claim 1, characterized in that: The construction of fence sequence and enterprise upstream and downstream relationship diagram according to vehicle stop point data and enterprise fence data includes: Obtain vehicle stop data and business fence data; Associating the vehicle stop point data with the enterprise fence data to convert the vehicle stop point data into a fence sequence; An enterprise upstream and downstream relationship diagram is generated according to the fence sequence.

3. The method according to claim 2, characterized in that The generating of the enterprise upstream and downstream relationship diagram according to the fence sequence includes: Determine the relationship between adjacent fences in the fence sequence and generate a relationship graph; Identifying identical relationships and relationships whose number of relationships is less than a preset threshold in the relationship graph; The identical relationships are merged, and the relationships whose number of relationships is less than a preset threshold are eliminated to obtain an upstream and downstream relationship diagram of the enterprise.

4. The method according to claim 1, characterized in that: The search method is breadth search, and each path is a path from the root node to the leaf node.

5. The method according to claim 1, characterized in that The model training is performed based on the target word vector corresponding to each group of context words to generate a logistics industry word vector matrix, including: Input the target word vector corresponding to each group of context words into a preset word embedding model, and output multiple target values; Generate a logistics industry word vector matrix according to the multiple target values.

6. The method according to claim 5, characterized in that Generating a logistics industry word vector matrix according to the multiple target values ​​includes: Add the multiple target values ​​to generate a model loss value; When the model loss value reaches a preset threshold, outputting the parameter matrix of the middle layer of the word embedding model; The parameter matrix of the intermediate layer is determined as the logistics industry word vector matrix.

7. A device for constructing a word vector matrix for the logistics industry using the method described in any one of claims 1 to 6, characterized in that: The device comprises: A data construction module is used to construct a fence sequence and an enterprise upstream and downstream relationship diagram based on vehicle stop data and enterprise fence data; A word vector construction module, used to construct a word vector for each fence in the fence sequence; A vocabulary generation module, used to generate multiple groups of contextual vocabulary for each enterprise according to the enterprise upstream and downstream relationship diagram; A word vector mapping module, used to map the word vector of each fence to a target word vector corresponding to each group of context words in the multiple groups of context words of each enterprise; The word vector matrix generation module is used to perform model training based on the target word vectors corresponding to each group of context words to generate a logistics industry word vector matrix.

8. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method according to any one of claims 1 to 6.

9. An electronic device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Question feature representation method and device and storage medium

    CN110362723A

  • Text sentiment classification method and system

    CN111881291A