WO2020060605A1 - Approximate nearest neighbor searching strategy generating based on reinforcement learning - Google Patents

Approximate nearest neighbor searching strategy generating based on reinforcement learning Download PDF

Info

Publication number
WO2020060605A1
WO2020060605A1 PCT/US2019/038078 US2019038078W WO2020060605A1 WO 2020060605 A1 WO2020060605 A1 WO 2020060605A1 US 2019038078 W US2019038078 W US 2019038078W WO 2020060605 A1 WO2020060605 A1 WO 2020060605A1
Authority
WO
WIPO (PCT)
Prior art keywords
vector
action
state
searching
preset
Prior art date
Application number
PCT/US2019/038078
Other languages
French (fr)
Inventor
Wei Li
Mingqin LI
Qi Chen
Wei Luo
Gang Ren
Jingdong Wang
Lintao Zhang
Original Assignee
Microsoft Technology Licensing, Llc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Microsoft Technology Licensing, Llc filed Critical Microsoft Technology Licensing, Llc
Publication of WO2020060605A1 publication Critical patent/WO2020060605A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3347Query execution using vector based model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/01Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation
    • G06N5/022Knowledge engineering; Knowledge acquisition

Definitions

  • the searching engine may provide information to various applications and is a service necessary to a lot of applications. In the period in which the information is growing fast, there may be a large amount of information such as webpage documents and images, and the amount of the webpage documents and the images are being increased. It is always a challenge in current searching engine technology to implementa a searching service, which can understand the intention of a user more quickly, more efficiently, and more accurately.
  • the embodiments of the present disclosure may provide a technique for generating nearest neighbor searching strategy for vectors based on reinforcement learning.
  • a searching technology using vectors approximate matching may be applied in a searching engine. More particularly, the searching engine may be subjected to a training by using a reinforcement learning so that a mapping relationship between a calculation state and a behavior action may be obtained. The searching engine may automatically generate a searching strategy for an enquiry content by using the mapping relationship.
  • FIG. 1 is a block diagram showing an information searching apparatus according to the embodiments of the present disclosure
  • FIG. 2 is a schematic diagram showing a structure of indexes of a spatial partition tree according to the embodiments of the present disclosure
  • FIG. 3 is a schematic diagram showing a structure of indexes of a nearest neighbor graph according to the embodiments of the present disclosure
  • Fig. 4 is a schematic diagram showing a combination structure of combined indexes of a spatial partition tree and a nearest neighbor graph according to the embodiments of the present disclosure
  • FIG. 5 is a schematic flowchart showing an information searching method according to the embodiments of the present disclosure.
  • Fig. 6 is a shematic flowchart showing a vector approximate matching searching performed in a preset vector database according to the embodiments of the present dislcousre;
  • FIG. 7 is a schematic block diagram showing a training apparatus with the information searching model applied therein according to the embodiments of the present disclosure
  • FIG. 8 is a shematic flowchart showing a training method of the information searching model according to the embodiments of the present disclosure
  • Fig. 9 is a schematic flowchart showing a vector approximate matching search performed in the information searching model with respect to an enquiry vector in a training set according to the embodiments of the present disclosure
  • Fig. 10 is a schematic flowchart showing a vector approximate matching search performed in the information searching model with respect to an enquiry vector in a training set according to the embodiments of the present disclosure.
  • Fig. 11 is a structural block diagram of an exemplary electronic apparatus.
  • the term "technique”, as cited herein, for instance, may refer to system(s), method(s), computer-readable instructions, module(s), algorithms, hardware logic (e.g., Field-programmable Gate Arrays (FPGAs), Application-specific Integrated Circuits (ASICs), Application-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs)), and/or other technique(s) as permitted by the context above and throughout the document.
  • FPGAs Field-programmable Gate Arrays
  • ASICs Application-specific Integrated Circuits
  • ASSPs Application-specific Standard Products
  • SOCs System-on-a-chip systems
  • CPLDs Complex Programmable Logic Devices
  • the embodiments of the present disclosure may provide a technique for generating a vector nearest neighbor searching strategy based on reinforcement learning.
  • the technology of searching engine has been widely used in various fields.
  • the searching engine may be not only used in a normal way of accessing webpage, the searching engine may be but also associated with various APP (applications) so as to provide various information searching services to users.
  • APP applications
  • a user may send an enquiry request to a searching engine, and the searching engine may perform searching in the stored information, such as webpage documents and images according to the enquiry content contained in the enquiry request, so as to acquire information matched with the enquiry content of the user and return the acquired information to the user.
  • the searching engine may not only perform searching on the webpage documents, but also perform searching on other kinds of documents, such as message documents, data documents. In the present disclosure, description would be made on the webpage document as an example.
  • the processing of searching for documents may mostly made based on a way of symbol matching.
  • An internet searching engine may commonly use a mode of acquiring relavent documents related to some enquiry content by the symbol matching method based on the inverted index of keywords.
  • the current searching method based on symbol matching cannot understand the intention of a user well.
  • the input original enquiry may be subjected to some changing processing and then a searching processing may be conducted so as to increase the recall ratio, such changing may be very limited.
  • the documents searching technology based on vector nearest neighbor searching proposed in the embodiments of the present disclosure may convert a document in a searching engine to a document vector in a form of semantic vector and convert the enquiry content input by a user into an enquiry vector in a form of semantic vector, and then the searching engine may conduct a vector-based approximate matching search for a document vector approximate to the enquiry vector, i.e., the inner product between the document vector and the enquiry vector is small, in a vector database including a plurality of document vectors obtained by converting a plurality of documents. Finally, the searching engine may obtain a document corresponding to the found document vector and return the obtained document as an enquiry result to the user.
  • the vector approximate matching search described above may be particularly adopt a technology of approximate nearest neighbor search (ANN). Since both the document and the enquiry are converted to be in a form of semantic vectors, the document to be recalled may be determined according to the similarity between the enquiry vector and the document vector. In such a way, there would be no limitation caused by the searching method based on symbol matching and the intention of a user may be understood better.
  • ANN approximate nearest neighbor search
  • the whole procedure of vector approximate matching search may include a series of searching actions and the whole procedure may be regarded as an action sequence. In order to acquire better searching result, it may be necessary to make a reasonable searching action sequence.
  • the searching action to be performed in the next step may be determined according to the current state, i.e., a suitable searching action may be selected from a preset set of actions according to the current state of environment.
  • an action to be performed may be determined based on the mapping relationship between states and actions and thus the action to be performed may be determined from a set of actions based on current state.
  • the environment may be changed to be in a new state.
  • an action to be performed next may be determined from the set of actions based on the new state.
  • Such procedure of determination on the actions to be performed may be repeated until a preset termination condition is met.
  • an action corresponding to the current state of environment may be an action of terminating a search according to the mapping relationship between states and actions.
  • the technology of reinforcement learning is to construct a controlling strategy so that the performance of the actions of the executive subject is maximum.
  • An executive subject may monitor some signals of the environment and acknowledge the state of current environment according to such signals.
  • the executive subject may improve the performance of itself by learning and make a selection on the actions so as to make a selection on group actions.
  • the selection on individual actions and the selection on group actions may cause the executive subject to make a decision to select some action so as to further influence the environment.
  • a training set data may be provided in advance. There may be a large amount of enquiry vectors and searching result candidate vectors corresponding to the enquiry vectors respectively contained in the training set.
  • An enquiry vector may be first input to a searching engine to be trained. As described above, a searching result corresponding to each enquiry vector may be finally obtained after the enquiry vector has been subjected to a series of searching actions in the searching engine. Therefore, when the environment is in some state, each enquiry vector in the training set may be subjected to a series of actions before the searching result thereof is obtained finally. Therefore, calculation may be made on the value for different actions performed after the current state.
  • the value of various enquiry vectors may be used to train the mapping relationship between states and actions. For example, the training may be performed by using the manner based on value or the manner of policy gradient.
  • the information searching apparatus 101 may be implemented as a server in an internet or provided in a server in the internet, and the server may be implemented by one or more computer systems (distributed server), or may be implemented as a server based on cloud.
  • Such server may be connected with a user terminal via internet, receive an enquiry request input via the user terminal and generate an enquiry result upon being subjected to the processing of the information searching apparatus so as to return the enquiry result to the user terminal.
  • the user terminal cited herein may be a notebook computer or desktop computer connected with the above server in communication via mobile network or wired network, or a small portable (or mobile) electronic apparatus (e.g., tablet computer, smart phone, personal digital assistant (PDA), media player device, wireless network player device, personal headset device, dedicate device or combined device containing any of functions described above).
  • a small portable (or mobile) electronic apparatus e.g., tablet computer, smart phone, personal digital assistant (PDA), media player device, wireless network player device, personal headset device, dedicate device or combined device containing any of functions described above).
  • the information searching apparatus 101 shown in the figures may be implemented as a small portable (or mobile) electronic apparatus.
  • the small portable (or mobile) electronic apparatus may be e.g., a cell phone, a personal digital assistant (PDA), a personal media player device, a wireless network player device, personal headset device, an IoT (internet of things) intelligent device, a dedicate device or combined device containing any of functions described above.
  • the information searching apparatus 101 may be further implemented as or provided in a notebook computer or a desktop computer.
  • the information searching apparatus 101 shown in Fig. 1, the information searching apparatus 101 shown in Fig. 1 may be provided in a server 102 in the internet.
  • the server 102 may be connected with a user terminal 104 in communication via internet 103 so as to provide the searching services to the user.
  • the information searching apparatus 101 may include a vector generating module 105, a vector searching module 106, and a result acquiring module 107.
  • a vector database 108 may be provided in the server 102 to store the document vectors for searching.
  • the vector database 108 may be provided outside the server 102, and the server 102 may access the vector database 108 via the communication network.
  • the vectors stored in the vector database 108 may consist a vector space where the vector searching described in the embodiments of the present disclosure is conducted.
  • the vector generating module 105 may be configured to generate an enquiry vector according to an enquiry content.
  • a user may input a content as an enquiry into the user terminal 104.
  • the content may be transmitted to the server 102 via the internet 103. Then, the content may be subjected to the processing by the vector generating module 105 of the information searching apparatus 101 in the server 102 so that the content may be vectorized.
  • the vectorizing technology may have the advantages that not only the content of a document, but also the whole document may be expressed by the feature elements in a plurality of dimensions, so that the comparison on the similarity between vectors may be conducted more accurately and flexibly.
  • the distance between vectors may show the similarity between the documents corresponding to the vectors. Compared with the traditional searching method based on symbol matching, the searching method based on vectors may have more flexibility and accuracy.
  • the distance between vectors as cited herein may refer to the Euler distance, Cosine similarity and so on.
  • the expression of“document” may refer to various kinds of information or data unit, which is vectorizable and may be used as a searching object, such as text document, webpage document, image, data, message or the like.
  • the vector searching module 106 may be configured to perform vector approximate matching search in a preset vector database 108 to acquire a candidate vector closest to the enquiry vector.
  • the vector approximate matching search may particularly adopt the approximate nearest neighbor search (ANN).
  • Document vectors for searching may be stored in the vector database 108 in advance.
  • a candidate vector closest to the enquiry vector may be found in the vector database by the processing of vector approximate matching search.
  • the vector searching module 106 is performing the vector approximate matching search, the following steps may be performed circularly, until a preset termination condition is met.
  • the vector searching module 106 may determine the current calculation state.
  • the current calculation state may include the contents which would be described detailedly below.
  • the vector searching module 106 may determine an action to be performed among the preset set of actions based on the determined current calculation state described above according to a preset state-action mapping relationship.
  • the preset state-action mapping relationship may show the correspondence between the states of the environment (i.e., calculating state) and the actions to be performed (i.e., searching actions). That is to say, the state-action mapping relationship may record the correspondence between the states and the actions.
  • the environment is in a state, it may be determined which action should be performed in the next step according to the state-action mapping relationship.
  • Such state-action mapping relationship may be a mapping table of states and actions, or a neural network showing the mapping relationship between the states and the actions as long as the action to be performed can be determined according to the state of the environment.
  • the vector approximate matching search may particularly adopt the approximate nearest neighbor search (ANN). Description would be made on the approximate nearest neighbor searching algorithm, which combines the Spatial Partition Trees and Neighborhood Graph. Such approximate nearest neighbor search can improve the efficiency of vector searching. More particularly, the Spatial Partition Trees may be a decision tree, such as KD tree or a BK tree.
  • Such vector searching algorithm may establish indexes for the vectors in the vector space in a structure of Spatial Partition Trees and Neighborhood Graph. More particularly, the index esblished in a form of Spatial Partition Trees may be referred as a spatial partition tree index, and the index esblished in a form of Neighborhood Graph may be referred as a neighborhood graph index.
  • the spatial partition trees indexes may be a coarse-grained partition on vectors in a vector space. More particularly, vectors in the vector space may be clustered to form a plurality of child vector spaces. Each leaf node of spatial partition trees indexes may be corresponding to one child vector space. Each leaf node may store therein a central vector of child vector space corresponding thereto or a vector identification of a central vector.
  • each intermediate node may be corresponding to one child vector space, and the child vector space corresponding to an intermediate node as a parent node may contain the child vector space corresponding to a leaf node or an intermediate node as a child node.
  • the intermediate node may store a central vector of the child vector space corresponding thereto or a vector identification of a central vector therein.
  • a query vector may be compared with the intermediate node and the central vector corresponding to the leaf node layer by layer to calculate a distance between a query vector and the central vector. Then the calculation may be conducted downward layer by layer according to a preset search condition till the child vector space corresponding to one or more leaf node is positioned and a central vector stored in that one or more leaf node is obtained.
  • the structure of the spatial partition trees indexes may be as shown in Fig. 2, which is a structural diagram 200 showing spatial partition trees indexes of embodiments of the present disclosure.
  • the nodes in the spatial partition trees indexes may be corresponding to different vector spaces respectively. More particularly, the root node 201 may correspond to the whole vector space, and the nodes other than the root node 201 may correspond to the child vector spaces in the vector space.
  • the spatial partition trees indexes may only include the root node 201 and leaf nodes 203, or may include the root node 201, at least one layer of intermediate nodes 201, and the leaf nodes 203.
  • the structure as shown in Fig. 2 may be the case that a plurality of layers of intermediate nodes are included.
  • Each of the intermediate nodes 202 and the leaf nodes 203 may correspond to different child vector spaces respectively, and the child vector space corresponding to the intermediate node 202 as the parent node may include a child vector space corresponding to the leaf node 203 or an intermediate node 202 as the child node.
  • the intermediate node 202 and the leaf node 203 may store therein a central vector 204 of the child vector space corresponding thereto or a vector identification of the central vector 204.
  • a vector distance between the query vector and the central vectors 204 of the child vector spaces corresponding to the intermediate nodes 202 of each layer may be calculated layer by layer, so as to narrow the range of the child vector space layer by layer till the leaf node 203. Then, one or more leaf nodes 203 most approximate to the query vector may be determined according to the vector distances between the query vector and the central vectors 204 corresponding to the leaf nodes 203.
  • the spatial partition trees indexes described above may be generated by clustering vectors in the vector space. More particularly, a plurality of child vector spaces may be generated by clustering processing on the vectors, and the central vectors of each child vector space may be obtained. Then, the central vectors or vector identifications of the central vectors may be stored in the spatial partition trees indexes.
  • the neighborhood graph indexes may be indexes established on the vectors in a vector space in a form of graph. More particularly, each point in the neighborhood graph indexes may be corresponding to one vector in the vector space.
  • RNG Relative Neighborhood Graph
  • the characteristic of the RNG may be as follows: one point p and another point q may be connected by using edges in the case that there is no a third point r whose distance to either of these two points of p and q is smaller than the distance between these two points of p and q, so that a group of points may be defined on an Euclidean plain. Based on such principle, indexes may be established with respect to the vectors in the whole vector space so as to form the neighborhood graph indexes.
  • connection relationship (edge relationship) among points in the neighborhood graph indexes may show the distance relationship among the vectors corresponding to the points respectively.
  • the point having the connection relationship of edges may be referred as neighborhood point, and the vectors corresponding to these neighborhood points may be referred as the neighborhood vectors of the vector corresponding to any point described above.
  • Each point in the neighborhood indexes may store a vector identification of the vector corresponding to this point and a vector identification of the vector corresponding to the neighborhood points adjacent thereto.
  • the vector corresponding to this point and/or the vectors corresponding to the neighborhood points in each point of the neighborhood graph indexes directly.
  • iterative calculation on vector distance may be conducted with K neighborhood vectors of one or more central vectors obtained by the searching based on the spatial partition trees search as seeds, so as to obtain one or more vectors most approximate to the query vector.
  • each point in Fig. 3 may represent a vector in a vector space, and the line between any two points may represent the neiborhood relationship between the two points.
  • Each point in the neighborhood graph index may store a vector identification of the vector corresponding thereto and a vector identification of a neighbor vector corresponding to a neiborhood point of the point therein, and thus it may be convenient ato obtain the vector identification of the neighborhood point of any point when the any point is determined, so that the subsequent vector distance iterative calculation may be performed.
  • vectors of the neighborhood points of each point may be stored in the each point, so that the processing of acquiring vector by using the vector identification may be omitted during the vector distance iterative calculation, so that the efficiency of vector distance iterative calculation may be improved.
  • the neighborhood graph indexes as shown in Fig. 3 may be established based on the vectors of the whole vector space without being limited by the spatial partition tree indexes shown in Fig. 2. In storage, the neighborhood graph indexes and the spatial partition indexes may be stored separately.
  • the vector search based on the neighborhood graph indexes may obtain one or more vectors most approximate to the query vector as search results mainly by continuously performing vector distance iterative calculations on the vectors in the child vector space and the query vector.
  • the vector distance iterative calculation of each turn may be extended along the neighborhood relationship of the points in the first neighborhood graph indexes, and one or more vectors most approximate to the query vector may be recorded.
  • the vectors most approximate to the query vector may be updated.
  • the vector distance iterative calculations may be terminated after preset turns, and the recorded result may be output as a search result.
  • the vector distance iterative calculations described above it is necessary for the vector distance iterative calculations described above to select some starting points in the child vector spaces as seeds to be used as the vectors where the vector distance iterative calculation is started.
  • the child vector spaces for the first neighborhood graph search processing module 106 to perform the vector search based on the first neighborhood graph indexes is determined at the same time.
  • central vectors corresponding to the leaf nodes described above may be used to determine the seeds for the vector distance iterative calculation. More particularly, one or more neighborhood vectors in the first neighborhood graph indexes corresponding to the central vectors described above may be used as the seeds for the vector distance iterative calculation, i.e., the starting points for the vector distance iterative calculation of the first turn.
  • a priority queue may be maintained, and the priority queue may store the calculation results of the distances between the vectors in the child vector spaces, which are involved in the calculations, and the query vector according to the order of the value of the distance.
  • the priority queue may be dynamically adjusted so that the vector most approximate to the query vector is on the top.
  • the vector distance iterative calculations described above may be performed on child vector spaces corresponding to one or more leaf nodes output by the spatial partition trees search processing module 105, to generate one or more vectors most approximate to the query vector with respect to each child vector space.
  • comprehensive ranking may be performed on the one or more vectors in each child vector space, which are most approximate to the query vector as described above, so as to select one or more first vectors most approximate to the query vector as search results to be output.
  • coarse-grained positioning may be first conducted based on the spatial partition trees indexes, and then precise search may be conducted based on neighborhood graph indexes. Bing benefit from the small amount of the data of the spatial partition trees indexes, a query vector may be quickly positioned to a specific child vector space so as to complete a coarse-grained search. Then, a precise vector search may be conducted with the neighborhood graph indexes. More particularly, a multi-turns vector distance iterative calculation may be conducted based on neighborhood graph indexes, so as to acquire one or more vectors most approximate to the query vector.
  • the spatial partition trees indexes may quickly position the query vector to a suitable child vector space, so as to avoid the conducting of a vector distance iterative calculation in the whole neighborhood graph indexes.
  • the neighborhood graph indexes may eliminate the regional limitation of spatial partition trees indexes.
  • the neighborhood graph indexes may be constructed with respect to the vectors in the whole vector space, and the connection relationship among points in the neighborhood graph indexes may be not limited by the set range of leaf nodes in the spatial partition trees indexes. Therefore, when there is a query vector falling on an edge of the border of child spaces, the regional limitation of the spatial partition trees indexes may be eliminated by using a structure of the neighborhood graph indexes, so as to find more preferable approximate vectors.
  • Fig. 4 is a schematic diagram 400 showing combined architecture of spatial partition trees indexes and neighborhood graph indexes of embodiments of the present disclosure.
  • a structure in a tree form on the top of the figure is spatial partition trees indexes 401, which may include a root node 201, intermediate nodes 202, and leaf nodes 203.
  • a structure in a planar topology form on the bottom of the figure may be neighborhood graph indexes 402, which may be a neighborhood graph consisted of a plurality of points and corresponding to the whole vector space.
  • the child vector space 403 corresponding to each leaf node 203 is identified in ellipse, and the child vector space 403 and the leaf nodes 203 are connected with dash lines.
  • a coarse-grained search may be performed by using the spatial partition trees indexes 401, so that a quick coarse-grained vector positioning may be done.
  • a search processing based on the neighborhood graph indexes 402 may be further performed.
  • central vectors of the positioned child vector space may be obtained, so as to provide seeds for the search processing.
  • the efficiency of vector search may be significantly improved by using the spatial partition trees indexes 401 and the neighborhood graph indexes 402 in combination.
  • the generation of the neighborhood graph indexes 402 is not limited by the spatial partition trees indexes 401.
  • the processing may not be affected by the partition on the child vector spaces 403 by the spatial partition trees indexes 401.
  • the vector distance iterative calculation may be extended to other child vector spaces 403 by breaking through the boundary of the child vector space 403 with a structure of the first neighborhood graph indexes 402, so that vectors more approximate to the query vector may be found.
  • storage resources such as memory and hard drive may be utilized based on the above technical idea, so as to further improve the technical solution of vector search.
  • the hard drive described above may be traditional disk medium or storage medium such as solid state divers (SSD).
  • first neighborhood graph index and second neighborhood graph index respectively.
  • the first neighborhood graph indexes described above may only correspond to part of vectors in the vector space, and the part of vectors as cited herein may refer to vectors of high quality selected from the whole vector space, and these vectors may be exemplary or representative.
  • a second neighborhood graph indexes may be established, and may correspond to all vectors in the vector space. Therefore, an index structure of three layers may be constructed, including a spatial partition trees indexes, a first neighborhood graph indexes and a second neighborhood graph indexes.
  • the spatial partition trees indexes may be obtained by performing coarse-grained partition on the vectors in the vector space, and the first neighborhood graph indexes may be obtained by performing a further coarse-grained partition on the vectors in the vector space.
  • the coarse-grained partition processing in two layers may position the query vector to a suitable position of the second neighborhood graph indexes constructed based on all vectors more accurately, so that the vector distance iterative calculation based on neighborhood graph indexes may be performed more efficiently.
  • the spatial partition trees indexes and the first neighborhood graph indexes may need relatively small storage space since they only involve part of vectors in the vector space and thus they may be stored in the memory.
  • the second neighborhood graph indexes are established based on all vectors in the vector space, and thus have a large amount of data and have to be stored in the hard drive.
  • the vectors recorded in the first neighborhood graph indexes may be output directly as search results. More particularly, a threshold for vector distance may be set for determining the matching degrees between the vectors recorded in the first neighborhood graph indexes and the query vector, so as to determine whether or not it is necessary to perform a vector search based on the second neighborhood graph indexes.
  • the spatial partition trees indexes and the first neighborhood graph indexes stored in the memory may take some of searching jobs so that the accessing to the hard drive may be decreased. Even in the case that it is necessary to access the hard drive to perform a search processing based on the second neighborhood graph indexes, because one or more first vectors have been obtained by the first neighborhood graph indexes, in the vector search processing based on the second neighborhood graph indexes, the one or more first vectors may be directly used as seeds for the search processing, so as to obtain one or more second vectors most approximate to the query vector more efficiently.
  • the preset set of actions may include the following actions.
  • Action 1 performing search in a decision tree
  • Action 2 performing search in a nearest neibor graph
  • Action 3 terminating the searching.
  • the preset set of actions may include the following actions.
  • Action 1 performing search in a decision tree
  • Action 2-1 performing search in a nearest neighbor graph stored in the memory of the computer
  • Action 2-2 performing search in a nearest neighbor graph stored in the hard drive of the computer
  • Action 3 terminating the searching.
  • the vector searching module 106 may perform the action to be performed and collect the candidate vectors found by the searching based on the performed actions.
  • the environment is changed to be in the next state.
  • the vector searching module 106 may determine the current calculation sate again, so that the above procedure may be repeated until a preset termination condition is met.
  • the preset set of actions may include an action for terminating the searching (Action 3), and thus when the environment is in some state, the searching may be terminated according to the preset state-action mapping relationship.
  • the preset termination condition may be processed so that a processing of evaluation may be performed on the found candidate vectors until a preset condition is met.
  • the termination condition may further consider the time taken by the whole procedure of searching or the number of the searching actions which have been performed.
  • the current calculation state described above may include at least one of the following: a number of the calculation for distance between vectors, a number of the searching performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching. It can be seen that, the current calculation state may be a combination of the calculation environment signals described above.
  • the state A may include: a number of the calculation for distance between vectors is 15, a number of the searching performed in the decision tree is 10, an average distance between all the current candidate vectors and the enquiry vector is 0.2, and the candidate vectors are updated by the previous searching; while the state B may include: a number of the calculation for distance between vectors is 20, a number of the searching performed in the decision tree is 15, an average distance between all the current candidate vectors and the enquiry vector is 0.15, and the candidate vectors are updated by the previous searching. That is to say, two states may be regarded as two different states, as long as at least one of the parameters contained in one of the two states is different from the parameters contained in the other state of the two states. Therefore, the vector searching module 106 may determine which searching actions should be performed according to the state of the environment in order that a candidate vector with higher quality may be found and the searching efficiency may be improved.
  • the result acquiring module 107 may be configured to acquire the searching result corresponding to the candidate vector most approximate to the enquiry vector. Based on the found one (or more) candidate vector(s) most approximate to the enquiry vector, the documents corresponding thereto may be acquired and transmitted as the searching result to a user terminal 104 via internet 103.
  • an action to be performed corresponding to the current state may be found according to the preset state-action mapping relationship and performed, and such procedure may be repeated so that a series of searching actions may be automatically generated for any enquiry input by a user so as to perform searching for related document content.
  • the information searching method may include the following steps.
  • S502 performing vector approximate matching search in a preset vector database, and acquiring a candidate vector most approximate to the enquiry vector. More particularly, an approximate nearest neighbor search may be performed as the vector approximate matching search performed in the preset vector database.
  • Fig. 6 is a schematic flowchart showing a vector approximate matching search performed in a preset vector database according to the embodiments of the present disclosure
  • the vector approximate matching search as shown in Fig. 6 may include the following steps.
  • the current calculation state may at least one of the following: a number of the calculation for distance between vectors, a number of the search performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous search.
  • S602 determining an action to be performed from a preset set of actions based on the current calculation state according to a preset state-action mapping relationship.
  • the preset state-action mapping relationship may show the correspondence between various calculation states and the actions to be performed.
  • Such state-action mapping relationship may be a mapping table of states and actions or a neural network showing the mapping relationship between the states and the actions.
  • the preset set of actions may include performing search in a decision tree, performing search in a neighborhood graph, and terminating searching.
  • the preset set of actions may include performing searching in a decision tree, performing search in a neighborhood graph stored in the memory of a computer, performing search in a neighborhood graph stored in the hard drive of a computer, and terminating search.
  • the training apparatus 702 of the information searching model 701 may be implemented as an off-line computer or a server connected to the internet or provided therein.
  • the server may be implemented in a computer system consisted of one or more computers (i.e., implemented as a distributed server), or implemented as a server based on cloud technology.
  • the training apparatus 702 may be implemented as a notebook computer or a desktop computer or provided therein.
  • both the information searching model 701 and the training apparatus 702 thereof as shown in Fig. 7 may be provided in a server 703.
  • the training apparatus 702 may include a training set inputting module 704, a value calculating module 705, and a mapping relationship updating module 706.
  • the training set inputting module 704 may be configured to input a preset training set into an information searching model 701 to be trained.
  • An initial state-action mapping relationship may be preset in the information searching model 701 to be trained, and in such initial state-action mapping relationship, the mapping relationship between each state and each action may be set according to previous experience or may be set randomly.
  • the preset training set may include a plurality of enquiry vectors and a plurality of searching result candidate vectors corresponding to these enquiry vectors respectively.
  • the searching result candidate vectors may be used in verifying a quality of the results found by the information searching model 701 during the training processing, i.e., in determining whether or not the found document content is matched with or approximate to the enquiry content.
  • the value calculating module 705 may be configured to calculate the value for each enquiry vector obtained after the vector approximate matching searching is performed in the information searching model 701. As described above, the vector approximate matching searching may be conducted by using the ANN search (approximate nearest neighbor search).
  • the value calculating module 705 may be configured to perform the following steps circulately until a preset termination condition is met.
  • the value calculating module 705 may determine the current calculation state.
  • the current calculation state may include at least one of the following: a number of the calculation for distance between vectors, a number of the search performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
  • the value calculating module 705 may select an action to be performed from a preset set of actions randomly.
  • the vector approximate matching search may be done by adopting ANN search.
  • the ANN search adopts the combination of a decision tree (e.g., KD tree or BK tree) algorithm and the nearest neighbor graph (NN Graph)
  • the preset set of actions may include the following actions.
  • Action 1 performing search in a decision tree
  • Action 2 performing search in a nearest neighbor graph
  • Action 3 terminating the search.
  • the preset set of actions may include the following actions.
  • Action 1 performing search in a decision tree
  • Action 2-1 performing search in a nearest neighbor graph stored in the memory of the computer;
  • Action 2-2 performing search in a nearest neighbor graph stored in the hard drive of the computer.
  • Action 3 terminating the search.
  • the value calculating module 705 may select an action to be performed from a preset set of actions according to a preset state-action mapping relationship and based on current calculation state according to a preset possibility, or select an action to be performed from a preset set of actions randomly. For example, during the initial training, in order to depend the previous experiences more, the possibility may be set as a relatively large number, e.g., 0.8.
  • one random function may be generated first and when the current value of such random function is 0.8, it may be determined that there is a possibility of 80% that an action to be performed is selected from a preset set of actions according to a preset state-action mapping relationship and based on the current calculation state according to a previous experiences with respect to this enquiry vector, and there is a possibility of 20% that an action to be performed is selected from a preset set of actions randomly, so that it may be guaranteed that the previous experiences may help a lot during the initial training and the deviation may be prevented from being too large.
  • the value calculating module 705 may perform this action and calculate an action reward. Description would be made on the specific calculation on the action reward. Furthermore, the value calculating module 705 may accumulate the action reward of searching actions after one searching action is done so as to obtain the value corresponding to the enquiry vector. Therefore, the value corresponding to each enquiry vector in the training set may be obtained with respect to each enquiry vector in the training set.
  • the mapping relationship updating module 706 may be configured to update the state-action mapping relationship with respect to every potential state in the information searching model 701 by using the value calculated by the value calculating module 705 described above.
  • the state-action mapping relationship in the information searching model 701 may be updated according to the value obtained upon the vector approximate matching search is performed in the information searching model with respect to the enquiry vector in the training set.
  • mapping relationship updating module 706 may be further configured to select and determine an action from the training set, the action has the highest value when the vector approximate matching search is performed with respect to a preset training set.
  • three actions Al, A2, and A3 may be selected in the set of actions. It may be assumed that, in the state Sl, the average value of the values of the action Al selected for an enquiry vector may be Ml, the average value of the values of the action A2 selected for the enquiry vector may be M2, and the average value of the values of the action A3 selected for the enquiry vector may be M3, the action determining module 706 may select the action with the value, which is highest among Ml, M2, and M3, as the action to be performed corresponding to the state Sl.
  • the potential state may include at least one of the following: a number of the calculation for distance between vectors, a number of the search performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
  • the vector approximate matching search may be done by adopting ANN search.
  • the ANN search adopts the combination of a decision tree (e.g., KD tree or BK tree) algorithm and the nearest neighbor graph (NN Graph)
  • the preset set of actions may include the following actions.
  • Action 1 performing search in a decision tree
  • Action 2 performing search in a nearest neighbor graph
  • Action 3 terminating the search.
  • the preset set of actions may include the following actions.
  • Action 1 performing search in a decision tree
  • Action 2-1 performing search in a nearest neighbor graph stored in the memory of the computer
  • Action 2-2 performing search in a nearest neighbor graph stored in the hard drive of the computer.
  • Action 3 terminating the search.
  • the mapping relationship updating module 706 may be further configured to update the state-action mapping relationship of the information searching model according to the action with highest average value corresponding to each potential state. Therefore, the state-action mapping relationship of the information searching model 701 may be updated according to the action with the highest average value corresponding to each potential state.
  • the state-action mapping relationship may be a mapping table of states and actions, or may be a neural network showing the mapping relationship therebetween, as long as an action to be performed can be obtained according to the state of the environment.
  • the mapping relationship updating module 706 may merely record the value obtained when different actions are performed in various potential states in the state-action mapping relationship rather than updating the state-action mapping relationship of the information searching model according to the action with the highest average value. Therefore, the action with the highest average value corresponding to the current state may be confirmed during a search processing, when the searching for information is conducted by using a trained information searching model.
  • the score calculating module 705 may use the following formular to calculate the score for actions when an action to be performed is performed.
  • Reward is a score of action
  • Wl and W2 are preset parameters
  • Quality is a score of quality of searching
  • Complexity is a score of complexity of searching.
  • corresponding searching actions may be conducted according to the action to be performed so as to obtain the searching candidate vector. Evaluation may be performed on the quality of the obtained searching candidate vector so as to obtain Quality, the score of quality of searching. Furthermore, evaluating may be performed on the complexity of the performed searching action (e.g., according to the time consumed by the searching action or the calculating amount of the searching action), so as to obtain Complexity, the score of complexity of searching. Therefore, a score corresponding to an action may be obtained once the action is performed, and the obtained scores may be accumulated so as to obtain Value, the total score.
  • the value calculating module 705 may confirm the current calculation state by using the candidate vectors obtained when an action to be performed was performed last time.
  • the candidate vectors obtained when the action to be performed was performed last time may affect the average distance between all current candidate vectors and the enquiry vector and the factor whether or not the candidate vectors are updated by the previous searching, and thus the current calculating state may be affected.
  • the score calculating module 705 may calculate the score of action after a plurality of actions to be performed have been performed. Therefore, the calculation step for calculating the score of action may be increased, so that the training may cover larger vector space. For example, the score of action may be calculated every time when five actions have been performed.
  • the training method may include the following steps.
  • the information searching model may include an initial state-action mapping relationship.
  • the state-action mapping relationship may show the correspondence relationship between various calculation states and actions.
  • the training set may include a plurality of enquiry vectors and the searching result candidate vectors corresponding to the enquiry vectors.
  • [00130] S802 calculating a value of each enquiry vector in the training set, which is subjected to a vector approximate matching search performed in the information searching model.
  • the vector approximate matching search performed in the information searching model may be an approximate nearest neighbor search.
  • the step of S803 may further include: determining an action from a preset set of actions, which has the highest average value when the vector approximate matching search is performed with respect to the training set.
  • the preset set of actions may include the actions of performing search in a decision tree; performing search in a nearest neighbor graph; and terminating the search.
  • the preset set of actions may include the actions of performing search in a decision tree; performing search in a nearest neighbor graph stored in the memory of the computer; performing search in a nearest neighbor graph stored in the hard drive of the computer; and terminating the search.
  • the potential states may include at least one of the following: a number of the calculation for distance between vectors, a number of the search performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous search.
  • the step of S803 may further include updating the state-action mapping relationship of the information searching model according to the action with the highest average score corresponding to each potential state.
  • the state-action mapping relationship may be a mapping table of states and actions or a neural network.
  • step of S802 when a vector approximate matching search is performed in the information searching model with respect to each enquiry vector in the training set, the steps as shown in Fig. 9 may be performed circularly until a preset termination condition is met.
  • the vector approximate matching search may include the following steps.
  • step of S802 when a vector approximate matching search is performed in the information searching model with respect to each enquiry vector in the training set, the steps as shown in Fig. 10 may be performed circularly until a preset termination condition is met.
  • the vector approximate matching search may include the following steps.
  • S1002 selecting an action to be performed from a preset set of actions according to a preset state-action mapping relationship and based on the current calculation state according to a preset possibility, or selecting an action to be performed from a preset set of actions randomly.
  • the current calculation state may be determined by using the candidate vectors obtained when the action to be performed was performed last time.
  • the score of action may be calculated by using the following formular.
  • Reward is a score of action
  • Wl and W2 are preset parameters
  • Quality is a score of quality of action
  • Complexity is a score of complexity of action.
  • the score of action may be calculated after a plurality of actions to be performed have been performed.
  • the information searching method may be implemented based on the information searching apparatus, or be implemented separately as a method process, or be designed by other software or hardware, and then be implemented based on the inventive concept herein.
  • the electronic apparatus may be a mobile electronic apparatus, or an electronic apparatus with less mobility or a stationary computing apparatus.
  • the electronic apparatus according to embodiments of the present disclosure may at least include a processor and a memory.
  • the memory may store instructions thereon and the processor may obtain instructions from the memory and execute the instructions to cause the electronic apparatus to perform operations.
  • one or more components or modules and one or more steps as shown in Fig. 1 to Fig. 10 may be implemented by software, hardware, or in combination of software and hardware.
  • the above component or module and one or more steps may be implemented in system on chip (SoC).
  • Soc may include: integrated circuit chip, including one or more of processing unit (such as center processing unit (CPU), micro controller, micro processing unit, digital signal processing unit (DSP) or the like), memory, one or more communication interface, and/or other circuit for performing its function and alternative embedded firmware.
  • processing unit such as center processing unit (CPU), micro controller, micro processing unit, digital signal processing unit (DSP) or the like
  • memory such as center processing unit (CPU), micro controller, micro processing unit, digital signal processing unit (DSP) or the like
  • DSP digital signal processing unit
  • the electronic apparatus 1100 may be a small portable (or mobile) electronic apparatus.
  • the small portable (or mobile) electronic apparatus may be e.g., a cell phone, a personal digital assistant (PDA), a personal media player device, a wireless network player device, personal headset device, an IoT (internet of things) intelligent device, a dedicate device or combined device containing any of functions described above.
  • the electronic apparatus 1100 may at least include a memory 1101 and a processor 1102.
  • the memory 1101 may be configured to store programs. In addition to the above programs, the memory 1101 may be configured to store other data to support operations on the electronic apparatus 1100.
  • the examples of these data may include instructions of any applications or methods operated on the electronic apparatus 1100, contact data, phone book data, messages, pictures, videos, and the like.
  • the memory 1101 may be implemented by any kind of volatile or nonvolatile storage device or their combinations, such as static random access memory (SRAM), electronically 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, disk memory, or optical disk.
  • SRAM static random access memory
  • EEPROM electronically erasable programmable read-only memory
  • EPROM erasable programmable read-only memory
  • PROM programmable read-only memory
  • ROM read-only memory
  • the memory 1101 may be coupled to the processor 1102 and contain instructions stored thereon.
  • the instructions may cause the electronic apparatus 1100 to perform operations upon being executed by the processor 1102, the operations may include: generating an enquiry vector according to an enquiry content;
  • the preset state-action mapping relationship may show the correspondence between various calculating states and the actions to be performed;
  • the state-action mapping relationship may be a mapping table of states and actions, or may be a neural network showing the mapping relationship therebetween.
  • the vector approximate matching search performed in the preset vector database may be an approximate nearest neighbor search.
  • the preset set of action may include: the actions of performing search in a decision tree; performing search in a nearest neighbor graph stored in the memory of the computer; performing search in a nearest neighborhood graph stored in the hard drive of the computer; and terminating the searching.
  • the current calculating state may include at least one of the following: a number of the calculation for distance between vectors, a number of the searching performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
  • the above operations may include:
  • the information searching model may include an initial state-action mapping relationship.
  • the state-action mapping relationship may show the correspondence relationship between various calculation states and actions.
  • the training set may include a plurality of enquiry vectors and the searching result candidate vectors corresponding to the enquiry vectors.
  • the updating the state-action mapping relationship by using the value with respect to each potential state in the information searching model may include:
  • the state-action mapping relationship may include a mapping table of states and actions or a neural network.
  • the vector approximate matching search performed in the preset vector database may be an approximate nearest neighbor search.
  • the preset set of action may include: the actions of performing search in a decision tree; performing search in a nearest neighbor graph; and terminating the search.
  • the preset set of action may include: the actions of performing search in a decision tree; performing search in a nearest neighbor graph stored in the memory of the computer; performing search in a nearest neighbor graph stored in the hard drive of the computer; and terminating the search.
  • the potential state may include at least one of the following: a number of the calculation for distance between vectors, a number of the search performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
  • the score of action may be calculated by using the following formular.
  • Reward is a score of action
  • Wl and W2 are preset parameters
  • Quality is a score of quality of action
  • Complexity is a score of complexity of action.
  • the current calculation state may be determined by using the candidate vectors obtained when the action to be performed was performed last time.
  • the performing the action to be performed and calculating a score of action may include: calculating the score of action after a plurality of actions to be performed have been performed.
  • the electronic apparatus 1100 may further include: a communication unit 1103, a power supply unit 1104, an audio unit 1105, a display unit 1106, chipset 1107, and other units. Only part of units are exemplarily shown in Fig. 11 and it is obvious to one skilled in the art that the electronic apparatus 1100 only includes the units shown in Fig. 11.
  • the communication unit 1103 may be configured to facilitate wireless or wired communication between the electronic apparatus 1100 and other apparatuses.
  • the electronic apparatus may be connected to wireless network based on communication standard, such as WiFi, 2G, 3G, or their combination.
  • the communication unit 1103 may receive radio signal or radio related information from external radio management system via radio channel.
  • the communication unit 1103 may further include near field communication (NFC) module for facilitating short-range communication.
  • NFC near field communication
  • the NFC module may be implemented with radio frequency identification (RFID) technology, Infrared data association (IrDA) technology, ultra wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA Infrared data association
  • UWB ultra wideband
  • Bluetooth Bluetooth
  • the power supply unit 1104 may be configured to supply power to various units of the electronic device.
  • the power supply unit 1104 may include a power supply management system, one or more power supplies, and other units related to power generation, management, and allocation.
  • the audio unit 1105 may be configured to output and/or input audio signals.
  • the audio unit 1105 may include a microphone (MIC).
  • the MIC When the electronic apparatus in an operation mode, such as calling mode, recording mode, and voice recognition mode, the MIC may be configured to receive external audio signals.
  • the received audio signals may be further stored in the memory 1101 or sent via the communication unit 1103.
  • the audio unit 1105 may further include a speaker configured to output audio signals.
  • the display unit 1106 may include a screen, which may include liquid crystal display (LCD) and touch panel (TP). If the screen includes a touch panel, the screen may be implemented as touch screen so as to receive input signal from users.
  • the touch panel may include a plurality of touch sensors to sense touching, sliding, and gestures on the touch panel. The touch sensor may not only sense edges of touching or sliding actions, but also sense period and pressure related to the touching or sliding operations.
  • the above memory 1101, processor 1102, communication unit 1103, power supply unit 1104, audio unit 1105 and display unit 1106 may be connected with the chipset 1107.
  • the chipset 1107 may provide interface between the processor 1102 and other units of the electronic apparatus 1100. Furthermore, the chipset 1107 may provide interface for each unit of the electronic apparatus 1100 to access the memory 1101 and communication interface for accessing among units.
  • one or more modules, one or more steps, or one or more processing procedures involved in Figs. 1 to 12 may be implemented by a computing device with an operating system and hardware configuration.
  • a method including:
  • the preset set of actions includes: the actions of performing search in a decision tree; performing search in a nearest neighbor graph stored in a memory of a computer; performing search in a nearest neighbor graph stored in a hard drive of a computer; and terminating a search.
  • the current calculating state include at least one of the following: a number of calculations for a distance between vectors, a number of the searching performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous search.
  • a method including:
  • the preset set of actions includes: the actions of performing search in decision tree; performing search in nearest neighbor graph stored in a memory of a computer; performing search in nearest neighbor graph stored in a hard drive of a computer; and terminating a search.
  • the potential state includes at least one of the following: a number of calculations for distance between vectors, a number of searching performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
  • N The method according to paragraph G, wherein when a vector approximate matching search is performed in the information searching model with respect to each enquiry vector in the training set, the following steps are performed circularly until a preset termination condition is met:
  • Reward is a score of action
  • Wl and W2 are preset parameters
  • Quality is a score of quality of searching
  • Complexity is a score of complexity of searching.
  • R The method according to paragraph N or O, wherein the performing the action to be performed and calculating a score of action includes: calculating the score of action after a plurality of actions to be performed have been performed.
  • An electronic apparatus including:
  • a memory coupled to the processing unit and containing instructions stored thereon, the instructions cause the electronic apparatus to perform operations upon being executed by the processing unit, the operations include:
  • V The electronic apparatus according to paragraph S, wherein the preset set of actions includes: the actions of performing search in a decision tree; performing search in a nearest neighbor graph; and terminating a searching.
  • the preset set of actions includes: the actions of performing search in a decision tree; performing search in a nearest neighbor graph stored in a memory of a computer; performing search in a nearest neighbor graph stored in a hard drive of a computer; and terminating a searching.
  • the current calculation state includes at least one of the following: a number of the calculation for distance between vectors, a number of the searching performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
  • An electronic apparatus including:
  • a memory coupled to the processing unit and containing instructions stored thereon, the instructions cause the electronic apparatus to perform operations upon being executed by the processing unit, the operations include:
  • the information searching model includes an initial state-action mapping relationship, the state-action mapping relationship showing the correspondence relationship between different calculation states and actions, and the training set includes a plurality of enquiry vectors and searching result candidate vectors corresponding to the plurality of enquiry vectors respectively;
  • Bl The electronic apparatus according to paragraph Y, wherein the vector approximate matching search performed in the information searching model is approximate nearest neighbor search.
  • Cl. The electronic apparatus according to paragraph Z, wherein the preset set of actions includes: the actions of performing search in a decision tree; performing search in a nearest neighbor graph; and terminating a searching.
  • the preset set of actions includes: the actions of performing search in decision tree; performing search in nearest neighbor graph stored in a memory of a computer; performing search in nearest neighbor graph stored in a hard drive of a computer; and terminating a search.
  • the potential state includes at least one of the following: a number of calculations for distance between vectors, a number of searching performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
  • Reward is a score of action
  • Wl and W2 are preset parameters
  • Quality is a score of quality of searching
  • Complexity is a score of complexity of searching.
  • Jl The electronic apparatus according to paragraph Fl or Gl, wherein the performing the action to be performed and calculating a score of action includes: calculating the score of action after a plurality of actions to be performed have been performed.
  • a device including:
  • a vector generating module configured to generate an enquiry vector according to an enquiry content
  • a vector searching module configured to perform vector approximate matching search in a preset vector database, and acquire a candidate vector most approximate to the enquiry vector;
  • a result acquiring module configured to acquire a searching result corresponding to the candidate vector most approximate to the enquiry vector
  • the vector searching module when the vector searching module is performing the vector approximate matching search, the vector searching module is further configured to perform the following steps circulately until a preset termination condition is met:
  • a device including:
  • an training set inputting module configured to input a preset training set into an information searching model to be trained, wherein the information searching model includes an initial state-action mapping relationship, the state-action mapping relationship shows the correspondence relationship between various calculation states and actions, and the training set includes a plurality of enquiry vectors and the searching result candidate vectors corresponding to the enquiry vectors;
  • a value calculating module configured to calculate a value of an enquiry vector in the training set, which is subjected to an vector approximate matching search performed in the information searching model
  • a state-action mapping relationship updating module configured to update the state-action mapping relationship with respect to each potential state in the information searching model by using the value.
  • an implementer may opt for a mainly hardware and/or firmware vehicle; if flexibility is paramount, the implementer may opt for a mainly software implementation; or, yet again alternatively, the implementer may opt for some combination of hardware, software, and/or firmware.
  • Examples of a signal bearing medium include, but are not limited to, the following: a recordable type medium such as a floppy disk, a hard disk drive, a Compact Disc (CD), a Digital Versatile Disk (DVD), a digital tape, a computer memory, etc.; and a transmission type medium such as a digital and/or an analog communication medium (e.g., a fiber optic cable, a waveguide, a wired communications link, a wireless communication link, etc.).
  • a typical data processing system generally includes one or more of a system unit housing, a video display device, a memory such as volatile and non-volatile memory, processors such as microprocessors and digital signal processors, computational entities such as operating systems, drivers, graphical user interfaces, and applications programs, one or more interaction devices, such as a touch pad or screen, and/or control systems including feedback loops and control motors (e.g., feedback for sensing position and/or velocity; control motors for moving and/or adjusting components and/or quantities).
  • a typical data processing system may be implemented utilizing any suitable commercially available components, such as those typically found in data computing/communication and/or network computing/communication systems.
  • any two components so associated can also be viewed as being “operably connected”, or “operably coupled”, to each other to achieve the desired functionality, and any two components capable of being so associated can also be viewed as being “operably couplable”, to each other to achieve the desired functionality.
  • operably couplable include but are not limited to physically mateable and/or physically interacting components and/or wirelessly interactable and/or wirelessly interacting components and/or logically interacting and/or logically interactable components.
  • references in the specification to“an implementation”,“one implementation”, “some implementations”, or“other implementations” may mean that a particular feature, structure, or characteristic described in connection with one or more implementations may be included in at least some implementations, but not necessarily in all implementations.
  • the various appearances of “an implementation”, “one implementation”, or “some implementations” in the preceding description are not necessarily all referring to the same implementations.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present disclosure discloses a technique for generating nearest neighbor searching strategy for vectors based on reinforcement learning. A searching technology using vectors approximate matching may be applied in a searching engine. More particularly, the searching engine may be subjected to a training by suing a reinforcement learning so that a mapping relationship between a calculation state and a behavior action may be obtained. The searching engine may automatically generate a searching strategy for an enquiry content by using the mapping relationship.

