A word vector construction method, device, equipment and computer-readable storage medium

By building and sending new word vectors that remove redundant information through the server, the problem of inaccurate semantic recognition of unregistered words or old words with new meanings on the end-side device is solved, and the semantic recognition capability of the end-side device is improved.

CN114528842BActive Publication Date: 2025-10-03HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011322164.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-23
Publication Date
2025-10-03
Estimated Expiration
2040-11-23

AI Technical Summary

Technical Problem

When the end-side device does not include the vocabulary in the corpus to be processed in the word vector library, it cannot recognize the semantics and perform natural language processing tasks. The word vectors used in the existing technology for synonyms are not accurate enough, resulting in inaccurate semantic recognition.

Method used

The server constructs word vectors for new words by obtaining word vectors of synonyms of the new word, removing redundant information, and constructing word vectors that better fit the semantics of the new word. The vectors are then sent to the end-side device, which stores and applies these word vectors for semantic recognition.

Benefits of technology

It improves the semantic recognition accuracy of terminal devices, ensures accurate semantic recognition in the case of unregistered words or old words with new meanings, and enhances the ability of natural language processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114528842B_ABST
    Figure CN114528842B_ABST
Patent Text Reader

Abstract

The present application provides a word vector construction method, apparatus, device and computer-readable storage medium, which is applied to the field of terminal artificial intelligence and the corresponding sub-field natural language processing. The method includes: obtaining a new word, which is an unregistered word or a vocabulary with a new meaning of an old word, and the new word has a first semantic meaning; based on the word vector of at least one synonym corresponding to the new word, determining the word vector of the second semantic meaning contained in each synonym, the second semantic meaning corresponding to the first semantic meaning; constructing the word vector of the new word based on the word vector of the second semantic meaning contained in each synonym and the number of synonyms; sending the word vector of the new word to the terminal device. Using the present application, the word vector of the new word is constructed based on the word vector of the synonym after removing redundant information, so that the word vector of the synonym is more consistent with the semantic meaning of the new word to be constructed, which can improve the accuracy of the constructed word vector.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to natural language processing technology in the field of artificial intelligence, and particularly relates to a method, device, equipment, and computer-readable storage medium for constructing word vectors. Background Art

[0002] With the rapid development of artificial intelligence (AI), end-side devices (such as mobile phones, intelligent robots, and Bluetooth headsets, etc.) can also perform natural language processing (NLP) related tasks. End-side devices mainly execute NLP tasks by calling a pre-downloaded word vector library and an NLP task model from the server side. In other words, end-side devices rely on this word vector library to identify the semantics of the to-be-processed corpus, and then call the NLP task model to execute NLP tasks according to this semantics. It can be seen that when the word vector library does not contain any vocabulary in the to-be-processed corpus, the end-side device cannot identify this to-be-processed corpus, and thus cannot execute NLP related tasks. For example, there is the vocabulary "lan shou" in the word vector library. When the intelligent question-and-answer robot receives the to-be-processed corpus "Today is very lan shou", the intelligent question-and-answer robot cannot identify this to-be-processed corpus.

[0003] The specific operation for the server to usually construct the word vector of an out-of-vocabulary word is: determine the nearest synonym with the same semantics as this out-of-vocabulary word from the existing word vector library, and use the word vector of this synonym as the word vector of this out-of-vocabulary word. For example, if the word for which the word vector is to be constructed is "ao li gei", and the word with the closest semantics to it is "jia you", then the server can use the word vector of "jia you" as the word vector of "ao li gei". However, if the synonym of this out-of-vocabulary word has multiple meanings (such as the word vector of "jia you" also has the meaning of "add gasoline"), using the word vector of this synonym as the word vector of the out-of-vocabulary word is not accurate. Summary of the Invention

[0004] This application provides a method, device, equipment, and computer-readable storage medium for constructing word vectors, which can construct the word vector of a new word corresponding to a synonym by removing redundant information, making the word vector of this new word more accurate.

[0005] In a first aspect, this application provides a method for constructing word vectors. This method can be applied to a server, and this method includes:

[0006] Acquire new words, which are unregistered words or old words with new meanings. The new words have a first semantic meaning. Unregistered words are words whose word vectors do not exist in the server. Words with new meanings of old words are words whose word vectors exist in the server, and the semantics indicated by their word vectors are different from the first semantics. Based on the word vector of at least one synonym corresponding to the new word, determine the word vector of the second semantic meaning contained in each synonym, where the second semantic meaning corresponds to the first semantic meaning. Construct a word vector for the new word based on the number of synonyms corresponding to the new word and the word vector of the second semantic meaning contained in each synonym. Send the word vector of the new word to the end-side device.

[0007] Based on the method described in the first aspect, the server can obtain synonyms of unregistered words or old words with new meanings, and remove redundant information in the corresponding word vectors of the synonyms, so that the word vectors of the synonyms are more in line with the semantics of the unregistered words or old words with new meanings. Furthermore, the word vectors of the unregistered words or old words with new meanings are constructed based on the word vectors of the synonyms after removing redundant information, which can improve the accuracy of the word vectors of the unregistered words or old words with new meanings.

[0008] In one possible implementation, the server determines, for each of at least one synonym, whether the synonym contains a third semantic meaning in addition to the second semantic meaning. If the synonym contains the third semantic meaning, the server obtains the word vector corresponding to the third semantic meaning. Based on the word vector of the synonym and the word vector corresponding to the third semantic meaning, the server determines the word vector for the second semantic meaning contained in the synonym. By implementing this possibility, the server can more accurately remove redundant information from the word vectors of each synonym, making the word vector of the synonym more consistent with the semantic meaning of the unregistered word or the old word with a new meaning.

[0009] In one possible implementation, if a synonym does not contain at least one third semantic meaning, the server determines the synonym's word vector as the word vector for the second semantic meaning. By implementing this possibility, when a synonym does not contain redundant information, the server can directly construct word vectors for unregistered words or old words with new meanings based on the synonym's word vector, thereby saving computing resources.

[0010] In one possible implementation, the server obtains the weight value corresponding to each synonym, and constructs a word vector for the new word based on the weight value corresponding to each synonym, the number of synonyms corresponding to the new word, and the word vector of the second semantics contained in each synonym. By realizing this possibility, when an unregistered word or a vocabulary with a new meaning of an old word has multiple synonyms, the server can obtain the weight value of each synonym based on the degree of fit between each synonym and the unregistered word or the vocabulary with a new meaning of the old word, and then construct a more accurate word vector for the unregistered word or the vocabulary with a new meaning of the old word based on the weight value of each synonym, the number of synonyms, and the word vector of the synonym with redundant information removed.

[0011] In a second aspect, the present application provides a semantic recognition method, which can be applied to a terminal device, and includes:

[0012] Receive a word vector of a new word sent by a server, where the new word has a first semantic meaning. The new word is an unregistered word or an old word with a new meaning. The unregistered word is a word whose word vector does not exist in the server. The old word with a new meaning is a word whose word vector exists in the server, and the semantics indicated by its word vector is different from the first semantic meaning. Store the word vector of the new word in a second word vector library. Segment the corpus to be processed to obtain at least one word segment. If a first target word has a first word vector in the first word vector library, and the first target word has a second word vector in the second word vector library, determine the language probability corresponding to the corpus to be processed based on the first word vector or the second word vector, where the first target word is any one of the at least one word segment. Determine the first word vector or the second word vector as the word vector corresponding to the first target word in the corpus to be processed based on the language probability.

[0013] Based on the method described in the second aspect, the terminal-side device obtains and stores the word vectors of new words (unregistered words or old words with new meanings) from the server. Furthermore, the terminal-side device can perform semantic recognition on the to-be-processed corpus containing new words based on the word vectors of the new words (unregistered words or old words with new meanings), thereby improving the semantic recognition capability of the terminal-side device.

[0014] In one possible implementation, if the first target vocabulary does not have a word vector in the first word vector library, and the first target vocabulary has a word vector in the second word vector library, then the word vector of the first target vocabulary in the second word vector library is determined to be the word vector corresponding to the first target vocabulary in the corpus to be processed. By implementing this possibility, the end-side device can find the aforementioned unregistered word in the corpus to be processed, and determine the word vector of the unregistered word to perform semantic recognition on the unregistered word.

[0015] In one possible implementation, the end-side device calls the language model based on the first word vector and the word vector of the second target vocabulary in the first word vector library to determine the language probability corresponding to the corpus to be processed, where the second target vocabulary is a vocabulary other than the first target vocabulary in at least one word segmentation; if the language probability is less than the probability threshold, the second word vector is determined as the word vector corresponding to the first target vocabulary in the corpus to be processed; if the language probability is greater than or equal to the probability threshold, the first word vector is determined as the word vector corresponding to the first target vocabulary in the corpus to be processed. By implementing this possibility, the end-side device can distinguish old words with new meanings from the corpus to be processed, and can accurately distinguish the semantics of the old words with new meanings in the current application scenario, thereby improving the accuracy of the semantic recognition capability of the end-side device.

