WO2015043318A1 - 自动回复方法及装置 - Google Patents

自动回复方法及装置 Download PDF

Info

Publication number
WO2015043318A1
WO2015043318A1 PCT/CN2014/083701 CN2014083701W WO2015043318A1 WO 2015043318 A1 WO2015043318 A1 WO 2015043318A1 CN 2014083701 W CN2014083701 W CN 2014083701W WO 2015043318 A1 WO2015043318 A1 WO 2015043318A1
Authority
WO
WIPO (PCT)
Prior art keywords
original
information
category
keyword
reply
Prior art date
Application number
PCT/CN2014/083701
Other languages
English (en)
French (fr)
Inventor
张�杰
张轶博
李航
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015043318A1 publication Critical patent/WO2015043318A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/9032Query formulation
    • G06F16/90332Natural language query formulation or dialogue systems
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Definitions

  • the present invention relates to the field of computers, and in particular, to an automatic reply method and apparatus. Background technique
  • the natural language generation system can realize automatic reply during the user chat process.
  • This technology can effectively save users time to edit reply messages.
  • the existing automatic reply scheme is: after receiving the information to be replied, searching for a original sentence matching the information to be replied in a pre-established corpus, and using the reply sentence corresponding to the original sentence as the waiting Replying to the reply information corresponding to the information, wherein the corpus includes a plurality of original sentences and a reply sentence respectively corresponding to the plurality of original sentences.
  • whether the automatic reply can be realized depends on whether there is an original sentence in the corpus that matches the information to be replied, that is, whether the automatic reply can be realized depends largely on the original sentence in the corpus.
  • the number of corpora, and the size of the corpus is usually limited, which limits the implementation of automatic replies to a certain extent, resulting in reduced reliability of automatic replies.
  • the invention provides an automatic reply method and device for solving the problem of low reliability of the existing automatic reply scheme.
  • the present invention provides an automatic reply method, including: searching for an original keyword of original information in a historical chat record according to the received information to be replied, and obtaining a first original matching the keyword of the information to be replied a first mapping information, where the first mapping information includes the original keyword and a reply keyword corresponding to the original keyword, and obtains a first reply keyword corresponding to the first original keyword; Second mapping information, the second mapping information includes the original keyword, and a category of the original keyword, obtaining a category of the first original keyword; searching for third mapping information, the third mapping information Include the category of the original keyword and the sentence pattern corresponding to the category of the original keyword, and obtain the first original a first sentence corresponding to the category of the initial keyword; and obtaining, according to the first reply keyword and the first sentence, the reply information corresponding to the information to be returned.
  • the method before the searching for the first mapping information, the method further includes: corresponding to the original information for each original information in the historical chat record a keyword of the reply information, a reply keyword corresponding to the original keyword of the original information; storing the original keyword, and a reply keyword corresponding to the original keyword to the first mapping information.
  • the method before the searching for the second mapping information, the method further includes: according to the original information in the historical chat record a keyword of the corresponding reply information, a category of the keyword that obtains the reply information corresponding to the original information by clustering; and a key of the reply information corresponding to the original information for each original information in the historical chat record a category of a word, a category of the original keyword as the original information; storing the original keyword, and a category of the original keyword to the second mapping information.
  • the method before the searching for the third mapping information, the method further includes: a category, the reply information corresponding to the category is obtained, and the reply information corresponding to the category includes: reply information corresponding to the original information to which the original keyword of the category belongs; and the number of the reply information corresponding to the category
  • the sentence pattern of the reply information corresponding to the category is used as the sentence pattern corresponding to the category; if the number of the reply information corresponding to the category is multiple, the sentence corresponding to the reply information of the category is The sentence pattern that is used most frequently is used as the sentence pattern corresponding to the category; and the sentence pattern corresponding to the category and the category is stored in the third mapping information.
  • the searching for the original information in the historical chat record according to the received information to be replied includes: searching for a pre-established corpus according to the information to be replied, the corpus including a plurality of original sentences and the plurality of a reply sentence corresponding to the original sentence; if the original sentence matching the information to be replied does not exist in the plurality of original sentences, searching for the original keyword of the original information in the historical chat record according to the information to be replied, With the to be replied
  • the first original keyword of the information keyword matches.
  • the present invention provides an automatic replying device, including: a first searching module, configured to: search for an original keyword of original information in a historical chat record according to the received information to be replied, and obtain the information to be replied to a first search keyword that matches the keyword; a second search module, configured to search for the first mapping information, where the first mapping information includes the original keyword and a reply keyword corresponding to the original keyword, and the obtained a first reply keyword corresponding to the first original keyword; a third search module, configured to search for the second mapping information, where the second mapping information includes the original keyword, and a category of the original keyword, a fourth search module, configured to search for third mapping information, where the third mapping information includes a category of the original keyword, and a sentence pattern corresponding to the category of the original keyword, Obtaining a first sentence pattern corresponding to a category of the first original keyword; a processing module, configured to use, according to the first reply key And the first sentence obtaining the reply to be information corresponding to reply.
  • a first searching module configured to: search for
  • the device further includes: a first acquiring module, configured to: before the searching for the first mapping information, for each of the historical chat records The original information, the keyword of the reply information corresponding to the original information is used as the reply keyword corresponding to the original keyword of the original information; the first storage module is configured to use the original keyword, and the original The keyword corresponding to the reply keyword is stored to the first mapping information.
  • the device further includes: a second acquiring module, configured to: before searching for the second mapping information, And obtaining, according to a keyword of the reply information corresponding to the original information in the historical chat record, a category of the keyword of the reply information corresponding to the original information by using a cluster; the second acquiring module is further configured to: Each of the original information in the record, the category of the keyword of the reply information corresponding to the original information is used as the category of the original keyword of the original information; the second storage module is configured to use the original keyword, and The category of the original keyword is stored to the second mapping information.
  • the device further includes: a third acquiring module, configured to search for the third mapping information Previously, for each category of the original keyword, the reply information corresponding to the category is obtained, and the reply information corresponding to the category includes, and the original keyword to which the category is the original keyword belongs to
  • the third information acquisition module is further configured to: if the number of the reply information corresponding to the category is one, the sentence pattern of the reply information corresponding to the category is used as the sentence corresponding to the category
  • the third obtaining module is further configured to: if the number of the reply information corresponding to the category is multiple, the sentence pattern of the sentence information corresponding to the category corresponding to the category is used as the a sentence corresponding to the category; a third storage module, configured to store the category and the sentence corresponding to the category to the third mapping information.
  • the first searching module includes: a first searching unit, configured to Retrieving information, searching for a pre-established corpus, the corpus including a plurality of original sentences and a reply sentence corresponding to the plurality of original sentences; a second searching unit, configured to: if the plurality of original sentences do not exist and The original sentence to be matched by the reply information is used to search for the original keyword of the original information in the historical chat record according to the information to be replied, and obtain the first original keyword that matches the keyword of the information to be replied.
  • the automatic reply method and device provided by the present invention, by determining a reply sentence pattern corresponding to the information to be returned and a reply keyword corresponding to the information to be returned according to a keyword of the information to be returned, thereby obtaining the corresponding information to be returned
  • the technical solution of replying information effectively improves the reliability of automatic reply.
  • FIG. 1 is a schematic flowchart of an automatic replying method according to Embodiment 1 of the present invention
  • FIG. 2 is a schematic structural diagram of an automatic replying device according to Embodiment 2 of the present invention
  • FIG. 1 is a schematic flowchart of an automatic reply method according to Embodiment 1 of the present invention. As shown in FIG. 1, the method includes:
  • the execution body of the embodiment may be an automatic reply device, and the automatic reply device may be set in the chat software of the user.
  • the original information may specifically be the chat information sent by other users in the historical chat record of the user.
  • the user can send chat information through a communication function device such as a mobile phone, a personal computer, or a tablet computer.
  • the original keyword of the original information is the keyword of the original information.
  • the method for extracting the keyword of the information is not described herein.
  • the original keyword of the original information in the historical chat record may be recorded in the original keyword library, so that when the information to be returned is received, the first keyword library is obtained to obtain the first keyword.
  • Original keyword the method for searching for the first original keyword that matches the keyword of the information to be replied may include: using the same keyword as the keyword to be replied in the original keyword library The original keyword, as the first original keyword.
  • an implementation scenario of 101 may be: if the information to be replied is received, the original keyword of the original information in the historical chat record is directly searched according to the information to be replied, and the first original keyword is obtained.
  • another implementation scenario of 101 may be: if the information to be replied is received, the replies are automatically replied based on the corpus, and if the corpus cannot be automatically replied based on the corpus, the automatic reply method provided by the embodiment is automatically implemented. Reply.
  • 101 may specifically include: searching, according to the information to be replied, a pre-established corpus, where the corpus includes a plurality of original sentences and replies corresponding to the plurality of original sentences; If the original sentence matching the information to be replied does not exist in the plurality of original sentences, the original keyword of the original information in the historical chat record is searched according to the information to be replied, and the original keyword is obtained. The first original keyword matched by the keyword of the information to be returned.
  • the method may further include: if the first original keyword does not exist in the original keyword, ending the process and The first error message is output.
  • the cause can be determined quickly and easily based on the error information for maintenance.
  • the method may further include: for each original information in the historical chat record, a keyword of the reply information corresponding to the original information, a reply keyword corresponding to the original keyword of the original information; storing the original keyword, and a reply keyword corresponding to the original keyword to the first mapping information.
  • the method may further include: if the first original keyword exists in the original keyword, and the first mapping information does not exist
  • the first reply keyword ends the process and outputs the second error message.
  • the reason can be determined quickly and easily according to the error information, so as to perform maintenance.
  • the 102 may be executed before 103, concurrently with 103, or executed after 103.
  • the figure is only one of the specific embodiments, and is not limited thereto.
  • the method may further include: obtaining, according to a keyword of the reply information corresponding to the original information in the historical chat record, obtaining the original information by clustering The category of the keyword of the reply message; the reply corresponding to the original information for each original information in the historical chat record a category of a keyword of the information, a category of the original keyword as the original information; storing the original keyword, and a category of the original keyword to the second mapping information.
  • the method further includes: if the first original keyword exists in the original keyword, and the first mapping information does not exist in the first mapping information
  • the category of the original keyword ends the process and outputs a third error message. According to the present embodiment, if the automatic reply cannot be realized, the cause can be determined quickly and easily based on the error information for maintenance.
  • the method may further include: obtaining, for each type of the original keyword, reply information corresponding to the category, where the reply information corresponding to the category includes And the reply information corresponding to the original information to which the original keyword of the category belongs; if the number of the reply information corresponding to the category is one, the sentence of the reply information corresponding to the category is used as the category a corresponding sentence pattern; if the number of the response information corresponding to the category is plural, the sentence pattern having the most used number of the sentence patterns corresponding to the category is used as the sentence pattern corresponding to the category; The category and the sentence pattern corresponding to the category are stored to the third mapping information.
  • the method further includes: if the first original keyword exists in the original keyword, the first original key exists in the second mapping information If the first sentence pattern does not exist in the third mapping information, the process ends and the fourth error information is output. According to the present embodiment, if the automatic reply cannot be realized, the cause can be determined quickly and easily based on the error information for maintenance.
  • the method may further include: sending, to the device that sends the information to be replied, the reply information corresponding to the information to be replied.
  • the device may include, but is not limited to, a mobile phone, a personal computer, a tablet computer, and other devices having communication functions.
  • the reply sentence corresponding to the information to be returned and the reply keyword corresponding to the information to be returned are determined according to the keyword of the information to be returned, thereby obtaining the corresponding information to be returned.
  • FIG. 2 is a schematic structural diagram of an automatic reply device according to Embodiment 2 of the present invention.
  • the device includes: a first search module 21, a second search module 22, a third search module 23, and a fourth
  • the search module 24 and the processing module 25 are configured to: search the original keyword of the original information in the historical chat record according to the received information to be replied, and obtain a keyword that matches the keyword of the information to be replied.
  • a first original keyword a second search module 22, configured to search for first mapping information, where the first mapping information includes the original keyword and a reply keyword corresponding to the original keyword, and obtain the first original The first reply keyword corresponding to the keyword;
  • a third search module 23 configured to search for second mapping information, where the second mapping information includes the original keyword, and a category of the original keyword, and obtain a category of the first original keyword;
  • the module 24 is configured to search for third mapping information, where the third mapping information includes a category of the original keyword, and a sentence pattern corresponding to the category of the original keyword, and obtains a category corresponding to the first original keyword.
  • the processing module 25 is configured to obtain, according to the first reply keyword and the first sentence pattern, reply information corresponding to the information to be returned. Specifically, in an implementation scenario of the embodiment, if the information to be replied is received, the original keyword of the original information in the historical chat record is directly searched according to the information to be replied, and the first original keyword is obtained. .
  • another implementation scenario of this embodiment may be, if receiving When the information to be replied is sent, the automatic reply is first performed based on the corpus. If the corpus cannot be automatically replied based on the corpus, the automatic reply device provided by the embodiment is automatically replied.
  • the first searching module 21 may further include: a first searching unit, configured to: search for a pre-established corpus according to the information to be replied, where the corpus includes multiple original sentences and And the second search unit is configured to: if the original sentence matching the information to be replied does not exist in the plurality of original sentences, search for the historical chat according to the information to be replied The original keyword of the original information in the record is obtained, and the first original keyword matching the keyword of the information to be replied is obtained.
  • the apparatus may further include: a first acquiring module, configured to: for each original information in the historical chat record, before the searching for the first mapping information, a keyword corresponding to the reply information corresponding to the original information, as a reply keyword corresponding to the original keyword of the original information; a first storage module, configured to: match the original keyword with the original keyword The reply keyword is stored to the first mapping information.
  • the device may further include: a second acquiring module, configured to: according to the reply information corresponding to the original information in the historical chat record, before searching for the second mapping information a keyword, the type of the keyword of the reply information corresponding to the original information is obtained by clustering; the second acquiring module is further configured to: corresponding to the original information in the historical chat record, corresponding to the original information a category of a keyword of the reply information, a category of the original keyword as the original information; a second storage module, configured to store the original keyword, and a category of the original keyword to the second map information.
  • a second acquiring module configured to: according to the reply information corresponding to the original information in the historical chat record, before searching for the second mapping information a keyword, the type of the keyword of the reply information corresponding to the original information is obtained by clustering
  • the second acquiring module is further configured to: corresponding to the original information in the historical chat record, corresponding to the original information a category of a keyword of the reply information, a category of the original keyword as the
  • the apparatus may further include: a third obtaining module, configured to obtain, according to a category of each original keyword, the category corresponding to the third mapping information Reply information, the reply information corresponding to the category includes: reply information corresponding to the original information to which the original keyword of the category belongs;
  • the third obtaining module is further configured to: if the number of the reply information corresponding to the category is one, the sentence pattern of the reply information corresponding to the category is used as a sentence pattern corresponding to the category;
  • the module is further configured to: if the number of the response information corresponding to the category is plural, the sentence pattern having the most used number of the sentence patterns corresponding to the category is used as the sentence pattern corresponding to the category;
  • a third storage module configured to store the category and the sentence pattern corresponding to the category to the third mapping information.
  • the processing module 25 is further configured to: if the first original keyword does not exist in the original keyword, end the process and output the first error information. Or if the first original keyword exists in the original keyword, and the first reply keyword does not exist in the first mapping information, ending the process and outputting the second error message; or If the first original keyword exists in the original keyword, and the category of the first original keyword does not exist in the second mapping information, the process ends and the third error message is output; or The first original keyword exists in the original keyword, and the first original keyword is in the second mapping information, and the first sentence does not exist in the third mapping information. End the process and output the fourth error message.
  • the device may further include: a communication module, configured to send, to the device that sends the information to be replied, the reply information corresponding to the information to be replied.
  • the automatic reply device provided in this embodiment determines the reply sentence pattern corresponding to the to-be-returned information and the reply keyword corresponding to the to-be-reviewed information according to the keyword of the information to be returned, thereby obtaining the corresponding information to be returned.
  • the technical solution of replying to information effectively improves the reliability of automatic reply.
  • FIG. 3 is a schematic structural diagram of another automatic recovery device according to Embodiment 3 of the present invention.
  • the automatic reply device includes: a communication interface 31, a memory 32, and a processor 33.
  • the communication interface 31 is configured to receive information to be replied.
  • the memory 32 is used to store the program.
  • the program can include program code, the program code including computer operating instructions.
  • Memory 32 may include high speed RAM memory and may also include non-volatile memory, such as at least one disk memory.
  • the processor 33 is configured to execute a program stored in the memory 32, configured to: search for an original keyword of the original information in the historical chat record according to the received information to be replied, and obtain a keyword matching the keyword of the information to be replied Searching for the first mapping information, the first mapping information includes the original keyword and the reply keyword corresponding to the original keyword, and obtaining the first reply keyword corresponding to the first original keyword Searching for second mapping information, the second mapping information including the original keyword, and a category of the original keyword, obtaining a category of the first original keyword; searching for third mapping information, the third The mapping information includes a class of the original keyword, and a sentence pattern corresponding to the category of the original keyword, and obtains a first sentence pattern corresponding to the category of the first original keyword; The keyword and the first sentence formula obtain the
  • the replies may be automatically replied based on the corpus, and if the corpus cannot be automatically replied based on the corpus, the automatic reply device provided by the embodiment is further Implement automatic reply.
  • the processor 33 is specifically configured to: search for a pre-established corpus according to the information to be replied, where the corpus includes multiple original sentences and corresponding replies of the multiple original sentences a sentence; if the original sentence matching the information to be replied does not exist in the plurality of original sentences, searching for the original keyword of the original information in the historical chat record according to the information to be replied, obtaining the replies with the original information The first original keyword of the information keyword matches.
  • the processor 33 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one configured to implement an embodiment of the present invention. Multiple integrated circuits. Specifically, based on the program stored in the memory 32, in order to pre-establish the first mapping information, the processor 33 is further configured to: for each original information in the historical chat record, before the searching for the first mapping information, a keyword corresponding to the reply information corresponding to the original information as a reply keyword corresponding to the original keyword of the original information; storing the original keyword, and a reply keyword corresponding to the original keyword to the First mapping information.
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • the processor 33 is further configured to: according to the reply information corresponding to the original information in the historical chat record, before searching for the second mapping information. Key words, obtaining, by clustering, reply information corresponding to the original information a category of the keyword; for each original information in the historical chat record, a category of a keyword of the reply information corresponding to the original information is used as a category of the original keyword of the original information; The keyword, and the category of the original keyword are stored to the second mapping information.
  • the processor 33 is further configured to obtain the category corresponding to each type of the original keyword before searching for the third mapping information.
  • the reply information corresponding to the category includes: reply information corresponding to the original information to which the original keyword of the category belongs; if the number of the reply information corresponding to the category is one, the The sentence pattern of the reply information corresponding to the category is used as the sentence pattern corresponding to the category; if the number of the reply information corresponding to the category is plural, the sentence information of the reply information corresponding to the category is used most frequently a sentence pattern as a sentence pattern corresponding to the category; storing the sentence pattern corresponding to the category and the category to the third mapping information.
  • the processor 33 may be further configured to: if the first original keyword does not exist in the original keyword, And outputting the first error information; or, if the first original keyword exists in the original keyword, and the first reply keyword does not exist in the first mapping information, ending the process and outputting a second error message; or, if the first original keyword exists in the original keyword, and the category of the first original keyword does not exist in the second mapping information, the process ends and outputs a third An error message; or, if the first original keyword exists in the original keyword, the first mapping keyword exists in the second mapping information, and the third mapping information does not exist in the third mapping information.
  • the communication interface 31 is further configured to send the reply information corresponding to the information to be returned to the device that sends the information to be returned.
  • the communication interface 31, the processor 33, and the memory 32 may be connected to each other through a bus and complete communication with each other.
  • the bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Wait.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For the sake of convenience, only one thick line is shown in Figure 3, but it does not mean that there is only one Bus or a type of bus.
  • the communication interface 31, the memory 32, and the processor 33 are integrated on one chip, the communication interface 31, the memory 32, and the processor 33 can complete the same communication through the internal interface.
  • the automatic reply device determines the reply sentence pattern corresponding to the to-be-returned information and the reply keyword corresponding to the to-be-reviewed information according to the keyword of the information to be returned, thereby obtaining the corresponding information to be returned.
  • the technical solution of replying to information effectively improves the reliability of automatic reply.
  • the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Abstract

