WO2021175005A1 - 基于向量的文档检索方法、装置、计算机设备及存储介质 - Google Patents

基于向量的文档检索方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2021175005A1
WO2021175005A1 PCT/CN2021/070585 CN2021070585W WO2021175005A1 WO 2021175005 A1 WO2021175005 A1 WO 2021175005A1 CN 2021070585 W CN2021070585 W CN 2021070585W WO 2021175005 A1 WO2021175005 A1 WO 2021175005A1
Authority
WO
WIPO (PCT)
Prior art keywords
retrieval
vector
vocabulary
document
similarity
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/CN2021/070585
Other languages
English (en)
French (fr)
Inventor
王盼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Smart Technology Co Ltd
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 OneConnect Smart Technology Co Ltd filed Critical OneConnect Smart Technology Co Ltd
Publication of WO2021175005A1 publication Critical patent/WO2021175005A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/3344Query execution using natural language analysis

Definitions

  • This application relates to the field of information retrieval technology, and in particular to a vector-based document retrieval method, device, computer equipment and storage medium.
  • the existing document retrieval method generally first establishes a Boolean expression including a first keyword and a logical operator, and then retrieves the document by using the logical relationship represented by the Boolean expression and the first keyword.
  • the inventor realizes that the document retrieval method in the prior art has the problems of low retrieval accuracy and greater retrieval difficulty.
  • This application provides a vector-based document retrieval method, device, computer equipment, and storage medium to solve the problems of the existing vector-based document retrieval method that it is difficult to extract feature data and the classification accuracy is not high.
  • the first embodiment of the present application provides a vector-based document retrieval method, including:
  • Sort the resource documents matching the document vector according to the magnitude of the similarity and use the sort result of the resource document as the retrieval result.
  • the second embodiment of the present application provides a vector-based document retrieval device, including:
  • the retrieval information acquisition module is used to acquire the retrieval information entered on the client;
  • the retrieval vector acquisition module is used to extract each vocabulary in the retrieval information, and convert the retrieval information into a retrieval vector according to the semantics of each vocabulary in the retrieval information;
  • the similarity acquisition module is used to calculate the similarity between the retrieval vector and the preformed document vector that matches the resource document;
  • the retrieval result acquisition module is used to sort the resource documents matching the document vector according to the similarity, and use the sorting result of the resource documents as the retrieval result.
  • the third embodiment of the present application provides a computer device, including a memory, a processor, and computer readable instructions stored in the memory and capable of running on the processor.
  • the processor executes the computer readable instructions, the following steps are implemented:
  • the resource documents matching the document vector are sorted according to the magnitude of the similarity, and the sorting result of the resource documents is used as the retrieval result.
  • the fourth embodiment of the present application provides one or more readable storage media storing computer readable instructions.
  • the computer readable storage medium stores computer readable instructions, wherein the computer readable instructions are When executed by one or more processors, the one or more processors are caused to perform the following steps:
  • the resource documents matching the document vector are sorted according to the magnitude of the similarity, and the sorting result of the resource documents is used as the retrieval result.
  • the retrieval information input at the client is first obtained, and then each word in the retrieval information is extracted, and the retrieval is performed according to the semantics of each word in the retrieval information
  • the information is converted into a retrieval vector, and then the similarity between the retrieval vector and the preformed document vector matching the resource document is calculated.
  • the resource documents matching the document vector are sorted according to the similarity, and the resource documents are sorted.
  • the sorted result is used as the search result. Extract each vocabulary in the retrieval information, and convert the retrieval information into a retrieval vector based on the semantics of each vocabulary in the retrieval information.
  • FIG. 1 is a schematic diagram of an application environment of the vector-based document retrieval method according to the first embodiment of the present application
  • Fig. 2 is a flowchart of a vector-based document retrieval method according to the first embodiment of the present application
  • step 12 is a flowchart of step 12 in the vector-based document retrieval method of the first embodiment of the present application
  • step 122 is a flowchart of step 122 in the vector-based document retrieval method of the first embodiment of the present application
  • step 1222 is a flowchart of step 1222 in the vector-based document retrieval method of the first embodiment of the present application
  • FIG. 6 is another flowchart of the vector-based document retrieval method of the first embodiment of the present application.
  • Fig. 7 is a schematic diagram of modules of a vector-based document retrieval device according to a second embodiment of the present application.
  • FIG. 8 is a schematic diagram of another module of the vector-based document retrieval device according to the second embodiment of the present application.
  • FIG. 9 is a schematic diagram of another module of the vector-based document retrieval device according to the second embodiment of the present application.
  • FIG. 10 is a schematic diagram of a module of the computer device of the third embodiment of the present application.
  • the vector-based document retrieval method provided by the first embodiment of the present application can be applied to the application environment as shown in FIG. 1, in which the client (computer equipment) communicates with the server through the network.
  • the server obtains the search information entered on the client, extracts each word in the search information, and converts the search information into a search vector according to the semantics of each word in the search information, and calculates the search vector and the preformed document vector that matches the resource document According to the similarity between the two, the resource documents that match the document vector are sorted according to the magnitude of the similarity, the sorting result of the resource documents is used as the retrieval result, and the retrieval result is sent to the client.
  • the client computer equipment
  • the server can be implemented with an independent server or a server cluster composed of multiple servers.
  • a vector-based document retrieval method is provided. Taking the method applied to the server in FIG. 1 as an example, the method includes the following steps 11 to 15.
  • Step 11 Obtain the search information entered on the client.
  • the retrieval information includes the information related to the specified target document input by the user to obtain the target document.
  • Step 12 Extract each word in the search information, and convert the search information into a search vector according to the semantics of each word in the search information.
  • one piece of retrieval information corresponds to one retrieval vector.
  • step 12 specifically includes the following steps 121 to 124:
  • Step 121 Obtain each vocabulary included in the retrieval information.
  • the above-mentioned step 121 includes: first performing word segmentation processing on the retrieval information, and then removing the stop words in the retrieval information. Specifically, first isolate each word in the search information, and query whether adjacent words can form a phrase in the dictionary. If it can form a phrase, then the adjacent text is formed into a phrase. Adjacent phrases are isolated, and then the question or symbol that has not formed the phrase is used as a stop word, and each formed phrase is used as each vocabulary in the search information. It should be noted that the adjacent characters can be two consecutive adjacent characters or three consecutive adjacent characters, and there is no specific restriction here.
  • the search information is "Explore the mystery of the universe”, first isolate each word in each search information to obtain “Explore/Suo/Uniu/Universal/ ⁇ /Mystery/Secret” , Query in the dictionary whether a phrase can be formed between adjacent words, get “exploration/universe/ ⁇ / mystery”, and use the phrases “exploration”, "universe” and “mystery” as the words in the search information, because " " ⁇ ” does not form a phrase with other words in the search information, and " ⁇ ” is used as a stop word.
  • Step 122 Use the same first keyword to represent vocabularies with similar semantics in each vocabulary.
  • words with similar semantics in the vocabulary are represented by the same keywords.
  • the synonym of each vocabulary should be searched, so that multiple vocabularies can be represented by the same first keyword.
  • Step 123 Count the number of occurrences of each first keyword.
  • the TF-IDF algorithm (term frequency-inverse document frequency, word frequency statistical algorithm) counts the number of occurrences of the first keyword, and marks the number of occurrences of each first keyword.
  • the above steps 122 to 123 can be understood more clearly.
  • An example is given: specifically, the first keyword of each vocabulary is obtained according to the semantics of each vocabulary, and the number of occurrences of each first keyword is counted. For example, the words “happy” appear 3 times, “happy” appear 4 times, and “happy” appear 5 times. Synonyms of the words “happy”, “happy", and “happy” can all be “happy”.
  • the synonym "happy” is used as the first keyword, and the first keyword “happy” is used to represent the words “happy", "happy", and “happy”.
  • the number of times the first keyword "happy” appears is the word “happy” , “Happy”, “happy” appeared 12 times, and the first keyword "happy” was marked, and the number of markings was 12.
  • Step 124 Map each first keyword and the number of occurrences of each first keyword to a vector dictionary to obtain a retrieval vector.
  • the search vector is an M-dimensional vector, and M represents the number of first keywords in the dictionary.
  • M represents the number of first keywords in the dictionary.
  • Each vocabulary in the vector dictionary is stored in a tree-like hierarchical structure. In this structure, each vocabulary is connected in the form of a node. The higher the similarity.
  • the presentation mode of each word in the vector dictionary may be in the form of a three-dimensional matrix.
  • the vector dictionary is specifically composed of each word and the frequency of each word.
  • each first keyword in the vector dictionary is only one, that is, each first keyword in the vector dictionary is different.
  • a value of 5 is assigned to the keyword A in the search vector formed by the vector dictionary.
  • the number of occurrences of the keyword B is 0, then in the space vector The keyword B is assigned a value of 0 in the formed search vector.
  • Step 13 Calculate the similarity between the retrieval vector and the pre-formed document vector that matches the resource document.
  • the document vector contains information in the resource document and is used to represent the resource document, and a document vector represents a resource document.
  • the similarity between the retrieval vector and the preformed document vector matching the resource document is calculated by the following formula (1):
  • cos ⁇ represents the similarity between the retrieval vector and the document vector
  • represents the angle between the retrieval vector and the document vector
  • a represents the retrieval vector
  • b represents the document vector
  • represents the dot product of the vector
  • represents the index of the retrieval vector Modulus
  • represents the modulus of the document vector.
  • Step 14 Sort the resource documents matching the document vector according to the similarity, and use the sort result of the resource document as the retrieval result.
  • the larger the similarity value the more similar the document vector and the retrieval vector.
  • the resource documents matching the document vector are sorted according to the order of similarity degree and then sent to the client.
  • the resource document corresponding to the similarity that reaches the preset threshold may also be sent to the client.
  • the retrieval information can be semantically converted into a retrieval vector, and the similarity between the retrieval vector and the document vector used to represent the resource document can be calculated, and the resource documents can be sorted according to the similarity.
  • the vocabulary semantics in, not only reduces the difficulty of retrieval, but also improves the accuracy of resource document retrieval.
  • the foregoing step 122 specifically includes the following steps 1221 to 1223:
  • Step 1221 Obtain at least one synonym that matches each vocabulary from the synonym word forest.
  • synonyms can be words that are arbitrarily related to each word in the synonym word forest.
  • Step 1222 Calculate the semantic similarity between each vocabulary and the corresponding matched synonyms.
  • Step 1223 When the similarity between the vocabulary and the synonym reaches the preset first threshold, the synonym is used as the first keyword matching the corresponding vocabulary.
  • the first keyword can be obtained from the synonyms according to the semantics.
  • step 1222 specifically includes the following steps 12221 to 12223:
  • Step 12221 Obtain the first semantic information according to the vocabulary, and obtain the second semantic information according to the synonyms;
  • Step 12222 Obtain a first semantic keyword from the first semantic information to form a first data set, and acquire a second semantic keyword from the second semantic information to form a second data set;
  • Step 12223 Calculate the similarity between the first data set and the second data set, and use the calculated similarity as the semantic similarity.
  • the search feedback results corresponding to the words and synonyms are obtained, the feedback results corresponding to the words are used as the first semantic information, and the feedback results corresponding to the synonyms are used as the first semantic information.
  • the feedback result is generally the explanation of vocabulary and synonyms.
  • the keywords in the first semantic information are specifically extracted as the first semantic keywords
  • the keywords in the second semantic information are extracted as the second semantic information.
  • step 12223 it is specifically to calculate the similarity between each vocabulary in the first data set and each vocabulary in the second data set.
  • the maximum value between each vocabulary in the first data set and each vocabulary in the second data set can be calculated.
  • the similarity is used as the semantic similarity, and the average of the similarity of each vocabulary in the first data set and each vocabulary in the second data set can also be used as the semantic similarity.
  • the semantic similarity between each vocabulary and synonyms can be judged according to the semantics of each vocabulary and synonyms, which is beneficial to realize the retrieval of resource documents based on semantics, and improves the accuracy of retrieval.
  • obtaining a pre-formed document vector that matches the resource document specifically includes the following steps 21 to Step 24:
  • Step 21 Obtain each resource vocabulary from the resource document.
  • the resource file represents the carrier for recording information.
  • the way to obtain the resource document may be a document formed by crawling the information in the webpage of the website using crawler technology, or a document formed by using text recognition technology to obtain text information, and there is no specific limitation here.
  • Step 22 Use second keywords to represent resource words with similar semantics in each resource vocabulary.
  • all the resource fields in the resource document are extracted first, and the resource fields are text, characters, etc. existing in the resource document, and the order of the extracted resource fields should be the same as the order of the original resource fields in the resource document.
  • step 22 that the resource words with similar semantics in each resource vocabulary are represented by the second keyword is the same as the method in step 122 that the words with similar semantics in each vocabulary are represented by the same first keyword. It's the same, so I won't repeat it here.
  • Step 23 Count the number of occurrences of each second keyword.
  • the TF-IDF algorithm can be used to count the number of occurrences of the second keyword, and mark the number of occurrences of each second keyword.
  • Step 24 Map each second keyword and the number of occurrences of each second keyword to a vector dictionary to obtain a document vector.
  • the resource document can be converted into a document vector, so that the similarity between the document vector and the retrieval vector is calculated in the above step 11 to step 14 to obtain the resource document corresponding to the document vector.
  • the content of the search information should not be limited, and the search information can also be a document.
  • the search information can be matched with the document according to the method of step 11 to step 14 above.
  • the second embodiment of the present application provides a vector-based document retrieval device, and the vector-based document retrieval device corresponds to the vector-based document retrieval method provided in the above-mentioned first embodiment in a one-to-one correspondence.
  • the vector-based document retrieval device includes a retrieval information acquisition module 41, a retrieval vector acquisition module 42, a similarity acquisition module 43 and a retrieval result acquisition module 44.
  • the detailed description of each functional module is as follows:
  • the retrieval information acquisition module 41 is used to acquire retrieval information entered at the client;
  • the retrieval vector acquisition module 42 is used to extract each vocabulary in the retrieval information, and convert the retrieval information into a retrieval vector according to the semantics of each vocabulary in the retrieval information;
  • the similarity acquisition module 43 is used to calculate the similarity between the retrieval vector and the preformed document vector that matches the resource document;
  • the retrieval result obtaining module 44 is configured to sort the resource documents matching the document vector according to the similarity degree, and use the sorting result of the resource documents as the retrieval result.
  • the retrieval vector acquisition module 42 includes a word segmentation processing unit 421, a first keyword acquisition unit 422, a statistics unit 423 and a retrieval vector acquisition unit 424.
  • the detailed functions of each functional unit are as follows:
  • the word segmentation processing unit 421 is configured to obtain each vocabulary contained in the retrieval information
  • the first keyword acquisition unit 422 is configured to represent words with similar semantics in each vocabulary with the same first keyword respectively;
  • the statistics unit 423 is used to count the number of times each first keyword appears
  • the retrieval vector obtaining unit 424 is configured to map each first keyword and the number of occurrences of each first keyword to a vector dictionary to obtain a retrieval vector.
  • the first keyword obtaining unit 422 includes a synonym obtaining subunit 4221, a semantic similarity obtaining subunit 4222, and a first keyword obtaining subunit 4223.
  • the detailed functions of each functional subunit are as follows:
  • the synonym obtaining subunit 4221 is configured to obtain at least one synonym that matches each vocabulary from the synonym word forest;
  • the semantic similarity obtaining subunit 4222 is used to calculate the semantic similarity between each vocabulary and the corresponding matching synonyms
  • the first keyword obtaining subunit 4223 is configured to use the synonym as the first keyword matching the corresponding vocabulary when the similarity between the vocabulary and the synonym reaches the preset first threshold.
  • the semantic similarity acquisition subunit 4222 includes a semantic information acquisition subunit, a data set acquisition subunit, and a semantic similarity calculation subunit.
  • the detailed functions of each functional subunit are as follows:
  • the semantic information acquisition subunit is used to acquire the first semantic information according to the vocabulary and the second semantic information according to the synonyms;
  • the data set acquisition subunit is used to acquire the first semantic keyword from the first semantic information to form a first data set, and to acquire the second semantic keyword from the second semantic information to form a second data set;
  • the semantic similarity calculation subunit is used to calculate the similarity between the first data set and the second data set, and use the calculated similarity as the semantic similarity.
  • the vector-based document retrieval device further includes a resource vocabulary acquisition module, a second keyword acquisition module, a word frequency statistics module, and a document vector acquisition module.
  • the detailed functions of each functional module are as follows:
  • Resource vocabulary acquisition module used to obtain various resource vocabularies from resource documents
  • the second keyword acquisition module is used to represent resource vocabularies with similar semantics in each resource vocabulary as second keywords;
  • the word frequency statistics module is used to count the number of times each second keyword appears
  • the document vector acquisition module is used to map each second keyword and the number of occurrences of each second keyword to a vector dictionary to obtain a document vector.
  • the various modules in the vector-based document retrieval device described above can be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
  • the third embodiment of the present application provides a computer device.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 10.
  • the computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a readable storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, computer readable instructions, and a database.
  • the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium.
  • the database of the computer equipment is used to store the data involved in the vector-based document retrieval method.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer-readable instructions are executed by the processor to implement the vector-based document retrieval method provided in the first embodiment of the present application.
  • the readable storage medium may be a non-volatile readable storage medium or a volatile readable storage medium.
  • the fourth embodiment of the present application provides one or more readable storage media storing computer readable instructions.
  • the computer readable storage medium stores computer readable instructions, wherein the computer readable instructions are When executed by one or more processors, the one or more processors are executed to implement the steps of the vector-based document retrieval method provided in the first embodiment of the present application, such as steps 11 to 14 shown in FIG. 2 , Step 121 to step 124 shown in FIG. 3, step 1221 to step 1223 shown in FIG. 4, step 12221 to step 12223 shown in FIG. 5, and step 21 to step 24 shown in FIG. Or, when the computer-readable instruction is executed by the processor, the function of each module/unit of the vector-based document retrieval method provided in the above-mentioned first embodiment is realized. To avoid repetition, I won’t repeat them here.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种基于向量的文档检索方法、装置、计算机设备及存储介质,该基于向量的文档检索方法包括:获取在客户端输入的检索信息(11);提取检索信息中的各个词汇,并根据检索信息中各个词汇的语义将检索信息转换为检索向量(12);计算检索向量与预先形成的与资源文档相匹配的文档向量之间的相似度(13);按照相似度的大小将与文档向量相匹配的资源文档进行排序,将资源文档的排序结果作为检索结果(14)。通过该技术方案的实施,能够解决现有技术中的文档检索方法存在检索准确度较低、检索难度较大的问题。

