A training method and device for embedding vector of meaning
By obtaining the keywords of web pages and encyclopedia entries related to the meaning, combined with the skipgram model and the loss function optimized by the TF-IDF value, the meaning embedding vector is trained, which solves the problem of inaccurate training results in the existing technology and improves the accuracy of the meaning embedding vector. accuracy.
Patent Information
- Application Number
- CN202011465969.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-14
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2040-12-14
AI Technical Summary
It is difficult to accurately train the embedding vectors of sense terms with the existing technology, resulting in inaccurate training results.
By obtaining meaning-related web pages and encyclopedia entries containing encyclopedia entries, keywords are extracted, and the skipgram model and the loss function optimized by TF-IDF values are used to train and obtain the embedding vector of the meaning.
The accuracy of the meaning embedding vector is improved, and the relevance and accuracy of the training results are enhanced.
Smart Images

Figure CN112507726B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a method and device for training a sense embedding vector. Background Art
[0002] A word can have multiple meanings, and each meaning can also be called a sense. In some scenarios, it is necessary to train the embedding vector of the sense so that the embedding vector of the sense can be used for further analysis and processing. The embedding vector of the sense is a vectorized representation of the semantic information of the sense.
[0003] At present, in some scenarios, it is not possible to accurately train the embedding vector of the meaning, so there is an urgent need for a solution to solve this problem. Summary of the invention
[0004] The technical problem to be solved by the present application is how to accurately train and obtain the embedding vector of the meaning term, and to provide a method and device for training the embedding vector of the meaning term.
[0005] In a first aspect, an embodiment of the present application provides a method for training a sense embedding vector, the method comprising:
[0006] Obtaining a first search term, wherein the first search term includes at least two meanings, the at least two meanings include a first meaning, and the first meaning has an encyclopedia entry;
[0007] Determining keywords related to the first meaning according to web pages related to the first meaning and encyclopedia entries of the first meaning;
[0008] The keywords related to the first meaning are used to train and obtain an embedding vector of the first search term corresponding to the first meaning.
[0009] Optionally, determining keywords related to the first meaning according to the web pages related to the first meaning and the encyclopedia entries of the first meaning includes:
[0010] Determine web pages related to the first meaning, and extract keywords from the web pages;
[0011] The keywords of the web page are matched with the encyclopedia entries of the first meaning, and the matched keywords are determined as keywords related to the first meaning.
[0012] Optionally, the keywords of the webpage are words whose term frequency-inverse text frequency TF-IDF value is greater than a first threshold value among the words included in the webpage; and the training of obtaining the embedding vector of the first meaning by using the keywords related to the first meaning includes:
[0013] Using the skipgram model and the keywords related to the first sense, training to obtain an embedding vector of the first sense;
[0014] in:
[0015] The loss function of the skipgram model is obtained according to the TF-IDF values of the keywords related to the first sense.
[0016] Optionally, the method further includes:
[0017] Obtaining a web page corresponding to the first search term;
[0018] Determine a word embedding vector corresponding to each web page in the web page corresponding to the first search term;
[0019] According to the embedding vector of each meaning item corresponding to the first search word and the word embedding vectors corresponding to the respective web pages, the web pages corresponding to each meaning item in the web pages corresponding to the first search word are determined.
[0020] Optionally, the method further includes:
[0021] In response to a search operation triggered by a user for the first meaning item;
[0022] Obtaining a web page corresponding to the first meaning among the web pages corresponding to the first search term;
[0023] The web page corresponding to the first meaning is displayed.
[0024] In a second aspect, an embodiment of the present application provides a training device for a sense embedding vector, the device comprising:
[0025] A first acquisition unit is used to acquire a first search term, wherein the first search term includes at least two meanings, the at least two meanings include a first meaning, and the first meaning has an encyclopedia entry;
[0026] A first determining unit, configured to determine keywords related to the first meaning according to web pages related to the first meaning and encyclopedia entries of the first meaning;
[0027] A training unit is used to train and obtain an embedding vector of the first search term corresponding to the first sense by using the keywords related to the first sense.
[0028] Optionally, the first determining unit is configured to:
[0029] Determine web pages related to the first meaning, and extract keywords from the web pages;
[0030] The keywords of the web page are matched with the encyclopedia entries of the first meaning, and the matched keywords are determined as keywords related to the first meaning.
[0031] Optionally, the keywords of the webpage are the words whose term frequency-inverse text frequency TF-IDF value is greater than a first threshold value among the words included in the webpage; the training unit is used to:
[0032] Using the skipgram model and the keywords related to the first sense, training to obtain an embedding vector of the first sense;
[0033] in:
[0034] The loss function of the skipgram model is obtained according to the TF-IDF values of the keywords related to the first sense.
[0035] Optionally, the device further comprises:
[0036] A second acquisition unit, configured to acquire a web page corresponding to the first search term;
[0037] A second determining unit is used to determine the word embedding vector corresponding to each web page in the web page corresponding to the first search word;
[0038] The third determination unit is used to determine the web pages corresponding to each meaning in the web pages corresponding to the first search term based on the embedding vector of each meaning corresponding to the first search term and the word embedding vectors corresponding to the respective web pages.
[0039] Optionally, the device further comprises:
[0040] A response unit, used to respond to a search operation triggered by a user for the first meaning item;
[0041] A third acquisition unit is used to acquire a web page corresponding to the first meaning among the web pages corresponding to the first search term;
[0042] The display unit is used to display the web page corresponding to the first meaning.
[0043] In a third aspect, an embodiment of the present application provides a training device for a sense embedding vector, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations:
[0044] Obtaining a first search term, wherein the first search term includes at least two meanings, the at least two meanings include a first meaning, and the first meaning has an encyclopedia entry;
[0045] Determining keywords related to the first meaning according to web pages related to the first meaning and encyclopedia entries of the first meaning;
[0046] The keywords related to the first meaning are used to train and obtain an embedding vector of the first search term corresponding to the first meaning.
[0047] Optionally, determining keywords related to the first meaning according to the web pages related to the first meaning and the encyclopedia entries of the first meaning includes:
[0048] Determine web pages related to the first meaning, and extract keywords from the web pages;
[0049] The keywords of the web page are matched with the encyclopedia entries of the first meaning, and the matched keywords are determined as keywords related to the first meaning.
[0050] Optionally, the keywords of the webpage are words whose term frequency-inverse text frequency TF-IDF value is greater than a first threshold value among the words included in the webpage; and the training of obtaining the embedding vector of the first meaning by using the keywords related to the first meaning includes:
[0051] Using the skipgram model and the keywords related to the first sense, training to obtain an embedding vector of the first sense;
[0052] in:
[0053] The loss function of the skipgram model is obtained according to the TF-IDF values of the keywords related to the first sense.
[0054] Optionally, the operation further includes:
[0055] Obtaining a web page corresponding to the first search term;
[0056] Determine a word embedding vector corresponding to each web page in the web page corresponding to the first search term;
[0057] According to the embedding vector of each meaning item corresponding to the first search word and the word embedding vectors corresponding to the respective web pages, the web pages corresponding to each meaning item in the web pages corresponding to the first search word are determined.
[0058] Optionally, the operation further includes:
[0059] In response to a search operation triggered by a user for the first meaning item;
[0060] Obtaining a web page corresponding to the first meaning among the web pages corresponding to the first search term;
[0061] The web page corresponding to the first meaning is displayed.
[0062] In a fourth aspect, an embodiment of the present application provides a computer-readable medium having instructions stored thereon, which, when executed by one or more processors, causes a device to execute the method described in any one of the first aspects above.
[0063] Compared with the prior art, the embodiments of the present application have the following advantages:
[0064] The embodiment of the present application provides a method for training a sense embedding vector. Specifically, a first search term can be obtained, and the first search term includes at least two senses. For the convenience of description, any one of the at least two senses is referred to as the first sense, and the first sense has an encyclopedia entry. In the present application, when training the embedding vector of the first sense, the keywords related to the first sense can be determined based on the web pages related to the first sense and the encyclopedia entry of the first sense, and the keywords related to the first sense can be further used to train the embedding vector of the first sense. It can be seen that in the present application, when training the embedding vector of the first sense, not only the encyclopedia entry of the first sense is considered, but also the web pages related to the first sense, thereby improving the accuracy of the embedding vector of the first sense obtained by training. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0066] Figure 1 A flowchart of a method for training a sense embedding vector provided in an embodiment of the present application;
[0067] Figure 2 A schematic diagram of the structure of a training device for a meaning embedding vector provided in an embodiment of the present application;
[0068] Figure 3 A schematic diagram of the structure of the client provided in the embodiment of the present application;
[0069] Figure 4 A schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0071] The inventor of the present application has found through research that, at present, when training the embedding vector of a sense item, the training can be carried out in combination with the encyclopedia entry of the sense item. In one example, the context corresponding to the hyperlink in the encyclopedia entry of the sense item can be used to train the embedding vector of the sense item. Therefore, the accuracy of the word embedding vector obtained by training depends on the accuracy of the context corresponding to the hyperlink in the encyclopedia entry of the sense item. If the accuracy of the context corresponding to the hyperlink in the encyclopedia entry of the sense item is not high, the accuracy of the embedding vector of the sense item obtained by training is also not high.
[0072] In order to solve the above problems, an embodiment of the present application provides a method for training a sense embedding vector, which can improve the accuracy of the sense embedding vector obtained through training.
[0073] Various non-limiting implementations of the present application are described in detail below in conjunction with the accompanying drawings.
[0074] Exemplary Methods
[0075] See also Figure 1 , which is a flow chart of a method for training a meaning embedding vector provided in an embodiment of the present application.
[0076] The method for training the meaning embedding vector provided in the embodiment of the present application can be executed by a controller or processor having a data processing function, or by a device including the aforementioned controller or processor, which is not specifically limited in the embodiment of the present application. Among them, the device including the controller or processor includes but is not limited to a terminal device and a server.
[0077] In this embodiment, Figure 1 The training method of the sense embedding vector shown may include, for example, the following steps S101-S103.
[0078] S101: Obtain a first search term, wherein the first search term includes at least two meanings, wherein the at least two meanings include a first meaning, and the first meaning has an encyclopedia entry.
[0079] In an embodiment of the present application, the first search term may be input by a user in a search input area provided by a search engine. In one example, a user may input a search statement in the search input area provided by a search engine, and the first search term may be obtained by segmenting the search statement. In another example, the content input by a user in the search input area provided by a search engine may also include only the first search term.
[0080] In the embodiment of the present application, the first search term includes multiple meanings. For the convenience of description, any one of the multiple meanings is referred to as the first meaning.
[0081] S102: Determine keywords related to the first meaning based on web pages related to the first meaning and encyclopedia entries of the first meaning.
[0082] In the embodiment of the present application, when training the embedding vector of the first sense, the keywords related to the first sense can be used for training. Therefore, the keywords related to the first sense can affect the accuracy of the embedding vector of the first sense obtained by training.
[0083] In an embodiment of the present application, considering that the web page related to the first sense and the encyclopedia entry of the first sense may include words with a relatively high degree of relevance to the first sense, the keywords related to the first sense may be determined based on the web page related to the first sense and the encyclopedia entry of the first sense. In this way, the accuracy of the embedding vector of the first sense obtained by training no longer depends solely on the encyclopedia entry of the first sense. Accordingly, the negative impact on the accuracy of the embedding vector of the first sense obtained by training due to the inaccuracy of the encyclopedia entry of the first sense can be compensated to a certain extent by the web page related to the first sense, thereby making the accuracy of the embedding vector of the first sense obtained by training higher.
[0084] In one implementation of the embodiment of the present application, S102 may include the following steps AB when being specifically implemented.
[0085] Step A: Determine web pages related to the first meaning and extract keywords of the web pages.
[0086] In the embodiment of the present application, a search may be performed using "first meaning + first search term" as a search keyword to obtain web pages related to the first meaning.
[0087] After determining the webpage related to the first meaning, the keywords of the webpage can be extracted. The webpage related to the first meaning may include multiple webpages. In the embodiment of the present application, the keywords of each webpage can be extracted respectively, so as to obtain the keywords of the multiple webpages. The following takes the first webpage as an example to introduce the specific implementation method of extracting the keywords of the first webpage.
[0088] In an embodiment of the present application, the text included in the first web page can be segmented to obtain a number of segmented words. Furthermore, the term frequency-inverse document frequency (TF-IDF) value of each segmented word is calculated, and segmented words with larger TF-IDF values are screened out, for example, segmented words with TF-IDF values greater than a first threshold are screened out as keywords of the first web page. For example, the web pages corresponding to the first meaning include 5 web pages, and each web page corresponds to 5 keywords. After executing step A, a maximum of 25 keywords can be obtained.
[0089] Step B: Match the keywords of the web page with the encyclopedia entries of the first meaning, and determine the matched keywords as keywords related to the first meaning.
[0090] In the embodiment of the present application, in order to further ensure that the keywords related to the first meaning are highly correlated with the first meaning, after obtaining the keywords of the web page in step A, the keywords of the web page can also be matched with the encyclopedia entries of the first meaning. For example, the keywords of the web page are matched with the segmented words included in one or several regions of the encyclopedia entries of the first meaning, and the keywords of the web page that match the encyclopedia entries of the first meaning are determined as keywords related to the first meaning.
[0091] The keywords in the keywords of the web page that match the encyclopedia entry of the first meaning mentioned here refer to the keywords in the keywords of the web page that exist in the encyclopedia entry of the first meaning; or, the keywords in the keywords of the web page that have the same or similar semantics as the word segments in the encyclopedia entry of the first meaning. It can be understood that the keywords in the keywords of the web page that match the encyclopedia entry of the first meaning have a relatively high degree of relevance to the first meaning. Therefore, determining the keywords in the keywords of the web page that match the encyclopedia entry of the first meaning as keywords related to the first meaning can improve the accuracy of the embedded vector of the first meaning obtained by training.
[0092] S103: Using the keywords related to the first meaning, train to obtain an embedding vector of the first search term corresponding to the first meaning.
[0093] In the embodiment of the present application, after determining the keywords related to the first sense corresponding to the first search term in S102, the keywords related to the first sense can be used to train an embedding vector of the first sense corresponding to the first search term. In the embodiment of the present application, the skipgram model and the keywords related to the first sense can be used to train an embedding vector of the first sense corresponding to the first search term, which can also be called an embedding vector of the first sense.
[0094] In an embodiment of the present application, in order to further improve the accuracy of the embedded vector of the first sense obtained by training, when using the skipgram model and the keywords related to the first sense to train the embedded vector of the first sense, the loss function of the skipgram model can be improved so that among the keywords related to the first sense, the keywords with a high degree of relevance to the first sense can play a greater role.
[0095] In the embodiment of the present application, the relevance of each keyword in the keywords related to the first meaning to the first meaning can be determined according to the TF-IDF value of the keyword. The TF-IDF value of a keyword refers to the TF-IDF value of the keyword in the webpage to which it belongs and related to the first meaning.
[0096] The larger the TF-IDF value, the higher the relevance of the keyword to the first meaning. Therefore, in one example, the loss function of the improved skipgram model can be obtained according to the TF-IDF value of the keyword related to the first meaning. In one example, the loss function of the skipgram model can be shown as the following formula (1).
[0097] Formula (1)
[0098] In formula (1):
[0099] Loss is the loss function of the skipgram model;
[0100] N is a set of keywords related to the first meaning;
[0101] j is the jth keyword in the set of keywords related to the first meaning;
[0102] is the TF-IDF value of the jth keyword;
[0103] u is the embedding vector of the first meaning of the j-th keyword;
[0104] is the word embedding vector of the jth keyword;
[0105] is the word set of the jth keyword and its corresponding negative sampling keyword;
[0106] for The The word embedding vectors of keywords.
[0107] It can be seen from the above description that by utilizing the solution of the embodiment of the present application, the accuracy of the embedded vector of the first search term corresponding to the first meaning obtained by training can be improved.
[0108] In an implementation of the embodiment of the present application, after executing S101, a web page corresponding to the first search term may also be obtained so as to display the web page corresponding to the first search term to the user. It is understandable that, since the first search term includes at least two meanings, the web page corresponding to the first search term determined may include web pages corresponding to the at least two meanings respectively.
[0109] In the embodiment of the present application, after obtaining the web page corresponding to the first search term, the web page corresponding to the first search term can also be classified according to the following steps D and E to determine the web page corresponding to each of the meanings in the web page corresponding to the first search term.
[0110] Step D: Determine the word embedding vector corresponding to each web page in the web page corresponding to the first search term.
[0111] For the convenience of description, "any web page among the web pages corresponding to the first search term" is referred to as the "second web page". In one implementation of the embodiment of the present application, the text in the second web page can be used to train the word embedding vector of the second web page. In another implementation, the keywords of the second web page can be extracted, and then the word bag model and the keywords of the second web page can be used to obtain the word embedding vector of the second web page. Regarding the extraction of keywords for the second web page, please refer to the relevant description of extracting keywords for the web page in step A, which will not be described here. The specific implementation method of obtaining the word embedding vector of the second web page using the word bag model and the keywords of the second web page will not be described in detail here.
[0112] Step E: Based on the embedding vector of each meaning item corresponding to the first search term and the word embedding vectors corresponding to each web page, determine the web pages corresponding to each meaning item in the web pages corresponding to the first search term.
[0113] It can be understood that the embedding vector of each sense item corresponding to the first search term can reflect the semantics of the first search term under the sense item, and the word embedding vector of the web page can also reflect the semantics of the content included in the web page. Therefore, for the multiple sense items of the first search term and the second web page, the correlation between the second web page and each sense item of the first search term can be obtained according to the word embedding vector of the second web page and the embedding vector of each sense item corresponding to the first search term. In one example, the cosine similarity between the word embedding vector of the second web page and the embedding vector of each sense item of the first search term can be calculated respectively to obtain the correlation between the second web page and each sense item of the first search term. When classifying the second web page, the second web page can be determined as the web page corresponding to the sense item with the highest correlation. For example: the first search term includes two sense items, namely sense item 1 and sense item 2. The correlation between the second web page and sense item 1 is higher than the correlation between the second web page and sense item 2, then the second web page is determined to be the web page corresponding to sense item 1.
[0114] In some embodiments, when the first search term includes multiple meanings, the user often wants to search based on one of the meanings. Therefore, in an embodiment of the present application, after the user enters the first search term in the search input area provided by the search engine, the various meanings of the first search term can also be displayed. The user can trigger a search operation for one of the meanings. For example, the user can click on one of the meanings to perform a search operation for the first search term under the meaning.
[0115] In order to provide users with search results that meet their needs, in an embodiment of the present application, after the user triggers a search operation for a first meaning, the search engine can obtain web pages corresponding to the first search term and web pages corresponding to the first meaning, and display the web pages related to the first meaning.
[0116] Exemplary Devices
[0117] Based on the method provided in the above embodiment, the embodiment of the present application further provides a device, which is described below in conjunction with the accompanying drawings.
[0118] See also Figure 2 , which is a schematic diagram of the structure of a training device for a meaning embedding vector provided in an embodiment of the present application. The device 200 may specifically include: a first acquisition unit 201, a first determination unit 202 and a training unit 203.
[0119] A first acquisition unit 201 is used to acquire a first search term, wherein the first search term includes at least two meanings, the at least two meanings include a first meaning, and the first meaning has an encyclopedia entry;
[0120] A first determining unit 202, configured to determine keywords related to the first meaning according to web pages related to the first meaning and encyclopedia entries of the first meaning;
[0121] The training unit 203 is used to train and obtain an embedding vector of the first search term corresponding to the first sense by using the keywords related to the first sense.
[0122] In one implementation, the first determining unit 202 is configured to:
[0123] Determine web pages related to the first meaning, and extract keywords from the web pages;
[0124] The keywords of the web page are matched with the encyclopedia entries of the first meaning, and the matched keywords are determined as keywords related to the first meaning.
[0125] In one implementation, the keywords of the webpage are the words whose term frequency-inverse text frequency TF-IDF value is greater than a first threshold value in the words included in the webpage; the training unit 203 is used to:
[0126] Using the skipgram model and the keywords related to the first sense, training to obtain an embedding vector of the first sense;
[0127] in:
[0128] The loss function of the skipgram model is obtained according to the TF-IDF values of the keywords related to the first sense.
[0129] In one implementation, the device further includes:
[0130] A second acquisition unit, configured to acquire a web page corresponding to the first search term;
[0131] A second determining unit is used to determine the word embedding vector corresponding to each web page in the web page corresponding to the first search word;
[0132] The third determination unit is used to determine the web pages corresponding to each meaning in the web pages corresponding to the first search term based on the embedding vector of each meaning corresponding to the first search term and the word embedding vectors corresponding to the respective web pages.
[0133] In one implementation, the device further includes:
[0134] A response unit, used to respond to a search operation triggered by a user for the first meaning item;
[0135] A third acquisition unit is used to acquire a web page corresponding to the first meaning among the web pages corresponding to the first search term;
[0136] The display unit is used to display the web page corresponding to the first meaning.
[0137] Since the device 200 is a device corresponding to the method provided in the above method embodiment, the specific implementation of each unit of the device 200 is based on the same concept as the above method embodiment. Therefore, for the specific implementation of each unit of the device 200, reference can be made to the description part of the above method embodiment, which will not be repeated here.
[0138] The method provided in the embodiment of the present application can be executed by a client or a server. The client and server that execute the above method are described below respectively.
[0139] Figure 3 1 shows a block diagram of a client 300. For example, the client 300 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0140] Reference Figure 3 , the client 300 may include one or more of the following components: a processing component 302 , a memory 304 , a power component 306 , a multimedia component 308 , an audio component 310 , an input / output (I / O) interface 33 , a sensor component 314 , and a communication component 316 .
[0141] The processing component 302 generally controls the overall operation of the client 300, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 302 may include one or more processors 320 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 302 may include one or more modules to facilitate the interaction between the processing component 302 and other components. For example, the processing component 302 may include a multimedia module to facilitate the interaction between the multimedia component 308 and the processing component 302.
[0142] The memory 304 is configured to store various types of data to support operations on the client 300. Examples of such data include instructions for any application or method operating on the client 300, contact data, phone book data, messages, pictures, videos, etc. The memory 304 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0143] The power supply component 306 provides power to the various components of the client 300. The power supply component 306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the client 300.
[0144] The multimedia component 308 includes a screen that provides an output interface between the client 300 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 308 includes a front camera and / or a rear camera. When the client 300 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0145] The audio component 310 is configured to output and / or input audio signals. For example, the audio component 310 includes a microphone (MIC), and when the client 300 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 304 or sent via the communication component 316. In some embodiments, the audio component 310 also includes a speaker for outputting audio signals.
[0146] The I / O interface provides an interface between the processing component 302 and the peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0147] The sensor assembly 314 includes one or more sensors for providing various aspects of status assessment for the client 300. For example, the sensor assembly 314 can detect the open / closed state of the device 300, the relative positioning of components, such as the display and keypad of the client 300, and the sensor assembly 314 can also detect the position change of the client 300 or a component of the client 300, the presence or absence of user contact with the client 300, the orientation or acceleration / deceleration of the client 300, and the temperature change of the client 300. The sensor assembly 314 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 314 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 314 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0148] The communication component 316 is configured to facilitate wired or wireless communication between the client 300 and other devices. The client 300 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 316 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 316 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0149] In an exemplary embodiment, the client 300 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the following methods:
[0150] Obtaining a first search term, wherein the first search term includes at least two meanings, the at least two meanings include a first meaning, and the first meaning has an encyclopedia entry;
[0151] Determining keywords related to the first meaning according to web pages related to the first meaning and encyclopedia entries of the first meaning;
[0152] The keywords related to the first meaning are used to train and obtain an embedding vector of the first search term corresponding to the first meaning.
[0153] In one implementation, determining keywords related to the first meaning based on web pages related to the first meaning and encyclopedia entries of the first meaning includes:
[0154] Determine web pages related to the first meaning, and extract keywords from the web pages;
[0155] The keywords of the web page are matched with the encyclopedia entries of the first meaning, and the matched keywords are determined as keywords related to the first meaning.
[0156] In one implementation, the keywords of the webpage are words whose term frequency-inverse text frequency TF-IDF value is greater than a first threshold value among the words included in the webpage; and the training of the embedding vector of the first sense using the keywords related to the first sense includes:
[0157] Using the skipgram model and the keywords related to the first sense, training to obtain an embedding vector of the first sense;
[0158] in:
[0159] The loss function of the skipgram model is obtained according to the TF-IDF values of the keywords related to the first sense.
[0160] In one implementation, the method further includes:
[0161] Obtaining a web page corresponding to the first search term;
[0162] Determine a word embedding vector corresponding to each web page in the web page corresponding to the first search term;
[0163] According to the embedding vector of each meaning item corresponding to the first search word and the word embedding vectors corresponding to the respective web pages, the web pages corresponding to each meaning item in the web pages corresponding to the first search word are determined.
[0164] In one implementation, the method further includes:
[0165] In response to a search operation triggered by a user for the first meaning item;
[0166] Obtaining a web page corresponding to the first meaning among the web pages corresponding to the first search term;
[0167] The web page corresponding to the first meaning is displayed.
[0168] Figure 44 is a schematic diagram of the structure of the server in the embodiment of the present application. The server 400 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 422 (for example, one or more processors) and memory 432, and one or more storage media 430 (for example, one or more mass storage devices) storing application programs 442 or data 444. Among them, the memory 432 and the storage medium 430 can be short-term storage or permanent storage. The program stored in the storage medium 430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processing unit 422 can be configured to communicate with the storage medium 430 to execute a series of instruction operations in the storage medium 430 on the server 400.
[0169] Furthermore, the CPU 422 may execute the following method:
[0170] Obtaining a first search term, wherein the first search term includes at least two meanings, the at least two meanings include a first meaning, and the first meaning has an encyclopedia entry;
[0171] Determining keywords related to the first meaning according to web pages related to the first meaning and encyclopedia entries of the first meaning;
[0172] The keywords related to the first meaning are used to train and obtain an embedding vector of the first search term corresponding to the first meaning.
[0173] In one implementation, determining keywords related to the first meaning based on web pages related to the first meaning and encyclopedia entries of the first meaning includes:
[0174] Determine web pages related to the first meaning, and extract keywords from the web pages;
[0175] The keywords of the web page are matched with the encyclopedia entries of the first meaning, and the matched keywords are determined as keywords related to the first meaning.
[0176] In one implementation, the keywords of the webpage are words whose term frequency-inverse text frequency TF-IDF value is greater than a first threshold value among the words included in the webpage; and the training of the embedding vector of the first sense using the keywords related to the first sense includes:
[0177] Using the skipgram model and the keywords related to the first sense, training to obtain an embedding vector of the first sense;
[0178] in:
[0179] The loss function of the skipgram model is obtained according to the TF-IDF values of the keywords related to the first sense.
[0180] In one implementation, the method further includes:
[0181] Obtaining a web page corresponding to the first search term;
[0182] Determine a word embedding vector corresponding to each web page in the web page corresponding to the first search term;
[0183] According to the embedding vector of each meaning item corresponding to the first search word and the word embedding vectors corresponding to the respective web pages, the web pages corresponding to each meaning item in the web pages corresponding to the first search word are determined.
[0184] In one implementation, the method further includes:
[0185] In response to a search operation triggered by a user for the first meaning item;
[0186] Obtaining a web page corresponding to the first meaning among the web pages corresponding to the first search term;
[0187] The web page corresponding to the first meaning is displayed.
[0188] The server 400 may also include one or more power supplies 426, one or more wired or wireless network interfaces 450, one or more input and output interfaces 456, one or more keyboards 456, and / or one or more operating systems 441, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0189] An embodiment of the present application also provides a computer-readable medium having instructions stored thereon, which, when executed by one or more processors, enables the device to execute the method for training the meaning embedding vector provided in the above method embodiment.
[0190] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0191] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0192] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A training method for sense embedding vectors, It is characterized in that The method comprises: Obtaining a first search term, wherein the first search term includes at least two meanings, the at least two meanings include a first meaning, and the first meaning has an encyclopedia entry; Determining keywords related to the first meaning based on the web page related to the first meaning and the encyclopedia entry of the first meaning, which includes: determining the web page related to the first meaning and extracting keywords of the web page, wherein the first meaning is combined with the first search word as a search keyword to search to obtain the web page related to the first meaning; matching the keywords of the web page with the encyclopedia entry of the first meaning, and determining the matched keywords as keywords related to the first meaning, wherein the keywords in the keywords of the web page that match the encyclopedia entry of the first meaning refer to the keywords in the keywords of the web page that exist in the encyclopedia entry of the first meaning; Using the keywords related to the first meaning, training to obtain an embedding vector of the first search term corresponding to the first meaning; The keywords of the webpage are the words whose term frequency-inverse text frequency TF-IDF value is greater than a first threshold value in the words included in the webpage; and the training of the embedding vector of the first meaning using the keywords related to the first meaning includes: Using the skipgram model and the keywords related to the first sense, training to obtain an embedding vector of the first sense; in: The loss function of the skipgram model is obtained according to the TF-IDF values of the keywords related to the first sense.
2. The method according to claim 1, It is characterized in that The method further comprises: Obtaining a web page corresponding to the first search term; Determine a word embedding vector corresponding to each web page in the web page corresponding to the first search term; According to the embedding vector of each meaning item corresponding to the first search word and the word embedding vectors corresponding to the respective web pages, the web pages corresponding to each meaning item in the web pages corresponding to the first search word are determined.
3. The method according to claim 2, It is characterized in that The method further comprises: In response to a search operation triggered by a user for the first meaning item; Obtaining a web page corresponding to the first meaning among the web pages corresponding to the first search term; The web page corresponding to the first meaning is displayed.
4. A training device for embedding vectors of meanings, It is characterized in that The device comprises: A first acquisition unit is used to acquire a first search term, wherein the first search term includes at least two meanings, the at least two meanings include a first meaning, and the first meaning has an encyclopedia entry; A first determining unit is used to determine keywords related to the first sense according to the web page related to the first sense and the encyclopedia entry of the first sense, which includes: determining the web page related to the first sense and extracting keywords of the web page, wherein the first sense is combined with the first search word as a search keyword to search to obtain the web page related to the first sense; matching the keywords of the web page with the encyclopedia entry of the first sense, and determining the matched keywords as keywords related to the first sense, wherein the keywords in the keywords of the web page that match the encyclopedia entry of the first sense refer to the keywords in the keywords of the web page that exist in the encyclopedia entry of the first sense; A training unit, configured to train and obtain an embedding vector of the first search term corresponding to the first sense by using the keywords related to the first sense; The keywords of the webpage are the words whose term frequency-inverse text frequency TF-IDF value is greater than the first threshold value in the words included in the webpage; the training unit is used to: Using the skipgram model and the keywords related to the first sense, training to obtain an embedding vector of the first sense; in: The loss function of the skipgram model is obtained according to the TF-IDF values of the keywords related to the first sense.
5. The device according to claim 4, It is characterized in that The device also includes: A second acquisition unit, configured to acquire a web page corresponding to the first search term; A second determining unit is used to determine the word embedding vector corresponding to each web page in the web page corresponding to the first search word; The third determination unit is used to determine the web pages corresponding to each meaning in the web pages corresponding to the first search term based on the embedding vector of each meaning corresponding to the first search term and the word embedding vectors corresponding to the respective web pages.
6. The device according to claim 5, It is characterized in that The device also includes: A response unit, used to respond to a search operation triggered by a user for the first meaning item; A third acquisition unit is used to acquire a web page corresponding to the first meaning among the web pages corresponding to the first search term; The display unit is used to display the web page corresponding to the first meaning.
7. A training device for embedding vectors of meanings, It is characterized in that The system comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations: Obtaining a first search term, wherein the first search term includes at least two meanings, the at least two meanings include a first meaning, and the first meaning has an encyclopedia entry; Determining keywords related to the first meaning based on the web page related to the first meaning and the encyclopedia entry of the first meaning, which includes: determining the web page related to the first meaning and extracting keywords of the web page, wherein the first meaning is combined with the first search word as a search keyword to search to obtain the web page related to the first meaning; matching the keywords of the web page with the encyclopedia entry of the first meaning, and determining the matched keywords as keywords related to the first meaning, wherein the keywords in the keywords of the web page that match the encyclopedia entry of the first meaning refer to the keywords in the keywords of the web page that exist in the encyclopedia entry of the first meaning; Using the keywords related to the first meaning, training to obtain an embedding vector of the first search term corresponding to the first meaning; The keywords of the webpage are the words whose term frequency-inverse text frequency TF-IDF value is greater than a first threshold value in the words included in the webpage; and the training of the embedding vector of the first meaning using the keywords related to the first meaning includes: Using the skipgram model and the keywords related to the first sense, training to obtain an embedding vector of the first sense; in: The loss function of the skipgram model is obtained according to the TF-IDF values of the keywords related to the first sense.
8. The device according to claim 7, It is characterized in that The operations also include: Obtaining a web page corresponding to the first search term; Determine a word embedding vector corresponding to each web page in the web page corresponding to the first search term; According to the embedding vector of each meaning item corresponding to the first search word and the word embedding vectors corresponding to the respective web pages, the web pages corresponding to each meaning item in the web pages corresponding to the first search word are determined.
9. The device according to claim 8, It is characterized in that The operations also include: In response to a search operation triggered by a user for the first meaning item; Obtaining a web page corresponding to the first meaning among the web pages corresponding to the first search term; The web page corresponding to the first meaning is displayed.
10. A computer-readable medium having instructions stored thereon, which, when executed by one or more processors, causes an apparatus to perform the method of any one of claims 1 to 3.
Citation Information
Patent Citations
Searching method and device
CN110019888A
Segmented semantic annotation method in weak annotation environment
CN110888991A