本发明提供一种自动回复方法及装置,包括:根据待回复信息,查找原始关键词,获得与所述待回复信息的关键词匹配的第一原始关键词;查找第一映射信息,获得所述第一原始关键词对应的第一回复关键词;查找第二映射信息,获得所述第一原始关键词的类别;查找第三映射信息,获得所述第一原始关键词的类别对应的第一句式;根据所述第一回复关键词和所述第一句式,获得所述待回复信息对应的回复信息。通过本发明提供的自动回复方法及装置,能够有效提高自动回复的可靠性。

Description

自动 复方法及装置
技术领域
本发明涉及计算机领域, 尤其涉及一种自动回复方法及装置。 背景技术
目前, 通过自然语言生成系统能够实现用户聊天过程中的自动回复。 该技术能够有效节省用户编辑回复信息的时间。 具体的, 现有的自动回复 方案为, 接收到待回复信息后, 在预先建立的语料库中, 査找与所述待回 复信息匹配的原始句子,并使用该原始句子对应的回复句子作为所述待回 复信息对应的回复信息, 其中, 所述语料库包括多个原始句子和与所述多 个原始句子分别对应的回复句子。
在上述自动回复方案中, 能否实现自动回复取决于语料库中是否存在 与所述待回复信息匹配的原始句子, 也就是说, 能否实现自动回复, 在很 大程度上取决于语料库中原始句子的数量, 而语料库的规模通常是有限 的, 这就在一定程度上限制了自动回复的实现, 导致自动回复的可靠性降 低。
发明内容
本发明提供一种自动回复方法及装置, 用于解决现有自动回复方案的 可靠性不高的问题。
第一方面, 本发明提供一种自动回复方法, 包括: 根据接收到的待回 复信息, 査找历史聊天记录中原始信息的原始关键词, 获得与所述待回复 信息的关键词匹配的第一原始关键词; 査找第一映射信息, 所述第一映射 信息包括所述原始关键词和所述原始关键词对应的回复关键词, 获得所述 第一原始关键词对应的第一回复关键词; 査找第二映射信息, 所述第二映 射信息包括所述原始关键词、 以及所述原始关键词的类别, 获得所述第一 原始关键词的类别; 査找第三映射信息, 所述第三映射信息包括所述原始 关键词的类别、 以及所述原始关键词的类别对应的句式, 获得所述第一原 始关键词的类别对应的第一句式; 根据所述第一回复关键词和所述第一句 式, 获得所述待回复信息对应的回复信息。
根据第一方面, 在第一方面的第一种可实施方式中, 所述査找第一映 射信息之前, 还包括: 针对所述历史聊天记录中的每个原始信息, 将所述 原始信息对应的回复信息的关键词, 作为所述原始信息的原始关键词对应 的回复关键词; 将所述原始关键词, 和所述原始关键词对应的回复关键词 存储至所述第一映射信息。
根据第一方面或第一方面的第一种可实施方式, 在第一方面的第二种 可实施方式中, 所述査找第二映射信息之前, 还包括: 根据所述历史聊天 记录中原始信息对应的回复信息的关键词, 通过聚类获得所述原始信息对 应的回复信息的关键词的类别; 针对所述历史聊天记录中的每个原始信 息, 将所述原始信息对应的回复信息的关键词的类别, 作为所述原始信息 的原始关键词的类别; 将所述原始关键词, 和所述原始关键词的类别存储 至所述第二映射信息。
根据第一方面或第一方面的前两种可实施方式之一, 在第一方面的第 三种可实施方式中, 所述査找第三映射信息之前, 还包括: 针对每种原始 关键词的类别, 获得所述类别对应的回复信息, 所述类别对应的回复信息 包括, 与类别为所述类别的原始关键词所属的原始信息对应的回复信息; 若所述类别对应的回复信息的个数为一个, 则将所述类别对应的回复信息 的句式作为所述类别对应的句式; 若所述类别对应的回复信息的个数为多 个, 则将所述类别对应的回复信息的句式中被使用次数最多的句式作为所 述类别对应的句式; 将所述类别和所述类别对应的句式, 存储至所述第三 映射信息。
根据第一方面或第一方面的前三种可实施方式之一, 在第一方面的第 四种可实施方式中, 所述根据接收到的待回复信息, 査找历史聊天记录中 的原始信息的原始关键词, 获得与所述待回复信息的关键词匹配的第一原 始关键词, 包括: 根据所述待回复信息, 査找预先建立的语料库, 所述语 料库包括多个原始句子和所述多个原始句子对应的回复句子; 若所述多个 原始句子中不存在与所述待回复信息匹配的原始句子, 则根据所述待回复 信息, 査找历史聊天记录中的原始信息的原始关键词, 获得与所述待回复 信息的关键词匹配的第一原始关键词。
第二方面, 本发明提供一种自动回复装置, 包括: 第一査找模块, 用 于根据接收到的待回复信息, 査找历史聊天记录中原始信息的原始关键 词, 获得与所述待回复信息的关键词匹配的第一原始关键词; 第二査找模 块, 用于査找第一映射信息, 所述第一映射信息包括所述原始关键词和所 述原始关键词对应的回复关键词, 获得所述第一原始关键词对应的第一回 复关键词; 第三査找模块, 用于査找第二映射信息, 所述第二映射信息包 括所述原始关键词、 以及所述原始关键词的类别, 获得所述第一原始关键 词的类别; 第四査找模块, 用于査找第三映射信息, 所述第三映射信息包 括所述原始关键词的类别、 以及所述原始关键词的类别对应的句式, 获得 所述第一原始关键词的类别对应的第一句式; 处理模块, 用于根据所述第 一回复关键词和所述第一句式, 获得所述待回复信息对应的回复信息。
根据第二方面,在第二方面的第一种可实施方式中,所述装置还包括: 第一获取模块, 用于在所述査找第一映射信息之前, 针对所述历史聊天记 录中的每个原始信息, 将所述原始信息对应的回复信息的关键词, 作为所 述原始信息的原始关键词对应的回复关键词; 第一存储模块, 用于将所述 原始关键词, 和所述原始关键词对应的回复关键词存储至所述第一映射信 息。
根据第二方面或第二方面的第一种可实施方式, 在第二方面的第二种 可实施方式中, 所述装置还包括: 第二获取模块, 用于在査找第二映射信 息之前, 根据所述历史聊天记录中原始信息对应的回复信息的关键词, 通 过聚类获得所述原始信息对应的回复信息的关键词的类别; 所述第二获取 模块, 还用于针对所述历史聊天记录中的每个原始信息, 将所述原始信息 对应的回复信息的关键词的类别, 作为所述原始信息的原始关键词的类 别; 第二存储模块, 用于将所述原始关键词, 和所述原始关键词的类别存 储至所述第二映射信息。
根据第二方面或第二方面的前两种可实施方式之一, 在第二方面的第 三种可实施方式中, 所述装置还包括: 第三获取模块, 用于在査找第三映 射信息之前,针对每种原始关键词的类别,获得所述类别对应的回复信息, 所述类别对应的回复信息包括, 与类别为所述类别的原始关键词所属的原 始信息对应的回复信息; 所述第三获取模块, 还用于若所述类别对应的回 复信息的个数为一个, 则将所述类别对应的回复信息的句式作为所述类别 对应的句式; 所述第三获取模块, 还用于若所述类别对应的回复信息的个 数为多个, 则将所述类别对应的回复信息的句式中被使用次数最多的句式 作为所述类别对应的句式; 第三存储模块, 用于将所述类别和所述类别对 应的句式, 存储至所述第三映射信息。
根据第二方面或第二方面的前三种可实施方式之一, 在第二方面的第 四种可实施方式中, 所述第一査找模块, 包括: 第一査找单元, 用于根据 所述待回复信息, 査找预先建立的语料库, 所述语料库包括多个原始句子 和所述多个原始句子对应的回复句子; 第二査找单元, 用于若所述多个原 始句子中不存在与所述待回复信息匹配的原始句子, 则根据所述待回复信 息, 査找历史聊天记录中的原始信息的原始关键词, 获得与所述待回复信 息的关键词匹配的第一原始关键词。
本发明提供的自动回复方法及装置, 通过根据待回复信息的关键词, 确定所述待回复信息对应的回复句式和所述待回复信息对应的回复关键 词, 从而获得所述待回复信息对应的回复信息的技术方案, 有效提高自动 回复的可靠性。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实 施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面 描述中的附图是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不 付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。 图 1为本发明实施例一提供的一种自动回复方法的流程示意图; 图 2为本发明实施例二提供的一种自动回复装置的结构示意图; 图 3为本发明实施例三提供的另一种自动回复装置的结构示意图。 具体实施方式
为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本发 明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于 本发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提下所获 得的所有其他实施例, 都属于本发明保护的范围。 图 1 为本发明实施例一提供的一种自动回复方法的流程示意图, 如图 1 所示, 所述方法包括:
101、根据接收到的待回复信息, 査找历史聊天记录中原始信息的原始关 键词, 获得与所述待回复信息的关键词匹配的第一原始关键词。 具体的, 本实施例的执行主体可以为自动回复装置, 所述自动回复装置 可以设置在用户的聊天软件中。 则进一歩具体的, 所述原始信息具体可以为 所述用户的历史聊天记录中其他用户发送来的聊天信息。 具体的, 所述用户 可以通过手机、 个人电脑、 平板电脑等具备通信功能的设备发送聊天信息。 所述原始信息的原始关键词即为所述原始信息的关键词, 具体的, 提取信息 的关键词的方法在此不再赘述。 在实际应用中, 可以将所述历史聊天记录中原始信息的原始关键词记录 在原始关键词库中, 从而在接收到待回复信息时, 通过査找所述原始关键词 库, 获得所述第一原始关键词。 具体的, 所述査找所述与所述待回复信息的 关键词匹配的第一原始关键词的方法, 可以包括: 将所述原始关键词库中, 与所述待回复信息的关键词相同的原始关键词, 作为所述第一原始关键词。
具体的, 101 的一种实施场景可以为, 若接收到待回复信息, 则直接根 据所述待回复信息, 査找历史聊天记录中原始信息的原始关键词, 获得所述 第一原始关键词。 可选的, 101 的另一种实施场景可以为, 若接收到待回复 信息, 则先基于语料库进行自动回复, 若基于语料库无法实现自动回复时, 再根据本实施例提供的自动回复方法实现自动回复。 相应的, 在后一种实施 场景中, 101具体可以包括: 根据所述待回复信息, 査找预先建立的语料库, 所述语料库包括多个原 始句子和所述多个原始句子对应的回复句子; 若所述多个原始句子中不存在与所述待回复信息匹配的原始句子, 则根 据所述待回复信息, 査找历史聊天记录中的原始信息的原始关键词, 获得与 所述待回复信息的关键词匹配的第一原始关键词。
可选的,在 101中所述査找历史聊天记录中原始信息的原始关键词之后, 所述方法还可以包括: 若所述原始关键词中不存在所述第一原始关键词, 则 结束流程并输出第一报错信息。 通过本实施方式, 若无法实现自动回复, 则 可根据报错信息方便快捷地确定原因, 以便进行维护。
102、 査找第一映射信息, 所述第一映射信息包括所述原始关键词和所述 原始关键词对应的回复关键词, 获得所述第一原始关键词对应的第一回复关 键词。 具体的, 为了预先建立所述第一映射信息, 在 102之前, 所述方法还可 以包括: 针对所述历史聊天记录中的每个原始信息, 将所述原始信息对应的回复 信息的关键词, 作为所述原始信息的原始关键词对应的回复关键词; 将所述原始关键词, 和所述原始关键词对应的回复关键词存储至所述第 一映射信息。
可选的, 在 102中所述査找第一映射信息之后, 所述方法还可以包括: 若所述原始关键词中存在所述第一原始关键词, 且所述第一映射信息中, 不 存在所述第一回复关键词, 则结束流程并输出第二报错信息。 通过本实施方 式, 若无法实现自动回复, 则可根据报错信息方便快捷地确定原因, 以便进 行维护。
103、 査找第二映射信息, 所述第二映射信息包括所述原始关键词、 以及 所述原始关键词的类别, 获得所述第一原始关键词的类别。
其中, 102可以在 103之前执行, 与 103同时执行, 或在 103之后执行, 图中给出的只是其中一种具体的实施方式, 而并未对其进行限制。
具体的, 为了预先建立所述第二映射信息, 在 103之前, 所述方法还可 以包括: 根据所述历史聊天记录中原始信息对应的回复信息的关键词, 通过聚类 获得所述原始信息对应的回复信息的关键词的类别; 针对所述历史聊天记录中的每个原始信息, 将所述原始信息对应的回复 信息的关键词的类别, 作为所述原始信息的原始关键词的类别; 将所述原始关键词,和所述原始关键词的类别存储至所述第二映射信息。 可选的, 在 103中所述査找第二映射信息之后, 还可以包括: 若所述原 始关键词中存在所述第一原始关键词, 且所述第二映射信息中不存在所述第 一原始关键词的类别, 则结束流程并输出第三报错信息。 通过本实施方式, 若无法实现自动回复, 则可根据报错信息方便快捷地确定原因, 以便进行维 护。
104、査找第三映射信息,所述第三映射信息包括所述原始关键词的类别、 以及所述原始关键词的类别对应的句式, 获得所述第一原始关键词的类别对 应的第一句式。 具体的, 为了预先建立所述第三映射信息, 在 104之前, 所述方法还可 以包括: 针对每种原始关键词的类别, 获得所述类别对应的回复信息, 所述类别 对应的回复信息包括, 与类别为所述类别的原始关键词所属的原始信息对应 的回复信息; 若所述类别对应的回复信息的个数为一个, 则将所述类别对应的回复信 息的句式作为所述类别对应的句式; 若所述类别对应的回复信息的个数为多个, 则将所述类别对应的回复信 息的句式中被使用次数最多的句式作为所述类别对应的句式; 将所述类别和所述类别对应的句式, 存储至所述第三映射信息。 可选的, 在 104中所述査找第三映射信息之后, 还可以包括: 若所述原 始关键词中存在所述第一原始关键词, 所述第二映射信息中存在所述第一原 始关键词的类别, 且所述第三映射信息中不存在所述第一句式, 则结束流程 并输出第四报错信息。 通过本实施方式, 若无法实现自动回复, 则可根据报 错信息方便快捷地确定原因, 以便进行维护。
105、根据所述第一回复关键词和所述第一句式, 获得所述待回复信息对 应的回复信息。 可选的, 所述第一映射信息、 第二映射信息和第三映射信息的建立也可 通过用户手动设置实现, 本实施例不对其具体的建立方法进行限制。 其中, 根据第一回复关键词和所述第一句式获得回复信息的具体方法不 再赘述。 具体的, 为了进一歩实现自动回复, 在 105之后, 所述方法还可以 包括: 向发送所述待回复信息的设备, 发送所述待回复信息对应的回复信息。 同样的, 所述设备可以包括但不限于: 手机、 个人电脑、 平板电脑、 及其它 具备通信功能的设备。 本实施例提供的自动回复方法, 通过根据待回复信息的关键词, 确定所 述待回复信息对应的回复句式和所述待回复信息对应的回复关键词, 从而获 得所述待回复信息对应的回复信息的技术方案,有效提高自动回复的可靠性。
图 2为本发明实施例二提供的一种自动回复装置的结构示意图, 如图 2 所示, 所述装置包括: 第一査找模块 21、 第二査找模块 22、 第三査找模块 23、 第四査找模块 24和处理模块 25; 其中, 第一査找模块 21, 用于根据接收到的待回复信息, 査找历史聊天记录中 原始信息的原始关键词, 获得与所述待回复信息的关键词匹配的第一原始关 键词; 第二査找模块 22, 用于査找第一映射信息, 所述第一映射信息包括所述 原始关键词和所述原始关键词对应的回复关键词, 获得所述第一原始关键词 对应的第一回复关键词;
第三査找模块 23, 用于査找第二映射信息, 所述第二映射信息包括所述 原始关键词、 以及所述原始关键词的类别, 获得所述第一原始关键词的类别; 第四査找模块 24, 用于査找第三映射信息, 所述第三映射信息包括所述 原始关键词的类别、 以及所述原始关键词的类别对应的句式, 获得所述第一 原始关键词的类别对应的第一句式;
处理模块 25, 用于根据所述第一回复关键词和所述第一句式, 获得所述 待回复信息对应的回复信息。 具体的, 本实施例的一种实施场景可以为, 若接收到待回复信息, 则直 接根据所述待回复信息, 査找历史聊天记录中原始信息的原始关键词, 获得 所述第一原始关键词。 可选的, 本实施例的另一种实施场景可以为, 若接收 到待回复信息, 则先基于语料库进行自动回复, 若基于语料库无法实现自动 回复时, 再基于本实施例提供的自动回复装置实现自动回复。 相应的, 在后 一种实施场景中, 第一査找模块 21, 具体可以包括: 第一査找单元, 用于根据所述待回复信息, 査找预先建立的语料库, 所 述语料库包括多个原始句子和所述多个原始句子对应的回复句子; 第二査找单元, 用于若所述多个原始句子中不存在与所述待回复信息匹 配的原始句子, 则根据所述待回复信息, 査找历史聊天记录中的原始信息的 原始关键词, 获得与所述待回复信息的关键词匹配的第一原始关键词。 具体的, 为了预先建立所述第一映射信息, 所述装置还可以包括: 第一获取模块, 用于在所述査找第一映射信息之前, 针对所述历史聊天 记录中的每个原始信息, 将所述原始信息对应的回复信息的关键词, 作为所 述原始信息的原始关键词对应的回复关键词; 第一存储模块, 用于将所述原始关键词, 和所述原始关键词对应的回复 关键词存储至所述第一映射信息。 再具体的, 为了预先建立所述第二映射信息, 所述装置还可以包括: 第二获取模块, 用于在査找第二映射信息之前, 根据所述历史聊天记录 中原始信息对应的回复信息的关键词, 通过聚类获得所述原始信息对应的回 复信息的关键词的类别; 所述第二获取模块, 还用于针对所述历史聊天记录中的每个原始信息, 将所述原始信息对应的回复信息的关键词的类别, 作为所述原始信息的原始 关键词的类别; 第二存储模块, 用于将所述原始关键词, 和所述原始关键词的类别存储 至所述第二映射信息。 又具体的, 为了预先建立所述第三映射信息, 所述装置还可以包括: 第三获取模块, 用于在査找第三映射信息之前, 针对每种原始关键词的 类别, 获得所述类别对应的回复信息, 所述类别对应的回复信息包括, 与类 别为所述类别的原始关键词所属的原始信息对应的回复信息; 所述第三获取模块, 还用于若所述类别对应的回复信息的个数为一个, 则将所述类别对应的回复信息的句式作为所述类别对应的句式; 所述第三获取模块, 还用于若所述类别对应的回复信息的个数为多个, 则将所述类别对应的回复信息的句式中被使用次数最多的句式作为所述类别 对应的句式; 第三存储模块, 用于将所述类别和所述类别对应的句式, 存储至所述第 三映射信息。
可选的, 在本实施例的上述任一实施方式中, 处理模块 25, 还可以用于 若所述原始关键词中不存在所述第一原始关键词, 则结束流程并输出第一报 错信息; 或者, 若所述原始关键词中存在所述第一原始关键词,且所述第一映射信息中, 不存在所述第一回复关键词, 则结束流程并输出第二报错信息; 或者, 若所述原始关键词中存在所述第一原始关键词, 且所述第二映射信息中 不存在所述第一原始关键词的类别, 则结束流程并输出第三报错信息; 或者, 若所述原始关键词中存在所述第一原始关键词, 所述第二映射信息中存 在所述第一原始关键词的类别,且所述第三映射信息中不存在所述第一句式, 则结束流程并输出第四报错信息。 具体的, 为了进一歩实现自动回复, 所述装置还可以包括: 通信模块, 用于向发送所述待回复信息的设备, 发送所述待回复信息对应的回复信息。 本实施例提供的自动回复装置, 通过根据待回复信息的关键词, 确定所 述待回复信息对应的回复句式和所述待回复信息对应的回复关键词, 从而获 得所述待回复信息对应的回复信息的技术方案,有效提高自动回复的可靠性。 图 3为本发明实施例三提供的另一种自动回复装置的结构示意图。 如图 3所示, 所述自动回复装置包括: 通信接口 31、 存储器 32和处理器 33。 通信接口 31, 用于接收待回复信息。 存储器 32, 用于存放程序。 具体地, 程序可以包括程序代码, 所述程序 代码包括计算机操作指令。 存储器 32可能包含高速 RAM存储器, 也可能还 包括非易失性存储器 (non- volatile memory) , 例如至少一个磁盘存储器。 处理器 33, 用于执行存储器 32存放的程序, 以用于: 根据接收到的待 回复信息, 査找历史聊天记录中原始信息的原始关键词, 获得与所述待回复 信息的关键词匹配的第一原始关键词; 査找第一映射信息, 所述第一映射信 息包括所述原始关键词和所述原始关键词对应的回复关键词, 获得所述第一 原始关键词对应的第一回复关键词; 査找第二映射信息, 所述第二映射信息 包括所述原始关键词、 以及所述原始关键词的类别, 获得所述第一原始关键 词的类别; 査找第三映射信息, 所述第三映射信息包括所述原始关键词的类 另 |J、 以及所述原始关键词的类别对应的句式, 获得所述第一原始关键词的类 别对应的第一句式; 根据所述第一回复关键词和所述第一句式, 获得所述待 回复信息对应的回复信息。 可选的, 在本实施例的一种实施场景中, 若接收到待回复信息, 则可先 基于语料库进行自动回复, 若基于语料库无法实现自动回复时, 再基于本实 施例提供的自动回复装置实现自动回复。 相应的, 在后一种实施场景中, 处 理器 33, 具体可以用于根据所述待回复信息, 査找预先建立的语料库, 所述 语料库包括多个原始句子和所述多个原始句子对应的回复句子; 若所述多个 原始句子中不存在与所述待回复信息匹配的原始句子, 则根据所述待回复信 息, 査找历史聊天记录中的原始信息的原始关键词, 获得与所述待回复信息 的关键词匹配的第一原始关键词。
其中, 处理器 33可能是一个中央处理器 (Central Processing Unit, 简称 为 CPU) , 或者是特定集成电路 (Application Specific Integrated Circuit, 简 称为 ASIC) , 或者是被配置成实施本发明实施例的一个或多个集成电路。 具体的, 基于存储器 32存放的程序, 为了预先建立所述第一映射信息, 处理器 33, 还用于在所述査找第一映射信息之前, 针对所述历史聊天记录中 的每个原始信息, 将所述原始信息对应的回复信息的关键词, 作为所述原始 信息的原始关键词对应的回复关键词; 将所述原始关键词, 和所述原始关键 词对应的回复关键词存储至所述第一映射信息。
再具体的,基于存储器 32存放的程序,为了预先建立所述第二映射信息, 处理器 33, 还用于在査找第二映射信息之前, 根据所述历史聊天记录中原始 信息对应的回复信息的关键词, 通过聚类获得所述原始信息对应的回复信息 的关键词的类别; 针对所述历史聊天记录中的每个原始信息, 将所述原始信 息对应的回复信息的关键词的类别,作为所述原始信息的原始关键词的类别; 将所述原始关键词, 和所述原始关键词的类别存储至所述第二映射信息。
又具体的,基于存储器 32存放的程序,为了预先建立所述第三映射信息, 处理器 33, 还用于在査找第三映射信息之前, 针对每种原始关键词的类别, 获得所述类别对应的回复信息, 所述类别对应的回复信息包括, 与类别为所 述类别的原始关键词所属的原始信息对应的回复信息; 若所述类别对应的回 复信息的个数为一个, 则将所述类别对应的回复信息的句式作为所述类别对 应的句式; 若所述类别对应的回复信息的个数为多个, 则将所述类别对应的 回复信息的句式中被使用次数最多的句式作为所述类别对应的句式; 将所述 类别和所述类别对应的句式, 存储至所述第三映射信息。
可选的,基于存储器 32存放的程序,在本实施例的上述任一实施方式中, 处理器 33, 还可以用于若所述原始关键词中不存在所述第一原始关键词, 则 结束流程并输出第一报错信息; 或者, 若所述原始关键词中存在所述第一原 始关键词, 且所述第一映射信息中, 不存在所述第一回复关键词, 则结束流 程并输出第二报错信息; 或者, 若所述原始关键词中存在所述第一原始关键 词, 且所述第二映射信息中不存在所述第一原始关键词的类别, 则结束流程 并输出第三报错信息; 或者, 若所述原始关键词中存在所述第一原始关键词, 所述第二映射信息中存在所述第一原始关键词的类别, 且所述第三映射信息 中不存在所述第一句式, 则结束流程并输出第四报错信息。 具体的, 为了进一歩实现自动回复, 通信接口 31, 还用于向发送所述待 回复信息的设备, 发送所述待回复信息对应的回复信息。
可选的, 在具体实现上, 如果通信接口 31、 处理器 33和存储器 32独立 实现, 则通信接口 31、 存储器 32和处理器 33可以通过总线相互连接并完成 相互间的通信。 所述总线可以是工业标准体系结构 (Industry Standard Architecture, 简称为 ISA) 总线、 外部设备互连 (Peripheral Component, 简 称为 PCI ) 总线或扩展工业标准体系结构 (Extended Industry Standard Architecture, 简称为 EISA)总线等。所述总线可以分为地址总线、数据总线、 控制总线等。 为便于表示, 图 3中仅用一条粗线表示, 但并不表示仅有一根 总线或一种类型的总线。
可选的, 在具体实现上, 如果通信接口 31、 存储器 32和处理器 33集成 在一块芯片上实现, 则通信接口 31、 存储器 32和处理器 33可以通过内部接 口完成相同间的通信。
本实施例提供的自动回复装置, 通过根据待回复信息的关键词, 确定所 述待回复信息对应的回复句式和所述待回复信息对应的回复关键词, 从而获 得所述待回复信息对应的回复信息的技术方案,有效提高自动回复的可靠性。 所属领域的技术人员可以清楚地了解到, 为描述的方便和简洁, 上述描 述的装置的具体工作过程, 可以参考前述方法实施例中的对应过程, 在此不 再赘述。 本领域普通技术人员可以理解: 实现上述各方法实施例的全部或部分歩 骤可以通过程序指令相关的硬件来完成。 前述的程序可以存储于一计算机可 读取存储介质中。 该程序在执行时, 执行包括上述各方法实施例的歩骤; 而 前述的存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序代码 的介质。 最后应说明的是: 以上各实施例仅用以说明本发明的技术方案, 而非对 其限制; 尽管参照前述各实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改, 或者对其中部分或者全部技术特征进行等同替换; 而这些修改或者替换, 并 不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims

权 利 要 求 书
1、 一种自动回复方法, 其特征在于, 包括: 根据接收到的待回复信息,査找历史聊天记录中原始信息的原始关键词, 获得与所述待回复信息的关键词匹配的第一原始关键词;
査找第一映射信息, 所述第一映射信息包括所述原始关键词和所述原始 关键词对应的回复关键词,获得所述第一原始关键词对应的第一回复关键词; 査找第二映射信息, 所述第二映射信息包括所述原始关键词、 以及所述 原始关键词的类别, 获得所述第一原始关键词的类别;
査找第三映射信息, 所述第三映射信息包括所述原始关键词的类别、 以 及所述原始关键词的类别对应的句式, 获得所述第一原始关键词的类别对应 的第一句式; 根据所述第一回复关键词和所述第一句式, 获得所述待回复信息对应的 回复信息。
2、 根据权利要求 1所述的方法, 其特征在于, 所述査找第一映射信息之 前, 还包括: 针对所述历史聊天记录中的每个原始信息, 将所述原始信息对应的回复 信息的关键词, 作为所述原始信息的原始关键词对应的回复关键词;
将所述原始关键词, 和所述原始关键词对应的回复关键词存储至所述第 一映射信息。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述査找第二映射信 息之前, 还包括: 根据所述历史聊天记录中原始信息对应的回复信息的关键词, 通过聚类 获得所述原始信息对应的回复信息的关键词的类别;
针对所述历史聊天记录中的每个原始信息, 将所述原始信息对应的回复 信息的关键词的类别, 作为所述原始信息的原始关键词的类别; 将所述原始关键词,和所述原始关键词的类别存储至所述第二映射信息。
4、 根据权利要求 1-3中任一项所述的方法, 其特征在于, 所述査找第三 映射信息之前, 还包括:
针对每种原始关键词的类别, 获得所述类别对应的回复信息, 所述类别 对应的回复信息包括, 与类别为所述类别的原始关键词所属的原始信息对应 的回复信息;
若所述类别对应的回复信息的个数为一个, 则将所述类别对应的回复信 息的句式作为所述类别对应的句式;
若所述类别对应的回复信息的个数为多个, 则将所述类别对应的回复信 息的句式中被使用次数最多的句式作为所述类别对应的句式;
将所述类别和所述类别对应的句式, 存储至所述第三映射信息。
5、 根据权利要求 1-4中任一项所述的方法, 其特征在于, 所述根据接收 到的待回复信息, 査找历史聊天记录中的原始信息的原始关键词, 获得与所 述待回复信息的关键词匹配的第一原始关键词, 包括:
根据所述待回复信息, 査找预先建立的语料库, 所述语料库包括多个原 始句子和所述多个原始句子对应的回复句子;
若所述多个原始句子中不存在与所述待回复信息匹配的原始句子, 则根 据所述待回复信息, 査找历史聊天记录中的原始信息的原始关键词, 获得与 所述待回复信息的关键词匹配的第一原始关键词。
6、 一种自动回复装置, 其特征在于, 包括: 第一査找模块, 用于根据接收到的待回复信息, 査找历史聊天记录中原 始信息的原始关键词, 获得与所述待回复信息的关键词匹配的第一原始关键 词;
第二査找模块, 用于査找第一映射信息, 所述第一映射信息包括所述原 始关键词和所述原始关键词对应的回复关键词, 获得所述第一原始关键词对 应的第一回复关键词;
第三査找模块, 用于査找第二映射信息, 所述第二映射信息包括所述原 始关键词、 以及所述原始关键词的类别, 获得所述第一原始关键词的类别; 第四査找模块, 用于査找第三映射信息, 所述第三映射信息包括所述原 始关键词的类别、 以及所述原始关键词的类别对应的句式, 获得所述第一原 始关键词的类别对应的第一句式; 处理模块, 用于根据所述第一回复关键词和所述第一句式, 获得所述待 回复信息对应的回复信息。
7、 根据权利要求 6所述的装置, 其特征在于, 所述装置还包括: 第一获取模块, 用于在所述査找第一映射信息之前, 针对所述历史聊天 记录中的每个原始信息, 将所述原始信息对应的回复信息的关键词, 作为所 述原始信息的原始关键词对应的回复关键词;
第一存储模块, 用于将所述原始关键词, 和所述原始关键词对应的回复 关键词存储至所述第一映射信息。
8、 根据权利要求 6或 7所述的装置, 其特征在于, 所述装置还包括: 第二获取模块, 用于在査找第二映射信息之前, 根据所述历史聊天记录 中原始信息对应的回复信息的关键词, 通过聚类获得所述原始信息对应的回 复信息的关键词的类别;
所述第二获取模块, 还用于针对所述历史聊天记录中的每个原始信息, 将所述原始信息对应的回复信息的关键词的类别, 作为所述原始信息的原始 关键词的类别; 第二存储模块, 用于将所述原始关键词, 和所述原始关键词的类别存储 至所述第二映射信息。
9、 根据权利要求 6-8中任一项所述的装置, 其特征在于, 所述装置还包 括:
第三获取模块, 用于在査找第三映射信息之前, 针对每种原始关键词的 类别, 获得所述类别对应的回复信息, 所述类别对应的回复信息包括, 与类 别为所述类别的原始关键词所属的原始信息对应的回复信息;
所述第三获取模块, 还用于若所述类别对应的回复信息的个数为一个, 则将所述类别对应的回复信息的句式作为所述类别对应的句式; 所述第三获取模块, 还用于若所述类别对应的回复信息的个数为多个, 则将所述类别对应的回复信息的句式中被使用次数最多的句式作为所述类别 对应的句式;
第三存储模块, 用于将所述类别和所述类别对应的句式, 存储至所述第 三映射信息。
10、 根据权利要求 6-9 中任一项所述的装置, 其特征在于, 所述第一査 找模块, 包括:
第一査找单元, 用于根据所述待回复信息, 査找预先建立的语料库, 所 述语料库包括多个原始句子和所述多个原始句子对应的回复句子;
第二査找单元, 用于若所述多个原始句子中不存在与所述待回复信息匹 配的原始句子, 则根据所述待回复信息, 査找历史聊天记录中的原始信息的 原始关键词, 获得与所述待回复信息的关键词匹配的第一原始关键词。
PCT/CN2014/083701 2013-09-30 2014-08-05 自动回复方法及装置 WO2015043318A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310464118.5A CN104516921B (zh) 2013-09-30 2013-09-30 自动回复方法及装置
CN201310464118.5 2013-09-30