[0016] In one possible implementation, based on the second word vector and the word vector of the second target vocabulary in the first word vector library, the language model is called to determine the language probability corresponding to the corpus to be processed, and the second target vocabulary is a vocabulary other than the first target vocabulary in at least one word segmentation; if the language probability is greater than or equal to the probability threshold, the second word vector is determined as the word vector corresponding to the first target vocabulary in the corpus to be processed; if the language probability is less than the probability threshold, the first word vector is determined as the word vector corresponding to the first target vocabulary in the corpus to be processed. By implementing such a possibility, the end-side device can distinguish old words with new meanings from the corpus to be processed, and can accurately distinguish the semantics expressed by the old words with new meanings in the corpus to be processed, thereby improving the accuracy of the semantic recognition capability of the end-side device.

[0017] On the third aspect, the present application provides a word vector construction device, which can be a device in a server, or a device that can be used in combination with a server. The word vector construction device may include: an acquisition unit, used to acquire new words, which are unregistered words or old words with new meanings, and the new words have a first semantics. Unregistered words are words whose word vectors do not exist in the server, and old words with new meanings are words whose word vectors exist in the server, and the semantics indicated by their word vectors are different from the first semantics; a determination unit, used to determine the word vector of the second semantics contained in each synonym based on the word vector of at least one synonym corresponding to the new word, and the second semantics corresponds to the first semantics; a construction unit, used to construct the word vector of the new word based on the number of synonyms corresponding to the new word and the word vector of the second semantics contained in each synonym; a sending unit, used to send the word vector of the new word to the end-side device.

[0018] In one possible implementation, the determination unit is specifically used to: for each synonym in at least one synonym, determine whether the synonym contains a third semantics in addition to the second semantics; if the synonym contains the third semantics, obtain the word vector corresponding to the third semantics; based on the word vector of the synonym and the word vector corresponding to the third semantics, determine the word vector of the second semantics contained in the synonym.

[0019] In a possible implementation, the determining unit is further configured to: if the synonym does not contain at least one third semantic meaning, determine the word vector of the synonym to be a word vector of the second semantic meaning.

[0020] In one possible implementation, the construction unit is specifically used to: obtain the weight value corresponding to each synonym; and construct the word vector of the new word based on the weight value corresponding to each synonym, the number of synonyms corresponding to the new word, and the word vector of the second semantics contained in each synonym.

[0021] The functions of the word vector construction device can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions. The unit can be software and / or hardware. The operations and beneficial effects performed by the word vector construction device can refer to the method and beneficial effects described in the first aspect above, and the repeated parts will not be repeated.

[0022] In a fourth aspect, the present application provides a semantic recognition device, which may be a device in an end-side device, or a device that can be used in combination with an end-side device. The semantic recognition device may include: a receiving unit, configured to receive a word vector of a new word sent by a server, wherein the new word has a first semantic meaning and is an unregistered word or an old word with a new meaning. An unregistered word is a word whose word vector does not exist in the server, and a word with a new meaning of an old word is a word whose word vector exists in the server, and the semantics indicated by its word vector is different from the first semantic meaning; a storage unit, configured to store the word vector of the new word in a second word vector library; a segmentation unit, configured to segment the corpus to be processed to obtain at least one word segmentation; a determination unit, configured to determine the language probability corresponding to the corpus to be processed based on the first word vector or the second word vector if the first target word has a first word vector in the first word vector library and the first target word has a second word vector in the second word vector library, wherein the first target word is any one of the at least one word segmentation; the determination unit is further configured to determine the first word vector or the second word vector as the word vector corresponding to the first target word in the corpus to be processed based on the language probability.

[0023] In one possible implementation, the determination unit is also used to: if the first target vocabulary does not have a word vector in the first word vector library, and the first target vocabulary has a word vector in the second word vector library, then determine that the word vector of the first target vocabulary in the second word vector library is the word vector corresponding to the first target vocabulary in the corpus to be processed.

[0024] In a possible implementation, the determination unit is specifically used to: call the language model based on the first word vector and the word vector of the second target vocabulary in the first word vector library, and determine the language probability corresponding to the corpus to be processed, where the second target vocabulary is a vocabulary other than the first target vocabulary in at least one word segmentation; if the language probability is less than the probability threshold, then determine the second word vector as the word vector corresponding to the first target vocabulary in the corpus to be processed; if the language probability is greater than or equal to the probability threshold, then determine the first word vector as the word vector corresponding to the first target vocabulary in the corpus to be processed.

[0025] In a possible implementation, the determination unit is specifically used to: call the language model based on the second word vector and the word vector of the second target vocabulary in the first word vector library, and determine the language probability corresponding to the corpus to be processed, where the second target vocabulary is a vocabulary other than the first target vocabulary in at least one word segmentation; if the language probability is greater than or equal to the probability threshold, then determine the second word vector as the word vector corresponding to the first target vocabulary in the corpus to be processed; if the language probability is less than the probability threshold, then determine the first word vector as the word vector corresponding to the first target vocabulary in the corpus to be processed.

[0026] The functions of the semantic recognition device can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions. The unit can be software and / or hardware. The operations and beneficial effects performed by the semantic recognition device can be referred to the method and beneficial effects described in the second aspect above, and the repeated parts will not be repeated.

[0027] In the fifth aspect, an embodiment of the present application also provides a server, which may include a memory and a processor, wherein the memory is used to store a computer program that supports the device to execute the above method, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the word vector construction method described in any one of the above first aspects.

[0028] In the sixth aspect, an embodiment of the present application also provides an end-side device, which may include a memory and a processor, wherein the memory is used to store a computer program that supports the device to execute the above method, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the semantic recognition method described in any one of the above second aspects.

[0029] In the seventh aspect, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes any word vector construction method described in any one of the first aspects or any semantic recognition method described in any one of the second aspects.

[0030] In the eighth aspect, an embodiment of the present application also provides a computer program, which includes computer software instructions, and when the computer software instructions are executed by a computer, the computer executes any word vector construction method described in any one of the first aspects or any semantic recognition method described in any one of the second aspects.

[0031] In the ninth aspect, the present application also provides a chip, which is used to implement any word vector construction method described in any one of the first aspects or any semantic recognition method described in any one of the second aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1a A schematic diagram of the architecture of a language model provided in an embodiment of the present application;

[0033] Figure 1b A schematic diagram of the architecture of another language model provided in an embodiment of the present application;

[0034] Figure 2 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0035] Figure 3 A software structure diagram of a terminal device provided in an embodiment of the present application;

[0036] Figure 4 A schematic diagram of the structure of a server provided in an embodiment of the present application;

[0037] Figure 5 A schematic diagram of the architecture of a language model provided in an embodiment of the present application;

[0038] Figure 6 A flowchart of a word vector construction method provided in an embodiment of the present application;

[0039] Figure 7 A schematic diagram of word vector decomposition provided in an embodiment of the present application;

[0040] Figure 8 A schematic diagram of a method for constructing word vectors for unregistered words provided in an embodiment of the present application;

[0041] Figure 9 A schematic diagram of a method for constructing word vectors for a vocabulary with new meanings of an old word provided in an embodiment of the present application;

[0042] Figure 10 A flowchart of a semantic recognition method provided in an embodiment of the present application;

[0043] Figure 11 A schematic diagram of a method for determining a probability threshold provided in an embodiment of the present application;

[0044] Figure 12 A schematic diagram of another method for determining a probability threshold provided in an embodiment of the present application;

[0045] Figure 13 A flowchart of another semantic recognition method provided in an embodiment of the present application;

[0046] Figure 14 A schematic diagram of the structure of a word vector construction device provided in an embodiment of the present application;

[0047] Figure 15 A schematic diagram of the structure of a semantic recognition device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solutions and advantages of this application clearer, this application will be further described in detail below with reference to the accompanying drawings.

[0049] The terms "first" and "second" and the like in the specification, claims, and drawings of this application are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of operations or units is not limited to the listed operations or units, but may optionally include operations or units not listed, or may optionally include other operations or units inherent to the process, method, product, or apparatus.

[0050] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0051] In this application, "at least one (item)" means one or more, "more than one" means two or more, "at least two (items)" means two or three and more, and "and / or" is used to describe the corresponding relationship between corresponding objects, indicating that three relationships can exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the corresponding objects before and after are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or plural.

[0052] In order to better understand the word vector construction method and semantic recognition method provided by the embodiment of the present application, the system architecture of the application of the embodiment of the present application is first introduced below.

[0053] See Figure 1a , Figure 1aThis is a schematic diagram of a system architecture provided by an embodiment of the present application, wherein the system architecture 10 includes a terminal device 100 and a server 200. It should be noted that, Figure 1a The number of terminal devices 100 and the number of servers 200 shown in the figure are only for illustration and are not specifically limited in this application.

[0054] Among them, see Figure 1b , Figure 1b For another system architecture diagram, Figure 1b The data interaction process between the client device 100 and the server 200 is reflected in the figure. The server 200 is mainly used to obtain new words and construct word vectors for the new words; train the language model based on the text corpus in the storage space of the server 200; and calculate the probability threshold based on the text corpus and the language model. Furthermore, the server 200 sends the new word vector, language model, and probability threshold to the client device 100, so that the client device 100 can perform NLP task processing based on the new word vector, language model, and probability threshold sent by the server 200. The NLP task processing may include intelligent question answering, text classification, natural language generation, sentiment classification, and dialogue management.