Description

APPROXIMATE NEAREST NEIGHBOR SEARCHING STRATEGY
GENERATING BASED ON REINFORCEMENT LEARNING
BACKGROUND
[001] With the development of the internet technology, the searching engine now has more and more various functions and the contents to be searched are more and more rich. The searching engine may provide information to various applications and is a service necessary to a lot of applications. In the period in which the information is growing fast, there may be a large amount of information such as webpage documents and images, and the amount of the webpage documents and the images are being increased. It is always a challenge in current searching engine technology to implementa a searching service, which can understand the intention of a user more quickly, more efficiently, and more accurately.
BRIEF SUMMARY
[002] The embodiments of the present disclosure are provided to give a brief introduction to some concepts, which would be further explained in the following description. This Summary is not intended to identify essential technical features or important features of the subject as claimed nor to limit the scope of the subject as claimed.
[003] The embodiments of the present disclosure may provide a technique for generating nearest neighbor searching strategy for vectors based on reinforcement learning. A searching technology using vectors approximate matching may be applied in a searching engine. More particularly, the searching engine may be subjected to a training by using a reinforcement learning so that a mapping relationship between a calculation state and a behavior action may be obtained. The searching engine may automatically generate a searching strategy for an enquiry content by using the mapping relationship.
The above description is merely a brief introduction of the technical solutions of the present disclosure, so that the technical means of the present disclosure may be clearly understood, and implemented according to the description of the specification, and the above and other technical objects, features and advantages of the present disclosure may be more obvious based on the embodiments of the present disclosure as follows.
BRIEF DESCRIPTION OF THE DRAWINGS
[004] Fig. 1 is a block diagram showing an information searching apparatus according to the embodiments of the present disclosure;
[005] Fig. 2 is a schematic diagram showing a structure of indexes of a spatial partition tree according to the embodiments of the present disclosure;
[006] Fig. 3 is a schematic diagram showing a structure of indexes of a nearest neighbor graph according to the embodiments of the present disclosure;
[007] Fig. 4 is a schematic diagram showing a combination structure of combined indexes of a spatial partition tree and a nearest neighbor graph according to the embodiments of the present disclosure;
[008] Fig. 5 is a schematic flowchart showing an information searching method according to the embodiments of the present disclosure;
[009] Fig. 6 is a shematic flowchart showing a vector approximate matching searching performed in a preset vector database according to the embodiments of the present dislcousre;
[0010] Fig. 7 is a schematic block diagram showing a training apparatus with the information searching model applied therein according to the embodiments of the present disclosure;
[0011] Fig. 8 is a shematic flowchart showing a training method of the information searching model according to the embodiments of the present disclosure;
[0012] Fig. 9 is a schematic flowchart showing a vector approximate matching search performed in the information searching model with respect to an enquiry vector in a training set according to the embodiments of the present disclosure;
[0013] Fig. 10 is a schematic flowchart showing a vector approximate matching search performed in the information searching model with respect to an enquiry vector in a training set according to the embodiments of the present disclosure; and
[0014] Fig. 11 is a structural block diagram of an exemplary electronic apparatus.
DETAILED DESCRIPTION
[0015] In the following, description will be given in detail on the exemplary embodiments of the present disclosure, in connection with the accompanying drawing. Although drawings show the exemplary embodiments of the present disclosure, it should be appreciated that the present disclosure may be implemented in various ways without being limited by the embodiments set forth herein. On the contrary, these embodiments are provided for thorough understanding of the present disclosure, and completely conveying the scope of the present disclosure to the skills in the art.
[0016] The following description sets forth various examples along with specific details to provide a thorough understanding of claimed subject matter. It will be understood by those skilled in the art, however, the claimed subject matter may be practiced without some or more of the specific details disclosed herein. Further, in some circumstances, well-known methods, procedures, systems, components and/or circuits have not been described in detail in order to avoid unnecessarily obscuring claimed subject matter.
[0017] In the following detailed description, reference is made to the accompanying drawings, which form a part hereof.
[0018] In the drawings, similar symbols typically identify similar components, unless context dictates otherwise. The illustrative embodiments described in the detailed description, drawings, and claims are not meant to be limiting. Other embodiments may be utilized, and other changes may be made, without departing from the spirit or scope of the subject matter presented here.
[0019] It will be readily understood that the aspects of the present disclosure, as generally described herein, and illustrated in the figures, can be arranged, substituted, combined, and designed in a wide variety of different configurations, all of which are explicitly contemplated and make part of this disclosure.
[0020] The term "technique", as cited herein, for instance, may refer to system(s), method(s), computer-readable instructions, module(s), algorithms, hardware logic (e.g., Field-programmable Gate Arrays (FPGAs), Application-specific Integrated Circuits (ASICs), Application-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs)), and/or other technique(s) as permitted by the context above and throughout the document.
Overview [0021] The embodiments of the present disclosure may provide a technique for generating a vector nearest neighbor searching strategy based on reinforcement learning.
[0022] The technology of searching engine has been widely used in various fields. The searching engine may be not only used in a normal way of accessing webpage, the searching engine may be but also associated with various APP (applications) so as to provide various information searching services to users.
[0023] A user may send an enquiry request to a searching engine, and the searching engine may perform searching in the stored information, such as webpage documents and images according to the enquiry content contained in the enquiry request, so as to acquire information matched with the enquiry content of the user and return the acquired information to the user. The searching engine may not only perform searching on the webpage documents, but also perform searching on other kinds of documents, such as message documents, data documents. In the present disclosure, description would be made on the webpage document as an example.
[0024] Currently, the processing of searching for documents may mostly made based on a way of symbol matching. An internet searching engine may commonly use a mode of acquiring relavent documents related to some enquiry content by the symbol matching method based on the inverted index of keywords. The current searching method based on symbol matching cannot understand the intention of a user well. Although in some searching engines, the input original enquiry may be subjected to some changing processing and then a searching processing may be conducted so as to increase the recall ratio, such changing may be very limited.
[0025] The documents searching technology based on vector nearest neighbor searching proposed in the embodiments of the present disclosure may convert a document in a searching engine to a document vector in a form of semantic vector and convert the enquiry content input by a user into an enquiry vector in a form of semantic vector, and then the searching engine may conduct a vector-based approximate matching search for a document vector approximate to the enquiry vector, i.e., the inner product between the document vector and the enquiry vector is small, in a vector database including a plurality of document vectors obtained by converting a plurality of documents. Finally, the searching engine may obtain a document corresponding to the found document vector and return the obtained document as an enquiry result to the user.
[0026] More particularly, the vector approximate matching search described above may be particularly adopt a technology of approximate nearest neighbor search (ANN). Since both the document and the enquiry are converted to be in a form of semantic vectors, the document to be recalled may be determined according to the similarity between the enquiry vector and the document vector. In such a way, there would be no limitation caused by the searching method based on symbol matching and the intention of a user may be understood better.
[0027] The whole procedure of vector approximate matching search may include a series of searching actions and the whole procedure may be regarded as an action sequence. In order to acquire better searching result, it may be necessary to make a reasonable searching action sequence. In the information searching processing according to the embodiments of the present disclosure, before each searching action, the searching action to be performed in the next step may be determined according to the current state, i.e., a suitable searching action may be selected from a preset set of actions according to the current state of environment.
[0028] More particularly, an action to be performed may be determined based on the mapping relationship between states and actions and thus the action to be performed may be determined from a set of actions based on current state. Upon the action is done, the environment may be changed to be in a new state. At this time, an action to be performed next may be determined from the set of actions based on the new state. Such procedure of determination on the actions to be performed may be repeated until a preset termination condition is met. For example, an action corresponding to the current state of environment may be an action of terminating a search according to the mapping relationship between states and actions.
[0029] Furthermore, a technology of performing training on a searching engine by reinforcement learning is proposed in the embodiments of the present disclosure.
[0030] The technology of reinforcement learning is to construct a controlling strategy so that the performance of the actions of the executive subject is maximum. An executive subject may monitor some signals of the environment and acknowledge the state of current environment according to such signals. The executive subject may improve the performance of itself by learning and make a selection on the actions so as to make a selection on group actions. The selection on individual actions and the selection on group actions may cause the executive subject to make a decision to select some action so as to further influence the environment.
[0031] In the training scheme proposed in the embodiments of the present disclosure, a training set data may be provided in advance. There may be a large amount of enquiry vectors and searching result candidate vectors corresponding to the enquiry vectors respectively contained in the training set. An enquiry vector may be first input to a searching engine to be trained. As described above, a searching result corresponding to each enquiry vector may be finally obtained after the enquiry vector has been subjected to a series of searching actions in the searching engine. Therefore, when the environment is in some state, each enquiry vector in the training set may be subjected to a series of actions before the searching result thereof is obtained finally. Therefore, calculation may be made on the value for different actions performed after the current state. Based on the idea of reinforcement learning, the value of various enquiry vectors may be used to train the mapping relationship between states and actions. For example, the training may be performed by using the manner based on value or the manner of policy gradient.
[0032] For example, when a value-based method is used for training, when the processing on all enquiry vectors have been done, average value for different actions performed after the state may be obtained by statistics, so that an action with highest average value may be selected as the action corresponding to the state and thus a mapping relationship between states and actions may be formed.
[0033] Detailed description would be made on the exemplary examples of above technology of generating vector nearest neighbor searching strategy based on reinforcement learning.
[0034] As shown in Fig. 1, which is a block diagram 100 showing an information searching apparatus according to the embodiments of the present disclosure, the information searching apparatus 101 may be implemented as a server in an internet or provided in a server in the internet, and the server may be implemented by one or more computer systems (distributed server), or may be implemented as a server based on cloud. Such server may be connected with a user terminal via internet, receive an enquiry request input via the user terminal and generate an enquiry result upon being subjected to the processing of the information searching apparatus so as to return the enquiry result to the user terminal. The user terminal cited herein may be a notebook computer or desktop computer connected with the above server in communication via mobile network or wired network, or a small portable (or mobile) electronic apparatus (e.g., tablet computer, smart phone, personal digital assistant (PDA), media player device, wireless network player device, personal headset device, dedicate device or combined device containing any of functions described above).
[0035] Furthermore, the information searching apparatus 101 shown in the figures may be implemented as a small portable (or mobile) electronic apparatus. The small portable (or mobile) electronic apparatus may be e.g., a cell phone, a personal digital assistant (PDA), a personal media player device, a wireless network player device, personal headset device, an IoT (internet of things) intelligent device, a dedicate device or combined device containing any of functions described above. The information searching apparatus 101 may be further implemented as or provided in a notebook computer or a desktop computer.
[0036] In an exemplary example of application scenario, the information searching apparatus 101 shown in Fig. 1, the information searching apparatus 101 shown in Fig. 1 may be provided in a server 102 in the internet. The server 102 may be connected with a user terminal 104 in communication via internet 103 so as to provide the searching services to the user. The information searching apparatus 101 may include a vector generating module 105, a vector searching module 106, and a result acquiring module 107. Furthermore, a vector database 108 may be provided in the server 102 to store the document vectors for searching. The vector database 108 may be provided outside the server 102, and the server 102 may access the vector database 108 via the communication network. The vectors stored in the vector database 108 may consist a vector space where the vector searching described in the embodiments of the present disclosure is conducted. Vector generating module 105
[0037] The vector generating module 105 may be configured to generate an enquiry vector according to an enquiry content. A user may input a content as an enquiry into the user terminal 104. The content may be transmitted to the server 102 via the internet 103. Then, the content may be subjected to the processing by the vector generating module 105 of the information searching apparatus 101 in the server 102 so that the content may be vectorized.
[0038] As the development of the vectorizing technology, various kinds of documents may be converted into vectors so that the vector-based searching may have a technical foundation. The vectorizing technology may have the advantages that not only the content of a document, but also the whole document may be expressed by the feature elements in a plurality of dimensions, so that the comparison on the similarity between vectors may be conducted more accurately and flexibly. The distance between vectors may show the similarity between the documents corresponding to the vectors. Compared with the traditional searching method based on symbol matching, the searching method based on vectors may have more flexibility and accuracy. The distance between vectors as cited herein may refer to the Euler distance, Cosine similarity and so on. Furthermore, it should be noted that, in the embodiments of the present disclosure, the expression of“document” may refer to various kinds of information or data unit, which is vectorizable and may be used as a searching object, such as text document, webpage document, image, data, message or the like.
Vector Searching Module 106
[0039] The vector searching module 106 may be configured to perform vector approximate matching search in a preset vector database 108 to acquire a candidate vector closest to the enquiry vector. The vector approximate matching search may particularly adopt the approximate nearest neighbor search (ANN).
[0040] Document vectors for searching may be stored in the vector database 108 in advance. A candidate vector closest to the enquiry vector may be found in the vector database by the processing of vector approximate matching search. When the vector searching module 106 is performing the vector approximate matching search, the following steps may be performed circularly, until a preset termination condition is met.
[0041] Firstly, the vector searching module 106 may determine the current calculation state. And the current calculation state may include the contents which would be described detailedly below.
[0042] Then, the vector searching module 106 may determine an action to be performed among the preset set of actions based on the determined current calculation state described above according to a preset state-action mapping relationship. The preset state-action mapping relationship may show the correspondence between the states of the environment (i.e., calculating state) and the actions to be performed (i.e., searching actions). That is to say, the state-action mapping relationship may record the correspondence between the states and the actions. When the environment is in a state, it may be determined which action should be performed in the next step according to the state-action mapping relationship. Such state-action mapping relationship may be a mapping table of states and actions, or a neural network showing the mapping relationship between the states and the actions as long as the action to be performed can be determined according to the state of the environment.
[0043] As described above, the vector approximate matching search may particularly adopt the approximate nearest neighbor search (ANN). Description would be made on the approximate nearest neighbor searching algorithm, which combines the Spatial Partition Trees and Neighborhood Graph. Such approximate nearest neighbor search can improve the efficiency of vector searching. More particularly, the Spatial Partition Trees may be a decision tree, such as KD tree or a BK tree.
[0044] Such vector searching algorithm may establish indexes for the vectors in the vector space in a structure of Spatial Partition Trees and Neighborhood Graph. More particularly, the index esblished in a form of Spatial Partition Trees may be referred as a spatial partition tree index, and the index esblished in a form of Neighborhood Graph may be referred as a neighborhood graph index.
Spatial Partition Trees Indexes
[0045] The spatial partition trees indexes may be a coarse-grained partition on vectors in a vector space. More particularly, vectors in the vector space may be clustered to form a plurality of child vector spaces. Each leaf node of spatial partition trees indexes may be corresponding to one child vector space. Each leaf node may store therein a central vector of child vector space corresponding thereto or a vector identification of a central vector. In the case that the spatial partition trees indexes are in a structure of multilayer tree, each intermediate node may be corresponding to one child vector space, and the child vector space corresponding to an intermediate node as a parent node may contain the child vector space corresponding to a leaf node or an intermediate node as a child node. The intermediate node may store a central vector of the child vector space corresponding thereto or a vector identification of a central vector therein.
[0046] Based on the structure of spatial partition trees indexes described above, during the search processing, a query vector may be compared with the intermediate node and the central vector corresponding to the leaf node layer by layer to calculate a distance between a query vector and the central vector. Then the calculation may be conducted downward layer by layer according to a preset search condition till the child vector space corresponding to one or more leaf node is positioned and a central vector stored in that one or more leaf node is obtained.
[0047] The structure of the spatial partition trees indexes may be as shown in Fig. 2, which is a structural diagram 200 showing spatial partition trees indexes of embodiments of the present disclosure. The nodes in the spatial partition trees indexes may be corresponding to different vector spaces respectively. More particularly, the root node 201 may correspond to the whole vector space, and the nodes other than the root node 201 may correspond to the child vector spaces in the vector space. The spatial partition trees indexes may only include the root node 201 and leaf nodes 203, or may include the root node 201, at least one layer of intermediate nodes 201, and the leaf nodes 203. The structure as shown in Fig. 2 may be the case that a plurality of layers of intermediate nodes are included. Only three layers of nodes are shown in Fig. 2, but it is obvious to one skilled in the art that, the number of layers of nodes may be increased according to practical needs, and the number of nodes in one layer may be increased according to practical needs. Each of the intermediate nodes 202 and the leaf nodes 203 may correspond to different child vector spaces respectively, and the child vector space corresponding to the intermediate node 202 as the parent node may include a child vector space corresponding to the leaf node 203 or an intermediate node 202 as the child node. The intermediate node 202 and the leaf node 203 may store therein a central vector 204 of the child vector space corresponding thereto or a vector identification of the central vector 204. In the vector search processing based on spatial partition trees indexes, a vector distance between the query vector and the central vectors 204 of the child vector spaces corresponding to the intermediate nodes 202 of each layer may be calculated layer by layer, so as to narrow the range of the child vector space layer by layer till the leaf node 203. Then, one or more leaf nodes 203 most approximate to the query vector may be determined according to the vector distances between the query vector and the central vectors 204 corresponding to the leaf nodes 203.
[0048] The spatial partition trees indexes described above may be generated by clustering vectors in the vector space. More particularly, a plurality of child vector spaces may be generated by clustering processing on the vectors, and the central vectors of each child vector space may be obtained. Then, the central vectors or vector identifications of the central vectors may be stored in the spatial partition trees indexes.
Neighborhood Graph Indexes
[0049] The neighborhood graph indexes may be indexes established on the vectors in a vector space in a form of graph. More particularly, each point in the neighborhood graph indexes may be corresponding to one vector in the vector space. In embodiments, RNG (Relative Neighborhood Graph) may be adopted to establish the neighborhood graph indexes. The characteristic of the RNG may be as follows: one point p and another point q may be connected by using edges in the case that there is no a third point r whose distance to either of these two points of p and q is smaller than the distance between these two points of p and q, so that a group of points may be defined on an Euclidean plain. Based on such principle, indexes may be established with respect to the vectors in the whole vector space so as to form the neighborhood graph indexes.
[0050] The connection relationship (edge relationship) among points in the neighborhood graph indexes may show the distance relationship among the vectors corresponding to the points respectively. For any point, the point having the connection relationship of edges may be referred as neighborhood point, and the vectors corresponding to these neighborhood points may be referred as the neighborhood vectors of the vector corresponding to any point described above. Each point in the neighborhood indexes may store a vector identification of the vector corresponding to this point and a vector identification of the vector corresponding to the neighborhood points adjacent thereto. As an alternative embodiment, in the case that the resources for storing is adequate, the vector corresponding to this point and/or the vectors corresponding to the neighborhood points in each point of the neighborhood graph indexes directly.
[0051] According to the structure of neighborhood graph indexes described above, during the searching processing, iterative calculation on vector distance may be conducted with K neighborhood vectors of one or more central vectors obtained by the searching based on the spatial partition trees search as seeds, so as to obtain one or more vectors most approximate to the query vector.
[0052] As shown in Fig. 3, which is a schematic diagram 300 showing a structure of indexes of a neighbour graph according to the embodiments of the present disclosure, each point in Fig. 3 may represent a vector in a vector space, and the line between any two points may represent the neiborhood relationship between the two points. Each point in the neighborhood graph index may store a vector identification of the vector corresponding thereto and a vector identification of a neighbor vector corresponding to a neiborhood point of the point therein, and thus it may be convenient ato obtain the vector identification of the neighborhood point of any point when the any point is determined, so that the subsequent vector distance iterative calculation may be performed. In other examples, when the storage resources are adequet, vectors of the neighborhood points of each point may be stored in the each point, so that the processing of acquiring vector by using the vector identification may be omitted during the vector distance iterative calculation, so that the efficiency of vector distance iterative calculation may be improved. Furthermore, the neighborhood graph indexes as shown in Fig. 3 may be established based on the vectors of the whole vector space without being limited by the spatial partition tree indexes shown in Fig. 2. In storage, the neighborhood graph indexes and the spatial partition indexes may be stored separately. [0053] The vector search based on the neighborhood graph indexes may obtain one or more vectors most approximate to the query vector as search results mainly by continuously performing vector distance iterative calculations on the vectors in the child vector space and the query vector. The vector distance iterative calculation of each turn may be extended along the neighborhood relationship of the points in the first neighborhood graph indexes, and one or more vectors most approximate to the query vector may be recorded. As the vector distance iterative calculations go on, the vectors most approximate to the query vector may be updated. The vector distance iterative calculations may be terminated after preset turns, and the recorded result may be output as a search result.
[0054] It is necessary for the vector distance iterative calculations described above to select some starting points in the child vector spaces as seeds to be used as the vectors where the vector distance iterative calculation is started. When one or more leaf nodes are determined by the spatial partition trees search module 105, the child vector spaces for the first neighborhood graph search processing module 106 to perform the vector search based on the first neighborhood graph indexes is determined at the same time. In the vector search processing, central vectors corresponding to the leaf nodes described above may be used to determine the seeds for the vector distance iterative calculation. More particularly, one or more neighborhood vectors in the first neighborhood graph indexes corresponding to the central vectors described above may be used as the seeds for the vector distance iterative calculation, i.e., the starting points for the vector distance iterative calculation of the first turn.
[0055] In the vector distance iterative calculations, a priority queue may be maintained, and the priority queue may store the calculation results of the distances between the vectors in the child vector spaces, which are involved in the calculations, and the query vector according to the order of the value of the distance. When a vector distance iterative calculation for one turn is completed, one or more vectors most approximate to the query vector may be selected, and preset number (e.g., K) of neighborhood vectors of that vector may be used as the targets of vector distance iterative calculation for the next turn. After the vector distance iterative calculation for each turn is completed, the priority queue may be dynamically adjusted so that the vector most approximate to the query vector is on the top.
[0056] During the neighborhood graph search processing, the vector distance iterative calculations described above may be performed on child vector spaces corresponding to one or more leaf nodes output by the spatial partition trees search processing module 105, to generate one or more vectors most approximate to the query vector with respect to each child vector space. In addition, comprehensive ranking may be performed on the one or more vectors in each child vector space, which are most approximate to the query vector as described above, so as to select one or more first vectors most approximate to the query vector as search results to be output.
Processing of Combined Indexes
[0057] In the searching processing based on the combination of partial partition trees indexes and neighborhood graph indexes of embodiments of the present disclosure, coarse-grained positioning may be first conducted based on the spatial partition trees indexes, and then precise search may be conducted based on neighborhood graph indexes. Bing benefit from the small amount of the data of the spatial partition trees indexes, a query vector may be quickly positioned to a specific child vector space so as to complete a coarse-grained search. Then, a precise vector search may be conducted with the neighborhood graph indexes. More particularly, a multi-turns vector distance iterative calculation may be conducted based on neighborhood graph indexes, so as to acquire one or more vectors most approximate to the query vector.
[0058] With such searching solution, characteristic of the spatial partition trees and neighborhood graph may be effectively combined so that the searching efficiency and quality of the search results may be better improved. On one hand, compared with the vector searching method only based on the neighborhood graph indexes, the spatial partition trees indexes may quickly position the query vector to a suitable child vector space, so as to avoid the conducting of a vector distance iterative calculation in the whole neighborhood graph indexes. On the other hand, the neighborhood graph indexes may eliminate the regional limitation of spatial partition trees indexes. In the embodiments of the present disclosure, the neighborhood graph indexes may be constructed with respect to the vectors in the whole vector space, and the connection relationship among points in the neighborhood graph indexes may be not limited by the set range of leaf nodes in the spatial partition trees indexes. Therefore, when there is a query vector falling on an edge of the border of child spaces, the regional limitation of the spatial partition trees indexes may be eliminated by using a structure of the neighborhood graph indexes, so as to find more preferable approximate vectors.
[0059] Fig. 4 is a schematic diagram 400 showing combined architecture of spatial partition trees indexes and neighborhood graph indexes of embodiments of the present disclosure. In Fig. 4, a structure in a tree form on the top of the figure is spatial partition trees indexes 401, which may include a root node 201, intermediate nodes 202, and leaf nodes 203. A structure in a planar topology form on the bottom of the figure may be neighborhood graph indexes 402, which may be a neighborhood graph consisted of a plurality of points and corresponding to the whole vector space. In order to show the relationship between the neighborhood graph indexes 402 and the spatial partition trees indexes 401, the child vector space 403 corresponding to each leaf node 203 is identified in ellipse, and the child vector space 403 and the leaf nodes 203 are connected with dash lines.
[0060] In the embodiments of the present disclosure, a coarse-grained search may be performed by using the spatial partition trees indexes 401, so that a quick coarse-grained vector positioning may be done. After one or more child vector space 403 are determined, a search processing based on the neighborhood graph indexes 402 may be further performed. In the search processing of the spatial partition trees indexes 401, central vectors of the positioned child vector space may be obtained, so as to provide seeds for the search processing. The efficiency of vector search may be significantly improved by using the spatial partition trees indexes 401 and the neighborhood graph indexes 402 in combination. Furthermore, the generation of the neighborhood graph indexes 402 is not limited by the spatial partition trees indexes 401. In the search processing performed by the neighborhood graph search processing module 106, the processing may not be affected by the partition on the child vector spaces 403 by the spatial partition trees indexes 401. When the query vector falls on the edge of the child vector space 403, the vector distance iterative calculation may be extended to other child vector spaces 403 by breaking through the boundary of the child vector space 403 with a structure of the first neighborhood graph indexes 402, so that vectors more approximate to the query vector may be found.
Applications of Memory and Hard drive in storing vector indexes
[0061] In practical implementation, storage resources such as memory and hard drive may be utilized based on the above technical idea, so as to further improve the technical solution of vector search. The hard drive described above may be traditional disk medium or storage medium such as solid state divers (SSD).
[0062] More particularly, two kinds of neighborhood graph indexes may be established. For convenience of description, these two kinds of neighborhood graph indexes may be referred as first neighborhood graph index and second neighborhood graph index respectively. The first neighborhood graph indexes described above may only correspond to part of vectors in the vector space, and the part of vectors as cited herein may refer to vectors of high quality selected from the whole vector space, and these vectors may be exemplary or representative. Besides, a second neighborhood graph indexes may be established, and may correspond to all vectors in the vector space. Therefore, an index structure of three layers may be constructed, including a spatial partition trees indexes, a first neighborhood graph indexes and a second neighborhood graph indexes. The spatial partition trees indexes may be obtained by performing coarse-grained partition on the vectors in the vector space, and the first neighborhood graph indexes may be obtained by performing a further coarse-grained partition on the vectors in the vector space. The coarse-grained partition processing in two layers may position the query vector to a suitable position of the second neighborhood graph indexes constructed based on all vectors more accurately, so that the vector distance iterative calculation based on neighborhood graph indexes may be performed more efficiently.
[0063] Based on the structure of indexes described above, the spatial partition trees indexes and the first neighborhood graph indexes may need relatively small storage space since they only involve part of vectors in the vector space and thus they may be stored in the memory. The second neighborhood graph indexes are established based on all vectors in the vector space, and thus have a large amount of data and have to be stored in the hard drive. In some cases, if the vectors recorded in the first neighborhood graph indexes are matched with the query vector well, the vectors recorded in the first neighborhood graph indexes may be output directly as search results. More particularly, a threshold for vector distance may be set for determining the matching degrees between the vectors recorded in the first neighborhood graph indexes and the query vector, so as to determine whether or not it is necessary to perform a vector search based on the second neighborhood graph indexes.
[0064] In the technical solution described above, the spatial partition trees indexes and the first neighborhood graph indexes stored in the memory may take some of searching jobs so that the accessing to the hard drive may be decreased. Even in the case that it is necessary to access the hard drive to perform a search processing based on the second neighborhood graph indexes, because one or more first vectors have been obtained by the first neighborhood graph indexes, in the vector search processing based on the second neighborhood graph indexes, the one or more first vectors may be directly used as seeds for the search processing, so as to obtain one or more second vectors most approximate to the query vector more efficiently.
[0065] Description has been made on the examples of implementation of ANN algorithm. In the embodiments of the present disclosure, description would be made with the ANN searching algorithm combining the decision tree (e.g., KD tree or BK tree) with the nearest neighbor graph (NN Graph) as an example. Based on such searching algorithm, the preset set of actions may include the following actions.
[0066] Action 1 : performing search in a decision tree;
[0067] Action 2: performing search in a nearest neibor graph; and
[0068] Action 3 : terminating the searching.
[0069] Furthermore, when the nearest neighbor graph is stored in the memory and the hard drive of a computer respectively, the preset set of actions may include the following actions.
[0070] Action 1 : performing search in a decision tree;
[0071] Action 2-1 : performing search in a nearest neighbor graph stored in the memory of the computer; [0072] Action 2-2: performing search in a nearest neighbor graph stored in the hard drive of the computer; and
[0073] Action 3 : terminating the searching.
[0074] When the action to be performed is determined in the preset set of actions, the vector searching module 106 may perform the action to be performed and collect the candidate vectors found by the searching based on the performed actions. When the action is performed, the environment is changed to be in the next state. At that time, the vector searching module 106 may determine the current calculation sate again, so that the above procedure may be repeated until a preset termination condition is met. As described above, the preset set of actions may include an action for terminating the searching (Action 3), and thus when the environment is in some state, the searching may be terminated according to the preset state-action mapping relationship. Furthermore, the preset termination condition may be processed so that a processing of evaluation may be performed on the found candidate vectors until a preset condition is met. Furthermore, the termination condition may further consider the time taken by the whole procedure of searching or the number of the searching actions which have been performed.
[0075] The current calculation state described above may include at least one of the following: a number of the calculation for distance between vectors, a number of the searching performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching. It can be seen that, the current calculation state may be a combination of the calculation environment signals described above. For example, the state A may include: a number of the calculation for distance between vectors is 15, a number of the searching performed in the decision tree is 10, an average distance between all the current candidate vectors and the enquiry vector is 0.2, and the candidate vectors are updated by the previous searching; while the state B may include: a number of the calculation for distance between vectors is 20, a number of the searching performed in the decision tree is 15, an average distance between all the current candidate vectors and the enquiry vector is 0.15, and the candidate vectors are updated by the previous searching. That is to say, two states may be regarded as two different states, as long as at least one of the parameters contained in one of the two states is different from the parameters contained in the other state of the two states. Therefore, the vector searching module 106 may determine which searching actions should be performed according to the state of the environment in order that a candidate vector with higher quality may be found and the searching efficiency may be improved.
Result Acquiring Module 107
[0076] The result acquiring module 107 may be configured to acquire the searching result corresponding to the candidate vector most approximate to the enquiry vector. Based on the found one (or more) candidate vector(s) most approximate to the enquiry vector, the documents corresponding thereto may be acquired and transmitted as the searching result to a user terminal 104 via internet 103.
[0077] Therefore, an action to be performed corresponding to the current state may be found according to the preset state-action mapping relationship and performed, and such procedure may be repeated so that a series of searching actions may be automatically generated for any enquiry input by a user so as to perform searching for related document content.
Illustrative Environment
[0078] The environment described below may merely construct an example without limiting claims of the present disclosure to any specific operating environment and other environment may be used without departing from the spirit and range as claimed by the present disclosure.
[0079] As shown in Fig. 5, which is a schematic flowchart showing an information searching method according to the embodiments of the present disclosure, the information searching method may include the following steps.
[0080] S501, generating an enquiry vector according to an enquiry content.
[0081] S502, performing vector approximate matching search in a preset vector database, and acquiring a candidate vector most approximate to the enquiry vector. More particularly, an approximate nearest neighbor search may be performed as the vector approximate matching search performed in the preset vector database.
[0082] S503, acquiring a searching result corresponding to the candidate vector most approximate to the enquiry vector.
[0083] When a vector approximate matching search is performed in the above step of S502, the steps as shown in Fig. 6 may be performed circulately until a preset termination condition is met.
[0084] As shown in Fig. 6, which is a schematic flowchart showing a vector approximate matching search performed in a preset vector database according to the embodiments of the present disclosure, the vector approximate matching search as shown in Fig. 6 may include the following steps.
[0085] S601, determining the current calculation state. The current calculation state may at least one of the following: a number of the calculation for distance between vectors, a number of the search performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous search.
[0086] S602, determining an action to be performed from a preset set of actions based on the current calculation state according to a preset state-action mapping relationship. The preset state-action mapping relationship may show the correspondence between various calculation states and the actions to be performed. Such state-action mapping relationship may be a mapping table of states and actions or a neural network showing the mapping relationship between the states and the actions. Furthermore, the preset set of actions may include performing search in a decision tree, performing search in a neighborhood graph, and terminating searching. Alternatively, the preset set of actions may include performing searching in a decision tree, performing search in a neighborhood graph stored in the memory of a computer, performing search in a neighborhood graph stored in the hard drive of a computer, and terminating search.
[0087] S603, performing the action to be performed, and collecting a candidate vector found based on the action which is performed.
Training Based on Reinforcement Learning
[0088] As shown in Fig. 7, which is a schematic block diagram 700 showing a training apparatus with the information searching model applied therein according to the embodiments of the present disclosure, the training apparatus 702 of the information searching model 701 may be implemented as an off-line computer or a server connected to the internet or provided therein. The server may be implemented in a computer system consisted of one or more computers (i.e., implemented as a distributed server), or implemented as a server based on cloud technology. Furthermore, the training apparatus 702 may be implemented as a notebook computer or a desktop computer or provided therein.
[0089] In an example of application scenario, both the information searching model 701 and the training apparatus 702 thereof as shown in Fig. 7 may be provided in a server 703. The training apparatus 702 may include a training set inputting module 704, a value calculating module 705, and a mapping relationship updating module 706.
Training Set Inputting Module 704
[0090] The training set inputting module 704 may be configured to input a preset training set into an information searching model 701 to be trained. An initial state-action mapping relationship may be preset in the information searching model 701 to be trained, and in such initial state-action mapping relationship, the mapping relationship between each state and each action may be set according to previous experience or may be set randomly. The preset training set may include a plurality of enquiry vectors and a plurality of searching result candidate vectors corresponding to these enquiry vectors respectively. The searching result candidate vectors may be used in verifying a quality of the results found by the information searching model 701 during the training processing, i.e., in determining whether or not the found document content is matched with or approximate to the enquiry content.
Value Calculating Module 705
[0091] The value calculating module 705 may be configured to calculate the value for each enquiry vector obtained after the vector approximate matching searching is performed in the information searching model 701. As described above, the vector approximate matching searching may be conducted by using the ANN search (approximate nearest neighbor search).
[0092] More particularly, when the vector approximate matching search is performed in the information searching model 701 with respect to each enquiry vector in the training set, the value calculating module 705 may be configured to perform the following steps circulately until a preset termination condition is met.
[0093] Firstly, the value calculating module 705 may determine the current calculation state. As described above, the current calculation state may include at least one of the following: a number of the calculation for distance between vectors, a number of the search performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
[0094] Then, according to the embodiments of the present disclosure, the value calculating module 705 may select an action to be performed from a preset set of actions randomly. As described above, the vector approximate matching search may be done by adopting ANN search. When the ANN search adopts the combination of a decision tree (e.g., KD tree or BK tree) algorithm and the nearest neighbor graph (NN Graph), the preset set of actions may include the following actions.
[0095] Action 1 : performing search in a decision tree;
[0096] Action 2: performing search in a nearest neighbor graph; and
[0097] Action 3 : terminating the search.
[0098] Furthermore, when the nearest neighbor graph is stored in the memory and the hard drive of a computer respectively, the preset set of actions may include the following actions.
[0099] Action 1 : performing search in a decision tree;
[00100] Action 2-1 : performing search in a nearest neighbor graph stored in the memory of the computer;
[00101] Action 2-2: performing search in a nearest neighbor graph stored in the hard drive of the computer; and
[00102] Action 3 : terminating the search.
[00103] According to the embodiments of the present disclosure, in some states of environment, it may be known that what kind of searching actions can obtain higher values, therefore, it may be preferably to determine the action to be performed according to such previous experience especially during early training. The value calculating module 705 may select an action to be performed from a preset set of actions according to a preset state-action mapping relationship and based on current calculation state according to a preset possibility, or select an action to be performed from a preset set of actions randomly. For example, during the initial training, in order to depend the previous experiences more, the possibility may be set as a relatively large number, e.g., 0.8. When a vector approximate matching search is performed in the information searching model 701 with respect to an enquiry vector in a training set, one random function may be generated first and when the current value of such random function is 0.8, it may be determined that there is a possibility of 80% that an action to be performed is selected from a preset set of actions according to a preset state-action mapping relationship and based on the current calculation state according to a previous experiences with respect to this enquiry vector, and there is a possibility of 20% that an action to be performed is selected from a preset set of actions randomly, so that it may be guaranteed that the previous experiences may help a lot during the initial training and the deviation may be prevented from being too large.
[00104] Upon the action to be performed is selected, the value calculating module 705 may perform this action and calculate an action reward. Description would be made on the specific calculation on the action reward. Furthermore, the value calculating module 705 may accumulate the action reward of searching actions after one searching action is done so as to obtain the value corresponding to the enquiry vector. Therefore, the value corresponding to each enquiry vector in the training set may be obtained with respect to each enquiry vector in the training set.
Mapping Relationship Updating Module 706
[00105] The mapping relationship updating module 706 may be configured to update the state-action mapping relationship with respect to every potential state in the information searching model 701 by using the value calculated by the value calculating module 705 described above. With the reinforcement learning technology, the state-action mapping relationship in the information searching model 701 may be updated according to the value obtained upon the vector approximate matching search is performed in the information searching model with respect to the enquiry vector in the training set. In the reinforcement learning technology, there may be various methods, which may achieve the above objects. For example, a value-based method or a policy gradient method may be adopted.
[00106] For example, when the training is performed by using the value-based method, the mapping relationship updating module 706 may be further configured to select and determine an action from the training set, the action has the highest value when the vector approximate matching search is performed with respect to a preset training set.
[00107] For example, in some state Sl of environment, three actions Al, A2, and A3 may be selected in the set of actions. It may be assumed that, in the state Sl, the average value of the values of the action Al selected for an enquiry vector may be Ml, the average value of the values of the action A2 selected for the enquiry vector may be M2, and the average value of the values of the action A3 selected for the enquiry vector may be M3, the action determining module 706 may select the action with the value, which is highest among Ml, M2, and M3, as the action to be performed corresponding to the state Sl.
[00108] As described above, the potential state may include at least one of the following: a number of the calculation for distance between vectors, a number of the search performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
[00109] As described above, the vector approximate matching search may be done by adopting ANN search. When the ANN search adopts the combination of a decision tree (e.g., KD tree or BK tree) algorithm and the nearest neighbor graph (NN Graph), the preset set of actions may include the following actions.
[00110] Action 1 : performing search in a decision tree;
[00111] Action 2: performing search in a nearest neighbor graph; and
[00112] Action 3 : terminating the search.
[00113] Furthermore, when the nearest neighbor graph is stored in the memory and the hard drive of a computer respectively, the preset set of actions may include the following actions.
[00114] Action 1 : performing search in a decision tree; [00115] Action 2-1 : performing search in a nearest neighbor graph stored in the memory of the computer;
[00116] Action 2-2: performing search in a nearest neighbor graph stored in the hard drive of the computer; and
[00117] Action 3 : terminating the search.
[00118] Then, the mapping relationship updating module 706 may be further configured to update the state-action mapping relationship of the information searching model according to the action with highest average value corresponding to each potential state. Therefore, the state-action mapping relationship of the information searching model 701 may be updated according to the action with the highest average value corresponding to each potential state.
[00119] As described above, the state-action mapping relationship may be a mapping table of states and actions, or may be a neural network showing the mapping relationship therebetween, as long as an action to be performed can be obtained according to the state of the environment.
[00120] It should be understood that, when a training is performed by using the value-based method, the mapping relationship updating module 706 may merely record the value obtained when different actions are performed in various potential states in the state-action mapping relationship rather than updating the state-action mapping relationship of the information searching model according to the action with the highest average value. Therefore, the action with the highest average value corresponding to the current state may be confirmed during a search processing, when the searching for information is conducted by using a trained information searching model.
[00121] According to the embodiments of the present disclosure, the score calculating module 705 may use the following formular to calculate the score for actions when an action to be performed is performed.
[00122] Reward = WlQuality - W2Complexity
[00123] In the above formular, Reward is a score of action, Wl and W2 are preset parameters, Quality is a score of quality of searching, and Complexity is a score of complexity of searching. [00124] According to the above formular, when the value calculating module 705 is performing the action to be performed, corresponding searching actions may be conducted according to the action to be performed so as to obtain the searching candidate vector. Evaluation may be performed on the quality of the obtained searching candidate vector so as to obtain Quality, the score of quality of searching. Furthermore, evaluating may be performed on the complexity of the performed searching action (e.g., according to the time consumed by the searching action or the calculating amount of the searching action), so as to obtain Complexity, the score of complexity of searching. Therefore, a score corresponding to an action may be obtained once the action is performed, and the obtained scores may be accumulated so as to obtain Value, the total score.
[00125] According to the embodiments of the present disclosure, the value calculating module 705 may confirm the current calculation state by using the candidate vectors obtained when an action to be performed was performed last time. For example, the candidate vectors obtained when the action to be performed was performed last time may affect the average distance between all current candidate vectors and the enquiry vector and the factor whether or not the candidate vectors are updated by the previous searching, and thus the current calculating state may be affected.
[00126] According to the embodiments of the present disclosure, when an actions to be performed is performed and the calculation on the score of the action is performed, the score calculating module 705 may calculate the score of action after a plurality of actions to be performed have been performed. Therefore, the calculation step for calculating the score of action may be increased, so that the training may cover larger vector space. For example, the score of action may be calculated every time when five actions have been performed.
Illustrative Process
[00127] Description has been made on the news conversation processing device above. Explanation would be made on information searching processing method cited herein below.
[00128] As shown in Fig. 8, which is a schematic flowchart showing a training method of the information searching model according to the embodiments of the present disclosure, the training method may include the following steps.
[00129] S801, inputting a preset training set into an information searching model to be trained. The information searching model may include an initial state-action mapping relationship. The state-action mapping relationship may show the correspondence relationship between various calculation states and actions. The training set may include a plurality of enquiry vectors and the searching result candidate vectors corresponding to the enquiry vectors.
[00130] S802, calculating a value of each enquiry vector in the training set, which is subjected to a vector approximate matching search performed in the information searching model. The vector approximate matching search performed in the information searching model may be an approximate nearest neighbor search.
[00131] S803, updating the state-action mapping relationship by using the value obtained by the calculation performed in the step of S802 with respect to each potential state in the information searching model.
[00132] According to the embodiments of the present disclosure, the step of S803 may further include: determining an action from a preset set of actions, which has the highest average value when the vector approximate matching search is performed with respect to the training set.
[00133] The preset set of actions may include the actions of performing search in a decision tree; performing search in a nearest neighbor graph; and terminating the search. Alternatively, the preset set of actions may include the actions of performing search in a decision tree; performing search in a nearest neighbor graph stored in the memory of the computer; performing search in a nearest neighbor graph stored in the hard drive of the computer; and terminating the search.
[00134] The potential states may include at least one of the following: a number of the calculation for distance between vectors, a number of the search performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous search.
[00135] Furthermore, the step of S803 may further include updating the state-action mapping relationship of the information searching model according to the action with the highest average score corresponding to each potential state. The state-action mapping relationship may be a mapping table of states and actions or a neural network.
[00136] According to the embodiments of the present disclosure, in the above step of S802, when a vector approximate matching search is performed in the information searching model with respect to each enquiry vector in the training set, the steps as shown in Fig. 9 may be performed circularly until a preset termination condition is met.
[00137] As shown in Fig. 9, which is a schematic flowchart showing a vector approximate matching search performed in the information searching model with respect to an enquiry vector in a training set according to the embodiments of the present disclosure, the vector approximate matching search may include the following steps.
[00138] S901, determining the current calculation state.
[00139] S902, selecting an action to be performed from the preset set of actions randomly.
[00140] S903, performing the action to be performed and calculating the score of action.
[00141] S904, accumulating the scores of actions to obtain a score corresponding to the enquiry vector.
[00142] According to the embodiments of the present disclosure, in the above step of S802, when a vector approximate matching search is performed in the information searching model with respect to each enquiry vector in the training set, the steps as shown in Fig. 10 may be performed circularly until a preset termination condition is met.
[00143] As shown in Fig. 10, which is a schematic flowchart showing a vector approximate matching search performed in the information searching model with respect to an enquiry vector in a training set according to the embodiments of the present disclosure, the vector approximate matching search may include the following steps.
[00144] S1001, determining a current calculation state.
[00145] S1002, selecting an action to be performed from a preset set of actions according to a preset state-action mapping relationship and based on the current calculation state according to a preset possibility, or selecting an action to be performed from a preset set of actions randomly.
[00146] S1003, performing the action to be performed and calculating a score of action.
[00147] S1004, summing up the scores of actions to obtain a value corresponding to the enquiry vector.
[00148] According to the embodiments of the present disclosure, in the above steps of S901 and S1001, the current calculation state may be determined by using the candidate vectors obtained when the action to be performed was performed last time.
[00149] According to the embodiments of the present disclosure, in the above steps of S903 and S1003, the score of action may be calculated by using the following formular.
[00150] Reward = WlQuality - W2Complexity
[00151] In the above formular, Reward is a score of action, Wl and W2 are preset parameters, Quality is a score of quality of action, and Complexity is a score of complexity of action.
[00152] According to the embodiments of the present disclosure, in the above steps of S903 and S1003, the score of action may be calculated after a plurality of actions to be performed have been performed.
[00153] It should be noted that the information searching method may be implemented based on the information searching apparatus, or be implemented separately as a method process, or be designed by other software or hardware, and then be implemented based on the inventive concept herein.
Implementation example of electronic apparatus
[00154] The electronic apparatus according to embodiments of the present disclosure may be a mobile electronic apparatus, or an electronic apparatus with less mobility or a stationary computing apparatus. The electronic apparatus according to embodiments of the present disclosure may at least include a processor and a memory. The memory may store instructions thereon and the processor may obtain instructions from the memory and execute the instructions to cause the electronic apparatus to perform operations.
[00155] In some examples, one or more components or modules and one or more steps as shown in Fig. 1 to Fig. 10 may be implemented by software, hardware, or in combination of software and hardware. For example, the above component or module and one or more steps may be implemented in system on chip (SoC). Soc may include: integrated circuit chip, including one or more of processing unit (such as center processing unit (CPU), micro controller, micro processing unit, digital signal processing unit (DSP) or the like), memory, one or more communication interface, and/or other circuit for performing its function and alternative embedded firmware.
[00156] As shown in Fig. 11, which is a structural block diagram of an exemplary electronic apparatus 1100. The electronic apparatus 1100 may be a small portable (or mobile) electronic apparatus. The small portable (or mobile) electronic apparatus may be e.g., a cell phone, a personal digital assistant (PDA), a personal media player device, a wireless network player device, personal headset device, an IoT (internet of things) intelligent device, a dedicate device or combined device containing any of functions described above. The electronic apparatus 1100 may at least include a memory 1101 and a processor 1102.
[00157] The memory 1101 may be configured to store programs. In addition to the above programs, the memory 1101 may be configured to store other data to support operations on the electronic apparatus 1100. The examples of these data may include instructions of any applications or methods operated on the electronic apparatus 1100, contact data, phone book data, messages, pictures, videos, and the like.
[00158] The memory 1101 may be implemented by any kind of volatile or nonvolatile storage device or their combinations, such as static random access memory (SRAM), electronically 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, disk memory, or optical disk.
[00159] The memory 1101 may be coupled to the processor 1102 and contain instructions stored thereon. The instructions may cause the electronic apparatus 1100 to perform operations upon being executed by the processor 1102, the operations may include: generating an enquiry vector according to an enquiry content;
[00160] performing vector approximate matching search in a preset vector database, acquiring a candidate vector most approximate to the enquiry vector;
[00161] acquiring a searching result corresponding to the candidate vector most approximate to the enquiry vector.
[00162] More particularly, when a vector approximate matching search is performed, the following steps may be performed circulately until a preset termination condition is met:
[00163] determining the current calculation state;
[00164] determining an action to be performed from a preset set of actions based on the current calculation state according to a preset state-action mapping relationship. The preset state-action mapping relationship may show the correspondence between various calculating states and the actions to be performed;
[00165] performing the action to be performed, and collecting a candidate vector found based on the action which is performed.
[00166] More particularly, the state-action mapping relationship may be a mapping table of states and actions, or may be a neural network showing the mapping relationship therebetween.
[00167] More particularly, the vector approximate matching search performed in the preset vector database may be an approximate nearest neighbor search.
[00168] More particularly, the preset set of action may include: the actions of performing search in a decision tree; performing search in a nearest neighbor graph stored in the memory of the computer; performing search in a nearest neighborhood graph stored in the hard drive of the computer; and terminating the searching.
[00169] More particularly, the current calculating state may include at least one of the following: a number of the calculation for distance between vectors, a number of the searching performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
[00170] In the embodiments of the electronic apparatus, the above operations may include:
[00171] inputting a preset training set into an information searching model to be trained. The information searching model may include an initial state-action mapping relationship. The state-action mapping relationship may show the correspondence relationship between various calculation states and actions. The training set may include a plurality of enquiry vectors and the searching result candidate vectors corresponding to the enquiry vectors.
[00172] calculating a value of each enquiry vector in the training set obtained after a vector approximate matching search is performed in the information searching model.
[00173] updating the state-action mapping relationship by using the value with respect to each potential state in the information searching model.
[00174] More particularly, the updating the state-action mapping relationship by using the value with respect to each potential state in the information searching model may include:
[00175] determining an action from a preset set of actions, which has the highest average value when the vector approximate matching search is performed with respect to the training set;
[00176] updating the state-action mapping relationship of the information searching model according to the action with the highest average value corresponding to each potential state.
[00177] More particularly, the state-action mapping relationship may include a mapping table of states and actions or a neural network.
[00178] More particularly, the vector approximate matching search performed in the preset vector database may be an approximate nearest neighbor search.
[00179] More particularly, the preset set of action may include: the actions of performing search in a decision tree; performing search in a nearest neighbor graph; and terminating the search.
[00180] More particularly, the preset set of action may include: the actions of performing search in a decision tree; performing search in a nearest neighbor graph stored in the memory of the computer; performing search in a nearest neighbor graph stored in the hard drive of the computer; and terminating the search.
[00181] More particularly, the potential state may include at least one of the following: a number of the calculation for distance between vectors, a number of the search performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
[00182] More particularly, when a vector approximate matching search is performed in the information searching model with respect to each enquiry vector in the training set, the following steps may be performed circularly until a preset termination condition is met: [00183] determining the current calculation state;
[00184] selecting an action to be performed from the preset set of actions randomly;
[00185] performing the action to be performed and calculating the score of action; and
[00186] summing up the scores of actions to obtain a score corresponding to the enquiry vector.
[00187] More particularly, when a vector approximate matching search is performed in the information searching model with respect to each enquiry vector in the training set, the following steps may be performed circularly until a preset termination condition is met:
[00188] determining current calculating state;
[00189] selecting an action to be performed from a preset set of actions according to a preset state-action mapping relationship and based on current calculation state according to a preset possibility, or selecting an action to be performed from a preset set of actions randomly;
[00190] performing the action to be performed and calculating a score of action; and
[00191] accumulating the scores of actions to obtain a value corresponding to the enquiry vector.
[00192] More particularly, when the action to be performed is performed, the score of action may be calculated by using the following formular.
[00193] Reward = WlQuality - W2Complexity
[00194] In the above formular, Reward is a score of action, Wl and W2 are preset parameters, Quality is a score of quality of action, and Complexity is a score of complexity of action.
[00195] More particularly, the current calculation state may be determined by using the candidate vectors obtained when the action to be performed was performed last time.
[00196] More particularly, the performing the action to be performed and calculating a score of action may include: calculating the score of action after a plurality of actions to be performed have been performed.
[00197] Detailed description has been made on the above operations in the above embodiments of method and device. The description on the above operations may be applied to electronic apparatus 1100. That is to say, the specific operations mentioned in the above embodiments may be recorded in memory 1101 in program and be performed by processor 1102.
[00198] Furthermore, as shown in Fig. 11, the electronic apparatus 1100 may further include: a communication unit 1103, a power supply unit 1104, an audio unit 1105, a display unit 1106, chipset 1107, and other units. Only part of units are exemplarily shown in Fig. 11 and it is obvious to one skilled in the art that the electronic apparatus 1100 only includes the units shown in Fig. 11.
[00199] The communication unit 1103 may be configured to facilitate wireless or wired communication between the electronic apparatus 1100 and other apparatuses. The electronic apparatus may be connected to wireless network based on communication standard, such as WiFi, 2G, 3G, or their combination. In an exemplary example, the communication unit 1103 may receive radio signal or radio related information from external radio management system via radio channel. In an exemplary example, the communication unit 1103 may further include near field communication (NFC) module for facilitating short-range communication. For example, the NFC module may be implemented with radio frequency identification (RFID) technology, Infrared data association (IrDA) technology, ultra wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[00200] The power supply unit 1104 may be configured to supply power to various units of the electronic device. The power supply unit 1104 may include a power supply management system, one or more power supplies, and other units related to power generation, management, and allocation.
[00201] The audio unit 1105 may be configured to output and/or input audio signals. For example, the audio unit 1105 may include a microphone (MIC). When the electronic apparatus in an operation mode, such as calling mode, recording mode, and voice recognition mode, the MIC may be configured to receive external audio signals. The received audio signals may be further stored in the memory 1101 or sent via the communication unit 1103. In some examples, the audio unit 1105 may further include a speaker configured to output audio signals.
[00202] The display unit 1106 may include a screen, which may include liquid crystal display (LCD) and touch panel (TP). If the screen includes a touch panel, the screen may be implemented as touch screen so as to receive input signal from users. The touch panel may include a plurality of touch sensors to sense touching, sliding, and gestures on the touch panel. The touch sensor may not only sense edges of touching or sliding actions, but also sense period and pressure related to the touching or sliding operations.
[00203] The above memory 1101, processor 1102, communication unit 1103, power supply unit 1104, audio unit 1105 and display unit 1106 may be connected with the chipset 1107. The chipset 1107 may provide interface between the processor 1102 and other units of the electronic apparatus 1100. Furthermore, the chipset 1107 may provide interface for each unit of the electronic apparatus 1100 to access the memory 1101 and communication interface for accessing among units.
[00204] In some examples, one or more modules, one or more steps, or one or more processing procedures involved in Figs. 1 to 12 may be implemented by a computing device with an operating system and hardware configuration.
[00205] Example Clauses
[00206] A. A method, including:
[00207] generating an enquiry vector according to an enquiry content;
[00208] performing vector approximate matching search in a preset vector database, and acquiring a candidate vector most approximate to the enquiry vector;
[00209] acquiring a searching result corresponding to the candidate vector most approximate to the enquiry vector,
[00210] wherein when a vector approximate matching search is performed, the following steps are performed circulately until a preset termination condition is met:
[00211] determining the current calculation state;
[00212] determining an action to be performed from a preset set of actions based on the current calculation state according to a preset state-action mapping relationship, wherein the preset state-action mapping relationship shows the correspondence between different calculation states and the actions to be performed;
[00213] performing the action to be performed, and collecting a candidate vector found based on the action which is performed. [00214] B. The method according to paragraph A, wherein the state-action mapping relationship includes a state-action mapping table or a neural network.
[00215] C. The method according to paragraph A, wherein the vector approximate matching search performed in the preset vector database is approximate nearest neighbor search.
[00216] D. The method according to paragraph A, wherein the preset set of actions include: the actions of performing search in decision tree; performing search in nearest neighbor graph; and terminating a searching.
[00217] E. The method according to paragraph A, wherein the preset set of actions includes: the actions of performing search in a decision tree; performing search in a nearest neighbor graph stored in a memory of a computer; performing search in a nearest neighbor graph stored in a hard drive of a computer; and terminating a search.
[00218] F. The method according to paragraph A, wherein the current calculating state include at least one of the following: a number of calculations for a distance between vectors, a number of the searching performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous search.
[00219] G. A method, including:
[00220] inputting a preset training set into an information searching model to be trained, wherein the information searching model includes an initial state-action mapping relationship, the state-action mapping relationship showing the correspondence relationship between different calculation states and actions, and the training set includes a plurality of enquiry vectors and searching result candidate vectors corresponding to the plurality of enquiry vectors respectively;
[00221] calculating a value of an enquiry vector in the training set, which is subjected to an vector approximate matching search performed in the information searching model; and [00222] updating the state-action mapping relationship with respect to a potential state in the information searching model by using the value.
[00223] H. The method according to paragraph G, wherein the updating the state-action mapping relationship with respect to each potential state in the information searching model by using the value includes:
[00224] determining an action from a preset set of actions, which has the highest average value when the vector approximate matching search is performed with respect to the training set; and
[00225] updating the state-action mapping relationship of the information searching model according to the action with the highest average value corresponding to each potential state.
[00226] I. The method according to paragraph G, wherein the state-action mapping relationship includes a state-action mapping table or a neural network.
[00227] J. The method according to paragraph G, wherein the vector approximate matching search performed in the information searching model is approximate nearest neighbor search.
[00228] K. The method according to paragraph H, wherein the preset set of actions includes: the actions of performing search in decision tree; performing search in nearest neighbor graph; and terminating a searching.
[00229] L. The method according to paragraph H, wherein the preset set of actions includes: the actions of performing search in decision tree; performing search in nearest neighbor graph stored in a memory of a computer; performing search in nearest neighbor graph stored in a hard drive of a computer; and terminating a search.
[00230] M. The method according to paragraph G, wherein the potential state includes at least one of the following: a number of calculations for distance between vectors, a number of searching performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
[00231] N. The method according to paragraph G, wherein when a vector approximate matching search is performed in the information searching model with respect to each enquiry vector in the training set, the following steps are performed circularly until a preset termination condition is met:
[00232] determining the current calculation state;
[00233] selecting an action to be performed from the preset set of actions randomly; [00234] performing the action to be performed and calculating the score of action; and [00235] summing up the scores of action to obtain a value corresponding to the enquiry vector.
[00236] O. The method according to paragraph G, wherein a vector approximate matching search is performed in the information searching model with respect to an enquiry vector in the training set, the following steps are performed circularly until a preset termination condition is met:
[00237] determining a current calculating state;
[00238] selecting an action to be performed from a preset set of actions according to a preset state-action mapping relationship and based on the current calculation state according to a preset possibility, or selecting an action to be performed from a preset set of actions randomly;
[00239] performing the action to be performed and calculating a score of action; and
[00240] summing up the scores of actions to obtain a value corresponding to the enquiry vector.
[00241] P. The method according to paragraph N or O, wherein when the action to be performed is performed, the score of action is calculated by using the following formular:
[00242] Reward = Wl Quality - W2Complexity
[00243] wherein Reward is a score of action, Wl and W2 are preset parameters, Quality is a score of quality of searching, and Complexity is a score of complexity of searching.
[00244] Q. The method according to paragraph N or O, wherein the preset set of actions includes: determining the current calculating state by using the candidate vectors obtained when the action to be performed is performed last time.
[00245] R. The method according to paragraph N or O, wherein the performing the action to be performed and calculating a score of action includes: calculating the score of action after a plurality of actions to be performed have been performed.
[00246] S. An electronic apparatus, including:
[00247] a processing unit; and
[00248] a memory, coupled to the processing unit and containing instructions stored thereon, the instructions cause the electronic apparatus to perform operations upon being executed by the processing unit, the operations include:
[00249] generating an enquiry vector according to an enquiry content;
[00250] performing vector approximate matching search in a preset vector database, and acquiring a candidate vector most approximate to the enquiry vector;
[00251] acquiring a searching result corresponding to the candidate vector most approximate to the enquiry vector,
[00252] wherein when a vector approximate matching search is performed, the following steps are performed circulately until a preset termination condition is met:
[00253] determining the current calculation state;
[00254] determining an action to be performed from a preset set of actions based on the current calculation state according to a preset state-action mapping relationship, wherein the preset state-action mapping relationship shows the correspondence between different calculation states and the actions to be performed;
[00255] performing the action to be performed, and collecting a candidate vector found based on the action which is performed.
[00256] T. The electronic apparatus according to paragraph S, wherein the state-action mapping relationship includes a state-action mapping table or a neural network.
[00257] U. The electronic apparatus according to paragraph S, wherein the vector approximate matching search performed in the preset vector database is an approximate nearest neighbor search.
[00258] V. The electronic apparatus according to paragraph S, wherein the preset set of actions includes: the actions of performing search in a decision tree; performing search in a nearest neighbor graph; and terminating a searching.
[00259] W. The electronic apparatus according to paragraph S, wherein the preset set of actions includes: the actions of performing search in a decision tree; performing search in a nearest neighbor graph stored in a memory of a computer; performing search in a nearest neighbor graph stored in a hard drive of a computer; and terminating a searching.
[00260] X. The electronic apparatus according to paragraph S, wherein the current calculation state includes at least one of the following: a number of the calculation for distance between vectors, a number of the searching performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
[00261] Y. An electronic apparatus, including:
[00262] a processing unit; and
[00263] a memory, coupled to the processing unit and containing instructions stored thereon, the instructions cause the electronic apparatus to perform operations upon being executed by the processing unit, the operations include:
[00264] inputting a preset training set into an information searching model to be trained, wherein the information searching model includes an initial state-action mapping relationship, the state-action mapping relationship showing the correspondence relationship between different calculation states and actions, and the training set includes a plurality of enquiry vectors and searching result candidate vectors corresponding to the plurality of enquiry vectors respectively;
[00265] calculating a value of an enquiry vector in the training set, which is subjected to an vector approximate matching search performed in the information searching model; and [00266] updating the state-action mapping relationship with respect to a potential state in the information searching model by using the value.
[00267] Z. The electronic apparatus according to paragraph Y, wherein the updating the state-action mapping relationship with respect to each potential state in the information searching model by using the value includes:
[00268] determining an action from a preset set of actions, which has the highest average value when the vector approximate matching search is performed with respect to the training set; and
[00269] updating the state-action mapping relationship according to the action with the highest average value corresponding to each potential state.
[00270] Al. The electronic apparatus according to paragraph Y, wherein the state-action mapping relationship includes a state-action mapping table or a neural network.
[00271] Bl. The electronic apparatus according to paragraph Y, wherein the vector approximate matching search performed in the information searching model is approximate nearest neighbor search. [00272] Cl. The electronic apparatus according to paragraph Z, wherein the preset set of actions includes: the actions of performing search in a decision tree; performing search in a nearest neighbor graph; and terminating a searching.
[00273] Dl. The electronic apparatus according to paragraph Z, wherein the preset set of actions includes: the actions of performing search in decision tree; performing search in nearest neighbor graph stored in a memory of a computer; performing search in nearest neighbor graph stored in a hard drive of a computer; and terminating a search.
[00274] El. The electronic apparatus according to paragraph X, wherein the potential state includes at least one of the following: a number of calculations for distance between vectors, a number of searching performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
[00275] Fl. The electronic apparatus according to paragraph X, wherein when a vector approximate matching search is performed in the information searching model with respect to each enquiry vector in the training set, the following steps are performed circularly until a preset termination condition is met:
[00276] determining the current calculation state;
[00277] selecting an action to be performed from the preset set of actions randomly;
[00278] performing the action to be performed and calculating the score of action; and [00279] accumulating the scores of actions to obtain a value corresponding to the enquiry vector.
[00280] Gl . The electronic apparatus according to paragraph X, wherein when a vector approximate matching search is performed in the information searching model with respect to an enquiry vector in the training set, the following steps are performed circularly until a preset termination condition is met:
[00281] determining a current calculating state;
[00282] selecting an action to be performed from a preset set of actions according to a preset state-action mapping relationship and based on the current calculation state according to a preset possibility, or selecting an action to be performed from a preset set of actions randomly; [00283] performing the action to be performed and calculating a score of action; and
[00284] summing up the scores of actions to obtain a value corresponding to the enquiry vector.
[00285] Hl. The electronic apparatus according to paragraph Fl or Gl, wherein when the action to be performed is performed, the score of action is calculated by using the following formular:
[00286] Reward = Wl Quality - W2Complexity
[00287] wherein Reward is a score of action, Wl and W2 are preset parameters, Quality is a score of quality of searching, and Complexity is a score of complexity of searching.
[00288] II. The electronic apparatus according to paragraph Fl or Gl, wherein the preset set of actions includes: determining the current calculating state by using the candidate vectors obtained when the action to be performed is performed last time.
[00289] Jl. The electronic apparatus according to paragraph Fl or Gl, wherein the performing the action to be performed and calculating a score of action includes: calculating the score of action after a plurality of actions to be performed have been performed.
[00290] Kl. A device, including:
[00291] a vector generating module configured to generate an enquiry vector according to an enquiry content;
[00292] a vector searching module configured to perform vector approximate matching search in a preset vector database, and acquire a candidate vector most approximate to the enquiry vector;
[00293] a result acquiring module configured to acquire a searching result corresponding to the candidate vector most approximate to the enquiry vector,
[00294] wherein when the vector searching module is performing the vector approximate matching search, the vector searching module is further configured to perform the following steps circulately until a preset termination condition is met:
[00295] determining the current calculation state;
[00296] determining an action to be performed from a preset set of actions based on the current calculation state according to a preset state-action mapping relationship, wherein the preset state-action mapping relationship shows the correspondence between different calculation states and the actions to be performed;
[00297] performing the action to be performed, and collecting a candidate vector found based on the action which is performed.
[00298] Ll. A device, including:
[00299] an training set inputting module configured to input a preset training set into an information searching model to be trained, wherein the information searching model includes an initial state-action mapping relationship, the state-action mapping relationship shows the correspondence relationship between various calculation states and actions, and the training set includes a plurality of enquiry vectors and the searching result candidate vectors corresponding to the enquiry vectors;
[00300] a value calculating module configured to calculate a value of an enquiry vector in the training set, which is subjected to an vector approximate matching search performed in the information searching model; and
[00301] a state-action mapping relationship updating module configured to update the state-action mapping relationship with respect to each potential state in the information searching model by using the value.
[00302] Conclusion
[00303] There is little distinction left between hardware and software implementations of aspects of systems; the use of hardware or software is generally (but not always, in that in certain contexts the choice between hardware and software can become significant) a design choice representing cost versus efficiency tradeoffs. There are various vehicles by which processes and/or systems and/or other technologies described herein can be effected (e.g., hardware, software, and/or firmware), and that the preferred vehicle will vary with the context in which the processes and/or systems and/or other technologies are deployed. For example, if an implementer determines that speed and accuracy are paramount, the implementer may opt for a mainly hardware and/or firmware vehicle; if flexibility is paramount, the implementer may opt for a mainly software implementation; or, yet again alternatively, the implementer may opt for some combination of hardware, software, and/or firmware. [00304] The foregoing detailed description has set forth various embodiments of the devices and/or processes via the use of block diagrams, flowcharts, and/or examples. Insofar as such block diagrams, flowcharts, and/or examples contain one or more functions and/or operations, it will be understood by those within the art that each function and/or operation within such block diagrams, flowcharts, or examples can be implemented, individually and/or collectively, by a wide range of hardware, software, firmware, or virtually any combination thereof. In one embodiment, several portions of the subject matter described herein may be implemented via Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs), digital signal processors (DSPs), or other integrated formats. However, those skilled in the art will recognize that some aspects of the embodiments disclosed herein, in whole or in part, can be equivalently implemented in integrated circuits, as one or more computer programs running on one or more computers (e.g., as one or more programs running on one or more computer systems), as one or more programs running on one or more processors (e.g., as one or more programs running on one or more microprocessors), as firmware, or as virtually any combination thereof, and that designing the circuitry and/or writing the code for the software and or firmware would be well within the skill of one of skill in the art in light of this disclosure. In addition, those skilled in the art will appreciate that the mechanisms of the subject matter described herein are capable of being distributed as a program product in a variety of forms, and that an illustrative embodiment of the subject matter described herein applies regardless of the particular type of signal bearing medium used to actually carry out the distribution. Examples of a signal bearing medium include, but are not limited to, the following: a recordable type medium such as a floppy disk, a hard disk drive, a Compact Disc (CD), a Digital Versatile Disk (DVD), a digital tape, a computer memory, etc.; and a transmission type medium such as a digital and/or an analog communication medium (e.g., a fiber optic cable, a waveguide, a wired communications link, a wireless communication link, etc.).
[00305] Those skilled in the art will recognize that it is common within the art to describe devices and/or processes in the fashion set forth herein, and thereafter use engineering practices to integrate such described devices and/or processes into data processing systems. That is, at least a portion of the devices and/or processes described herein can be integrated into a data processing system via a reasonable amount of experimentation. Those having skill in the art will recognize that a typical data processing system generally includes one or more of a system unit housing, a video display device, a memory such as volatile and non-volatile memory, processors such as microprocessors and digital signal processors, computational entities such as operating systems, drivers, graphical user interfaces, and applications programs, one or more interaction devices, such as a touch pad or screen, and/or control systems including feedback loops and control motors (e.g., feedback for sensing position and/or velocity; control motors for moving and/or adjusting components and/or quantities). A typical data processing system may be implemented utilizing any suitable commercially available components, such as those typically found in data computing/communication and/or network computing/communication systems.
[00306] The herein described subject matter sometimes illustrates different components contained within, or connected with, different other components. It is to be understood that such depicted architectures are merely exemplary, and that in fact many other architectures can be implemented which achieve the same functionality. In a conceptual sense, any arrangement of components to achieve the same functionality is effectively "associated" such that the desired functionality is achieved. Hence, any two components herein combined to achieve a particular functionality can be seen as "associated with" each other such that the desired functionality is achieved, irrespective of architectures or intermedial components. Likewise, any two components so associated can also be viewed as being "operably connected", or "operably coupled", to each other to achieve the desired functionality, and any two components capable of being so associated can also be viewed as being "operably couplable", to each other to achieve the desired functionality. Specific examples of operably couplable include but are not limited to physically mateable and/or physically interacting components and/or wirelessly interactable and/or wirelessly interacting components and/or logically interacting and/or logically interactable components.
[00307] With respect to the use of substantially any plural and/or singular terms herein, those having skill in the art can translate from the plural to the singular and/or from the singular to the plural as is appropriate to the context and/or application. The various singular/plural permutations may be expressly set forth herein for sake of clarity.
[00308] It will be understood by those within the art that, in general, terms used herein, and especially in the appended claims (e.g., bodies of the appended claims) are generally intended as "open" terms (e.g., the term "including" should be interpreted as "including but not limited to," the term "having" should be interpreted as "having at least," the term "includes" should be interpreted as "includes but is not limited to," etc.). It will be further understood by those within the art that if a specific number of an introduced claim recitation is intended, such an intent will be explicitly recited in the claim, and in the absence of such recitation no such intent is present. For example, as an aid to understanding, the following appended claims may contain usage of the introductory phrases "at least one" and "one or more" to introduce claim recitations. However, the use of such phrases should not be construed to imply that the introduction of a claim recitation by the indefinite articles "a" or "an" limits any particular claim containing such introduced claim recitation to disclosures containing only one such recitation, even when the same claim includes the introductory phrases "one or more" or "at least one" and indefinite articles such as "a" or "an" (e.g., "a" and/or "an" should typically be interpreted to mean "at least one" or "one or more"); the same holds true for the use of definite articles used to introduce claim recitations. In addition, even if a specific number of an introduced claim recitation is explicitly recited, those skilled in the art will recognize that such recitation should typically be interpreted to mean at least the recited number (e.g., the bare recitation of "two recitations," without other modifiers, typically means at least two recitations, or two or more recitations). Furthermore, in those instances where a convention analogous to "at least one of A, B, and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B, and C" would include but not be limited to systems that have A alone, B alone, C alone, A and B together, A and C together, B and C together, and/or A, B, and C together, etc.). In those instances where a convention analogous to "at least one of A, B, or C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B, or C" would include but not be limited to systems that have A alone, B alone, C alone, A and B together, A and C together, B and C together, and/or A, B, and C together, etc.). It will be further understood by those within the art that virtually any disjunctive word and/or phrase presenting two or more alternative terms, whether in the description, claims, or drawings, should be understood to contemplate the possibilities of including one of the terms, either of the terms, or both terms. For example, the phrase "A or B" will be understood to include the possibilities of "A" or "B" or "A and B."
[00309] Reference in the specification to“an implementation”,“one implementation”, “some implementations”, or“other implementations” may mean that a particular feature, structure, or characteristic described in connection with one or more implementations may be included in at least some implementations, but not necessarily in all implementations. The various appearances of “an implementation”, “one implementation”, or “some implementations” in the preceding description are not necessarily all referring to the same implementations.
[00310] While certain exemplary techniques have been described and shown herein using various methods and systems, it should be understood by those skilled in the art that various other modifications may be made, and equivalents may be substituted, without departing from claimed subject matter. Additionally, many modifications may be made to adapt a particular situation to the teachings of claimed subject matter without departing from the central concept described herein. Therefore, it is intended that claimed subject matter not be limited to the particular examples disclosed, but that such claimed subject matter also may include all implementations falling within the scope of the appended claims, and equivalents thereof.
[00311] Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described. Rather, the specific features and acts are disclosed as illustrative forms of implementing the claims.
[00312] Conditional language such as, among others, "can," "could," "might" or "may," unless specifically stated otherwise, are otherwise understood within the context as used in general to present that certain examples include, while other examples do not include, certain features, elements and/or steps. Thus, such conditional language is not generally intended to imply that features, elements and/or steps are in any way required for one or more examples or that one or more examples necessarily include logic for deciding, with or without user input or prompting, whether these features, elements and/or steps are included or are to be performed in any particular example.
[00313] Conjunctive language such as the phrase "at least one of X, Y or Z," unless specifically stated otherwise, is to be understood to present that an item, term, etc. can be either X, Y, or Z, or a combination thereof.
[00314] Any routine descriptions, elements or blocks in the flow diagrams described herein and/or depicted in the attached figures should be understood as potentially representing modules, segments, or portions of code that include one or more executable instructions for implementing specific logical functions or elements in the routine. Alternate examples are included within the scope of the examples described herein in which elements or functions can be deleted, or executed out of order from that shown or discussed, including substantially synchronously or in reverse order, depending on the functionality involved as would be understood by those skilled in the art.
[00315] It should be emphasized that many variations and modifications can be made to the above-described examples, the elements of which are to be understood as being among other acceptable examples. All such modifications and variations are intended to be included herein within the scope of this disclosure and protected by the following claims [00316] It would be obvious to one skilled in the art that, all or part of steps for implementing the above embodiments may be accomplished by hardware related to programs or instructions. The above program may be stored in a computer readable storing medium. Such program may perform the steps of the above embodiments upon being executed. The above storing medium may include: ROM, RAM, magnetic disk, or optic disk or other medium capable of storing program codes.
[00317] It should be noted that the foregoing embodiments are merely used to illustrate the technical solution of the present disclosure, and not to limit the present disclosure. Although the present disclosure has been described in detail with reference to the foregoing embodiments, one skilled in the art would understand that the technical solutions recited in the foregoing embodiments may be modified or all or a part of the technical features may be replaced equally. These modifications and replacements are not intended to make corresponding technical solution depart from the scope of the technical solution of embodiments of the present disclosure.