Publications (1)

Publication Number Publication Date
WO2015043318A1 true WO2015043318A1 (zh) 2015-04-02

Family

ID=52742003

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/083701 WO2015043318A1 (zh) 2013-09-30 2014-08-05 自动回复方法及装置

Country Status (2)

Country Link
CN (1) CN104516921B (zh)
WO (1) WO2015043318A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109067643A (zh) * 2018-09-26 2018-12-21 中国平安财产保险股份有限公司 基于关键字的回复方法、装置、计算机设备及存储介质
CN112202661A (zh) * 2020-09-11 2021-01-08 腾讯科技(深圳)有限公司 会话消息处理方法、装置、计算机设备以及存储介质

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105912734A (zh) * 2016-06-22 2016-08-31 北京金山安全软件有限公司 一种用户反馈自动回复方法及装置
CN106383590A (zh) * 2016-09-06 2017-02-08 珠海格力电器股份有限公司 一种智能输入的方法及装置
CN106649280B (zh) * 2017-02-13 2019-07-09 长沙军鸽软件有限公司 一种创建共享语料库的方法
CN107766416A (zh) * 2017-09-08 2018-03-06 阿里巴巴集团控股有限公司 数据分析方法、装置及系统
CN108062388B (zh) * 2017-12-15 2021-09-17 北京百度网讯科技有限公司 人机对话的回复生成方法和装置
CN108769408A (zh) * 2018-05-28 2018-11-06 维沃移动通信有限公司 一种消息发送方法及终端设备
CN109670155A (zh) * 2018-11-08 2019-04-23 龙马智声(珠海)科技有限公司 一种自动回复通信信息的方法
CN112784030B (zh) * 2021-01-28 2022-08-26 北京三快在线科技有限公司 一种生成样本的方法、装置、存储介质及电子设备
CN112818109B (zh) * 2021-02-25 2022-09-16 网易(杭州)网络有限公司 邮件的智能回复方法、介质、装置和计算设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6029171A (en) * 1997-02-10 2000-02-22 Actioneer, Inc. Method and apparatus for group action processing between users of a collaboration system
CN101233532A (zh) * 2005-08-02 2008-07-30 Nxp股份有限公司 天线结构、转发器和制造天线结构的方法
CN102035868A (zh) * 2009-09-28 2011-04-27 上海智臻网络科技有限公司 实现网页自动客户服务的方法和装置
CN102289431A (zh) * 2011-06-24 2011-12-21 华南理工大学 一种基于自然语言理解并提供短信回复选项的方法
CN103200550A (zh) * 2013-04-26 2013-07-10 上海华勤通讯技术有限公司 移动终端及其自动回复短信的方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100565515C (zh) * 2006-11-30 2009-12-02 腾讯科技(深圳)有限公司 一种中文自动应答方法及系统
CN101232532A (zh) * 2007-12-11 2008-07-30 中兴通讯股份有限公司 在移动终端中实现短信智能回复的装置和方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6029171A (en) * 1997-02-10 2000-02-22 Actioneer, Inc. Method and apparatus for group action processing between users of a collaboration system
CN101233532A (zh) * 2005-08-02 2008-07-30 Nxp股份有限公司 天线结构、转发器和制造天线结构的方法
CN102035868A (zh) * 2009-09-28 2011-04-27 上海智臻网络科技有限公司 实现网页自动客户服务的方法和装置
CN102289431A (zh) * 2011-06-24 2011-12-21 华南理工大学 一种基于自然语言理解并提供短信回复选项的方法
CN103200550A (zh) * 2013-04-26 2013-07-10 上海华勤通讯技术有限公司 移动终端及其自动回复短信的方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109067643A (zh) * 2018-09-26 2018-12-21 中国平安财产保险股份有限公司 基于关键字的回复方法、装置、计算机设备及存储介质
CN112202661A (zh) * 2020-09-11 2021-01-08 腾讯科技(深圳)有限公司 会话消息处理方法、装置、计算机设备以及存储介质