[0055] The end-side device 100 involved in the embodiment of the present application, which may also be referred to as a terminal device, is an entity on the user side for running a natural language processing model (such as segmenting the corpus to be processed and running a semantic recognition method). For example, the end-side device 100 may be a handheld device, a vehicle-mounted device, etc. with a wireless connection function. The end-side device may also be other processing devices connected to a wireless modem. The end-side device may also communicate with a radio access network (RAN) and be a wireless terminal device, a subscriber unit, a subscriber station, a mobile station, a mobile station, a remote station, an access point, a remote terminal device, an access terminal device, a user terminal device, a user agent, a user device, or a user equipment (UE), etc. The end-side device may also be a mobile terminal device, such as a mobile phone (or "cellular" phone) and a computer with a mobile terminal device. For example, it may be a portable, pocket-sized, handheld, computer-built-in, or vehicle-mounted mobile device that exchanges voice and / or data with a wireless access network. The end-side device may also be a personal communication service (PCS) phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), or other device. Common end-side devices 100 may include: automobiles, drones, robotic arms, mobile phones, tablet computers, laptop computers, PDAs, mobile internet devices (MIDs), wearable devices such as smart watches, smart bracelets, pedometers, etc., but the embodiments of the present application are not limited thereto.

[0056] The following describes the structure of the terminal device 100. Figure 2 , Figure 2 It is a structural diagram of the terminal side device 100 provided in an embodiment of the present application.

[0057] The end-side device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0058] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the end-side device 100. In other embodiments of the present application, the end-side device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0059] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0060] The controller may be the nerve center and command center of the terminal device 100. The controller may generate an operation control signal based on the instruction operation code and the timing signal to complete the control of instruction fetching and execution.

[0061] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0062] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0063] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, processor 110 may include multiple I2C busses. Processor 110 can be coupled to touch sensor 180K, a charger, a flash, camera 193, and the like via different I2C bus interfaces. For example, processor 110 can be coupled to touch sensor 180K via an I2C interface, enabling communication between processor 110 and touch sensor 180K via the I2C bus interface, thereby enabling touch functionality on terminal device 100.

[0064] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.

[0065] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can communicate via the PCM interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0066] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.

[0067] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the terminal device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the terminal device 100.

[0068] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0069] The USB interface 130 is an interface that complies with USB standards and specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the terminal device 100, or to transfer data between the terminal device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as AR devices.

[0070] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt a different interface connection method from the above embodiments, or a combination of multiple interface connection methods.

[0071] The charging management module 140 is configured to receive charging input from a charger, which may be a wireless charger or a wired charger.

[0072] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. In some other embodiments, the power management module 141 can also be provided in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be provided in the same device.

[0073] The wireless communication function of the terminal device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.

[0074] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the client device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antenna can be used in conjunction with a tuning switch.

[0075] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for use on the end-side device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low-noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be located in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be located in the same device as at least some of the modules of the processor 110.

[0076] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium- or high-frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs audio signals through an audio device (including but not limited to the speaker 170A, the receiver 170B, etc.) or displays images or videos on the display 194. In some embodiments, the modem processor may be a standalone device. In other embodiments, the modem processor may be independent of the processor 110 and may be located in the same device as the mobile communication module 150 or other functional modules.

[0077] The wireless communication module 160 can provide wireless communication solutions applied to the terminal device 100, including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth (BT), BLE broadcast, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, frequency modulate them, amplify them, and convert them into electromagnetic waves for radiation through the antenna 2.

[0078] In some embodiments, antenna 1 of the terminal device 100 is coupled to the mobile communication module 150, and antenna 2 is coupled to the wireless communication module 160, so that the terminal device 100 can communicate with the network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0079] The end-side device 100 implements display functions through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0080] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLED, or a quantum dot light-emitting diode (QLED). In some embodiments, the end-side device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0081] The terminal device 100 can realize the shooting function through the ISP, camera 193, video codec, GPU, display 194 and application processor.

[0082] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and transformed into a visible image. The ISP can also perform algorithmic optimization for image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0083] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the terminal device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0084] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the terminal device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0085] Video codecs are used to compress or decompress digital video. The client device 100 can support one or more video codecs. This allows the client device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0086] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU enables intelligent cognitive applications on the device 100, such as image recognition, face recognition, voice recognition, and text comprehension.

[0087] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0088] The internal memory 121 can be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the terminal device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The program storage area may store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device 100 (such as audio data, a phone book, etc.). In addition, the internal memory 121 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0089] The terminal device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0090] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0091] The speaker 170A, also called a "speaker," is used to convert audio electrical signals into sound signals. The client device 100 can listen to music or make hands-free calls through the speaker 170A.

[0092] The receiver 170B, also called a "handset," is used to convert audio electrical signals into sound signals. When the end-side device 100 receives a call or voice message, the user can place the receiver 170B close to the ear to hear the voice.

[0093] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The end-side device 100 can be provided with at least one microphone 170C. In other embodiments, the end-side device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the end-side device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.

[0094] The headphone jack 170D is used to connect a wired headphone. The headphone jack 170D may be the USB interface 130 or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.

[0095] The pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194 .

[0096] The gyroscope sensor 180B can be used to determine the motion posture of the device 100. In some embodiments, the gyroscope sensor 180B can be used to determine the angular velocity of the device 100 around three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can also be used for image stabilization. The gyroscope sensor 180B can also be used for navigation and somatosensory gaming scenarios.

[0097] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.

[0098] The magnetic sensor 180D includes a Hall sensor, and the terminal device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover.

[0099] The accelerometer 180E can detect the magnitude of acceleration of the device 100 in all directions (generally three axes). When the device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.

[0100] The distance sensor 180F is used to measure distance. The end-side device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the end-side device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0101] The proximity light sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The device 100 emits infrared light through the LED. The device 100 uses the photodiode to detect infrared light reflected from nearby objects, automatically turning off the screen to save power. The proximity light sensor 180G can also be used to automatically unlock and lock the screen in holster mode and pocket mode.

[0102] The ambient light sensor 180L is used to sense ambient light brightness. The end-side device 100 can adaptively adjust the brightness of the display screen 194 based on the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking photos. The ambient light sensor 180L can also work with the proximity light sensor 180G to detect whether the end-side device 100 is in a pocket to prevent accidental touches.

[0103] The fingerprint sensor 180H is used to collect fingerprints. The terminal device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering calls, etc.

[0104] The temperature sensor 180J is used to detect temperature. In some embodiments, the end-side device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy.

[0105] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the terminal device 100, at a different location from the display screen 194.

[0106] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone mass in a human vocal part.

[0107] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The terminal device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the terminal device 100.

[0108] Motor 191 can generate vibration alerts. This can be used for incoming call vibration alerts and touch vibration feedback. For example, touch operations applied to different applications (such as taking photos, playing audio, etc.) can correspond to different vibration feedback effects. Motor 191 can also generate different vibration feedback effects for touch operations applied to different areas of the display 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. Touch vibration feedback effects can also be customized.

[0109] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0110] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and disconnected from the terminal device 100 by inserting or removing it from the SIM card interface 195. The terminal device 100 can support one or N SIM card interfaces, where N is a positive integer greater than one. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The terminal device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the terminal device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.

[0111] The software system of the terminal device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with a layered architecture is used as an example to illustrate the software structure of the terminal device 100. Figure 3 This is a block diagram of the software structure of the end-side device 100 in an embodiment of the present application. A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0112] The application layer can include a series of application packages. Figure 3 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0113] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 3 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0114] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0115] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0116] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0117] The phone manager is used to provide communication functions for the terminal device 100, such as management of call status (including answering, hanging up, etc.).

[0118] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0119] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

[0120] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

[0121] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0122] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0123] The system library can include multiple functional modules, such as the surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), and 2D graphics engine (such as SGL).

[0124] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0125] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0126] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0127] A 2D graphics engine is a drawing engine for 2D drawings.

[0128] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0129] The structure of the server 200 is introduced below. Figure 4 , Figure 4 It is a structural diagram of the server 200 provided in an embodiment of the present application.

[0130] The server 200 includes a processor 201 , a communication interface 202 , and a memory 203 . The processor 201 , the communication interface 202 , and the memory 203 are interconnected via an internal bus 204 .

[0131] The processor 201 may be composed of one or more general-purpose processors, such as a central processing unit (CPU), or a combination of a CPU and a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0132] The bus 204 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus 204 may be divided into an address bus, a data bus, a control bus, etc. For ease of presentation, Figure 2 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0133] The memory 203 may include a volatile memory, such as a random access memory (RAM); the memory 203 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); the memory 203 may also include a combination of the above types.

[0134] In order to better understand the solution provided by this application, the following is an introduction to the relevant terms involved in the embodiments of this application:

[0135] Vocabulary, also referred to as words or participles in this application, is the sum of all or a specific range of words and / or phrases in a language (including Chinese, English, etc.). In the embodiments of this application, unless otherwise specified, "vocabulary" can refer to words or phrases. Among them, the words here include "characters" and "phrases" in Chinese characters, as well as "words" in languages ​​such as English.

[0136] The semantics of a word is a set of characteristic information used to describe the word. The characteristic information of a word may include but is not limited to at least one of the following: the meaning of the word, part of speech (such as noun, adjective, etc.), synonyms and antonyms, etc. For example, the semantic information of "beautiful" may include: the meaning is "good-looking, that is, close to perfection or ideal in form, proportion, layout, demeanor, color or sound, which makes all senses extremely pleasing"; the part of speech is adjective; the synonym is "pretty"; the antonym is "ugly", etc. The semantic information of a word may include the characteristic information of the word contained in the word. In this application, the semantic information of a word mostly represents the meaning of the word.