Description

基于向量的文档检索方法、装置、计算机设备及存储介质
本申请要求于2020年03月04日提交中国专利局、申请号为202010143243.6,发明名称为“基于向量的文档检索方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息检索技术领域,尤其涉及一种基于向量的文档检索方法、装置、计算机设备及存储介质。
背景技术
随着信息技术的不断发展,各行各业产生的信息量越来越大,传统的检索方式逐渐不能满足人们日常的检索需求。为了能够快速准确地获取到检索结果,需要对传统的文档检索方法进行改进,以使用户能够快速获得检索结果。目前,现有的文档检索方法一般是先建立包含第一关键词和逻辑运算符的布尔表达式,然后利用布尔表达式所表示的逻辑关系和第一关键词对文档进行检索。
虽然通过上述文档检索方法能够获得检索结果,但由于布尔逻辑式的构造不易全面准确反映用户的需求,对用户的检索技能有较高要求,同时仅根据用户输入的第一关键词的文字表意进行检索,使得检索的结果准确度较低、检索难度较大。
综上所述,发明人意识到现有技术中的文档检索方法存在检索准确度较低、检索难度较大的问题。
技术问题
本申请提供一种基于向量的文档检索方法、装置、计算机设备及存储介质,以解决现有的基于向量的文档检索方法存在特征数据提取难度较大、分类精确度不高的问题。
技术解决方案
本申请的第一实施例提供一种基于向量的文档检索方法,包括:
获取在客户端输入的检索信息;
提取检索信息中的各个词汇,并根据检索信息中各个词汇的语义将检索信息转换为检索向量;
计算检索向量与预先形成的与资源文档相匹配的文档向量之间的相似度;
按照相似度的大小将与文档向量相匹配的资源文档进行排序,将资源文档的排序结果作为检索结果。
本申请的第二实施例提供一种基于向量的文档检索装置,包括:
检索信息获取模块,用于获取在客户端输入的检索信息;
检索向量获取模块,用于提取检索信息中的各个词汇,并根据检索信息中各个词汇的语义将检索信息转换为检索向量;
相似度获取模块,用于计算检索向量与预先形成的与资源文档相匹配的文档向量之间的相似度;
检索结果获取模块,用于按照相似度的大小将与文档向量相匹配的资源文档进行排序,将资源文档的排序结果作为检索结果。
本申请的第三实施例提供一种计算机设备,包括存储器、处理器以及存储在存储器中并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现如下步骤:
获取在客户端输入的检索信息;
提取所述检索信息中的各个词汇,并根据所述检索信息中各个词汇的语义将所述检索信息转换为检索向量;
计算所述检索向量与预先形成的与资源文档相匹配的文档向量之间的相似度;
按照所述相似度的大小将与所述文档向量相匹配的所述资源文档进行排序,将所述资源文档的排序结果作为检索结果。
本申请的第四实施例提供一种一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
获取在客户端输入的检索信息;
提取所述检索信息中的各个词汇,并根据所述检索信息中各个词汇的语义将所述检索信息转换为检索向量;
计算所述检索向量与预先形成的与资源文档相匹配的文档向量之间的相似度;
按照所述相似度的大小将与所述文档向量相匹配的所述资源文档进行排序,将所述资源文档的排序结果作为检索结果。
有益效果
本申请提供的基于向量的文档检索方法、装置、计算机设备及存储介质中,首先获取在客户端输入的检索信息,再提取检索信息中的各个词汇,并根据检索信息中各个词汇的语义将检索信息转换为检索向量,然后计算检索向量与预先形成的与资源文档相匹配的文档向量之间的相似度,最后按照相似度的大小将与文档向量相匹配的资源文档进行排序,将资源文档的排序结果作为检索结果。提取检索信息中的各个词汇,并根据检索信息中的各个词汇的语义将检索信息转换成检索向量,通过本申请的实施,能够解决现有技术中的文档检索方法存在检索准确度较低、检索难度较大的问题。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请的第一实施例的基于向量的文档检索方法的一应用环境示意图;
图2是本申请的第一实施例的基于向量的文档检索方法的流程图;
图3是本申请的第一实施例的基于向量的文档检索方法中步骤12的流程图;
图4是本申请的第一实施例的基于向量的文档检索方法中步骤122的流程图;
图5是本申请的第一实施例的基于向量的文档检索方法中步骤1222的流程图;
图6是本申请的第一实施例的基于向量的文档检索方法的又一流程图;
图7是本申请的第二实施例的基于向量的文档检索装置的模块示意图;
图8是本申请的第二实施例的基于向量的文档检索装置的又一模块示意图;
图9是本申请的第二实施例的基于向量的文档检索装置的又一模块示意图;
图10是本申请的第三实施例的计算机设备的一模块示意图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请的第一实施例提供的基于向量的文档检索方法,可应用于如图1所示的应用环境中,其中,客户端(计算机设备)通过网络与服务端进行通信。服务器获取在客户端输入的检索信息,提取检索信息中的各个词汇,并根据检索信息中各个词汇的语义将检索信息转换为检索向量,计算检索向量与预先形成的与资源文档相匹配的文档向量之间的相似度,按照相似度的大小将与文档向量相匹配的资源文档进行排序,将资源文档的排序结果作为检索结果,并将检索结果发送至客户端。其中,客户端(计算机设备)可以但不限于各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。服务端可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在本申请的第一实施例中,如图2所示,提供一种基于向量的文档检索方法,以该方法应用在图1中的服务端为例进行说明,包括如下步骤11至步骤15。
步骤11:获取在客户端输入的检索信息。
其中,检索信息包含用户想要获得目标文档而输入的指定的与目标文档相关的信息。
步骤12:提取检索信息中的各个词汇,并根据检索信息中各个词汇的语义将检索信息转换为检索向量。
其中,一条检索信息对应一个检索向量。
进一步地,作为本实施例的一种实施方式,如图3所示,上述步骤12具体包括以下步骤121至步骤124:
步骤121:获取检索信息所包含的各个词汇。
其中,上述步骤121包括:先对检索信息进行分词处理,然后去掉检索信息中的停用词。具体是先对检索信息中的各个文字进行隔离,在词典中查询各相邻文字之间是否能够组成词组,若能够组成词组,则将该相邻文字组成词组,若不能组成词组,则将该相邻词组进行隔离,然后将未形成词组的问或符号作为停用词,将形成的各个词组作为检索信息中的各个词汇。需要注意的是,相邻文字可以是连续两个相邻的文字,也可以是连续三个相邻的文字,此处不做具体限制。
为能够更加清楚地理解上述步骤121,列举示例:检索信息为“探索宇宙的奥秘”,先对各个检索信息中的各个文字进行隔离得到“探/索/宇/宙/的/奥/秘”,在词典中查询各相邻文字之间是否能够组成词组,得到“探索/宇宙/的/奥秘”,将词组“探索”、“宇宙”、“奥秘”作为检索信息中的各个词汇,由于“的”并未与检索信息中的其他文字形成词组,将“的”作为停用词。
步骤122:将各个词汇中语义相近的词汇分别用同一第一关键词进行表示。
其中,具体是将词汇中语义相近的词汇用同一关键词进行表示。当词汇的数量为多个时,应当查询获得每个词汇的近义词,以使多个词汇能够用同一第一关键词进行表示。
步骤123:统计各个第一关键词出现的次数。
具体可以通过TF-IDF算法(term frequency–inverse document frequency,词频统计算法)统计第一关键词出现的次数,并对各个第一关键词出现的次数进行标记。
为例能够更加清楚地理解上述步骤122至步骤123,列举示例:其中,具体是按照各个词汇的语义获得各个词汇的第一关键词,统计各个第一关键词出现的次数。例如,存在词汇“开心”出现3次、“快乐”出现4次、“高兴”出现5次,词汇“开心”、“快乐”、“高兴”的近义词均可以为“愉快”,此时,将该近义词“愉快”作为第一关键词,用该第一关键词“愉快”来代表词汇“开心”、“快乐”、“高兴”,第一关键词“愉快”出现的次数为词汇“开心”、“快乐”、“高兴”出现次数之和12次,同时对第一关键词“愉快”进行标记,标记次数为12。
步骤124:将各个第一关键词和各个第一关键词出现的次数映射到向量词典,以得到检索向量。
其中,所述检索向量是一个M维向量,M代表词典中第一关键词的个数。向量词典中的各个词汇采用树状层次的结构进行存储,在该结构中,每个词汇之间通过节点的形式连接,每个词汇之间相差的节点数量越少,表示每个词汇之间的相似度越高。另外,向量词典中的各个词汇展现方式可以是三维矩阵的形式,具体而言,向量词典具体是由各个词汇和各个词汇出现的频率组成。
需要注意的是,在本方案中,向量词典中每个第一关键词的数量仅有一个,也就是说,在该向量词典中,各个第一关键词均各不相同。例如在向量词典中,当第一关键词A出现的次数为5,则在向量词典形成的检索向量中给关键词A赋一个值5,当关键词B出现的次数为0,则在空间向量形成的检索向量中给关键词B赋一个值0。
步骤13:计算检索向量与预先形成的与资源文档相匹配的文档向量之间的相似度。
其中,文档向量包含资源文档中的信息,用于代表资源文档,一个文档向量代表一个资源文档。
具体是通过以下公式(1)计算获得检索向量与预先形成的与资源文档相匹配的文档向量之间的相似度:
cosθ= (a • b) /(|a| × |b|)  (1)
其中,cosθ代表检索向量与文档向量的相似度,θ代表检索向量与文档向量之间的夹角,a代表检索向量,b代表文档向量,•代表向量的点乘,|a|代表检索向量的模,|b|代表文档向量的模。
需要注意的是,当存在多个资源文档时,文档向量也应当存在多个,按照上述公式能够分别计算出各个文档向量与检索向量的相似度。
步骤14:按照相似度的大小将与文档向量相匹配的资源文档进行排序,将资源文档的排序结果作为检索结果。
其中,相似度的数值越大,则代表文档向量与检索向量越相似。具体是按照相似度由大到小的顺序将与文档向量相匹配的资源文档进行排序后发送至客户端。
另外,在本实施例中,也可以将达到预设阈值的相似度对应的资源文档发送至客户端。
通过上述步骤11至步骤14的实施,能够将检索信息按照语义转换为检索向量,并计算检索向量与用于表示资源文档的文档向量的相似度,按照相似度的大小对资源文档进行排序,无需使用检索表达式进行检索,并按照检索信息中词汇的语义对资源文档进行检索,以防止检索得到的资源文档仅满足与检索信息中的词汇文字高度吻合这一条件,而忽略资源文档和检索信息中的词汇语义,降低了检索的难度的同时,提高了对资源文档检索的精准度。
进一步地,作为本实施例的一种实施方式,如图4所示,上述步骤122具体包括以下步骤1221至步骤1223:
步骤1221:从同义词词林中获取与各个词汇相匹配的至少一个同义词。
其中,同义词可以是在同义词词林中与各个词汇有任意关联的词汇。
步骤1222:计算各个词汇与对应匹配的同义词的语义相似度。
其中,具体是分别计算各个词汇与对应的各个同义词之间的语义相似度。
步骤1223:当词汇与同义词的相似度达到预设第一阈值时,将同义词作为与对应词汇相匹配的第一关键词。
通过上述步骤1221至步骤1223的实施,能够根据语义从同义词中获得第一关键词。
进一步地,作为本实施例的一种实施方式,如图5所示,上述步骤1222具体包括以下步骤12221至步骤12223:
步骤12221:根据词汇获取第一语义信息,根据同义词获取第二语义信息;
步骤12222:从第一语义信息中获取第一语义关键词,以形成第一数据集,从第二语义信息中获取第二语义关键词,以形成第二数据集;
步骤12223:计算第一数据集和第二数据集之间的相似度,并将计算的相似度作为语义相似度。
对于上述步骤12221,具体是通过在词典或者搜索引擎中搜索词汇和同义词,获得与词汇和同义词对应的搜索反馈结果,将与词汇对应的反馈结果作为第一语义信息,将与同义词对应的反馈结果作为第二语义信息。具体地,反馈结果一般是对词汇和同义词的解释内容。
对于上述步骤12222,具体抽取第一语义信息中的关键词作为第一语义关键词,抽取第二语义信息中的关键词作为第二语义信息。
对于上述步骤12223,具体是计算第一数据集中的各个词汇和第二数据集中的各个词汇之间的相似度,可以将第一数据集中的各个词汇和第二数据集中的各个词汇之间的最大相似度作为语义相似度,也可以将第一数据集中的各个词汇和第二数据集中的各个词汇的相似度平均值作为语义相似度。
通过上述步骤12221至步骤12223的实施,能够根据各个词汇和同义词的语义判断各个词汇和同义词之间的语义相似度,有利于实现根据语义对资源文档进行检索,提高了检索的精度。
进一步地,作为本实施例的一种实施方式,需要将资源文档转换成可供检索的文档向量,如图6所示,获取预先形成的与资源文档相匹配的文档向量具体包括以下步骤21至步骤24:
步骤21:从资源文档中获取各个资源词汇。
其中,资源文档代表记载信息的载体。获取资源文档的方式可以是利用爬虫技术爬取网站网页内的信息形成的文档,也可以是利用文字识别技术获取文本信息形成的文档,此处不做具体限制。
步骤22:将各个资源词汇中语义相近的资源词汇分别用第二关键词表示。
其中,具体是先提取资源文档中所有的资源字段,资源字段为资源文档中存在的文字、字符等,提取出来的资源字段的顺序应当与资源文档中原有的资源字段的顺序相同。
另外,由于步骤22中的将各个资源词汇中语义相近的资源词汇分别用第二关键词表示的方法与上述步骤122中将各个词汇中语义相近的词汇分别用同一第一关键词进行表示的方法相同,此处不再赘述。
步骤23:统计各个第二关键词出现的次数。
其中,具体可以通过TF-IDF算法统计第二关键词出现的次数,并对各个第二关键词出现的次数进行标记。
步骤24:将各个第二关键词和各个第二关键词出现的次数映射到向量词典,以得到文档向量。
其中,由于步骤24中将各个第二关键词和各个第二关键词出现的次数映射到向量词典的方法与上述步骤124中将各个第一关键词和各个第一关键词出现的次数映射到向量词典的方法相同,此处不再赘述。
通过上述步骤21至步骤24的实施,能够实现将资源文档转换成文档向量,以便于在上述步骤11至步骤14过程中计算文档向量与检索向量的相似度,获得与文档向量对应的资源文档。
需要注意的是,在本实施例中,应当不对检索信息中的内容进行限定,检索信息也可以是文档,当检索信息为文档时,根据上述步骤11至步骤14的方法能够获得与文档相匹配的资源文档,以获得与文档最相似的资源文档。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
本申请的第二实施例提供一种基于向量的文档检索装置,该基于向量的文档检索装置与上述第一实施例提供的基于向量的文档检索方法一一对应。
进一步地,如图7所示,该基于向量的文档检索装置包括检索信息获取模块41、检索向量获取模块42、相似度获取模块43和检索结果获取模块44。各功能模块详细说明如下:
检索信息获取模块41,用于获取在客户端输入的检索信息;
检索向量获取模块42,用于提取检索信息中的各个词汇,并根据检索信息中各个词汇的语义将检索信息转换为检索向量;
相似度获取模块43,用于计算检索向量与预先形成的与资源文档相匹配的文档向量之间的相似度;
检索结果获取模块44,用于按照相似度的大小将与文档向量相匹配的资源文档进行排序,将资源文档的排序结果作为检索结果。
进一步地,作为本实施例的一种实施方式,如图8所示,检索向量获取模块42包括分词处理单元421、第一关键词获取单元422、统计单元423和检索向量获取单元424。各功能单元详细功能如下:
分词处理单元421,用于获取检索信息所包含的各个词汇;
第一关键词获取单元422,用于将各个词汇中语义相近的词汇分别用同一第一关键词进行表示;
统计单元423,用于统计各个第一关键词出现的次数;
检索向量获取单元424,用于将各个第一关键词和各个第一关键词出现的次数映射到向量词典,以得到检索向量。
进一步地,作为本实施例的一种实施方式,如图9所示,第一关键词获取单元422包括同义词获取子单元4221、语义相似度获取子单元4222和第一关键词获取子单元4223。各功能子单元详细功能如下:
同义词获取子单元4221,用于从同义词词林中获取与各个词汇相匹配的至少一个同义词;
语义相似度获取子单元4222,用于计算各个词汇与对应匹配的同义词的语义相似度;
第一关键词获取子单元4223,用于当词汇与同义词的相似度达到预设第一阈值时,将同义词作为与对应词汇相匹配的第一关键词。
进一步地,作为本实施例的一种实施方式,语义相似度获取子单元4222包括语义信息获取子单元、数据集获取子单元和语义相似度计算子单元。各功能子单元详细功能如下:
语义信息获取子单元,用于根据词汇获取第一语义信息,根据同义词获取第二语义信息;
数据集获取子单元,用于从第一语义信息中获取第一语义关键词,以形成第一数据集,从第二语义信息中获取第二语义关键词,以形成第二数据集;
语义相似度计算子单元,用于计算第一数据集和第二数据集之间的相似度,并将计算的相似度作为语义相似度。
进一步地,作为本实施例的一种实施方式,基于向量的文档检索装置还包括资源词汇获取模块、第二关键词获取模块、词频统计模块和文档向量获取模块。各功能模块详细功能如下:
资源词汇获取模块,用于从资源文档中获取各个资源词汇;
第二关键词获取模块,用于将各个资源词汇中语义相近的资源词汇分别用第二关键词表示;
词频统计模块,用于统计各个第二关键词出现的次数;
文档向量获取模块,用于将各个第二关键词和各个第二关键词出现的次数映射到向量词典,以得到文档向量。
关于基于向量的文档检索装置的具体限定可以参见上文中对于基于向量的文档检索方法的限定,在此不再赘述。上述基于向量的文档检索装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
本申请的第三实施例提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图10所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括可读存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储基于向量的文档检索方法中涉及到的数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现本申请的第一实施例提供的基于向量的文档检索方法。本示例中,可读存储介质可以是非易失性可读存储介质,也可以是易失性可读存储介质。
本申请的第四实施例提供了一种一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行时实现本申请的第一实施例提供的基于向量的文档检索方法的步骤,例如图2所示的步骤11至步骤14、如图3所示的步骤121至步骤124、如图4所示的步骤1221至步骤1223、如图5所示的步骤12221至步骤12223以及如图6所示的步骤21至步骤24。或者,计算机可读指令被处理器执行时实现上述第一实施例提供的基于向量的文档检索方法的各模块/单元的功能。为避免重复,这里不再赘述。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink) DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种基于向量的文档检索方法,其中,所述文档检索方法包括:
    获取在客户端输入的检索信息;
    提取所述检索信息中的各个词汇,并根据所述检索信息中各个词汇的语义将所述检索信息转换为检索向量;
    计算所述检索向量与预先形成的与资源文档相匹配的文档向量之间的相似度;
    按照所述相似度的大小将与所述文档向量相匹配的所述资源文档进行排序,将所述资源文档的排序结果作为检索结果。
  2. 根据权利要求1所述的基于向量的文档检索方法,其中,所述提取所述检索信息中的各个词汇,并根据所述检索信息中各个词汇的语义将所述检索信息转换为检索向量包括:
    获取所述检索信息所包含的各个词汇;
    将所述各个词汇中语义相近的所述词汇分别用同一第一关键词进行表示;
    统计各个所述第一关键词出现的次数;
    将各个所述第一关键词和各个所述第一关键词出现的次数映射到向量词典,以得到所述检索向量。
  3. 根据权利要求2所述的基于向量的文档检索方法,其中,所述将所述各个词汇中语义相近的所述词汇分别用同一第一关键词进行表示包括:
    从同义词词林中获取与所述各个词汇相匹配的至少一个同义词;
    计算所述各个词汇与对应匹配的所述同义词的语义相似度;
    当所述词汇与所述同义词的相似度达到预设第一阈值时,将所述同义词作为与对应词汇相匹配的所述第一关键词。
  4. 根据权利要求3所述的基于向量的文档检索方法,其中,所述计算所述各个词汇与对应匹配的所述同义词的语义相似度的步骤包括:
    根据所述词汇获取第一语义信息,根据所述同义词获取第二语义信息;
    从所述第一语义信息中获取第一语义关键词,以形成第一数据集,从所述第二语义信息中获取第二语义关键词,以形成第二数据集;
    计算所述第一数据集和所述第二数据集之间的相似度,并将计算的所述相似度作为所述语义相似度。
  5. 根据权利要求1所述的基于向量的文档检索方法,其中,所述基于向量的文档检索方法还包括:
    从所述资源文档中获取各个资源词汇;
    将所述各个资源词汇中语义相近的所述资源词汇分别用第二关键词表示;
    统计各个所述第二关键词出现的次数;
    将各个所述第二关键词和各个所述第二关键词出现的次数映射到向量词典,以得到所述文档向量。
  6. 一种基于向量的文档检索装置,其中,包括:
    检索信息获取模块,用于获取在客户端输入的检索信息;
    检索向量获取模块,用于提取所述检索信息中的各个词汇,并根据所述检索信息中各个词汇的语义将所述检索信息转换为检索向量;
    相似度获取模块,用于计算所述检索向量与预先形成的与资源文档相匹配的文档向量之间的相似度;
    检索结果获取模块,用于按照所述相似度的大小将与所述文档向量相匹配的所述资源文档进行排序,将所述资源文档的排序结果作为检索结果。
  7. 根据权利要求6所述的基于向量的文档检索装置,其中,所述检索向量获取模块包括:
    分词处理单元,用于获取所述检索信息所包含的各个词汇;
    第一关键词获取单元,用于将所述各个词汇中语义相近的所述词汇分别用同一第一关键词进行表示;
    统计单元,用于统计各个所述第一关键词出现的次数;
    检索向量获取单元,用于将各个所述第一关键词和各个所述第一关键词出现的次数映射到向量词典,以得到所述检索向量。
  8. 根据权利要求7所述的基于向量的文档检索装置,其中,所述第一关键词获取单元包括:
    同义词获取子单元,用于从同义词词林中获取与所述各个词汇相匹配的至少一个同义词;
    语义相似度获取子单元,用于计算所述各个词汇与对应匹配的所述同义词的语义相似度;
    第一关键词获取子单元,用于当所述词汇与所述同义词的相似度达到预设第一阈值时,将所述同义词作为与对应词汇相匹配的所述第一关键词。
  9. 根据权利要求8所述的基于向量的文档检索装置,其中,所述语义相似度获取子单元,包括:
    语义信息获取子单元,用于根据所述词汇获取第一语义信息,根据所述同义词获取第二语义信息;
    数据集获取子单元,用于从所述第一语义信息中获取第一语义关键词,以形成第一数据集,从所述第二语义信息中获取第二语义关键词,以形成第二数据集;
    语义相似度计算子单元,用于计算所述第一数据集和所述第二数据集之间的相似度,并将计算的所述相似度作为所述语义相似度。
  10. 根据权利要求6所述的基于向量的文档检索装置,其中,所述基于向量的文档检索装置还包括:
    资源词汇获取模块,用于从所述资源文档中获取各个资源词汇;
    第二关键词获取模块,用于将所述各个资源词汇中语义相近的所述资源词汇分别用第二关键词表示;
    词频统计模块,用于统计各个所述第二关键词出现的次数;
    文档向量获取模块,用于将各个所述第二关键词和各个所述第二关键词出现的次数映射到向量词典,以得到所述文档向量。
  11. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其中,所述处理器执行所述计算机可读指令时实现如下步骤:
    获取在客户端输入的检索信息;
    提取所述检索信息中的各个词汇,并根据所述检索信息中各个词汇的语义将所述检索信息转换为检索向量;
    计算所述检索向量与预先形成的与资源文档相匹配的文档向量之间的相似度;
    按照所述相似度的大小将与所述文档向量相匹配的所述资源文档进行排序,将所述资源文档的排序结果作为检索结果。
  12. 根据权利要求11所述的计算机设备,其中,所述提取所述检索信息中的各个词汇,并根据所述检索信息中各个词汇的语义将所述检索信息转换为检索向量包括:
    获取所述检索信息所包含的各个词汇;
    将所述各个词汇中语义相近的所述词汇分别用同一第一关键词进行表示;
    统计各个所述第一关键词出现的次数;
    将各个所述第一关键词和各个所述第一关键词出现的次数映射到向量词典,以得到所述检索向量。
  13. 根据权利要求12所述的计算机设备,其中,所述将所述各个词汇中语义相近的所述词汇分别用同一第一关键词进行表示包括:
    从同义词词林中获取与所述各个词汇相匹配的至少一个同义词;
    计算所述各个词汇与对应匹配的所述同义词的语义相似度;
    当所述词汇与所述同义词的相似度达到预设第一阈值时,将所述同义词作为与对应词汇相匹配的所述第一关键词。
  14. 根据权利要求13所述的计算机设备,其中,所述计算所述各个词汇与对应匹配的所述同义词的语义相似度的步骤包括:
    根据所述词汇获取第一语义信息,根据所述同义词获取第二语义信息;
    从所述第一语义信息中获取第一语义关键词,以形成第一数据集,从所述第二语义信息中获取第二语义关键词,以形成第二数据集;
    计算所述第一数据集和所述第二数据集之间的相似度,并将计算的所述相似度作为所述语义相似度。
  15. 根据权利要求11所述的计算机设备,其中,所述处理器执行所述计算机可读指令时还实现如下步骤:
    从所述资源文档中获取各个资源词汇;
    将所述各个资源词汇中语义相近的所述资源词汇分别用第二关键词表示;
    统计各个所述第二关键词出现的次数;
    将各个所述第二关键词和各个所述第二关键词出现的次数映射到向量词典,以得到所述文档向量。
  16. 一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
    获取在客户端输入的检索信息;
    提取所述检索信息中的各个词汇,并根据所述检索信息中各个词汇的语义将所述检索信息转换为检索向量;
    计算所述检索向量与预先形成的与资源文档相匹配的文档向量之间的相似度;
    按照所述相似度的大小将与所述文档向量相匹配的所述资源文档进行排序,将所述资源文档的排序结果作为检索结果。
  17. 根据权利要求16所述的可读存储介质,其中,所述提取所述检索信息中的各个词汇,并根据所述检索信息中各个词汇的语义将所述检索信息转换为检索向量包括:
    获取所述检索信息所包含的各个词汇;
    将所述各个词汇中语义相近的所述词汇分别用同一第一关键词进行表示;
    统计各个所述第一关键词出现的次数;
    将各个所述第一关键词和各个所述第一关键词出现的次数映射到向量词典,以得到所述检索向量。
  18. 根据权利要求17所述的可读存储介质,其中,所述将所述各个词汇中语义相近的所述词汇分别用同一第一关键词进行表示包括:
    从同义词词林中获取与所述各个词汇相匹配的至少一个同义词;
    计算所述各个词汇与对应匹配的所述同义词的语义相似度;
    当所述词汇与所述同义词的相似度达到预设第一阈值时,将所述同义词作为与对应词汇相匹配的所述第一关键词。
  19. 根据权利要求18所述的可读存储介质,其中,所述计算所述各个词汇与对应匹配的所述同义词的语义相似度的步骤包括:
    根据所述词汇获取第一语义信息,根据所述同义词获取第二语义信息;
    从所述第一语义信息中获取第一语义关键词,以形成第一数据集,从所述第二语义信息中获取第二语义关键词,以形成第二数据集;
    计算所述第一数据集和所述第二数据集之间的相似度,并将计算的所述相似度作为所述语义相似度。
  20. 根据权利要求16所述的可读存储介质,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:
    从所述资源文档中获取各个资源词汇;
    将所述各个资源词汇中语义相近的所述资源词汇分别用第二关键词表示;
    统计各个所述第二关键词出现的次数;
    将各个所述第二关键词和各个所述第二关键词出现的次数映射到向量词典,以得到所述文档向量。
     
