WO2021189803A1 - 文本纠错方法、装置、电子设备及存储介质 - Google Patents

文本纠错方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2021189803A1
WO2021189803A1 PCT/CN2020/119084 CN2020119084W WO2021189803A1 WO 2021189803 A1 WO2021189803 A1 WO 2021189803A1 CN 2020119084 W CN2020119084 W CN 2020119084W WO 2021189803 A1 WO2021189803 A1 WO 2021189803A1
Authority
WO
WIPO (PCT)
Prior art keywords
word
candidate
error correction
text
corrected
Prior art date
Application number
PCT/CN2020/119084
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 WO2021189803A1 publication Critical patent/WO2021189803A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/226Validation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/237Lexical tools
    • G06F40/242Dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates

Definitions

  • This application relates to the field of artificial intelligence technology, and in particular to a text error correction method, device, electronic equipment, and computer-readable storage medium.
  • the current text error correction methods include two major categories. One is divided into two stages: error recognition and error correction. Error recognition is to specify the position of a bit error in a sentence. Error correction refers to finding out all possible errors that have been located. Replace the words and find the most suitable words for replacement and correction; the second type is to use the deep learning method to complete the error recognition and error correction steps at the same time, and output the corrected sentence results.
  • the inventor realizes that among the above two types of methods, the first type of method is mainly based on the confusing word dictionary, and the accuracy rate is low; the second type of method must collect a large amount of mislabeled corpus for training, and the efficiency is low.
  • a text error correction method provided by this application includes:
  • a pre-trained language model is used to score the candidate error correction sentences, and the suspected wrong words are determined to be corrected according to the score.
  • the present application also provides a text error correction device, the device includes:
  • the word segmentation module is used to obtain the text to be corrected, and perform word segmentation on the text to be corrected to obtain a word set;
  • the module for determining suspected wrong words is used to determine the suspected wrong words in the word set by using a preset dictionary
  • a candidate phrase set acquiring module configured to determine, according to the suspected wrong word, a candidate phrase set that can be used to replace the suspected wrong word;
  • a candidate error correction sentence acquiring module configured to replace the suspected wrong word in the text to be corrected with each candidate phrase in the candidate phrase set to obtain a candidate error correction sentence corresponding to each candidate phrase;
  • the wrong word correction module is used for scoring the candidate error correction sentence using a pre-trained language model, and correcting the suspected wrong word according to the score.
  • This application also provides an electronic device, which includes:
  • Memory storing at least one computer program instruction
  • the processor executes the computer program instructions stored in the memory to implement the following steps:
  • a pre-trained language model is used to score the candidate error correction sentences, and the suspected wrong words are determined to be corrected according to the score.
  • This application also provides a computer-readable storage medium that stores a computer program, and the computer program is executed by a processor to implement the following steps:
  • a pre-trained language model is used to score the candidate error correction sentences, and the suspected wrong words are determined to be corrected according to the score.
  • FIG. 1 is a schematic flowchart of a text error correction method provided by an embodiment of this application
  • FIG. 2 is a schematic flowchart of a word segmentation method provided by an embodiment of this application.
  • FIG. 3 is a schematic flowchart of a method for determining a suspected wrong word provided by an embodiment of the application
  • FIG. 4 is a schematic flowchart of a method for determining candidate phrases according to an embodiment of this application.
  • FIG. 5 is a schematic flowchart of a method for determining a candidate error correction sentence provided by an embodiment of the application
  • FIG. 6 is a schematic flowchart of a sentence scoring method provided by an embodiment of the application.
  • FIG. 7 is a schematic diagram of modules of a text error correction device provided by an embodiment of the application.
  • FIG. 8 is a schematic diagram of the internal structure of an electronic device for implementing a text error correction method provided by an embodiment of the application;
  • the execution subject of the text error correction method provided in the embodiments of the present application includes, but is not limited to, at least one of the electronic devices that can be configured to execute the method provided in the embodiments of the present application, such as a server and a terminal.
  • the text error correction method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform.
  • the server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
  • the text error correction method includes:
  • the text to be corrected is a computer document type, which is mainly used to record and store text information.
  • the text to be corrected in the embodiment of the present application may be various documents written by the user, or documents such as notices.
  • the obtaining the text to be corrected includes: receiving the text to be corrected uploaded by the user; obtaining the text to be corrected from a preset database; downloading the text to be corrected from a webpage; and/or from the blockchain Get the text to be corrected in the node of.
  • the word segmentation of the text to be corrected to obtain a word set includes:
  • the embodiment of the present application uses a word segmentation technology based on a prefix word segmentation dictionary to segment each sentence in the sentence set to be corrected.
  • the specific implementation steps of the word segmentation include:
  • a directed acyclic graph is constructed by connecting end to end;
  • a dynamic programming algorithm is used to calculate the maximum probability path in the directed acyclic graph, and the word segmentation result obtained by the division method corresponding to the maximum probability path is selected.
  • the preset dictionary includes a common dictionary and a scene professional word dictionary, wherein the common word dictionary is a word set containing a plurality of modern high-frequency common words, and the scene professional word dictionary contains a plurality of specific scenes.
  • the word set of proprietary words For example, when the specific scenario is for insurance, the proprietary words include the insurer, the insured, the beneficiary, etc.
  • the method before using a preset dictionary to determine the suspected wrong words in the word set, the method further includes constructing a dictionary of common words.
  • the construction of a dictionary of commonly used words includes:
  • the use of a preset dictionary to determine the suspected wrong words in the word set includes:
  • the determination of a candidate phrase set that can be used to replace the suspected wrong word according to the suspected wrong word includes:
  • is a suspected wrong word, which can be divided into “ ⁇ ” and " ⁇ ", corresponding to the homophones and homographs found in “ ⁇ ” are Shi, Shi, Shi, Shi, Shi, Guo, Discuss, pay, etc.
  • the homonyms and homographs of "piece” include Jian, Jian, Jian, Wu, etc. Combining them to form words, you can get words such as time, stone sword, practice, and so on. Collect these words The candidate phrase set corresponding to the suspected wrong word "timepiece” can be obtained.
  • the embodiment of the present application first uses a preset dictionary to quickly find possible wrong words, and then combines the homophone table and the homograph table to find all possible candidate word combinations, which expands the range of candidate words and facilitates subsequent corrections , Improve the accuracy of correction.
  • one suspected wrong word in the embodiment of the present application corresponds to one candidate phrase set.
  • using each candidate phrase in the candidate phrase set to replace the suspected wrong word in the text to be corrected to obtain a candidate error correction sentence corresponding to each candidate phrase includes:
  • a candidate phrase in the candidate phrase set is used to replace a corresponding suspected wrong word to obtain a candidate error correction sentence corresponding to the candidate phrase.
  • the pre-trained language model is a language model based on a neural network, and the language model can calculate the probability value of a sentence.
  • the probability of the entire sentence is the product of the occurrence probabilities of each word, and the greater the probability value is Show that the sentence is more reasonable.
  • the language model may be stored in a node of a blockchain.
  • the S5 includes:
  • S50 Calculate the probability value of each candidate error correction sentence by using the language model
  • the scoring algorithm described in the embodiment of the present application includes:
  • P is the score value
  • N is the total number of the candidate error correction sentences
  • q(x i ) is the probability value of the i-th candidate error correction sentence output by the language model.
  • the embodiment of the present application can find the candidate phrase corresponding to the replacement of the suspected wrong word through the above-mentioned scoring algorithm, and replace the corresponding suspected wrong word with the candidate phrase in the text to be corrected to obtain the corrected text.
  • this embodiment of the application uses a pre-trained language model to determine the reasonableness of the candidate phrase in the sentence.
  • the language model can incorporate semantic information to determine the rationality of the sentence and improve the accuracy of text error correction.
  • the embodiment of the application obtains the text to be corrected and performs word segmentation on the text to be corrected to obtain a word set.
  • the text is divided into words to facilitate subsequent detection and correction of words; a preset dictionary is used to determine the word set
  • the suspected wrong words can be quickly located by using the dictionary to improve the detection efficiency; according to the suspected wrong words, the candidate phrase set that can be used to replace the suspected wrong words is determined, and all possible candidate word combinations can be found.
  • the text error correction device 100 described in this application can be installed in an electronic device.
  • the text error correction device may include a word segmentation module 101, a suspected wrong word determination module 102, a candidate phrase set acquisition module 103, a candidate error correction sentence acquisition module 104, and a wrong word correction module 105.
  • the module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the word segmentation module 101 is used to obtain the text to be corrected, and perform word segmentation on the text to be corrected to obtain a word set.
  • the text to be corrected is a computer document type, which is mainly used to record and store text information.
  • the text to be corrected in the embodiment of the present application may be various documents written by the user, or documents such as notices.
  • the obtaining the text to be corrected includes: receiving the text to be corrected uploaded by the user; obtaining the text to be corrected from a preset database; downloading the text to be corrected from a webpage; and/or from the blockchain Get the text to be corrected in the node of.
  • word segmentation module 101 is specifically used for:
  • the embodiment of the present application uses a word segmentation technology based on a prefix word segmentation dictionary to segment each sentence in the sentence set to be corrected.
  • the specific implementation steps of the word segmentation include:
  • a directed acyclic graph is constructed by connecting end to end;
  • a dynamic programming algorithm is used to calculate the maximum probability path in the directed acyclic graph to obtain the word segmentation result of the sentence sentence.
  • the suspected wrong word determining module 102 is used to determine the suspected wrong words in the word set by using a preset dictionary.
  • the preset dictionary includes a common dictionary and a scene professional word dictionary, wherein the common word dictionary is a word set containing a plurality of modern high-frequency common words, and the scene professional word dictionary contains a plurality of specific scenes.
  • the word set of proprietary words For example, when the specific scenario is for insurance, the proprietary words include the insurer, the insured, the beneficiary, etc.
  • the method before using a preset dictionary to determine the suspected wrong words in the word set, the method further includes constructing a dictionary of common words.
  • the construction of a dictionary of commonly used words includes:
  • the suspected wrong word determining module 102 specifically performs the following operations:
  • the candidate phrase set obtaining module 103 is configured to determine, according to the suspected wrong words, a candidate phrase set that can be used to replace the suspected wrong words.
  • the candidate phrase set obtaining module 103 is specifically configured to:
  • the characters in the candidate character set are combined to form words to obtain a candidate phrase set.
  • is a suspected wrong word, which can be divided into “ ⁇ ” and " ⁇ ", corresponding to the homophones and homographs found in “ ⁇ ” are Shi, Shi, Shi, Shi, Shi, Guo, Discuss, pay, etc.
  • the homonyms and homographs of "piece” include Jian, Jian, Jian, Wu, etc. Combining them to form words, you can get words such as time, stone sword, practice, and so on. Collect these words The candidate phrase set corresponding to the suspected wrong word "timepiece” can be obtained.
  • the embodiment of the present application first uses a preset dictionary to quickly find possible wrong words, and then combines the homophone table and the homograph table to find all possible candidate word combinations, which expands the range of candidate words and facilitates subsequent corrections , Improve the accuracy of correction.
  • the candidate error correction sentence obtaining module 104 is configured to use each candidate phrase in the candidate phrase set to replace the suspected wrong word in the text to be corrected to obtain a candidate error correction sentence corresponding to each candidate phrase .
  • the acquiring candidate error correction sentence module 104 is specifically configured to:
  • a candidate phrase in the candidate phrase set is used to replace the corresponding suspected wrong word to obtain a candidate error correction sentence corresponding to the candidate phrase.
  • the wrong word correction module 105 is configured to score the candidate error correction sentences using a pre-trained language model, and determine to correct the suspected wrong words according to the score.
  • the pre-trained language model is a language model based on a neural network, and the language model can calculate the probability value of a sentence.
  • the probability of the entire sentence is the product of the occurrence probabilities of each word, and the greater the probability value is Show that the sentence is more reasonable.
  • the language model may be stored in a node of a blockchain.
  • the wrong word correction module 105 is specifically configured to:
  • a preset scoring algorithm is used to calculate the scoring value of each candidate error correction sentence
  • the candidate phrase corresponding to the candidate error correction sentence with the highest score is selected to correct the suspected wrong word.
  • the scoring algorithm described in the embodiment of the present application includes:
  • P is the score value
  • N is the total number of the candidate error correction sentences
  • q(x i ) is the probability value of the i-th candidate error correction sentence output by the language model.
  • the embodiment of the present application can find the candidate phrase corresponding to the replacement of the suspected wrong word through the above-mentioned scoring algorithm, and replace the corresponding suspected wrong word with the candidate phrase in the text to be corrected to obtain the corrected text.
  • this embodiment of the application uses a pre-trained language model to determine the reasonableness of the candidate phrase in the sentence.
  • the language model can incorporate semantic information to determine the rationality of the sentence and improve the accuracy of text error correction.
  • FIG. 8 it is a schematic diagram of the structure of an electronic device implementing the text error correction method of the present application.
  • the electronic device 1 may include a processor 10, a memory 11, and a bus, and may also include a computer program stored in the memory 11 and running on the processor 10, such as a text error correction program 12.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, for example, a mobile hard disk of the electronic device 1.
  • the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart media card (SMC), and a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash card (Flash Card), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can be used not only to store application software and various data installed in the electronic device 1, such as the code of the text error correction program 12, etc., but also to temporarily store data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Combinations of central processing unit (CPU), microprocessor, digital processing chip, graphics processor, and various control chips, etc.
  • the processor 10 is the control unit of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules stored in the memory 11 (for example, executing Text error correction programs, etc.), and call data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • the bus may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection and communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 8 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 8 does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure. Components, or a combination of certain components, or different component arrangements.
  • the electronic device 1 may also include a power source (such as a battery) for supplying power to various components.
  • the power source may be logically connected to the at least one processor 10 through a power management device, thereby controlling power
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators.
  • the electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface.
  • the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may also include a user interface.
  • the user interface may be a display (Display) and an input unit (such as a keyboard (Keyboard)).
  • the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc.
  • the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
  • the text error correction program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can realize:
  • a pre-trained language model is used to score the candidate error correction sentences, and the suspected wrong words are determined to be corrected according to the score.
  • the integrated module/unit of the electronic device 1 can be stored in a computer readable storage medium. It can be non-volatile or volatile.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional modules.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)
  • Document Processing Apparatus (AREA)