[0137] A word vector, also called a word feature vector, is a vector composed of numbers mapped from the feature information of a word, and is used to represent the feature information of a word.

[0138] Unregistered words: These are words that are not included in the word segmentation vocabulary (or word vector library) but must be segmented, including various proper nouns (personal names, place names, company names, etc.), abbreviations, new words, etc.

[0139] Old words with new meanings: These words are already included in the word segmentation vocabulary (or word vector library), but have been given new meanings due to changes in application scenarios. For example, "shiitake mushroom" is usually a noun, meaning a type of food. However, in some contexts, people now use "shiitake mushroom" as a verb, meaning to want to cry.

[0140] A language model is a probability distribution model constructed for a text corpus. It is used to calculate the probability of a language sequence corresponding to the text corpus. It can be used to determine whether a language sequence is a normal sentence, that is, to determine whether a text corpus is fluent. Figure 5 The figure shows a schematic diagram of the architecture of a language model, which includes an embedding layer, a neural network layer, and an output layer. The embedding layer is used to receive words in the vocabulary and output the word vectors corresponding to each word; the neural network layer is used to process and analyze the word vectors; and the output layer outputs the probability of the language sequence. It should be noted that the language model mentioned in this application includes but is not limited to the embedding layer being a word2vec model or a Glove model, and the neural network layer being a recurrent neural network (RNN) or a long short-term memory neural network (LSTM). For example, when the embedding layer receives the corpus to be processed as "I want to eat mushrooms", it outputs the word vector of "I", the word vector of "want", the word vector of "eat", and the word vector of "mushrooms" respectively. The neural network layer processes and analyzes the word vector of "I", the word vector of "want", the word vector of "eat", and the word vector of "mushrooms", and in order to make the conditional probability of the first word "I" meaningful, it adds a start symbol before the first word "I" in the language sequence. <s>. The output layer outputs the conditional probability that the word vector of "I" appears as , the conditional probability that the word vector of "want" appears as , the conditional probability that the word vector of "eat" appears as , and the conditional probability that the word vector of "mushroom" appears as .

[0141] The word vector construction method provided by the embodiments of the present application will be further described in detail below:

[0142] Please refer to Figure 6 , Figure 6 , which is a schematic flowchart of a word vector construction method provided by an embodiment of the present application. As Figure 6 shown, the word vector construction method includes the following steps 601 to step 604. Figure 6 The execution subject of the method shown can be a server or a chip in the server. Figure 6 Taking the server as the execution subject of the word vector construction method as an example for illustration. Among them:

[0143] 601. Obtain a new word, which is an out-of-vocabulary word or a word with a new meaning of an old word. The new word has a first semantic meaning. An out-of-vocabulary word is a word for which there is no word vector in the server, and a word with a new meaning of an old word is a word for which there is a word vector in the server, and the semantic meaning indicated by its word vector is different from the first semantic meaning.

[0144] The server can receive a word vector construction instruction input by an operator and obtain the new word carried in the word vector construction instruction. For example, in an application scenario, the operator conducts an Internet search for the network popular words within a fixed time period, or conducts an Internet search based on network hot events, and determines whether there are new words according to the search results. If the operator determines that there are new words, the operator sends a word vector construction instruction for the new word to the server. Exemplarily, the operator discovers the word "awesome" through an Internet search and determines that "awesome" is an out-of-vocabulary word according to his own common sense (or knowledge reserve), that is, a word for which there is no word vector in the server's word vector library. Then the operator sends a word vector construction instruction for "awesome" to the server. Furthermore, the server can obtain the new word "awesome" from the word vector construction instruction.

[0145] It should be noted that the number of new words obtained by the server can be obtained individually or in batches by the server. This application does not make too many limitations in this regard. In the embodiments designed in this application, obtaining a single new word is taken as an example.

[0146] 602. Based on the word vectors of at least one synonym corresponding to the new word, determine the word vectors of the second semantic meanings included in each synonym, and the second semantic meaning corresponds to the first semantic meaning.

[0147] After the server obtains the new word, the operation / development personnel list the synonyms of the new word based on their own knowledge reserves or common sense. The server obtains at least one synonym corresponding to the new word listed by the operation / development personnel, and obtains the word vector of each synonym from the thesaurus. Further, the server can determine the word vector of the second semantic contained in the synonym based on the word vector of each synonym.

[0148] It should be noted that the second semantic corresponding to the first semantic may include the case where the second semantic is the same as the first semantic, such as "mom" and "mother", or may also include the case where the second semantic is semantically similar to the first semantic, such as "appreciate" and "understand" both mean "comprehend, experience and recognize", but "appreciate" emphasizes the emotional experience and appreciation, while "understand" emphasizes the rational understanding.

[0149] In a possible implementation, the server can determine whether each synonym in the at least one synonym contains a third semantic other than the second semantic. If the synonym contains the third semantic, obtain the word vector corresponding to the third semantic, and based on the word vector of the synonym and the word vector corresponding to the third semantic, determine the word vector of the second semantic contained in the synonym.

[0150] After the server obtains the word vector of each synonym, for each synonym, determine whether the synonym is a polysemous word (that is, in addition to the second semantic, the synonym also contains a third semantic). In other words, the server determines whether the synonym contains two types of semantics (the second semantic and the third semantic). Among them, the second semantic is the same or similar to the first semantic of the new word; the third semantic is not the same or not similar to the first semantic of the new word, and there may be one or more third semantics. If the synonym is a polysemous word and the third semantic is clear (that is, the word vector corresponding to the third semantic or its synonym can be obtained from the word vector library), while the second semantic is not clear (that is, the word vector corresponding to the second semantic or its synonym cannot be obtained from the word vector library), the server obtains the word vector corresponding to the third semantic or its synonym from the word vector library according to the third semantic contained in the synonym, and determines the word vector of the third semantic based on the word vector corresponding to the third semantic or its synonym. Further, the server obtains the word vector of the synonym from the word vector library, and based on the word vector corresponding to the third semantic, decomposes the word vector of the synonym to obtain the word vector of the second semantic contained in the synonym.

[0151] It should be known that the specific method for the server to determine whether the synonym is a polysemous word is not specifically limited in this application. For example, the operation personnel can determine whether the synonym is a polysemous word (or has multiple semantics) according to common knowledge.

[0152] Exemplarily, an operator sends a new word "Aoli Gei" for which a word vector is to be constructed to the service, and lists the near synonyms of "Aoli Gei" as "Come on". The server outputs a first prompt message "Is 'Come on' a polysemous word?", and the operator inputs an operation instruction of "Yes, it is a polysemous word" according to this first prompt message. The server triggers and outputs a second prompt message "Please input near synonyms with other semantics" based on this operation instruction, and the operator inputs near synonyms with other semantics (i.e., the third semantics referred to above) as "Add gasoline" and "Add fuel oil". As Figure 7 shown, Figure 7 As a schematic diagram of word vector decomposition, the server obtains the word vectors of the near synonyms "Add gasoline" and "Add fuel oil" with the third semantics, and calculates the average word vector Y of the word vectors of "Add gasoline" and "Add fuel oil", and determines this average word vector Y as the word vector with the third semantics. Further, the server obtains the word vector X of "Come on", and removes the word vector Y with the third semantics in the word vector X of "Come on" according to formula (1), and obtains the word vector Z with the second semantics.

[0153] (1)

[0154] where Z is the word vector Z with the second semantics, X is the word vector X of "Come on", Y is the word vector Y with the third semantics, X.Y is the inner product of the word vector X and the word vector Y, is the two-norm of the word vector Y.

[0155] In a possible implementation, if the near synonym does not contain at least one third semantics, the word vector of the near synonym is determined as the word vector with the second semantics.

[0156] The server outputs a prompt message to prompt the operator to determine whether the near synonym is a polysemous word. If the operator inputs an operation instruction of "No, it is not a polysemous word" according to this prompt message, the server determines that the near synonym does not contain two types of semantics, that is, when the near synonym only contains the aforementioned second semantics, the server can determine the word vector of the near synonym as the word vector with the second semantics.

[0157] 603. Construct the word vector of the new word based on the number of near synonyms corresponding to the new word and the word vectors with the second semantics included in each near synonym.

[0158] The server can calculate the average word vector of the second semantics included in the near synonyms based on the number of near synonyms corresponding to the new word and the word vectors of the second semantics included in each near synonym. For example, if the number of near synonyms corresponding to the new word is 3, namely near synonym 1, near synonym 2, and near synonym 3, and the word vectors of the second semantics corresponding to each near synonym are word vector 1, word vector 2, and word vector 3 respectively, then the server calculates the average word vector of word vector 1, word vector 2, and word vector 3, and determines this average word vector as the word vector of the new word.