PCT/CN2021/070585 2020-03-04 2021-01-07 基于向量的文档检索方法、装置、计算机设备及存储介质 Ceased WO2021175005A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010143243.6 2020-03-04
CN202010143243.6A CN111460090A (zh) 2020-03-04 2020-03-04 基于向量的文档检索方法、装置、计算机设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021175005A1 true WO2021175005A1 (zh) 2021-09-10

Family

ID=71680091

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/070585 Ceased WO2021175005A1 (zh) 2020-03-04 2021-01-07 基于向量的文档检索方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN111460090A (zh)
WO (1) WO2021175005A1 (zh)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114443895A (zh) * 2022-01-26 2022-05-06 网易传媒科技(北京)有限公司 检索方法和装置、计算机可读存储介质和计算设备
CN115309995A (zh) * 2022-09-14 2022-11-08 北京航空航天大学 一种基于需求文本的科技资源推送方法和装置
CN115878759A (zh) * 2023-01-05 2023-03-31 京华信息科技股份有限公司 一种文本查找方法、装置及存储介质
CN116126899A (zh) * 2023-01-17 2023-05-16 马上消费金融股份有限公司 数据检索方法及装置、电子设备及存储介质
CN116401212A (zh) * 2023-06-07 2023-07-07 东营市第二人民医院 一种基于数据分析的人事文书档案快速查找系统
CN116821055A (zh) * 2023-05-31 2023-09-29 中国银行股份有限公司 基于版本控制系统的文件检索方法、装置和设备
CN116842138A (zh) * 2023-07-24 2023-10-03 上海诚狐信息科技有限公司 基于文档的检索方法、装置、设备及存储介质
CN116932547A (zh) * 2023-07-14 2023-10-24 支付宝(杭州)信息技术有限公司 实体名称匹配的方法及装置
CN119004542A (zh) * 2024-10-24 2024-11-22 云上(江西)安全技术有限公司 一种基于索引树的云数据采集方法及系统
CN119377389A (zh) * 2024-12-31 2025-01-28 苏州元脑智能科技有限公司 文件快速检索方法、产品、计算机设备和存储介质
CN119621940A (zh) * 2025-02-06 2025-03-14 北京星震同源数字系统股份有限公司 一种文章检索方法、程序产品、设备及存储介质
CN119961380A (zh) * 2025-04-09 2025-05-09 山东征途信息科技股份有限公司 一种基于物联网的政务数据的智能检索方法及系统
CN120196726A (zh) * 2025-05-16 2025-06-24 中山大学 一种基于数据中台的教学领域数据采集方法及相关装置
CN121502059A (zh) * 2026-01-14 2026-02-10 北京八月瓜科技有限公司 一种大数据快速检索方法及系统

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111460090A (zh) * 2020-03-04 2020-07-28 深圳壹账通智能科技有限公司 基于向量的文档检索方法、装置、计算机设备及存储介质
JP2022050169A (ja) * 2020-09-17 2022-03-30 富士フイルムビジネスイノベーション株式会社 情報処理システム及びプログラム
CN112506864B (zh) * 2020-12-18 2023-07-25 北京百度网讯科技有限公司 文件检索的方法、装置、电子设备及可读存储介质
CN112765321A (zh) * 2021-01-22 2021-05-07 中信银行股份有限公司 接口查询方法及装置、设备、计算机可读存储介质
CN113449063B (zh) * 2021-06-25 2023-06-16 树根互联股份有限公司 一种构建文档结构信息检索库的方法及装置
CN113704408A (zh) * 2021-08-31 2021-11-26 工银科技有限公司 检索方法、装置、电子设备、存储介质和程序产品
CN114818678B (zh) * 2022-03-28 2024-08-23 西安远诺技术转移有限公司 一种科技成果管理方法、装置及电子设备
CN115048495A (zh) * 2022-07-22 2022-09-13 中国工商银行股份有限公司 文档检索方法、装置、电子设备和介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190179910A1 (en) * 2017-12-13 2019-06-13 International Business Machines Corporation Fast filtering for similarity searches on indexed data
CN110019669A (zh) * 2017-10-31 2019-07-16 北京国双科技有限公司 一种文本检索方法及装置
CN110276071A (zh) * 2019-05-24 2019-09-24 众安在线财产保险股份有限公司 一种文本匹配方法、装置、计算机设备及存储介质
CN110807149A (zh) * 2019-10-11 2020-02-18 卓尔智联(武汉)研究院有限公司 检索方法、装置及存储介质
CN111460090A (zh) * 2020-03-04 2020-07-28 深圳壹账通智能科技有限公司 基于向量的文档检索方法、装置、计算机设备及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662952B (zh) * 2012-03-02 2015-04-15 成都康赛信息技术有限公司 一种基于层次的中文文本并行数据挖掘方法
CN107122340B (zh) * 2017-03-30 2018-11-06 浙江省科技信息研究院 一种基于同义词分析的科技项目申报书的相似度检测方法
CN110399385A (zh) * 2019-06-24 2019-11-01 厦门市美亚柏科信息股份有限公司 一种用于小数据集的语义分析方法和系统
CN110442760B (zh) * 2019-07-24 2022-02-15 银江技术股份有限公司 一种问答检索系统的同义词挖掘方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110019669A (zh) * 2017-10-31 2019-07-16 北京国双科技有限公司 一种文本检索方法及装置
US20190179910A1 (en) * 2017-12-13 2019-06-13 International Business Machines Corporation Fast filtering for similarity searches on indexed data
CN110276071A (zh) * 2019-05-24 2019-09-24 众安在线财产保险股份有限公司 一种文本匹配方法、装置、计算机设备及存储介质
CN110807149A (zh) * 2019-10-11 2020-02-18 卓尔智联(武汉)研究院有限公司 检索方法、装置及存储介质
CN111460090A (zh) * 2020-03-04 2020-07-28 深圳壹账通智能科技有限公司 基于向量的文档检索方法、装置、计算机设备及存储介质

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114443895A (zh) * 2022-01-26 2022-05-06 网易传媒科技(北京)有限公司 检索方法和装置、计算机可读存储介质和计算设备
CN115309995A (zh) * 2022-09-14 2022-11-08 北京航空航天大学 一种基于需求文本的科技资源推送方法和装置
CN115878759A (zh) * 2023-01-05 2023-03-31 京华信息科技股份有限公司 一种文本查找方法、装置及存储介质
CN115878759B (zh) * 2023-01-05 2023-05-26 京华信息科技股份有限公司 一种文本查找方法、装置及存储介质
CN116126899A (zh) * 2023-01-17 2023-05-16 马上消费金融股份有限公司 数据检索方法及装置、电子设备及存储介质
CN116821055A (zh) * 2023-05-31 2023-09-29 中国银行股份有限公司 基于版本控制系统的文件检索方法、装置和设备
CN116401212A (zh) * 2023-06-07 2023-07-07 东营市第二人民医院 一种基于数据分析的人事文书档案快速查找系统
CN116401212B (zh) * 2023-06-07 2023-08-11 东营市第二人民医院 一种基于数据分析的人事文书档案快速查找系统
CN116932547A (zh) * 2023-07-14 2023-10-24 支付宝(杭州)信息技术有限公司 实体名称匹配的方法及装置
CN116842138A (zh) * 2023-07-24 2023-10-03 上海诚狐信息科技有限公司 基于文档的检索方法、装置、设备及存储介质
CN119004542A (zh) * 2024-10-24 2024-11-22 云上(江西)安全技术有限公司 一种基于索引树的云数据采集方法及系统
CN119377389A (zh) * 2024-12-31 2025-01-28 苏州元脑智能科技有限公司 文件快速检索方法、产品、计算机设备和存储介质
CN119621940A (zh) * 2025-02-06 2025-03-14 北京星震同源数字系统股份有限公司 一种文章检索方法、程序产品、设备及存储介质
CN119961380A (zh) * 2025-04-09 2025-05-09 山东征途信息科技股份有限公司 一种基于物联网的政务数据的智能检索方法及系统
CN120196726A (zh) * 2025-05-16 2025-06-24 中山大学 一种基于数据中台的教学领域数据采集方法及相关装置
CN121502059A (zh) * 2026-01-14 2026-02-10 北京八月瓜科技有限公司 一种大数据快速检索方法及系统