Also Published As

Publication number Publication date
CN104516921B (zh) 2018-02-06
CN104516921A (zh) 2015-04-15

Similar Documents

Publication Publication Date Title
WO2015043318A1 (zh) 自动回复方法及装置
JP6936888B2 (ja) トレーニングコーパスの生成方法、装置、機器及び記憶媒体
US9798774B1 (en) Graph data search method and apparatus
US11138971B2 (en) Using context to interpret natural language speech recognition commands
WO2018149209A1 (zh) 语音识别方法、电子设备以及计算机存储介质
US10043220B2 (en) Method, device and storage medium for data processing
WO2015096477A1 (zh) 信息回复方法及装置
US20120215786A1 (en) Server-Side Search Of Email Attachments
WO2019161645A1 (zh) 基于Shell的数据表提取方法、终端、设备及存储介质
WO2020155740A1 (zh) 信息查询方法、装置、计算机设备及存储介质
WO2016202222A1 (zh) 一种随机存取存储器的访问方法、装置及控制芯片、存储介质
CN112257436A (zh) 文本检测方法及装置
CN112667415A (zh) 数据调用方法、装置、可读存储介质及电子设备
CN109543027B (zh) 分页数据的获取方法及装置、设备及存储介质
CN114050974B (zh) 一种拓扑准确度的确定方法、装置及计算机可读存储介质
CN106202440B (zh) 数据处理方法、装置及设备
WO2020103447A1 (zh) 视频信息链式存储方法、装置、计算机设备及存储介质
CN110442696B (zh) 查询处理方法及装置
US20150235228A1 (en) Method, device and system for on-line payment information transmission
WO2020258652A1 (zh) 字符替换方法、系统、计算机设备及计算机可读存储介质
CN110750472A (zh) 一种int中断转msi中断的转换方法、装置及存储介质
WO2023221427A1 (zh) 寻卡方法、nfc芯片及电子设备
JP2014102280A (ja) 機能実行指示システム、機能実行指示方法及び機能実行指示プログラム
WO2015055062A1 (zh) 数据文件写入方法及系统、数据文件读取方法及系统
CN110085237B (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: 14849855

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

Country of ref document: EP

Kind code of ref document: A1