[0159] In one example, as Figure 8 shown, it is a schematic diagram of a method for constructing a word vector of an out-of-vocabulary word. When the word for which the word vector is to be constructed is the out-of-vocabulary word "blue thin", the server obtains the near synonyms "uncomfortable", "sad", and "painful" input by the operator based on common knowledge. Since "uncomfortable", "sad", and "painful" each contain only one semantics (i.e., the aforementioned second semantics), the server can obtain the word vectors of "uncomfortable", "sad", and "painful" from its corresponding word vector library respectively as the word vectors of the second semantics included in "uncomfortable", "sad", and "painful", that is, calculate the average word vector of the word vectors of "uncomfortable", "sad", and "painful", and determine this average word vector as the word vector of "blue thin". The server stores the constructed word vector of "blue thin" in the word vector library corresponding to the server.

[0160] In another example, as Figure 9 shown, it is a schematic diagram of a method for constructing a word vector of a word with a new meaning for an old word. When the word for which the word vector is to be constructed is the word with a new meaning for an old word "mushroom", the server, according to the near synonyms "want to cry" and "on the verge of crying" input by the operator based on common knowledge, since "want to cry" and "on the verge of crying" each contain only one semantics (i.e., the aforementioned second semantics), the server can obtain the word vectors of "want to cry" and "on the verge of crying" from its corresponding word vector library respectively as the word vectors of the second semantics included in "want to cry" and the word vectors of the second semantics included in "on the verge of crying", that is, calculate the average word vector of the word vectors of "want to cry" and "on the verge of crying". The server determines this average word vector as the word vector of "mushroom". Since "mushroom" is a word with a new meaning for an old word, that is, there is a word vector of "mushroom" in the word vector library corresponding to the server (such as Figure 9 the word vector corresponding to mushroom 1 in the word vector library), after the server determines the aforementioned average word vector as the word vector of "mushroom", it stores this word vector of "mushroom" with the identifier of mushroom 2 in the word vector library corresponding to the server.

[0161] In one possible implementation, the server obtains the weight values ​​corresponding to each synonym, and constructs a word vector for the new word based on the weight values ​​corresponding to each synonym, the number of synonyms corresponding to the new word, and the word vector of the second semantics contained in each synonym. The weight value corresponding to each synonym is set by the operator based on the degree of correlation between the semantics of the synonym and the semantics of the new word to be constructed. It can be adjusted according to specific circumstances, and this application does not make too many restrictions on this.

[0162] For example, based on the weight values ​​corresponding to the synonyms, the number of synonyms corresponding to the new word, and the word vectors of the second semantics contained in each synonym, a specific method for constructing the word vector of the new word can be shown as formula (2).

[0163] (2)

[0164] in, is the number of synonyms corresponding to the new word, is the word vector of the second semantics contained in the first synonym of the new word, is the word vector of the second semantic meaning of the new word corresponding to the second synonym, is the word vector of the second semantics contained in the nth synonym of the new word, is the weight of the first synonym of the new word, is the weight of the new word corresponding to the second synonym, is the weight of the new word corresponding to the nth synonym, It is the average word vector of the synonyms corresponding to the new word, and also the word vector of the new word constructed by the server.

[0165] 604. Send the word vector of the new word to the end-side device.

[0166] The server sends the constructed word vector of the new word to the end-side device so that the end-side device can perform related tasks of natural language processing based on the word vector of the new word, further improving the processing capability of the natural language processing task of the end-side device. It should be noted that the server can send the word vector of at least one new word to the end-side device according to a preset time period, wherein the preset time period is set by the development / operation personnel according to the specific application scenario and is not specifically limited here. The server can also create a word vector for a new word and then send the word vector of the new word to the end-side device.

[0167] It can be seen that through the implementation Figure 6 In the described word vector construction method, the client device can decompose the word vectors of the synonyms corresponding to the new word and, from the decomposed synonym word vectors, determine the word vector corresponding to the semantics (the second semantics contained in the synonym) that is identical or similar to the lexical semantics (the first semantics) of the word vector to be constructed. Furthermore, the server can construct the word vector for the new word using the word vector corresponding to the second semantics contained in the synonym, thereby improving the accuracy of the constructed word vector for the new word.

[0168] See Figure 10 , Figure 10 This is a flow chart of a semantic recognition method provided by an embodiment of the present application. Figure 6 As shown, the semantic recognition method includes the following steps 1001 to 1005. Figure 10 The subject executing the method shown may be an end-side device or a chip in the end-side device. Figure 10 The semantic recognition method is described below using the end-side device as an example.

[0169] 1001. Receive a word vector of a new word sent by a server, where the new word has a first semantic meaning. The new word is an unregistered word or an old word with a new meaning, and the word vector of the unregistered word does not exist in the server. The word vector of the old word with a new meaning exists in the server, and the semantics indicated by the word vector is different from the first semantics.

[0170] The server sends the word vector of the new word to the end-side device, and the end-side device can output a prompt message, which is used to prompt the user to input the instruction information of whether to receive the word vector of the new word. If the end-side device receives the instruction information of receiving the word vector of the new word input by the user, it receives the word vector of the new word sent by the server. If the end-side device does not receive the instruction information of receiving the word vector of the new word input by the user, it ignores the word vector of the new word sent by the server. It should be noted that the specific implementation method of the server sending the word vector of the new word to the end-side device can be found in the specific implementation method of step 604 in the aforementioned embodiment, and will not be elaborated on here.

[0171] 1002. Store the word vector of the new word in a second word vector library.

[0172] The end-side device stores the word vector of the new word in the second word vector library. It should be noted that the second word vector library can be a word vector library that only contains word vectors of new words. In other words, there is no intersection data between the second word vector library and the preset word vector library (i.e., the first word vector library) when the end-side device leaves the factory or when the system is installed. In this way, it is possible to effectively distinguish between the word vector 1 (i.e., the word vector corresponding to the new semantics) corresponding to the old word with a new meaning in the new word sent by the server and the word vector 2 (i.e., the word vector corresponding to the old semantics) corresponding to the word in the first word vector library. It should be noted that after the end-side device stores the word vector of the new word, it can be used in natural language processing application scenarios such as intelligent question answering, text classification, natural language generation, sentiment classification, and dialogue management based on the word vector of the new word.

[0173] 1003. Segment the corpus to be processed to obtain at least one segmented word.

[0174] The client device receives the corpus to be processed and segments it based on a preset word segmentation model to obtain at least one word segmentation (also called a vocabulary). The preset word segmentation model is obtained by developers training an existing word segmentation model based on experimental corpus. This application does not specifically limit this. For example, the existing word segmentation model may be a Jieba word segmentation model.

[0175] For example, when the terminal device receives the corpus to be processed as "today is very mushroom", it can segment the corpus to be processed according to the preset word segmentation model to obtain 3 participles: "today", "very", "mushroom".

[0176] 1004. If the first target vocabulary has a first word vector in the first word vector library and the first target vocabulary has a second word vector in the second word vector library, then the language probability corresponding to the corpus to be processed is determined based on the first word vector or the second word vector, and the first target vocabulary is any one of the at least one word segmentation vocabulary.

[0177] The end-side device matches each of the at least one segmented words obtained by segmenting the corpus to be processed with the second word vector library. If the match is successful, the vocabulary is determined to be the first target vocabulary. Furthermore, the end-side device matches the first target vocabulary with the first word vector library. If the match is successful, it is determined that the corpus to be processed contains vocabulary with old words and new meanings. Furthermore, the end-side device can determine the language probability corresponding to the corpus to be processed based on the first word vector / second word vector and the language model. In other words, the end-side device calls the language model and the word vectors of each segmented word in the corpus to be processed in the first word vector library or the word vectors in the second word vector library to obtain the language probability of the corpus to be processed. It should be noted that the corresponding language probability is larger when the corpus is fluent, and the corresponding language probability is smaller when the corpus is not fluent.

[0178] Exemplarily, the first word vector library and the second word vector library are shown in Table 1. Among them, the first word vector of "shiitake mushroom" in the first word vector library represents the semantics of food, and the second word vector of "shiitake mushroom" in the second word vector library represents the semantics of wanting to cry.

[0179] Table 1

[0180]

[0181] The edge device segments the to-be-processed corpus "Today is very shiitake mushroom" to obtain 3 segmented words: "Today", "very", and "shiitake mushroom". The edge device respectively matches "Today", "very", and "shiitake mushroom" with the second word vector library. If "shiitake mushroom" matches successfully with the second word vector library, the edge device determines "shiitake mushroom" as the first target word (i.e., a new word, which may be an out-of-vocabulary word or a word with a new meaning for an old word). Further, the edge device matches "shiitake mushroom" with the first word vector library. If the match is successful, the edge device determines that "shiitake mushroom" is a word with a new meaning for an old word among the new words. However, "shiitake mushroom" in this to-be-processed corpus may be using the new meaning, corresponding to the second vector in the second word vector library, or it may be using the old meaning, corresponding to the first word vector in the first word vector library. Further, the edge device can call the language model to obtain the language probability of the to-be-processed corpus "Today is very shiitake mushroom" based on the first word vector corresponding to "shiitake mushroom" in the first word vector library, the word vector 1 corresponding to "Today", and the word vector 3 corresponding to "very". Alternatively, the edge device can call the language model to obtain the language probability of the to-be-processed corpus "Today is very shiitake mushroom" based on the first word vector corresponding to "shiitake mushroom" in the second word vector library, the word vector 1 corresponding to "Today", and the word vector 3 corresponding to "very".