Claims

1. A device, comprising:
a vector generating module configured to generate an enquiry vector according to an enquiry content;
a vector searching module configured to perform vector approximate matching search in a preset vector database, and acquire a candidate vector most approximate to the enquiry vector;
a result acquiring module configured to acquire a searching result corresponding to the candidate vector most approximate to the enquiry vector,
wherein when the vector searching module is performing the vector approximate matching search, the vector searching module is further configured to perform the following steps circulately until a preset termination condition is met:
determining the current calculation state;
determining an action to be performed from a preset set of actions based on the current calculation state according to a preset state-action mapping relationship, wherein the preset state-action mapping relationship shows the correspondence between different calculation states and the actions to be performed;
performing the action to be performed, and collecting a candidate vector found based on the action which is performed.
2. A method, comprising:
inputting a preset training set into an information searching model to be trained, wherein the information searching model comprises an initial state-action mapping relationship, the state-action mapping relationship showing the correspondence relationship between different calculation states and actions, and the training set comprises a plurality of enquiry vectors and searching result candidate vectors corresponding to the plurality of enquiry vectors respectively;
calculating a value of an enquiry vector in the training set, which is subjected to an vector approximate matching search performed in the information searching model; and updating the state-action mapping relationship with respect to a potential state in the information searching model by using the value.
3. The method according to claim 2, wherein the updating the state-action mapping relationship with respect to a potential state in the information searching model by using the value comprises:
determining an action from a preset set of actions, which has the highest average value when the vector approximate matching search is performed with respect to the training set; and
updating the state-action mapping relationship according to the action with the highest average value corresponding to each potential state.
4. The method according to claim 2, wherein the state-action mapping relationship comprises a state-action mapping table or a neural network.
5. The method according to claim 2, wherein the vector approximate matching search performed in the information searching model is approximate nearest neighbor search.
6. The method according to claim 3, wherein the preset set of actions comprises: performing search in decision tree; performing search in nearest neighbor graph; and terminating a search.
7. The method according to claim 3, wherein the preset set of actions comprises: performing search in decision tree; performing search in nearest neighbor graph stored in a memory of a computer; performing search in nearest neighbor graph stored in a hard drive of a computer; and terminating a search.
8. The method according to claim 2, wherein the potential state comprises at least one of the following: a number of calculations for distance between vectors, a number of searching performed in the decision tree, an average distance between all the current candidate vectors and the enquiry vector, and whether or not the candidate vectors are updated by the previous searching.
9. The method according to claim 2, wherein when a vector approximate matching search is performed in the information searching model with respect to each enquiry vector in the training set, the following steps are performed circularly until a preset termination condition is met:
determining the current calculation state; selecting an action to be performed from the preset set of actions randomly;
performing the action to be performed and calculating the score of action; and summing up the scores of action to obtain a value corresponding to the enquiry vector.
10. The method according to claim 2, wherein when a vector approximate matching search is performed in the information searching model with respect to an enquiry vector in the training set, the following steps are performed circularly until a preset termination condition is met:
determining a current calculating state;
selecting an action to be performed from a preset set of actions according to a preset state-action mapping relationship and based on the current calculation state according to a preset possibility, or selecting an action to be performed from a preset set of actions randomly;
performing the action to be performed and calculating a score of action; and summing up the scores of actions to obtain a value corresponding to the enquiry vector.
11. The method according to claim 9 or 10, wherein when the action to be performed is performed, the score of action is calculated by using the following formular:
Reward = WiQuality - W2Complexity
wherein Reward is a score of action, Wi and W2 are preset parameters, Quality is a score of quality of searching, and Complexity is a score of complexity of searching.
12. The method according to claim 9 or 10, wherein the preset set of actions comprises: determining the current calculation state by using the candidate vectors obtained when the action to be performed is performed last time.
13. The method according to claim 9 or 10, wherein the performing the action to be performed and calculating a score of action comprises:
calculating the score of action after a plurality of actions to be performed have been performed.
14. An electronic apparatus, comprising:
a processing unit; and a memory, coupled to the processing unit and containing instructions stored thereon, the instructions cause the electronic apparatus to perform operations upon being executed by the processing unit, the operations comprise:
generating an enquiry vector according to an enquiry content;
performing vector approximate matching search in a preset vector database, and acquiring a candidate vector most approximate to the enquiry vector;
acquiring a searching result corresponding to the candidate vector most approximate to the enquiry vector,
wherein when a vector approximate matching search is performed, the following steps are performed circulately until a preset termination condition is met:
determining the current calculation state;
determining an action to be performed from a preset set of actions based on the current calculation state according to a preset state-action mapping relationship, wherein the preset state-action mapping relationship shows the correspondence between different calculation states and the actions to be performed; and
performing the action to be performed, and collecting a candidate vector found based on the action which is performed.
15. The electronic apparatus according to claim 14, wherein the state-action mapping relationship comprises a state-action mapping table or a neural network.
PCT/US2019/038078 2018-09-21 2019-06-20 Approximate nearest neighbor searching strategy generating based on reinforcement learning WO2020060605A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811109988.XA CN110941754B (en) 2018-09-21 2018-09-21 Generating vector nearest neighbor search strategy based on reinforcement learning
CN201811109988.X 2018-09-21