Also Published As

Publication number Publication date
CN111460090A (zh) 2020-07-28

Similar Documents

Publication Publication Date Title
WO2021175005A1 (zh) 基于向量的文档检索方法、装置、计算机设备及存储介质
CN108304378B (zh) 文本相似度计算方法、装置、计算机设备和存储介质
US9727637B2 (en) Retrieving text from a corpus of documents in an information handling system
US10586155B2 (en) Clarification of submitted questions in a question and answer system
US11017178B2 (en) Methods, devices, and systems for constructing intelligent knowledge base
US12541543B2 (en) Large language model-based information retrieval for large datasets
US9318027B2 (en) Caching natural language questions and results in a question and answer system
WO2022227165A1 (zh) 机器阅读理解的问答方法、装置、计算机设备及存储介质
KR102491172B1 (ko) 자연어 질의응답 시스템 및 그 학습 방법
WO2021017721A1 (zh) 智能问答方法、装置、介质及电子设备
WO2021189951A1 (zh) 文本搜索方法、装置、计算机设备和存储介质
CN111797214A (zh) 基于faq数据库的问题筛选方法、装置、计算机设备及介质
WO2020233131A1 (zh) 问答处理方法、装置、计算机设备和存储介质
CN110162771B (zh) 事件触发词的识别方法、装置、电子设备
WO2021051934A1 (zh) 基于人工智能的合同关键条款提取方法、装置及存储介质
CN106055549A (zh) 利用加速器的概念分析操作
WO2021139343A1 (zh) 基于自然语言处理的数据分析方法、装置和计算机设备
CN114880447A (zh) 信息检索方法、装置、设备及存储介质
CN113609847B (zh) 信息抽取方法、装置、电子设备及存储介质
CN113505196A (zh) 基于词性的文本检索方法、装置、电子设备及存储介质
CN111523019B (zh) 用于输出信息的方法、装置、设备以及存储介质
CN114298020A (zh) 一种基于主题语义信息的关键词向量化方法及其应用
CN120045750A (zh) 一种基于大语言模型的检索增强生成方法和系统
CN118797005A (zh) 智能问答方法、装置、电子设备、存储介质及产品
WO2022198747A1 (zh) 三元组信息的抽取方法、装置、电子设备和存储介质

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: 21764804

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 11/01/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21764804

Country of ref document: EP

Kind code of ref document: A1