[0182] 1005. Determine the first word vector or the second word vector as the word vector corresponding to the first target word in the to-be-processed corpus based on this language probability.

[0183] The edge device compares the language probability of the to-be-processed corpus obtained in step 1004 with the probability threshold, and determines the first word vector or the second word vector as the word vector corresponding to the first target word in the to-be-processed corpus according to the comparison result. In other words, if the edge device determines the first word vector as the word vector corresponding to the first target word in the to-be-processed corpus according to the comparison result, it indicates that the semantics expressed by this first target word in the to-be-processed corpus is the old meaning of this word. If the edge device determines the second word vector as the word vector corresponding to this first target word in the to-be-processed corpus according to the comparison result, it indicates that the semantics expressed by this first target word in the to-be-processed corpus is the new meaning of this word.

[0184] Among them, the probability threshold is calculated by the server based on the experimental corpus and the language model and then sent to the edge device. This application does not specifically limit the specific value of the probability threshold. For example Figure 11 As shown, it is a schematic diagram of a method for determining a probability threshold. The server calls a language model to calculate the language probabilities of each text corpus in the first text corpus set, and obtains a probability density curve as shown in Figure 11 102 in the figure. Among them, the text corpora in the first text corpus set do not contain words with new meanings for old words. For example, the text corpora in the first text corpus set can be "I really want to cry today.", "Come on!", "He feels very uncomfortable.", etc. The server calls a language model to calculate the language probabilities of each text corpus in the second text corpus set, and obtains a probability density curve as shown in Figure 11 101 in the figure. Among them, the text corpora in the second text corpus set contain new words, and the text corpora in the second text corpus set correspond to the text corpora in the first text corpus set, that is, the text corpora in the second text corpus set and the text corpora in the first text corpus set represent the same / similar meanings. For example, if the text corpora in the first text corpus set are "I really want to cry today", "Come on", "He feels very uncomfortable", then the text corpora in the second text corpus set can be "Today I'm very xianggu", "Oli给", "He's very lanshou". It should be noted that according to statistical principles, the areas enclosed by the probability density curve 101 and the probability density curve 102 and the horizontal axis are both 1. In an application scenario, assuming that for any word with a new meaning for an old word, among the total number of text corpora containing this word in the first text corpus set and the second text corpus set, the number of text corpora in which this word represents a new meaning (i.e., an old word used in a new way) is the same as the number of text corpora in which it represents an old meaning (i.e., an old word used in an old way). Exemplarily, there are 1000 text corpora containing "xianggu" in the first text corpus set and the second text corpus set. Among them, in 500 text corpora, "xianggu" means want to cry, and in the remaining 500 text corpora, "xianggu" means the food xianggu. Then the server determines the ratio of the number of correct judgments when this word with a new meaning for an old word represents a new meaning to the total number of judgments when this word with a new meaning for an old word is judged as a new meaning as the precision rate. For example, the total number of times "xianggu" is judged as a new meaning (i.e., want to cry) is 700 times, and 500 of them are correct. That is, among these 700 judgments, 500 judgments that "xianggu" represents a new meaning (i.e., want to cry) are correct, and the remaining 200 judgments that "xianggu" represents a new meaning (i.e., want to cry) are incorrect. In those 200 judgments, "xianggu" actually represents an old meaning (i.e., the food xianggu). Then the expression of the precision rate is . In other words, the precision rate (Accuracy) formula can be as shown in formula (3), and the recall rate formula is as shown in formula (4).

[0185] (3)

[0186] (4)

[0187] in, for Figure 11 Medium probability threshold The area enclosed by the left horizontal axis and the probability density curve 102, for Figure 11 Medium probability threshold The area enclosed by the right horizontal axis of and the probability density curve 101. Figure 11 visible, and Can be regarded as probability threshold As the dependent variable of the independent variable, and Represented as function expressions and function expressions In machine learning classification problems, the harmonic mean of precision and recall is usually used as a measurement indicator. - score, the The expression of is shown in formula (5).

[0188] (5)

[0189] Furthermore, the server can obtain The maximum value of the probability threshold is determined .

[0190] like Figure 12 The figure shows another method for determining the probability threshold. The server can use the aforementioned first text corpus set to call the language model to calculate the language probability of each text corpus in the first text corpus set. The probability density curve is shown as Figure 12 As shown in 103, is the probability threshold to be obtained. In order to save computing resources, the server can The area enclosed by the horizontal axis on the left side of the value and the probability density curve 103 , the area enclosed by the horizontal axis and the probability density curve 103 (According to statistical principles, the area enclosed by the probability density curve 103 and the horizontal axis 1) and the preset value are determined. The preset value is set by the developer based on experimental measurement data and is not specifically limited in this application. In other words, when and When the ratio between them is a preset value, Determination of area The server can save computing resources by using this probability threshold determination method.

[0191] In one possible implementation, if the first target vocabulary does not have a word vector in the first word vector library, and the first target vocabulary has a word vector in the second word vector library, then the word vector of the first target vocabulary in the second word vector library is determined to be the word vector corresponding to the first target vocabulary in the corpus to be processed.

[0192] The client-side device matches each of the at least one segmented word obtained by segmenting the corpus to be processed with the second word vector library. If the match is successful, the word is determined to be the first target word. Furthermore, the client-side device matches the first target word with the first word vector library. If the match is unsuccessful, the client-side device determines that the word vector of the first target word in the second word vector library is the word vector corresponding to the first target word in the corpus to be processed.

[0193] Exemplarily, the first word vector library and the second word vector library are shown in Table 1 above. The end-side device segments the corpus to be processed "today is very blue and thin" and obtains three segmented words: "today", "very", and "blue and thin". The end-side device matches "today", "very", and "blue and thin" with the second word vector library respectively. If "blue and thin" successfully matches the second word vector library, the end-side device determines "blue and thin" as the first target vocabulary (that is, a new word, which may be an unregistered word or an old word with a new meaning). Further, the end-side device matches "blue and thin" with the first word vector library. If the match is unsuccessful, the end-side device matches the word vector 4 of "blue and thin" in the second word vector to its corresponding word vector in the corpus to be processed.

[0194] In one possible implementation, the terminal-side device calls the language model to determine the language probability corresponding to the corpus to be processed based on the first word vector of the first target vocabulary and the word vector of the second target vocabulary in the first word vector library, where the second target vocabulary is a vocabulary other than the first target vocabulary in at least one word segmentation. Furthermore, if the language probability is less than the probability threshold, the second word vector is determined as the word vector corresponding to the first target vocabulary in the corpus to be processed. If the language probability is greater than or equal to the probability threshold, the first word vector is determined as the word vector corresponding to the first target vocabulary in the corpus to be processed.

[0195] Exemplarily, the edge device segments the to-be-processed corpus "Today is very xianggu" and obtains 3 word segments: "Today", "very", and "xianggu". The edge device respectively matches "Today", "very", and "xianggu" with the second word vector library. If "xianggu" matches successfully in the second word vector library, the edge device determines "xianggu" as the first target word (i.e., a new word, which may be an out-of-vocabulary word or a word with a new meaning for an old word), and determines "Today" and "very" as the second target words. Further, the edge device matches "xianggu" with the first word vector library. If the match is successful, the edge device determines that "xianggu" is a word with a new meaning for an old word among the new words. If the edge device obtains the language probability a of the to-be-processed corpus "Today is very xianggu" by invoking a language model based on the first word vector corresponding to "xianggu" in the first word vector library, the word vector 1 corresponding to "Today", and the word vector 3 corresponding to "very". If the probability threshold is b and a is less than b, the second word vector corresponding to "xianggu" in the second word vector library is determined as the word vector corresponding to the first target word in the to-be-processed corpus.

[0196] In a possible implementation, the edge device invokes a language model based on the second word vector corresponding to the first target word and the word vectors of the second target words in the first word vector library to determine the language probability corresponding to the to-be-processed corpus. The second target words are the words other than the first target word among at least one word segment. Further, if the language probability is greater than or equal to the probability threshold, the second word vector is determined as the word vector corresponding to the first target word in the to-be-processed corpus. If the language probability is less than the probability threshold, the first word vector is determined as the word vector corresponding to the first target word in the to-be-processed corpus.

[0197] Exemplarily, if the edge device obtains the language probability c of the to-be-processed corpus "Today is very xianggu" by invoking a language model based on the second word vector corresponding to "xianggu" in the second word vector library, the word vector 1 corresponding to "Today" in the first word vector library, and the word vector 3 corresponding to "very". If the probability threshold is b and c is greater than or equal to b, the second word vector corresponding to "xianggu" in the second word vector library is determined as the word vector corresponding to the first target word in the to-be-processed corpus.