Publications (1)

Publication Number Publication Date
WO2020060605A1 true WO2020060605A1 (en) 2020-03-26

Family

ID=67138232

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2019/038078 WO2020060605A1 (en) 2018-09-21 2019-06-20 Approximate nearest neighbor searching strategy generating based on reinforcement learning

Country Status (2)

Country Link
CN (1) CN110941754B (en)
WO (1) WO2020060605A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112084300A (en) * 2020-08-07 2020-12-15 北京三快在线科技有限公司 Response information output method and device, electronic equipment and readable storage medium
CN116610848A (en) * 2023-07-17 2023-08-18 上海爱可生信息技术股份有限公司 Vector database retrieval method based on NPU optimization and readable storage medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113742288A (en) * 2020-05-29 2021-12-03 伊姆西Ip控股有限责任公司 Method, electronic device and computer program product for data indexing
CN114022934B (en) * 2021-11-04 2023-06-27 清华大学 Real-time portrait filing method, system and medium based on majority principle
CN116467494B (en) * 2023-06-20 2023-08-29 上海爱可生信息技术股份有限公司 Vector data indexing method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049474A (en) * 2011-10-25 2013-04-17 微软公司 Search query and document-related data translation
US10210180B2 (en) * 2015-12-04 2019-02-19 Intel Corporation Hybrid nearest neighbor search tree with hashing table
CN107368895A (en) * 2016-05-13 2017-11-21 扬州大学 A kind of combination machine learning and the action knowledge extraction method planned automatically

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
CORBY ROSSET ET AL: "Optimizing Query Evaluations Using Reinforcement Learning for Web Search", RESEARCH & DEVELOPMENT IN INFORMATION RETRIEVAL, ACM, 2 PENN PLAZA, SUITE 701NEW YORKNY10121-0701USA, 27 June 2018 (2018-06-27), pages 1193 - 1196, XP058411332, ISBN: 978-1-4503-5657-2, DOI: 10.1145/3209978.3210127 *
M.K HUGHEY ET AL: "Improved Query Matching Using kd-Trees: A Latent Semantic Indexing Enhancement", INFORMATION RETRIEVAL, 1 May 2000 (2000-05-01), Boston, pages 287 - 302, XP055618858, Retrieved from the Internet <URL:https://link.springer.com/content/pdf/10.1023/A:1009915010963.pdf> [retrieved on 20190910], DOI: 10.1023/A:1009915010963 *
RODRIGO NOGUEIRA ET AL: "Task-Oriented Query Reformulation with Reinforcement Learning", PROCEEDINGS OF THE 2017 CONFERENCE ON EMPIRICAL METHODS IN NATURAL LANGUAGE PROCESSING, 1 January 2017 (2017-01-01), Stroudsburg, PA, USA, pages 574 - 583, XP055619007, DOI: 10.18653/v1/D17-1061 *
ZENG WEI ET AL: "Reinforcement Learning to Rank with Markov Decision Process", RESEARCH AND DEVELOPMENT IN INFORMATION RETRIEVAL, ACM, 2 PENN PLAZA, SUITE 701NEW YORKNY10121-0701USA, 7 August 2017 (2017-08-07), pages 945 - 948, XP058368464, ISBN: 978-1-4503-5022-8, DOI: 10.1145/3077136.3080685 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112084300A (en) * 2020-08-07 2020-12-15 北京三快在线科技有限公司 Response information output method and device, electronic equipment and readable storage medium
CN116610848A (en) * 2023-07-17 2023-08-18 上海爱可生信息技术股份有限公司 Vector database retrieval method based on NPU optimization and readable storage medium
CN116610848B (en) * 2023-07-17 2023-10-20 上海爱可生信息技术股份有限公司 Vector database retrieval method based on NPU optimization and readable storage medium