Abstract

一种文本纠错方法、一种文本纠错装置、电子设备及计算机可读存储介质,涉及人工智能技术,该方法包括:获取待纠错文本,并对所述待纠错文本进行分词,得到词语集(S1);利用预设的词典确定所述词语集中的疑似错词(S2);根据所述疑似错词确定用于替换所述疑似错词的候选词组集(S3);利用所述候选词组集中的每个候选词组替换所述待纠错文本中的所述疑似错词,得到与每个候选词组对应的候选纠错语句(S4);利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进行纠正(S5)。该方法还涉及区块链技术,预先训练好的语言模型可存储于区块链中。该方法可以提高文本纠错的准确率和效率。

Description

文本纠错方法、装置、电子设备及存储介质
本申请要求于2020年9月3日提交中国专利局、申请号为202010914967.6,发明名称为“文本纠错方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,尤其涉及一种文本纠错方法、装置、电子设备及计算机可读存储介质。
背景技术
随着计算机的发展,很多文本的书写不再是用笔书写,而是转为计算机输入打印。但文本书写过程中往往会出现很多错误,如用字错误(短板写成短班),语法错误(的地得混用),用词错误(辅助决策写成扶助决策)等。
目前的文本纠错方法包括两大类,一类是分为错误识别和错误纠正两个阶段,错误识别是指定位错误在句子中出现的位置,错误纠正是指找出已定位错误的所有可能替代用词并找出最合适的词进行替换修正;第二类是使用深度学习方法同时完成错误识别和错误修正步骤,并输出修正后的句子结果。发明人意识到上述两类方法中,第一类方法主要基于易混词词典,准确率较低;第二类方法必须要收集大量错误标注语料进行训练,效率较低。
发明内容
本申请提供的一种文本纠错方法,包括:
获取待纠错文本,并对所述待纠错文本进行分词,得到词语集;
利用预设的词典确定所述词语集中的疑似错词;
根据所述疑似错词确定可用于替换所述疑似错词的候选词组集;
利用所述候选词组集中的每个候选词组替换所述待纠错文本中的所述疑似错词,得到与每个候选词组对应的候选纠错语句;
利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进行纠正。
本申请还提供一种文本纠错装置,所述装置包括:
分词模块,用于获取待纠错文本,并对所述待纠错文本进行分词,得到词语集;
确定疑似错词模块,用于利用预设的词典确定所述词语集中的疑似错词;
获取候选词组集模块,用于根据所述疑似错词确定可用于替换所述疑似错词的候选词组集;
获取候选纠错语句模块,用于利用所述候选词组集中的每个候选词组替换所述待纠错文本中的所述疑似错词,得到与每个候选词组对应的候选纠错语句;
错词纠正模块,用于利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进行纠正。
本申请还提供一种电子设备,所述电子设备包括:
存储器,存储至少一个计算机程序指令;及
处理器,执行所述存储器中存储的计算机程序指令以实现如下步骤:
获取待纠错文本,并对所述待纠错文本进行分词,得到词语集;
利用预设的词典确定所述词语集中的疑似错词;
根据所述疑似错词确定可用于替换所述疑似错词的候选词组集;
利用所述候选词组集中的每个候选词组替换所述待纠错文本中的所述疑似错词,得到与每个候选词组对应的候选纠错语句;
利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进行纠正。
本申请还提供一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行以实现如下步骤:
获取待纠错文本,并对所述待纠错文本进行分词,得到词语集;
利用预设的词典确定所述词语集中的疑似错词;
根据所述疑似错词确定可用于替换所述疑似错词的候选词组集;
利用所述候选词组集中的每个候选词组替换所述待纠错文本中的所述疑似错词,得到与每个候选词组对应的候选纠错语句;
利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进行纠正。
附图说明
图1为本申请一实施例提供的文本纠错方法的流程示意图;
图2为本申请一实施例提供的分词方法的流程示意图;
图3为本申请一实施例提供的确定疑似错词方法的流程示意图;
图4为本申请一实施例提供的确定候选词组方法的流程示意图;
图5为本申请一实施例提供的确定候选纠错语句方法的流程示意图;
图6为本申请一实施例提供的语句评分方法的流程示意图;
图7为本申请一实施例提供的文本纠错装置的模块示意图;
图8为本申请一实施例提供的实现文本纠错方法的电子设备的内部结构示意图;
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例提供的文本纠错方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述文本纠错方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。
参照图1所示,为本申请一实施例提供的文本纠错方法的流程示意图。在本实施例中,文本纠错方法包括:
S1、获取待纠错文本,并对所述待纠错文本进行分词,得到词语集。
较佳地,所述待纠错文本是一种计算机的文档类型,主要用于记载和存储文字信息。本申请实施例中所述待纠错文本可以是用户写好的各种文书,或是通知等文档。
详细地,所述获取待纠错文本,包括:接收用户上传的待纠错文本;从预设的数据库中获取待纠错文本;从网页中下载待纠错文本;及/或从区块链的节点中获取待纠错文本。
详细地,参阅图2所示,所述对所述待纠错文本进行分词,得到词语集,包括:
S10、将所述待纠错文本按句进行划分,得到待纠错语句集;
S11、对所述待纠错语句集中的每个语句进行分词,得到词语集。
进一步地,本申请实施例利用基于前缀分词词典的分词技术对所述待纠错语句集中的每个语句进行分词。所述分词具体实现步骤包括:
利用前缀分词词典对所述语句进行切分,得到一种或者多种划分方式下的原始词语集;
根据所述原始词语集,通过首尾相连构建有向无环图;
采用动态规划算法计算所述有向无环图中的最大概率路径,选择所述最大概率路径对应的划分方式得到的分词结果。
S2、利用预设的词典确定所述词语集中的疑似错词。
优选地,所述预设的词典包括常用词典和场景专业词词典,其中,所述常用词词典是包含多个现代高频常用词语的词语集,所述场景专业词词典是包含多个具体场景专有词的词语集,如在具体场景为办理保险时,专有词包括保险人、投保人、受益人等。
本申请一可选实施例中,在利用预设的词典确定所述词语集中的疑似错词之前,还包括构建常用词词典。其中,所述构建常用词词典包括:
获取常用的基础词汇;
以所述基础词汇作为关键词在网页中进行检索,得到网络数据文本;
对所述网络数据文本进行分析,并提取所述网络数据文本中的高频词语;
将所述基础词汇和高频词语汇集,得到常用词词典。
详细地,参阅图3所示,所述利用预设的词典确定所述词语集中的疑似错词,包括:
S20、选择所述词语集中的一个词语;
S21、查找所述词语是否存在于常用词词典及场景专业词词典中;
在所述词语不存在于所述常用词词典及场景专业词词典中时,执行S22、将所述词语划归为疑似错词;
当所述词语已经划归为疑似错词,或者所述词语存在于所述常用词词典及场景专业词词典中时,返回S21,直至所述词语集中每个词语都被选择完毕。
S3、根据所述疑似错词确定可用于替换所述疑似错词的候选词组集。
详细地,参阅图4所示,所述根据所述疑似错词确定可用于替换所述疑似错词的候选词组集,包括:
S30、将所述疑似错词按字进行拆分,得到一个或多个疑似错字;
S31、在预设的同音字表中和同形字表中找到与所述疑似错字对应的同音字、同形字,得到候选字集;
S32、根据所述疑似错词将所述候选字集中的字进行组合组词,得到候选词组集。
例如,“时件”为一个疑似错词,可以将其拆分为“时”、“件”,对应找到“时”的同音字和同形字有是、十、什、石、实、过、讨、付等,“件”的同音字和同形字有间、见、剑、荐、践、仵等,将其进行组合组词,可以得到时间、石剑、实践等词语,将这些词语汇集即可得到“时件”这个疑似错词对应的候选词组集。
优选地,本申请实施例先利用预设词典快速找到到可能的错误词,再结合同音字表和同形字表找出所有可能的候选词组合,扩大了候选词的范围,有利于后 续的纠正,提高纠正的准确率。
S4、利用所述候选词组集中的每个候选词组替换所述待纠错文本中的所述疑似错词,得到与每个候选词组对应的候选纠错语句。
详细地,本申请实施例中一个疑似错词对应一个候选词组集。参阅图5所示,所述利用所述候选词组集中的每个候选词组替换所述待纠错文本中的所述疑似错词,得到与每个候选词组对应的候选纠错语句,包括:
S40、根据所述候选词组集确定对应的疑似错词;
S41、根据所述疑似错词确定具有疑似错词的待纠错语句;
S42、在所述待纠错语句中用所述候选词组集中的候选词组替换对应的疑似错词,得到与所述候选词组对应的候选纠错语句。
S5、利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进行纠正。
优选地,所述预先训练好的语言模型是基于神经网络的一种语言模型,所述语言模型可以计算一个句子的概率值大小,整句的概率就是各个词出现概率的乘积,概率值越大表明该句子越合理。为了保证所述语言模型的安全性,所述语言模型可以存储于一区块链的节点中。
详细地,参阅图6所示,所述S5详细包括:
S50、利用所述语言模型计算将每个所述候选纠错语句的概率值;
S51、根据所述概率值,利用预设的评分算法计算每个候选纠错语句的评分值;
S52、选择评分值最高的候选纠错语句对应的候选词组对所述疑似错词进行纠正。
进一步地,本申请实施例中所述评分算法包括:
Figure PCTCN2020119084-appb-000001
其中,P是评分值;N是所述候选纠错语句的总数;q(x i)是所述语言模型输出的第i个候选纠错语句的概率值。
优选地,本申请实施例通过上述评分算法可以找到替换疑似错词对应的候选词组,在所述待纠错文本中用所述候选词组代替对应的疑似错词,即可得到纠正后的文本。
较佳地,本申请实施例利用预先训练好的语言模型,判断候选词组在句子中存在的合理度,所述语言模型可以融入语义信息进行句子合理性的判断,提高文本的纠错准确率。
本申请实施例获取待纠错文本,并对所述待纠错文本进行分词,得到词语集,将文本分为词语,便于后续对词语进行检测纠错;利用预设的词典确定所述词语集中的疑似错词,利用词典可以快速定位到可能的错误词,提高检测效率;根据所述疑似错词确定可用于替换所述疑似错词的候选词组集,找出所有可能的候选词组合,可以扩大疑似错词的可替换范围,提高纠错的准确率;利用所述候选词组集中的每个候选词组替换所述待纠错文本中的所述疑似错词,得到与每个候选词组对应的候选纠错语句,将候选词组放入原语句中,便于后续判断候选词语与原语句的匹配合理度;利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进行纠正,利用语言模型可以融入语义信息对候选纠错语句的合理性进行评分,可以提高纠错的准确率,并且能够提高效率。因此本申请提出的文本纠错方法、装置及计算机可读存储介质,可以实现提高文本纠错的准确率和效率。
如图7所示,是本申请文本纠错装置的功能模块图。
本申请所述文本纠错装置100可以安装于电子设备中。根据实现的功能,所述文本纠错装置可以包括分词模块101、确定疑似错词模块102、获取候选词组集模块103、获取候选纠错语句模块104和错词纠正模块105。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。
在本实施例中,关于各模块/单元的功能如下:
所述分词模块101,用于获取待纠错文本,并对所述待纠错文本进行分词,得到词语集。
较佳地,所述待纠错文本是一种计算机的文档类型,主要用于记载和存储文字信息。本申请实施例中所述待纠错文本可以是用户写好的各种文书,或是通知等文档。
详细地,所述获取待纠错文本,包括:接收用户上传的待纠错文本;从预设的数据库中获取待纠错文本;从网页中下载待纠错文本;及/或从区块链的节点中获取待纠错文本。
详细地,所述分词模块101具体用于:
将所述待纠错文本按句进行划分,得到待纠错语句集;
对所述待纠错语句集中的每个语句进行分词,得到词语集。
进一步地,本申请实施例利用基于前缀分词词典的分词技术对所述待纠错语句集中的每个语句进行分词。所述分词具体实现步骤包括:
利用前缀分词词典对所述语句进行切分,得到一种或者多种划分方式下的原始词语集;
根据所述原始词语集,通过首尾相连构建有向无环图;
采用动态规划算法计算所述有向无环图中的最大概率路径,得到所述文语句的分词结果。
所述确定疑似错词模块102,用于利用预设的词典确定所述词语集中的疑似错词。
优选地,所述预设的词典包括常用词典和场景专业词词典,其中,所述常用词词典是包含多个现代高频常用词语的词语集,所述场景专业词词典是包含多个具体场景专有词的词语集,如在具体场景为办理保险时,专有词包括保险人、投保人、受益人等。
本申请一可选实施例中,在利用预设的词典确定所述词语集中的疑似错词之前,还包括构建常用词词典。其中,所述构建常用词词典包括:
获取常用的基础词汇;
以所述基础词汇作为关键词在网页中进行检索,得到网络数据文本;
对所述网络数据文本进行分析,并提取所述网络数据文本中的高频词语;
将所述基础词汇和高频词语汇集,得到常用词词典。
详细地,在利用预设的词典确定所述词语集中的疑似错词时,所述确定疑似错词模块102具体执行下述操作:
选择所述词语集中的一个词语;
查找所述词语是否存在于常用词词典及场景专业词词典中;
在所述词语不存在于所述常用词词典及场景专业词词典中时,将所述词语划归为疑似错词;
直至所述词语集中每个词语都被选择完毕。
所述获取候选词组集模块103,用于根据所述疑似错词确定可用于替换所述疑似错词的候选词组集。
详细地,所述获取候选词组集模块103具体用于:
将所述疑似错词按字进行拆分,得到一个或多个疑似错字;
在预设的同音字表中和同形字表中找到与所述疑似错字对应的同音字、同形字,得到候选字集;
根据所述疑似错词将所述候选字集中的字进行组合组词,得到候选词组集。
例如,“时件”为一个疑似错词,可以将其拆分为“时”、“件”,对应找到“时”的同音字和同形字有是、十、什、石、实、过、讨、付等,“件”的同音字和同形字有间、见、剑、荐、践、仵等,将其进行组合组词,可以得到时间、石剑、实践等词语,将这些词语汇集即可得到“时件”这个疑似错词对应的候选词组集。
优选地,本申请实施例先利用预设词典快速找到到可能的错误词,再结合同音字表和同形字表找出所有可能的候选词组合,扩大了候选词的范围,有利于后续的纠正,提高纠正的准确率。
所述获取候选纠错语句模块104,用于利用所述候选词组集中的每个候选词组替换所述待纠错文本中的所述疑似错词,得到与每个候选词组对应的候选纠错语句。
详细地,本申请实施例中一个疑似错词对应一个候选词组集。所述获取候选纠错语句模块104具体用于:
根据所述候选词组集确定对应的疑似错词;
根据所述疑似错词确定具有疑似错词的待纠错语句;
在所述待纠错语句中用所述候选词组集中的候选词组替换对应的疑似错词,得到与所述候选词组对应的候选纠错语句。
所述错词纠正模块105,用于利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进行纠正。
优选地,所述预先训练好的语言模型是基于神经网络的一种语言模型,所述语言模型可以计算一个句子的概率值大小,整句的概率就是各个词出现概率的乘积,概率值越大表明该句子越合理。为了保证所述语言模型的安全性,所述语言模型可以存储于一区块链的节点中。
详细地,所述错词纠正模块105具体用于:
利用所述语言模型计算将每个所述候选纠错语句的概率值;
根据所述概率值,利用预设的评分算法计算每个候选纠错语句的评分值;
选择评分值最高的候选纠错语句对应的候选词组对所述疑似错词进行纠正。
进一步地,本申请实施例中所述评分算法包括:
Figure PCTCN2020119084-appb-000002
其中,P是评分值;N是所述候选纠错语句的总数;q(x i)是所述语言模型输出的第i个候选纠错语句的概率值。
优选地,本申请实施例通过上述评分算法可以找到替换疑似错词对应的候选词组,在所述待纠错文本中用所述候选词组代替对应的疑似错词,即可得到纠正后的文本。
较佳地,本申请实施例利用预先训练好的语言模型,判断候选词组在句子中存在的合理度,所述语言模型可以融入语义信息进行句子合理性的判断,提高文本的纠错准确率。
如图8所示,是本申请实现文本纠错方法的电子设备的结构示意图。
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如文本纠错程序12。
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如文本纠错程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行文本纠错程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。
图8仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图8示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。
所述电子设备1中的所述存储器11存储的文本纠错程序12是多个指令的组合,在所述处理器10中运行时,可以实现:
获取待纠错文本,并对所述待纠错文本进行分词,得到词语集;
利用预设的词典确定所述词语集中的疑似错词;
根据所述疑似错词确定可用于替换所述疑似错词的候选词组集;
利用所述候选词组集中的每个候选词组替换所述待纠错文本中的所述疑似错词,得到与每个候选词组对应的候选纠错语句;
利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进行纠正。
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中,所述计算机可读存储介质可以是非易失性,也可以是易失性。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图表记视为限制所涉及的权利要求。
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。