[0198] Exemplarily, such as Figure 13 The figure shows a flow chart of a semantic recognition method. A client device receives a corpus to be processed and segments it to obtain at least one segmented word. For each segmented word, the client device matches it with a second word vector library. If the match fails, the client device determines a new word vector for the segmented word based on the first word vector library. If the segmented word matches the second word vector library, the client device matches it with the first word vector library. If the match fails, the client device determines a new word vector for the segmented word based on the second word vector library. If the segmented word matches both the second word vector library and the first word vector library, the client device invokes a language model to determine the language probability of the corpus to be processed based on the first word vector library. The client device compares the language probability with a probability threshold and, based on the comparison, determines whether the segmented word is an old word with a new meaning (i.e., an old word with a new meaning represents a new meaning in the corpus to be processed) or an old word with an old meaning (i.e., an old word with a new meaning represents an old meaning in the corpus to be processed). If the language probability of the corpus to be processed is determined to be greater than or equal to the probability threshold based on the first vector library, the first word vector of the segmented word is determined from the first vector library to be the word vector corresponding to it in the corpus to be processed, i.e., the segmented word is an old word with an old use (i.e., the vocabulary with a new meaning in the corpus to be processed has the old meaning). If the language probability of the corpus to be processed is determined to be less than the probability threshold based on the first vector library, the second word vector of the segmented word is determined from the second vector library to be the word vector corresponding to it in the corpus to be processed, i.e., the segmented word is an old word with a new use (i.e., the vocabulary with a new meaning in the corpus to be processed has the new meaning).

[0199] It can be seen that through the implementation Figure 10 With the semantic recognition method described, the client-side device can correctly identify whether a word with a new meaning represents a new meaning (i.e., an old word with a new use) or an old meaning (i.e., an old word with an old use) in the corpus to be processed. Furthermore, the client-side device expands its word vector library by continuously receiving word vectors for new words from the server, thereby improving the accuracy of semantic recognition.

[0200] It should be noted that in specific implementations, some of the steps in the drawings may be selected for implementation, and the order of the steps in the drawings may be adjusted for implementation, and this application does not limit this. It should be understood that implementing some of the steps in the drawings or adjusting the order of the steps for specific implementation falls within the scope of protection of this application.

[0201] See Figure 14 , Figure 14 A structural diagram of a word vector construction device according to an embodiment of the present application is shown. Figure 14 The word vector construction device shown can be used to implement the above Figure 6 Part or all of the functions of the server in the described method embodiments. Figure 14 The word vector construction device shown may include an acquisition unit 1401, a determination unit 1402, a construction unit 1403, and a sending unit 1404.

[0202] An acquiring unit 1401 is configured to acquire a new word, wherein the new word is an unregistered word or a word with a new meaning of an old word, and the new word has a first semantic meaning. The unregistered word is a word whose word vector does not exist in the server, and the word with a new meaning of an old word is a word whose word vector exists in the server, and the semantics indicated by the word vector is different from the first semantic meaning.

[0203] A determining unit 1402 is configured to determine, based on a word vector of at least one synonym corresponding to the new word, a word vector of a second semantic meaning contained in each of the synonyms, where the second semantic meaning corresponds to the first semantic meaning;

[0204] A construction unit 1403 is configured to construct a word vector for the new word based on the number of synonyms corresponding to the new word and the word vector of the second semantic meaning contained in each of the synonyms;

[0205] The sending unit 1404 is configured to send the word vector of the new word to the end-side device.

[0206] In one possible implementation, the determination unit 1402 is specifically used to: for each synonym of the at least one synonym, determine whether the synonym contains a third semantics other than the second semantics; if the synonym contains the third semantics, obtain the word vector corresponding to the third semantics; based on the word vector of the synonym and the word vector corresponding to the third semantics, determine the word vector of the second semantics contained in the synonym.

[0207] In a possible implementation, the determining unit 1402 is further configured to: if the synonym does not include the at least one third semantic meaning, determine that the word vector of the synonym is the word vector of the second semantic meaning.

[0208] In one possible implementation, the construction unit 1403 is specifically used to: obtain the weight value corresponding to each of the synonyms; and construct the word vector of the new word based on the weight value corresponding to each of the synonyms, the number of synonyms corresponding to the new word, and the word vector of the second semantics contained in each of the synonyms.

[0209] It should be noted that the functions of the various functional units in the word vector construction device 1400 described in the embodiment of the present application can be found in the above Figure 6 The relevant descriptions of steps 601 to 604 in the method embodiment are not repeated here.

[0210] See Figure 15 , Figure 15 A structural diagram of a semantic recognition device according to an embodiment of the present application is shown. Figure 15 The semantic recognition device shown can be used to implement the above Figure 10 Some or all of the functions on the end side in the described method embodiments. Figure 15 The semantic recognition device shown may include a receiving unit 1501, a storage unit 1502, a segmentation unit 1503, and a determination unit 1504.

[0211] Receiving unit 1501 is configured to receive a word vector of a new word sent by a server, the new word having a first semantic meaning, the new word being an unregistered word or a word with a new meaning of an old word, the unregistered word being a word for which a word vector does not exist in the server, and the word with a new meaning of an old word being a word for which a word vector exists in the server, and the semantic meaning indicated by the word vector of the word is different from the first semantic meaning;

[0212] A storage unit 1502 is configured to store the word vector of the new word in a second word vector library;

[0213] A segmentation unit 1503 is used to segment the corpus to be processed to obtain at least one segmented word;

[0214] Determining unit 1504 is configured to determine, if a first target vocabulary has a first word vector in a first word vector library and a second word vector in a second word vector library, a language probability corresponding to the corpus to be processed based on the first word vector or the second word vector, wherein the first target vocabulary is any one of the at least one word segmentation vocabulary;

[0215] The determining unit 1504 is further configured to determine, based on the language probability, the first word vector or the second word vector as the word vector corresponding to the first target vocabulary in the corpus to be processed.

[0216] In a possible implementation, the determination unit 1504 is also used to: if the first target vocabulary does not have a word vector in the first word vector library, and the first target vocabulary has a word vector in the second word vector library, then determine that the word vector of the first target vocabulary in the second word vector library is the word vector corresponding to the first target vocabulary in the corpus to be processed.

[0217] In a possible implementation, the determination unit 1504 is specifically used to: call the language model based on the first word vector and the word vector of the second target vocabulary in the first word vector library to determine the language probability corresponding to the corpus to be processed, where the second target vocabulary is the vocabulary other than the first target vocabulary in the at least one word segmentation; if the language probability is less than the probability threshold, then determine the second word vector as the word vector corresponding to the first target vocabulary in the corpus to be processed; if the language probability is greater than or equal to the probability threshold, then determine the first word vector as the word vector corresponding to the first target vocabulary in the corpus to be processed.

[0218] In a possible implementation, the determination unit 1504 is specifically used to: call the language model based on the second word vector and the word vector of the second target vocabulary in the first word vector library to determine the language probability corresponding to the corpus to be processed, where the second target vocabulary is the vocabulary other than the first target vocabulary in the at least one word segmentation; if the language probability is greater than or equal to the probability threshold, determine the second word vector as the word vector corresponding to the first target vocabulary in the corpus to be processed; if the language probability is less than the probability threshold, determine the first word vector as the word vector corresponding to the first target vocabulary in the corpus to be processed.

[0219] It should be noted that the functions of the various functional units in the semantic recognition device 1500 described in the embodiment of the present application can be found in the above Figure 10 The relevant descriptions of steps 1001 to 1005 in the method embodiment are not repeated here.

[0220] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the program can implement part or all of the steps of any one of the above method embodiments, as well as implement the above method embodiments. Figure 6 or Figure 10 The function of any functional module described.

[0221] The present application also provides a computer program product which, when executed on a computer or processor, enables the computer or processor to execute the above-mentioned Figure 6 or Figure 10 If the components of the above-mentioned devices are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above-mentioned computer-readable storage medium.

[0222] In the above embodiments, the description of each embodiment has different emphases. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0223] It should be understood that the first, second, third, fourth and various numerical numbers involved in this document are only distinctions made for the convenience of description and are not intended to limit the scope of this application.

[0224] It should be understood that the term "and / or" in this document simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the related objects are in an "or" relationship.

[0225] It should also be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0226] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0227] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0228] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0229] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0230] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0231] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a terminal device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.

[0232] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0233] The descriptions of the various embodiments provided in this application can refer to each other. The descriptions of each embodiment have their own focus. For parts not described in detail in a particular embodiment, please refer to the relevant descriptions of other embodiments. For the convenience and brevity of description, for example, the functions and execution steps of the various devices and equipment provided in the embodiments of this application can refer to the relevant descriptions of the method embodiments of this application. The various method embodiments and the various device embodiments can also refer to, be combined with, or quote each other.

[0234] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application 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 or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.< / s>

Claims

1. A word vector construction method, characterized in that: The method is applied to a server and includes: Acquire a new word, wherein the new word is an unregistered word or an old word with a new meaning, and the new word has a first semantic meaning. The unregistered word is a word whose word vector does not exist in the server, and the old word with a new meaning is a word whose word vector exists in the server, and the semantics indicated by the word vector is different from the first semantic meaning. Determining, based on a word vector of at least one synonym corresponding to the new word, a word vector of a second semantic meaning contained in each of the synonyms, where the second semantic meaning corresponds to the first semantic meaning and is the same as or similar to the first semantic meaning of the new word; Constructing a word vector for the new word based on the number of synonyms corresponding to the new word and the word vectors of the second semantics contained in each of the synonyms; Sending the word vector of the new word to the end-side device; The determining, based on the word vector of at least one synonym corresponding to the new word, the word vector of the second semantic meaning contained in each of the synonyms includes: For each of the at least one synonym, determining whether the synonym includes a third semantic meaning in addition to the second semantic meaning, wherein the third semantic meaning is a semantic meaning that is different from or not similar to the first semantic meaning of the new word; If the synonym contains the third semantics, obtaining the word vector corresponding to the third semantics; Based on the word vector of the synonym and the word vector corresponding to the third semantics, the word vector of the second semantics included in the synonym is determined.