Also Published As

Publication number Publication date
CN110941754A (en) 2020-03-31
CN110941754B (en) 2023-11-24

Similar Documents

Publication Publication Date Title
WO2020060605A1 (en) Approximate nearest neighbor searching strategy generating based on reinforcement learning
JP6311194B2 (en) Contact grouping method and apparatus
WO2020155627A1 (en) Facial image recognition method and apparatus, electronic device, and storage medium
KR102197364B1 (en) Mobile video search
KR102607176B1 (en) Self-pruning neural networks for weight parameter reduction
CN108280458B (en) Group relation type identification method and device
CN111046227B (en) Video duplicate checking method and device
US11501078B2 (en) Method and device for performing reinforcement learning on natural language processing model and storage medium
US20210382893A1 (en) Intelligently identifying the most knowledgable person based on multiple data source inputs
CN108197225B (en) Image classification method and device, storage medium and electronic equipment
KR102355152B1 (en) Method for searching content and electronic device thereof
US20170300782A1 (en) Methods and systems of personalized photo albums based on social media data
WO2020232976A1 (en) Information processing method and apparatus, electronic device, and storage medium
WO2019173085A1 (en) Intelligent knowledge-learning and question-answering
CN112395396A (en) Question-answer matching and searching method, device, system and storage medium
US11561964B2 (en) Intelligent reading support
US20240005157A1 (en) Methods and systems for unstructured pruning of a neural network
US11580303B2 (en) Method and device for keyword extraction and storage medium
WO2023088142A1 (en) Audio signal processing method and apparatus, and device and storage medium
KR20210043894A (en) Electronic apparatus and method of providing sentence thereof
US20160004702A1 (en) Multiple criteria decision analysis in distributed databases
CN110110186A (en) Vector index technology of the space partition tree in conjunction with neighborhood graph
US11403534B2 (en) Acquiring entity webpage link based on topological relationship graph
US11860584B2 (en) Dynamically controllable smartwatch
CN114265948A (en) Image pushing method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19735173

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19735173

Country of ref document: EP

Kind code of ref document: A1