Claims (20)

  1. 一种文本纠错方法,其中,所述方法包括:
    获取待纠错文本,并对所述待纠错文本进行分词,得到词语集;
    利用预设的词典确定所述词语集中的疑似错词;
    根据所述疑似错词确定可用于替换所述疑似错词的候选词组集;
    利用所述候选词组集中的每个候选词组替换所述待纠错文本中的所述疑似错词,得到与每个候选词组对应的候选纠错语句;
    利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进行纠正。
  2. 如权利要求1所述的文本纠错方法,其中,所述对所述待纠错文本进行分词,得到词语集,包括:
    将所述待纠错文本按句进行划分,得到待纠错语句集;
    对所述待纠错语句集中的每个语句进行分词,得到词语集。
  3. 如权利要求2所述的文本纠错方法,其中,所述对所述待纠错语句集中的每个语句进行分词,包括:
    利用前缀分词词典对所述语句进行切分,得到一种或者多种划分方式下的原始词语集;
    根据所述原始词语集,通过首尾相连构建有向无环图;
    采用动态规划算法计算所述有向无环图中的最大概率路径,选择所述最大概率路径对应的划分方式得到的分词结果。
  4. 如权利要求1所述的文本纠错方法,其中,所述利用预设的词典确定所述词语集中的疑似错词,包括:
    选择所述词语集中的一个词语;
    查找所述词语是否存在于预设的常用词词典及场景专业词词典中;
    在所述词语不存在于所述常用词词典及场景专业词词典中时,将所述词语划归为疑似错词。
  5. 如权利要求1所述的文本纠错方法,其中,所述根据所述疑似错词确定可用于替换所述疑似错词的候选词组集,包括:
    将所述疑似错词按字进行拆分,得到一个或多个疑似错字;
    在预设的同音字表中和同形字表中找到与所述疑似错字对应的同音字、同形字,得到候选字集;
    根据所述疑似错词将所述候选字集中的字进行组合组词,得到候选词组集。
  6. 如权利要求1至5中任意一项所述的文本纠错方法,其中,所述利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进行纠正,包括:
    计算每个所述候选纠错语句的概率值;
    根据所述概率值,利用预设的评分算法计算每个候选纠错语句的评分值;
    选择评分值最高的候选纠错语句对应的候选词组对所述疑似错词进行纠正。
  7. 如权利要求6所述的文本纠错方法,其中,所述评分算法包括:
    Figure PCTCN2020119084-appb-100001
    其中,P是评分值;N是所述候选纠错语句的总数;q(x i)是所述语言模型输出的第i个候选纠错语句的概率值。
  8. 一种文本纠错装置,其中,所述装置包括:
    分词模块,用于获取待纠错文本,并对所述待纠错文本进行分词,得到词语集;
    确定疑似错词模块,用于利用预设的词典确定所述词语集中的疑似错词;
    获取候选词组集模块,用于根据所述疑似错词确定可用于替换所述疑似错词的候选词组集;
    获取候选纠错语句模块,用于利用所述候选词组集中的每个候选词组替换所述待纠错文本中的所述疑似错词,得到与每个候选词组对应的候选纠错语句;
    错词纠正模块,用于利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进行纠正。
  9. 一种电子设备,其中,所述电子设备包括:
    存储器,存储至少一个计算机程序指令;及
    处理器,执行所述存储器中存储的计算机程序指令以执行如下步骤:
    获取待纠错文本,并对所述待纠错文本进行分词,得到词语集;
    利用预设的词典确定所述词语集中的疑似错词;
    根据所述疑似错词确定可用于替换所述疑似错词的候选词组集;
    利用所述候选词组集中的每个候选词组替换所述待纠错文本中的所述疑似错词,得到与每个候选词组对应的候选纠错语句;
    利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进行纠正。
  10. 如权利要求9所述的电子设备,其中,所述对所述待纠错文本进行分词,得到词语集,包括:
    将所述待纠错文本按句进行划分,得到待纠错语句集;
    对所述待纠错语句集中的每个语句进行分词,得到词语集。
  11. 如权利要求10所述的电子设备,其中,所述对所述待纠错语句集中的每个语句进行分词,包括:
    利用前缀分词词典对所述语句进行切分,得到一种或者多种划分方式下的原始词语集;
    根据所述原始词语集,通过首尾相连构建有向无环图;
    采用动态规划算法计算所述有向无环图中的最大概率路径,选择所述最大概率路径对应的划分方式得到的分词结果。
  12. 如权利要求9所述的电子设备,其中,所述利用预设的词典确定所述词语集中的疑似错词,包括:
    选择所述词语集中的一个词语;
    查找所述词语是否存在于预设的常用词词典及场景专业词词典中;
    在所述词语不存在于所述常用词词典及场景专业词词典中时,将所述词语划归为疑似错词。
  13. 如权利要求9所述的电子设备,其中,所述根据所述疑似错词确定可用于替换所述疑似错词的候选词组集,包括:
    将所述疑似错词按字进行拆分,得到一个或多个疑似错字;
    在预设的同音字表中和同形字表中找到与所述疑似错字对应的同音字、同形字,得到候选字集;
    根据所述疑似错词将所述候选字集中的字进行组合组词,得到候选词组集。
  14. 如权利要求9至13中任意一项所述的电子设备,其中,所述利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进 行纠正,包括:
    计算每个所述候选纠错语句的概率值;
    根据所述概率值,利用预设的评分算法计算每个候选纠错语句的评分值;
    选择评分值最高的候选纠错语句对应的候选词组对所述疑似错词进行纠正。
  15. 如权利要求14所述的电子设备,其中,所述评分算法包括:
    Figure PCTCN2020119084-appb-100002
    其中,P是评分值;N是所述候选纠错语句的总数;q(x i)是所述语言模型输出的第i个候选纠错语句的概率值。
  16. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下步骤:
    获取待纠错文本,并对所述待纠错文本进行分词,得到词语集;
    利用预设的词典确定所述词语集中的疑似错词;
    根据所述疑似错词确定可用于替换所述疑似错词的候选词组集;
    利用所述候选词组集中的每个候选词组替换所述待纠错文本中的所述疑似错词,得到与每个候选词组对应的候选纠错语句;
    利用预先训练好的语言模型对所述候选纠错语句进行评分,根据评分确定对所述疑似错词进行纠正。
  17. 如权利要求16所述的计算机可读存储介质,其中,所述对所述待纠错文本进行分词,得到词语集,包括:
    将所述待纠错文本按句进行划分,得到待纠错语句集;
    对所述待纠错语句集中的每个语句进行分词,得到词语集。
  18. 如权利要求17所述的计算机可读存储介质,其中,所述对所述待纠错语句集中的每个语句进行分词,包括:
    利用前缀分词词典对所述语句进行切分,得到一种或者多种划分方式下的原始词语集;
    根据所述原始词语集,通过首尾相连构建有向无环图;
    采用动态规划算法计算所述有向无环图中的最大概率路径,选择所述最大概率路径对应的划分方式得到的分词结果。
  19. 如权利要求16所述的计算机可读存储介质,其中,所述利用预设的词典确定所述词语集中的疑似错词,包括:
    选择所述词语集中的一个词语;
    查找所述词语是否存在于预设的常用词词典及场景专业词词典中;
    在所述词语不存在于所述常用词词典及场景专业词词典中时,将所述词语划归为疑似错词。
  20. 如权利要求16所述的计算机可读存储介质,其中,所述根据所述疑似错词确定可用于替换所述疑似错词的候选词组集,包括:
    将所述疑似错词按字进行拆分,得到一个或多个疑似错字;
    在预设的同音字表中和同形字表中找到与所述疑似错字对应的同音字、同形字,得到候选字集;
    根据所述疑似错词将所述候选字集中的字进行组合组词,得到候选词组集。