2. The method according to claim 1, characterized in that The method further comprises: If the synonym does not include the at least one third semantics, the word vector of the synonym is determined to be the word vector of the second semantics.

3. The method according to claim 1 or 2, characterized in that The constructing the word vector of the new word based on the number of synonyms corresponding to the new word and the word vector of the second semantics contained in each of the synonyms includes: Obtaining the weight value corresponding to each of the synonyms; A word vector of the new word is constructed based on the weight values ​​corresponding to the respective synonyms, the number of synonyms corresponding to the new word, and the word vector of the second semantics contained in the respective synonyms.

4. A semantic recognition method, characterized in that: The method is applied to a terminal-side device, and includes: Receive a word vector of a new word sent by a server, where the new word has a first semantic meaning, is an unregistered word or a word with a new meaning of an old word, where the unregistered word is a word whose word vector does not exist in the server, and the word with a new meaning of an old word is a word whose word vector exists in the server, and the semantics indicated by its word vector is different from the first semantic meaning, and the word vector of the new word is constructed based on the number of at least one synonymous word corresponding to the new word and the word vector of a second semantic meaning contained in each of the synonyms, where the second semantic meaning is the same as or similar to the first semantic meaning of the new word; The word vector of the second semantics is determined based on the word vector of the synonym and the word vector corresponding to the third semantics, and the word vector corresponding to the third semantics is obtained based on the third semantics contained in each synonym in addition to the second semantics, and the third semantics is a semantics that is different from or not similar to the first semantics of the new word; Storing the word vector of the new word in a second word vector library; Segment the corpus to be processed and obtain at least one segmented word; If a first target vocabulary has a first word vector in a first word vector library, and the first target vocabulary has a second word vector in a second word vector library, then determining the language probability corresponding to the corpus to be processed based on the first word vector or the second word vector, where the first target vocabulary is any one of the at least one word segmentation vocabulary; Based on the language probability, the first word vector or the second word vector is determined as the word vector corresponding to the first target vocabulary in the corpus to be processed.

5. The method according to claim 4, characterized in that: The method further comprises: If the first target vocabulary does not have a word vector in the first word vector library, and the first target vocabulary has a word vector in the second word vector library, then the word vector of the first target vocabulary in the second word vector library is determined to be the word vector corresponding to the first target vocabulary in the corpus to be processed.

6. The method according to claim 4 or 5, characterized in that The determining the language probability corresponding to the corpus to be processed based on the first word vector or the second word vector includes: Based on the first word vector and the word vector of the second target vocabulary in the first word vector library, calling the language model to determine the language probability corresponding to the corpus to be processed, where the second target vocabulary is the vocabulary in the at least one word segmentation other than the first target vocabulary; The determining, based on the language probability, the first word vector or the second word vector as the word vector corresponding to the first target vocabulary in the corpus to be processed includes: If the language probability is less than the probability threshold, determining the second word vector as the word vector corresponding to the first target word in the corpus to be processed; If the language probability is greater than or equal to the probability threshold, the first word vector is determined as the word vector corresponding to the first target vocabulary in the corpus to be processed.

7. The method according to claim 4 or 5, characterized in that The determining the language probability corresponding to the corpus to be processed based on the first word vector or the second word vector includes: Based on the second word vector and the word vector of the second target vocabulary in the first word vector library, calling the language model to determine the language probability corresponding to the corpus to be processed, where the second target vocabulary is the vocabulary in the at least one word segmentation other than the first target vocabulary; The determining, based on the language probability, the first word vector or the second word vector as the word vector corresponding to the first target vocabulary in the corpus to be processed includes: If the language probability is greater than or equal to the probability threshold, determining the second word vector as the word vector corresponding to the first target word in the corpus to be processed; If the language probability is less than the probability threshold, the first word vector is determined as the word vector corresponding to the first target vocabulary in the corpus to be processed.

8. A word vector construction device, characterized in that: The device is configured on a server, and includes: an acquisition unit, configured to acquire a new word, wherein the new word is an unregistered word or a word with a new meaning of an old word, the new word having a first semantic meaning; the unregistered word is a word whose word vector does not exist in the server; the word with a new meaning of an old word is a word whose word vector exists in the server, and the semantics indicated by the word vector is different from the first semantic meaning; a determining unit, configured to determine, based on a word vector of at least one synonym corresponding to the new word, a word vector of a second semantic meaning contained in each of the synonyms, wherein the second semantic meaning corresponds to the first semantic meaning and is the same as or similar to the first semantic meaning of the new word; A construction unit, configured to construct a word vector for the new word based on the number of synonyms corresponding to the new word and the word vector of the second semantics contained in each of the synonyms; a sending unit, configured to send the word vector of the new word to a terminal device; The determining unit is specifically configured to: For each of the at least one synonym, determining whether the synonym includes a third semantic meaning in addition to the second semantic meaning, wherein the third semantic meaning is a semantic meaning that is different from or not similar to the first semantic meaning of the new word; If the synonym contains the third semantics, obtaining the word vector corresponding to the third semantics; Based on the word vector of the synonym and the word vector corresponding to the third semantics, the word vector of the second semantics included in the synonym is determined.

9. The device according to claim 8, characterized in that The determining unit is further configured to: If the synonym does not include the at least one third semantics, the word vector of the synonym is determined to be the word vector of the second semantics.

10. The device according to claim 8 or 9, characterized in that: The building blocks are specifically used for: Obtaining the weight value corresponding to each of the synonyms; A word vector of the new word is constructed based on the weight values ​​corresponding to the respective synonyms, the number of synonyms corresponding to the new word, and the word vector of the second semantics contained in the respective synonyms.

11. A semantic recognition device, characterized in that: The device is configured on a terminal device and includes: a receiving unit, configured to receive a word vector of a new word sent by a server, wherein the new word has a first semantic meaning, the new word is an unregistered word or a word with a new meaning of an old word, the unregistered word being a word whose word vector does not exist in the server, the word with a new meaning of an old word being a word whose word vector exists in the server, and the semantics indicated by its word vector being different from the first semantic meaning, the word vector of the new word being constructed based on the number of at least one synonymous word corresponding to the new word and the word vector of a second semantic meaning contained in each of the synonymous words, the second semantic meaning being the same as or similar to the first semantic meaning of the new word; The word vector of the second semantics is determined based on the word vector of the synonym and the word vector corresponding to the third semantics, and the word vector corresponding to the third semantics is obtained based on the third semantics contained in each synonym in addition to the second semantics, and the third semantics is a semantics that is different from or not similar to the first semantics of the new word; A storage unit, configured to store the word vector of the new word in a second word vector library; A segmentation unit is used to segment the corpus to be processed and obtain at least one segmented word; a determining unit, configured to determine, if a first target vocabulary has a first word vector in a first word vector library and a second word vector in a second word vector library, a language probability corresponding to the corpus to be processed based on the first word vector or the second word vector, wherein the first target vocabulary is any one of the at least one word segmentation vocabulary; The determining unit is further configured to determine, based on the language probability, the first word vector or the second word vector as the word vector corresponding to the first target vocabulary in the corpus to be processed.

12. The device according to claim 11, characterized in that The determining unit is further configured to: If the first target vocabulary does not have a word vector in the first word vector library, and the first target vocabulary has a word vector in the second word vector library, then the word vector of the first target vocabulary in the second word vector library is determined to be the word vector corresponding to the first target vocabulary in the corpus to be processed.

13. The device according to claim 11 or 12, characterized in that: The determining unit is specifically configured to: Based on the first word vector and the word vector of the second target vocabulary in the first word vector library, calling the language model to determine the language probability corresponding to the corpus to be processed, where the second target vocabulary is the vocabulary in the at least one word segmentation other than the first target vocabulary; If the language probability is less than the probability threshold, determining the second word vector as the word vector corresponding to the first target word in the corpus to be processed; If the language probability is greater than or equal to the probability threshold, the first word vector is determined as the word vector corresponding to the first target vocabulary in the corpus to be processed.

14. The device according to claim 11 or 12, characterized in that: The determining unit is specifically configured to: Based on the second word vector and the word vector of the second target vocabulary in the first word vector library, calling the language model to determine the language probability corresponding to the corpus to be processed, where the second target vocabulary is the vocabulary in the at least one word segmentation other than the first target vocabulary; If the language probability is greater than or equal to the probability threshold, determining the second word vector as the word vector corresponding to the first target word in the corpus to be processed; If the language probability is less than the probability threshold, the first word vector is determined as the word vector corresponding to the first target vocabulary in the corpus to be processed.

15. A server, characterized in that: The method comprises a processor and a memory, wherein the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 3.

16. A terminal side device, characterized in that: The method comprises a processor and a memory, wherein the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 4 to 7.

17. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program or instruction. When the computer program or instruction is executed by the processor, the word vector construction method as described in any one of claims 1 to 3 or the semantic recognition method as described in any one of claims 4 to 7 is implemented.

Citation Information

Patent Citations

  • Deep text matching method and device based on unlogged word processing

    CN109992788A

  • Secret language discovery method and device

    CN111506699A