PCT/CN2020/119084 2020-09-03 2020-09-29 文本纠错方法、装置、电子设备及存储介质 WO2021189803A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010914967.6A CN112016304A (zh) 2020-09-03 2020-09-03 文本纠错方法、装置、电子设备及存储介质
CN202010914967.6 2020-09-03

Publications (1)

Publication Number Publication Date
WO2021189803A1 true WO2021189803A1 (zh) 2021-09-30

Family

ID=73517155

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/119084 WO2021189803A1 (zh) 2020-09-03 2020-09-29 文本纠错方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN112016304A (zh)
WO (1) WO2021189803A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114201967A (zh) * 2022-02-17 2022-03-18 杭州费尔斯通科技有限公司 一种基于候选实体分类的实体识别方法、系统及装置
CN116050391A (zh) * 2022-11-17 2023-05-02 西安电子科技大学广州研究院 基于细分行业纠错词表的语音识别纠错方法及装置
CN116306600A (zh) * 2023-05-25 2023-06-23 山东齐鲁壹点传媒有限公司 一种基于MacBert的中文文本纠错方法
CN116681070A (zh) * 2023-08-04 2023-09-01 北京永辉科技有限公司 文本纠错方法、系统、模型训练方法、介质及设备
CN117523590A (zh) * 2023-11-10 2024-02-06 广州方舟信息科技有限公司 一种校验生产厂商名称的方法、装置、设备及存储介质
CN117523590B (zh) * 2023-11-10 2024-05-28 广州方舟信息科技有限公司 一种校验生产厂商名称的方法、装置、设备及存储介质

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112232059B (zh) * 2020-12-14 2021-03-26 北京声智科技有限公司 文本纠错方法、装置、计算机设备及存储介质
CN112528882B (zh) * 2020-12-15 2024-05-10 平安科技(深圳)有限公司 基于ocr识别房产证信息确定方法、装置、设备及介质
CN112597771A (zh) * 2020-12-29 2021-04-02 重庆邮电大学 基于前缀树合并的中文文本纠错方法
CN112685550B (zh) * 2021-01-12 2023-08-04 腾讯科技(深圳)有限公司 智能问答方法、装置、服务器及计算机可读存储介质
CN112949290B (zh) * 2021-02-03 2023-11-17 深圳市优必选科技股份有限公司 文本纠错方法、装置及通信设备
CN113011149B (zh) * 2021-03-04 2024-05-14 中国科学院自动化研究所 一种文本纠错方法及系统
CN113221545B (zh) * 2021-05-10 2023-08-08 北京有竹居网络技术有限公司 一种文本处理方法、装置、设备及介质、程序产品
CN113033185B (zh) * 2021-05-28 2021-08-10 中国电子技术标准化研究院 标准文本纠错方法、装置、电子设备和存储介质
CN113449090A (zh) * 2021-06-23 2021-09-28 山东新一代信息产业技术研究院有限公司 一种用于智能问答的纠错方法、设备及介质
CN113361266B (zh) * 2021-06-25 2022-12-06 达闼机器人股份有限公司 文本纠错方法、电子设备及存储介质
CN113553833B (zh) * 2021-06-30 2024-01-19 北京百度网讯科技有限公司 文本纠错的方法、装置及电子设备
CN113268977B (zh) * 2021-07-19 2021-10-15 中国平安人寿保险股份有限公司 基于语言模型的文本纠错方法、装置、终端设备及介质
CN113536789B (zh) * 2021-09-16 2021-12-24 平安科技(深圳)有限公司 算法比赛关联性预测方法、装置、设备及介质
CN113807081A (zh) * 2021-09-18 2021-12-17 北京云上曲率科技有限公司 基于上下文的聊天文本内容纠错方法及装置
CN114218937B (zh) * 2021-11-24 2022-12-02 中国科学院深圳先进技术研究院 数据纠错方法、装置及电子设备
CN117034911B (zh) * 2023-09-28 2023-12-22 通用技术集团健康数字科技(北京)有限公司 医院诊断词典的校正方法、装置、服务器及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108090043A (zh) * 2017-11-30 2018-05-29 北京百度网讯科技有限公司 基于人工智能的纠错举报处理方法、装置及可读介质
CN110276077A (zh) * 2019-06-25 2019-09-24 上海应用技术大学 中文纠错的方法、装置及设备
CN111079412A (zh) * 2018-10-18 2020-04-28 北京嘀嘀无限科技发展有限公司 文本纠错方法及装置
CN111090986A (zh) * 2019-11-29 2020-05-01 福建亿榕信息技术有限公司 一种公文文档纠错的方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108959250A (zh) * 2018-06-27 2018-12-07 众安信息技术服务有限公司 一种基于语言模型和词特征的纠错方法及其系统
CN110362824B (zh) * 2019-06-24 2022-12-02 广州多益网络股份有限公司 一种自动纠错的方法、装置、终端设备及存储介质
CN111369996B (zh) * 2020-02-24 2023-08-18 网经科技(苏州)有限公司 一种特定领域的语音识别文本纠错方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108090043A (zh) * 2017-11-30 2018-05-29 北京百度网讯科技有限公司 基于人工智能的纠错举报处理方法、装置及可读介质
CN111079412A (zh) * 2018-10-18 2020-04-28 北京嘀嘀无限科技发展有限公司 文本纠错方法及装置
CN110276077A (zh) * 2019-06-25 2019-09-24 上海应用技术大学 中文纠错的方法、装置及设备
CN111090986A (zh) * 2019-11-29 2020-05-01 福建亿榕信息技术有限公司 一种公文文档纠错的方法

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114201967A (zh) * 2022-02-17 2022-03-18 杭州费尔斯通科技有限公司 一种基于候选实体分类的实体识别方法、系统及装置
CN114201967B (zh) * 2022-02-17 2022-06-10 杭州费尔斯通科技有限公司 一种基于候选实体分类的实体识别方法、系统及装置
CN116050391A (zh) * 2022-11-17 2023-05-02 西安电子科技大学广州研究院 基于细分行业纠错词表的语音识别纠错方法及装置
CN116050391B (zh) * 2022-11-17 2024-05-14 西安电子科技大学广州研究院 基于细分行业纠错词表的语音识别纠错方法及装置
CN116306600A (zh) * 2023-05-25 2023-06-23 山东齐鲁壹点传媒有限公司 一种基于MacBert的中文文本纠错方法
CN116306600B (zh) * 2023-05-25 2023-08-11 山东齐鲁壹点传媒有限公司 一种基于MacBert的中文文本纠错方法
CN116681070A (zh) * 2023-08-04 2023-09-01 北京永辉科技有限公司 文本纠错方法、系统、模型训练方法、介质及设备
CN117523590A (zh) * 2023-11-10 2024-02-06 广州方舟信息科技有限公司 一种校验生产厂商名称的方法、装置、设备及存储介质
CN117523590B (zh) * 2023-11-10 2024-05-28 广州方舟信息科技有限公司 一种校验生产厂商名称的方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN112016304A (zh) 2020-12-01

Similar Documents

Publication Publication Date Title
WO2021189803A1 (zh) 文本纠错方法、装置、电子设备及存储介质
WO2022142593A1 (zh) 文本分类方法、装置、电子设备及可读存储介质
CN112016310A (zh) 文本纠错方法、系统、设备及可读存储介质
US10762293B2 (en) Using parts-of-speech tagging and named entity recognition for spelling correction
JP5462001B2 (ja) 文脈上の入力方法
CN108537176B (zh) 目标弹幕的识别方法、装置、终端及存储介质
RU2613846C2 (ru) Метод и система извлечения данных из изображений слабоструктурированных документов
WO2021208703A1 (zh) 问题解析方法、装置、电子设备及存储介质
US9286526B1 (en) Cohort-based learning from user edits
WO2020005605A1 (en) Table detection in spreadsheet
WO2014036827A1 (zh) 一种文本校正方法及用户设备
JP2014186395A (ja) 文書作成支援装置、方法およびプログラム
TW201544976A (zh) 自然語言處理系統、自然語言處理方法、及自然語言處理程式
CN107861948B (zh) 一种标签提取方法、装置、设备和介质
US20220284185A1 (en) Storage medium, information processing method, and information processing device
CN115223188A (zh) 票据信息处理方法、装置、电子设备及计算机存储介质
US6754386B1 (en) Method and system of matching ink processor and recognizer word breaks
CN111126010A (zh) Freemaker模板文件修复方法、装置、计算机设备及存储介质
CN114329112A (zh) 内容审核方法、装置、电子设备及存储介质
JP6476886B2 (ja) キーワード抽出システム、キーワード抽出方法、及び、コンピュータ・プログラム
CN110929514B (zh) 文本校对方法、装置、计算机可读存储介质及电子设备
US20200320255A1 (en) Language Processing Method and Device
CN110457683B (zh) 模型优化方法、装置、计算机设备及存储介质
CN109670183B (zh) 一种文本重要性的计算方法、装置、设备和存储介质
CN116860747A (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: 20927661

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

Country of ref document: EP

Kind code of ref document: A1