WO2022227166A1 - 词语替换方法、装置、电子设备和存储介质 - Google Patents

词语替换方法、装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2022227166A1
WO2022227166A1 PCT/CN2021/096421 CN2021096421W WO2022227166A1 WO 2022227166 A1 WO2022227166 A1 WO 2022227166A1 CN 2021096421 W CN2021096421 W CN 2021096421W WO 2022227166 A1 WO2022227166 A1 WO 2022227166A1
Authority
WO
WIPO (PCT)
Prior art keywords
word
probability value
target
phrase
sentence
Prior art date
Application number
PCT/CN2021/096421
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 WO2022227166A1 publication Critical patent/WO2022227166A1/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/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/237Lexical tools
    • G06F40/247Thesauruses; Synonyms
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Definitions

  • the present application relates to the technical field of natural language processing, and in particular, to a word replacement method, apparatus, electronic device and storage medium.
  • the inventor found that the traditional method uses keywords for controllable text generation. In order to quickly generate a large number of similar texts, the method of synonym replacement is adopted to replace keywords. Increase the amount of text generated. Based on this, the keyword replacement method becomes the key to control the text quality of the newly generated text.
  • the problem with this method is that the vocabulary is small, and several synonyms can be found for common common words, but it is difficult to find synonyms for some emerging words or special nouns.
  • the second method is to use the word vectors trained by the word2vec method to match the word vectors.
  • this method solves the disadvantage of the small vocabulary of the thesaurus dictionary, problems such as generating related words instead of synonyms and the generated synonyms cannot match the context will occur.
  • the embodiments of the present application provide a word replacement method, device, electronic device and storage medium, so that the generated synonyms have a wider range and can better fit the contextual words territory.
  • embodiments of the present application provide a method for replacing words, including:
  • each first probability value in the at least one first probability value is used to characterize the use of each first probability value
  • the reasonable degree to which the corresponding second word replaces the first word, and at least one second word is in one-to-one correspondence with at least one first probability value
  • embodiments of the present application provide a word replacement device, including:
  • a masking module configured to perform mask processing on the first word in the first sentence to obtain a second sentence, wherein the first word includes at least two words;
  • the prediction module is configured to input the second sentence into the keyword prediction model to obtain at least one second word and at least one first probability value, wherein each first probability value in the at least one first probability value is used to characterize the use of each The reasonable degree to which the second word corresponding to the first probability value replaces the first word, and at least one second word corresponds to at least one first probability value one-to-one;
  • a word determination module configured to determine a first similarity between the first word and each second word in the at least one second word; and according to the first probability value and the first similarity corresponding to each second word, determining a second probability value for each second word; and determining at least one target second word in the at least one second word, the second probability value for each target second word pair in the at least one target second word being greater than first threshold;
  • a replacement module for replacing the first word in the first sentence with each target second word respectively.
  • embodiments of the present application provide an electronic device, comprising: a processor, the processor is connected to a memory, the memory is used for storing a computer program, and the processor is used for executing the computer program stored in the memory, so that the electronic device executes the following method :
  • each first probability value in the at least one first probability value is used to characterize the use of each first probability value
  • the reasonable degree to which the corresponding second word replaces the first word, and at least one second word is in one-to-one correspondence with at least one first probability value
  • embodiments of the present application provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program causes a computer to execute the following method:
  • each first probability value in the at least one first probability value is used to characterize the use of each first probability value
  • the reasonable degree to which the corresponding second word replaces the first word, and at least one second word is in one-to-one correspondence with at least one first probability value
  • the embodiments of the present application can better conform to the context of the context in the first sentence while ensuring that the semantics of the second word are similar to the first word.
  • FIG. 1 is a schematic flowchart of a word replacement method provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a method for determining a first word in a first sentence provided by an embodiment of the present application
  • FIG. 3 is a schematic flowchart of a method for determining the inverse document frequency of each target third word according to an embodiment of the present application
  • FIG. 4 is a schematic flowchart of a method for inputting a second sentence into a keyword prediction model to obtain at least one second word and at least one first probability value provided by an embodiment of the present application;
  • FIG. 5 is a schematic flowchart of a method for determining a first similarity between a first word and each second word in at least one second word according to an embodiment of the present application
  • FIG. 6 is a block diagram of functional modules of a word replacement device provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • an embodiment means that a particular feature, result, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application.
  • the appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor a separate or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
  • the technical solutions of the present application relate to the technical field of artificial intelligence and/or big data, such as natural language processing technology.
  • the present application can be applied to scenarios such as text processing to realize word replacement, so as to make the context more in line with the context, thereby promoting the construction of smart cities.
  • the data involved in this application such as sentences, corpus and/or words, etc., may be stored in a database, or may be stored in a blockchain, such as distributed storage through a blockchain, which is not limited in this application.
  • FIG. 1 is a schematic flowchart of a word replacement method provided by an embodiment of the present application.
  • the word replacement method includes the following steps:
  • the first word includes at least two words, and the word refers to a word composed of at least one word, for example, a word may be "coffee”, “coffee”, “coffee” and so on. Based on this, the first word may be understood as a word including at least two words, for example, the first word may be "coffee”, "black coffee”, “milk coffee” and so on. Therefore, compared with the traditional single-word mask processing, directly masking the first word of at least two words can make subsequent prediction operations more accurate.
  • a multilingual-t5 model can be used for mask processing.
  • this embodiment before performing mask processing on the first word in the first sentence, the first word needs to be determined in the first sentence. Specifically, this embodiment provides a method for determining the first word in the first sentence, as shown in FIG. 2 , the method includes:
  • the N-gram segmentation method with arity of 2, 3, and 4 can be used to segment the first sentence.
  • the N-gram segmentation method is a method of segmenting a sentence into a sequence of segments consisting of N characters, each of which is called an N-gram.
  • the N-gram segmentation method can be called uni-gram (unary gram)
  • the N-gram segmentation method can be called bi-gram (binary gram)
  • the N-gram segmentation method can be called tri-gram.
  • the segmentation results can be filtered and cleaned to filter out meaningless segmentation results, such as “I yesterday”, “Drinking in the sky”, and “Cafe”. Segmentation results of certain semantics, such as: “yesterday”, “drinking”, and “coffee” as the third word.
  • the subject, predicate or object in the original sentence is usually replaced, and the subject and object are usually nouns or numbers.
  • the part-of-speech information of each target third word in the at least one target third word is a noun, a verb or a numeral.
  • the focus is to find out more important keywords in the sentence for replacement.
  • common words such as "we”
  • the actual meaning of the text obtained by the replacement is not great. Therefore, in this embodiment, the inverse document frequency of each target third word is calculated to determine the importance of the target third word, and then common words in it are eliminated.
  • this embodiment provides a method for determining the inverse document frequency of each target third word, as shown in FIG. 3 , the method includes:
  • the corpus is a database storing corpus related to the first sentence.
  • the inverse document frequency can be expressed by formula 1:
  • represents the total number of corpora in the corpus
  • represents the total number of corpora containing the word t in the corpus, that is, the first number.
  • c is a constant, which can be adjusted according to the actual situation.
  • c may be 1.
  • the word frequency and the inverse document frequency of each target third word may also be calculated, and the target third word whose product of the word frequency and the inverse document frequency is greater than the second threshold may be used as the first word.
  • each of the at least one first probability value is used to represent the reasonable degree of replacing the first word with the second word corresponding to each first probability value, and the at least one second word and the At least one of the first probability values is in one-to-one correspondence.
  • an embodiment of the present application provides a method for inputting a second sentence into a keyword prediction model to obtain at least one second word and at least one first probability value.
  • the method includes:
  • the part-of-speech information of the word stored in the target word database is consistent with the part-of-speech information of the first word, so that the part of speech of the predicted word can be kept consistent with the part of speech of the original word, and the accuracy of prediction can be improved.
  • 403 Determine at least one second word and at least one first probability value according to the second sentence and the target word database.
  • the second sentence may be segmented first to obtain a first phrase and a second phrase, where the first phrase is a phrase composed of all words located before the target position in the second sentence, and the second phrase is the second sentence.
  • the first word is “Fried fish”
  • the second sentence “I ate yesterday ⁇ /span mask> and fries”.
  • the position of " ⁇ /span mask>” is the target position.
  • the first phrase “I ate yesterday” and the second phrase “and chips” can be obtained.
  • the obtained third phrase can be: (hamburger, 0.9), (apple , 0.9), (Fried fish, 0.9), (Coke, 0.75), etc., where the number is the third probability corresponding to the preceding word. For example, the reasonable probability of completing the first phrase with "hamburger” is 0.9.
  • the obtained fourth phrase can be: (hamburger, 0.9), (tomato, 0.65), (fried fish, 0.95), (cola, 0.9), etc.
  • At least one third phrase and at least one fourth phrase are obtained, at least one third phrase and at least one fourth phrase are intersected to obtain at least one fifth phrase; and each of the at least one fifth phrase The third probability value corresponding to the fifth phrase and the fourth probability value are multiplied to obtain at least one fifth probability value, wherein the at least one fifth phrase and the at least one fifth probability value are in one-to-one correspondence.
  • the third phrase can be: (burger, 0.9), (apple, 0.9), (fried fish, 0.9), (Coke, 0.75), etc.
  • the fourth phrase can be: (burger, 0.9), (tomato, 0.65), (fried fish, 0.95), (cola, 0.9), etc.
  • At least one second word and at least one first probability value are determined according to the at least one fifth phrase, the at least one fifth probability value, and the target word library.
  • At least one second word may be determined in the at least one fifth word, wherein the at least one second word is a word in the at least one fifth word and also in the target word database; then, the The fifth probability value corresponding to each second word in the at least one second word is used as the first probability value corresponding to each second word.
  • the finally obtained second word and the first probability values corresponding to the second word are: (burger, 0.81) and (fried fish, 0.855).
  • the derived second word is not only more accurate, but also more in line with the context in the original sentence.
  • a method for determining the first similarity between a first word and each second word in at least one second word includes:
  • 503 Take the modulo of the first word vector to obtain the first modulo.
  • 504 Take the modulo of the second word vector to obtain the second modulo.
  • 505 Determine the value of the product of the first modulo and the second modulo.
  • 506 Determine the inner product of the first word vector and the second word vector.
  • the cosine value of the included angle between the first word vector corresponding to the first word and the second word vector corresponding to the second word can be calculated by dot product, and the cosine value of the included angle can be used as the first word and the second word. the first similarity between.
  • a ⁇ B represents the inner product of the first word vector A and the second word vector B
  • is the modulo symbol
  • ⁇ A ⁇ represents the modulus of the first word vector A
  • ⁇ B ⁇ represents the second word vector B mold.
  • modulus of the first word vector A can be expressed by formula 5:
  • the correlation coefficient between the first word vector A and the second word vector B can be represented by formula 6:
  • the value range of the cosine value is [-1, 1]
  • the first probability value corresponding to each second word and the first similarity may be multiplied, and the result result may be used as the second probability value of each second word.
  • the second probability value used for each target second word pair in the at least one target second word pair is greater than the first threshold.
  • a second sentence is obtained by performing a mask operation on the first word including at least two words, so that the second sentence is input into the keyword prediction model, and multiple words are predicted.
  • the second word and the corresponding first probability value Therefore, by performing a mask operation on the first word including at least two words at the same time, compared with the traditional single-word mask processing, it is possible to directly mask the word line, thereby making the subsequent prediction operation more accurate.
  • the embodiment of the present application generates a mixed index second word by calculating the similarity between each second word and the first word, and then combining the first probability value corresponding to each second word. probability value.
  • the first word in the first sentence is replaced with a second word corresponding to a second probability value greater than the first threshold. Therefore, while ensuring that the semantics of the second word are similar to the first word, it can better conform to the context of the context in the first sentence.
  • FIG. 6 is a block diagram of functional modules of a word replacement device according to an embodiment of the present application.
  • the word replacement device 600 includes:
  • Masking module 601 configured to perform mask processing on the first word in the first sentence to obtain a second sentence, wherein the first word includes at least two words;
  • the prediction module 602 is configured to input the second sentence into the keyword prediction model to obtain at least one second word and at least one first probability value, wherein each first probability value in the at least one first probability value is used to characterize the use of The reasonable degree to which the second word corresponding to each first probability value replaces the first word, and at least one second word is in one-to-one correspondence with at least one first probability value;
  • a word determination module 603, configured to determine a first similarity between the first word and each second word in the at least one second word; and according to the first probability value and the first similarity corresponding to each second word , determining a second probability value for each second word; and determining at least one target second word in the at least one second word, and a second probability value for each target second word pair in the at least one target second word greater than the first threshold;
  • a replacement module 604 configured to replace the first word in the first sentence with each target second word respectively.
  • the masking module 601 before performing mask processing on the first word in the first sentence to obtain the second sentence, the masking module 601 is also used for:
  • determining at least one target third word in the at least one third word, and the part-of-speech information of each target third word in the at least one third target word is a noun, a verb or a numeral;
  • the target third word whose inverse document frequency is greater than the second threshold is used as the first word.
  • the mask module 601 in determining the inverse document frequency of each target third word, is specifically used for:
  • the prediction module 602 in terms of inputting the second sentence into the keyword prediction model to obtain at least one second word and at least one first probability value, the prediction module 602 is specifically used for:
  • At least one second word and at least one first probability value are determined according to the second sentence and the target word library.
  • the prediction module 602 in terms of determining at least one second word and at least one first probability value according to the second sentence and the target word database, the prediction module 602 is specifically used for:
  • At least one second word and at least one first probability value are determined based on the at least one fifth phrase, the at least one fifth probability value, and the target word library.
  • the prediction module 602 is specifically configured to:
  • At least one second word is determined, wherein the at least one second word is a word in the at least one fifth word and also in the target word database;
  • the fifth probability value corresponding to each second word in the at least one second word is used as the first probability value corresponding to each second word.
  • the word determination module 603 in determining the first similarity between the first word and each second word in the at least one second word, is specifically configured to:
  • the second word vector is modulo to obtain the second modulo
  • the quotient of the inner product and the product value is taken as the first similarity between the first word and each second word.
  • FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • Electronic devices include processors and memory.
  • the electronic device may further include a communication interface, and the communication interface may be a transceiver or other input and output devices.
  • an electronic device 700 includes a transceiver 701 , a processor 702 and a memory 703 . They are connected through a bus 704 .
  • the transceiver 701 is configured to receive the data to be processed to the processor 702 and output the processing result of the processor 702 to the outside.
  • the transceiver 701 may be configured to receive the first sentence , and output the first sentence after replacing the first word with the target second word.
  • the memory 703 is used to store computer programs and data, and can transmit the data stored in the memory 703 to the processor 702 .
  • the processor 702 is used to read the computer program in the memory 703 to perform the following operations:
  • each first probability value in the at least one first probability value is used to characterize the use of each first probability value
  • the reasonable degree to which the corresponding second word replaces the first word, and at least one second word is in one-to-one correspondence with at least one first probability value
  • the processor 702 before performing mask processing on the first word in the first sentence to obtain the second sentence, the processor 702 is specifically configured to perform the following operations:
  • determining at least one target third word in the at least one third word, and the part-of-speech information of each target third word in the at least one third target word is a noun, a verb or a numeral;
  • the target third word whose inverse document frequency is greater than the second threshold is used as the first word.
  • the processor 702 in determining the inverse document frequency of each target third word, is specifically configured to perform the following operations:
  • the processor 702 in terms of inputting the second sentence into the keyword prediction model to obtain at least one second word and at least one first probability value, the processor 702 is specifically configured to perform the following operations:
  • At least one second word and at least one first probability value are determined according to the second sentence and the target word library.
  • the processor 702 in terms of determining at least one second word and at least one first probability value according to the second sentence and the target word database, the processor 702 is specifically configured to perform the following operations:
  • At least one second word and at least one first probability value are determined based on the at least one fifth phrase, the at least one fifth probability value, and the target word library.
  • the processor 702 in terms of determining at least one second word and at least one first probability value according to the at least one fifth phrase, at least one fifth probability value and the target word library, the processor 702 is specifically configured to execute the following operate:
  • At least one second word is determined, wherein the at least one second word is a word in the at least one fifth word and also in the target word database;
  • the fifth probability value corresponding to each second word in the at least one second word is used as the first probability value corresponding to each second word.
  • the processor 702 in determining the first similarity between the first word and each second word in the at least one second word, is specifically configured to perform the following operations:
  • the second word vector is modulo to obtain the second modulo
  • the quotient of the inner product and the product value is taken as the first similarity between the first word and each second word.
  • the word replacement devices in this application may include smart phones (such as Android mobile phones, iOS mobile phones, Windows Phone mobile phones, etc.), tablet computers, handheld computers, notebook computers, and mobile Internet devices MID (Mobile Internet Devices, referred to as: MID) , robots or wearable devices, etc.
  • MID Mobile Internet Devices, referred to as: MID
  • the above word replacement means are only examples, not exhaustive, including but not limited to the above word replacement means.
  • the above apparatus for replacing words may also include: intelligent vehicle-mounted terminals, computer equipment, and the like.
  • embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program is executed by a processor to implement any one of the words described in the above method embodiments Replace some or all steps of a method.
  • the storage medium may include a hard disk, a floppy disk, an optical disk, a magnetic tape, a magnetic disk, a USB flash drive, a flash memory, and the like.
  • the storage medium involved in this application such as a computer-readable storage medium, may be non-volatile or volatile.
  • Embodiments of the present application also provide a computer program product, the computer program product comprising a non-transitory computer-readable storage medium storing a computer program, the computer program being operable to cause a computer to execute the method described in the foregoing method embodiments Some or all of the steps of any word replacement method.
  • the disclosed apparatus may be implemented in other manners.
  • the device implementations described above are only illustrative, for example, the division of the units is only a logical function division, and other divisions may be used in actual implementation, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this implementation manner.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, and can also be implemented in the form of software program modules.
  • the integrated unit if implemented in the form of a software program module and sold or used as a stand-alone product, may be stored in a computer readable memory.
  • the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art, or all or part of the technical solution, and the computer software product is stored in a memory.
  • a computer device which may be a personal computer, a server, or a network device, etc.
  • the aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Machine Translation (AREA)

Abstract

一种词语替换方法、装置、电子设备和存储介质,其中,替换方法包括:对第一句子中的第一词语进行掩码处理,得到第二句子,其中,第一词语至少包括两个单词;将第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值,至少一个第二词语和至少一个第一概率值一一对应;确定第一词语与至少一个第二词语中的每个第二词语之间的第一相似度;根据每个第二词语对应的第一概率值和第一相似度,确定每个第二词语的第二概率值;确定至少一个第二词语中的至少一个目标第二词语,至少一个目标第二词语中的每个目标第二词语的第二概率值大于第一阈值;分别使用每个目标第二词语替换第一句子中的第一词语。

Description

词语替换方法、装置、电子设备和存储介质
本申请要求于2021年4月26日提交中国专利局、申请号为202110458707.7,发明名称为“词语替换方法、装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及自然语言处理技术领域,具体涉及一种词语替换方法、装置、电子设备和存储介质。
背景技术
目前,无论是在自然语言领域还是人工智能领域,对一个语言相关模型进行训练时,往往需要大量的文本。对此,发明人发现,传统方式利用关键词进行可控文本生成工作,为了能快速生成大量相似的文本,采取了同义词替换的方式将关键词进行替换,不同关键词排列组合之后可以以指数级别增加文本生成的数量。基于此,对于关键词的替换方法便成为了对新生成文本的文本质量进行控制的关键。
发明人意识到,传统的替换方法主要分为两种:第一种是利用同义词词典的方法进行查找替换,例如:利用哈工大推出的《同义词词林扩展版》词典进行同义词查找替换。但是,这种方法的问题在于词汇量较少,对于一般的常用词还能找到几个同义词,而对于一些新兴词汇或者特殊名词而言,很难找到同义词。第二种方法是利用word2vec方法训练的词向量,进行词向量的匹配。但是,这种方法虽然解决了同义词词典的词汇量少的弊端,但是会发生如生成相关词而非同义词以及生成的同义词无法匹配上下文等问题。
发明内容
为了解决现有技术中存在的上述问题,本申请实施方式提供了一种词语替换方法、装置、电子设备和存储介质,使生成的同义词具有更大的范围,且能够更好地符合上下文的语境。
第一方面,本申请的实施方式提供了一种词语替换方法,包括:
对第一句子中的第一词语进行掩码处理,得到第二句子,其中,第一词语至少包括两个单词;
将第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值,其中,至少一个第一概率值中的每个第一概率值用于表征使用每个第一概率值对应的第二词语替换第一词语的合理程度,至少一个第二词语和至少一个第一概率值一一对应;
确定第一词语与至少一个第二词语中的每个第二词语之间的第一相似度;
根据每个第二词语对应的第一概率值和第一相似度,确定每个第二词语的第二概率值;
确定至少一个第二词语中的至少一个目标第二词语,至少一个目标第二词语中的每个目标第二词语对用的第二概率值大于第一阈值;
分别使用每个目标第二词语替换第一句子中的第一词语。
第二方面,本申请的实施方式提供了一种词语替换装置,包括:
掩码模块,用于对第一句子中的第一词语进行掩码处理,得到第二句子,其中,第一词语至少包括两个单词;
预测模块,用于将第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值,其中,至少一个第一概率值中的每个第一概率值用于表征使用每个第一概率值对应的第二词语替换第一词语的合理程度,至少一个第二词语和至少一个第一概率值一一对应;
词语确定模块,用于确定第一词语与至少一个第二词语中的每个第二词语之间的第一相似度;并根据每个第二词语对应的第一概率值和第一相似度,确定每个第二词语的第二概率值;以及确定至少一个第二词语中的至少一个目标第二词语,至少一个目标第二词语 中的每个目标第二词语对用的第二概率值大于第一阈值;
替换模块,用于分别使用每个目标第二词语替换第一句子中的第一词语。
第三方面,本申请实施方式提供一种电子设备,包括:处理器,处理器与存储器相连,存储器用于存储计算机程序,处理器用于执行存储器中存储的计算机程序,以使得电子设备执行以下方法:
对第一句子中的第一词语进行掩码处理,得到第二句子,其中,第一词语至少包括两个单词;
将第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值,其中,至少一个第一概率值中的每个第一概率值用于表征使用每个第一概率值对应的第二词语替换第一词语的合理程度,至少一个第二词语和至少一个第一概率值一一对应;
确定第一词语与至少一个第二词语中的每个第二词语之间的第一相似度;
根据每个第二词语对应的第一概率值和第一相似度,确定每个第二词语的第二概率值;
确定至少一个第二词语中的至少一个目标第二词语,至少一个目标第二词语中的每个目标第二词语对用的第二概率值大于第一阈值;
分别使用每个目标第二词语替换第一句子中的第一词语。
第四方面,本申请实施方式提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序使得计算机执行以下方法:
对第一句子中的第一词语进行掩码处理,得到第二句子,其中,第一词语至少包括两个单词;
将第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值,其中,至少一个第一概率值中的每个第一概率值用于表征使用每个第一概率值对应的第二词语替换第一词语的合理程度,至少一个第二词语和至少一个第一概率值一一对应;
确定第一词语与至少一个第二词语中的每个第二词语之间的第一相似度;
根据每个第二词语对应的第一概率值和第一相似度,确定每个第二词语的第二概率值;
确定至少一个第二词语中的至少一个目标第二词语,至少一个目标第二词语中的每个目标第二词语对用的第二概率值大于第一阈值;
分别使用每个目标第二词语替换第一句子中的第一词语。
本申请实施方式在保证第二词语的语义与第一词语相近的同时,能够更好地符合第一句子中上下文的语境。
附图说明
为了更清楚地说明本申请实施方式中的技术方案,下面将对实施方式描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施方式提供的一种词语替换方法的流程示意图;
图2为本申请实施方式提供的一种在第一句子中确定第一词语的方法的流程示意图;
图3为本申请实施方式提供的一种确定每个目标第三词语的逆文档频率的方法的流程示意图;
图4为本申请实施方式提供的一种将第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值的方法的流程示意图;
图5为本申请实施方式提供的一种确定第一词语与至少一个第二词语中的每个第二词语之间的第一相似度的方法的流程示意图;
图6为本申请实施方式提供的一种词语替换装置的功能模块组成框图;
图7为本申请实施方式提供的一种电子设备的结构示意图。
具体实施方式
下面将结合本申请实施方式中的附图,对本申请实施方式中的技术方案进行清楚、完整地描述,显然,所描述的实施方式是本申请一部分实施方式,而不是全部的实施方式。基于本申请中的实施方式,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施方式,都属于本申请保护的范围。
本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
在本文中提及“实施方式”意味着,结合实施方式描述的特定特征、结果或特性可以包含在本申请的至少一个实施方式中。在说明书中的各个位置出现该短语并不一定均是指相同的实施方式,也不是与其它实施方式互斥的独立的或备选的实施方式。本领域技术人员显式地和隐式地理解的是,本文所描述的实施方式可以与其它实施方式相结合。
本申请的技术方案涉及人工智能和/或大数据技术领域,如可具体涉及自然语言处理技术。本申请可应用于文本处理等场景,以实现词语替换,使得更符合上下文的语境,从而推动智慧城市的建设。可选的,本申请涉及的数据如句子、语料和/或各词语等可存储于数据库中,或者可以存储于区块链中,比如通过区块链分布式存储,本申请不做限定。
参阅图1,图1为本申请实施方式提供的一种词语替换方法的流程示意图。该词语替换方法包括以下步骤:
101:对第一句子中的第一词语进行掩码处理,得到第二句子。
在本实施方式中,该第一词语至少包括两个单词,单词则指代由至少一个字组成的词语,例如,一个单词可以是“咖”、“啡”、“咖啡”等。基于此,第一词语可以以理解为包括至少两个字的词语,例如,第一词语可以是“咖啡”、“黑咖啡”、“牛奶咖啡”等。由此,相较于传统的单字掩码处理,直接对至少两个单词的第一词语进行掩码,可以使后续的预测操作更加精准。
示例性的,可以采用multilingual-t5模型进行掩码处理。
在本实施方式中,在对第一句子中的第一词语进行掩码处理之前,还需要在第一句子中确定第一词语。具体而言,本实施方式给出了一种在第一句子中确定第一词语的方法,如图2所示,该方法包括:
201:对第一句子进行分词处理,得到至少一个第三词语。
在本实施方式中,可以分别采用元数2、3、4的N-gram分割法对第一句子进行分词。具体而言,N-gram分割法是一种将句子分割成若干个分别由N个字符组成的片段序列的方法,每个片段称作一个N-gram。在N=1时,N-gram分割法可以称作uni-gram(一元gram),在N=2时,N-gram分割法可以称作bi-gram(二元gram),在N=3时,N-gram分割法可以称作tri-gram(三元gram)。示例性的,如果使用bi-gram去分割句子“我昨天喝了咖啡”这段文本,那么可以得到“我昨”、“昨天”、“天喝”、“喝了”、“了咖”和“咖啡”。
由此,在本实施方式中,得到分割结果后,可以对分割结果进行过滤清洗,滤除没有意义的分割结果,例如:“我昨”、“天喝”、和“了咖”,保留包含一定语义的分割结果,例如:“昨天”、“喝了”、和“咖啡”作为第三词语。
202:对第一句子进行语法分析,得到语法特征。
203:根据语法特征确定至少一个第三词语中每个第三词语的词性信息。
204:确定至少一个第三词语中的至少一个目标第三词语。
由于在关键词替换式的文本生成时,往往不会改变原句子的句式,因此,通常会对原句中的主语、谓语或宾语进行替换,而主语和宾语通常是以名词或数词的方式出现,而谓语则是以动词的方式出现,因此,在本实施方式中,该至少一个目标第三词语中的每个目标第三词语的词性信息为名词、动词或数词。
205:确定每个目标第三词语的逆文档频率。
对于关键词替换式的文本生成,其重点是找出句子中较为重要的关键词进行替换,对于例如“我们”这样的常见词,进行替换所得到的文本的实际意义并不大。因此,在本实施方式中,通过计算每个目标第三词语的逆文档频率,来确定该目标第三词语的重要性,继而剔除其中的常见词。
示例性的,本实施方式给出了一种确定每个目标第三词语的逆文档频率的方法,如图3所示,该方法包括:
301:在语料库中确定所有包含有每个目标第三词语的语料的数量,得到第一数量。
在本实施方式中,语料库为存储有与第一句子相关的语料的数据库。
302:确定语料库中的语料的总数与第一数量的商,得到第一商。
303:将第一商的对数作为每个目标第三词语的逆文档频率。
具体而言,逆文档频率可以通过公式①表示:
Figure PCTCN2021096421-appb-000001
其中,|D|表示语料库中的语料的总数;|[j:t∈d]|表示语料库中包含词语t的语料的总数,即第一数量。
同时,若语料库中不存在包含词语t的语料,则会导致|[j:t∈d]|为0,因此,为了避免这种情况,逆文档频率可以通过公式②表示:
Figure PCTCN2021096421-appb-000002
其中,c为常数,可根据实际情况进行相应的调整。示例性的,c可以为1。
206:将逆文档频率大于第二阈值的目标第三词语作为第一词语。
在可选的实施方式中,还可以通过计算每个目标第三词语的词频和逆文档频率,并将词频和逆文档频率的乘积大于第二阈值的目标第三词语作为第一词语。
102:将第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值。
在本实施方式中,至少一个第一概率值中的每个第一概率值用于表征使用每个第一概率值对应的第二词语替换第一词语的合理程度,且至少一个第二词语和至少一个第一概率值一一对应。
示例性的,本申请实施方式给出了一种将第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值的方法,如图4所示,该方法包括:
401:将第二句子和第一词语的词性信息输入关键词预测模型。
402:根据第一词语的词性信息确定目标词语库。
在本实施方式中,目标词语库中存储的词语的词性信息与第一词语的词性信息一致,由此,可以使预测出的词语的词性与原词语的词性保持一致,提升预测的精准度。
403:根据第二句子和目标词语库确定至少一个第二词语和至少一个第一概率值。
示例性的,可以先对第二句子进行分割,得到第一短语和第二短语,其中,第一短语 为第二句子中位于目标位置之前的所有单词组成的短语,第二短语为第二句子中位于目标位置之后的所有单词组成的短语,目标位置为掩码处理所掩码的位置。
具体而言,对于第一句子“我昨天吃了炸鱼和薯条”,第一词语为“炸鱼”,经过掩码操作后,可以得到第二句子“我昨天吃了</span mask>和薯条”。其中,“</span mask>”的位置即为目标位置。对此,对该第二句子进行拆分后,可以得到第一短语“我昨天吃了”,和第二短语“和薯条”。
然后,对第一短语进行语义补全,得到至少一个第三短语和至少一个第三概率值,其中,至少一个第三短语和至少一个第三概率值一一对应;以及,对第二短语进行语义补全,得到至少一个第四短语和至少一个第四概率值,其中,至少一个第四短语和至少一个第四概率值一一对应。
沿用上述第一短语“我昨天吃了”,和第二短语“和薯条”的示例,对第一短语进行语义补全后,得到的第三短语可以为:(汉堡,0.9)、(苹果,0.9)、(炸鱼,0.9)、(可乐,0.75)等,其中数字为前方词语对应的第三概率,例如,用“汉堡”补全第一短语的合理概率为0.9。
同理,对第二短语进行语义补全后,得到的第四短语可以为:(汉堡,0.9)、(番茄,0.65)、(炸鱼,0.95)、(可乐,0.9)等。
在得到至少一个第三短语和至少一个第四短语后,将至少一个第三短语和至少一个第四短语进行求交集,得到至少一个第五短语;并分别将至少一个第五短语中的每个第五短语对应的第三概率值和第四概率值进行乘积,得到至少一个第五概率值,其中,至少一个第五短语和至少一个第五概率值一一对应。
具体而言,对于第三短语可以为:(汉堡,0.9)、(苹果,0.9)、(炸鱼,0.9)、(可乐,0.75)等,以及第四短语可以为:(汉堡,0.9)、(番茄,0.65)、(炸鱼,0.95)、(可乐,0.9)等。两者的交集为词语:“汉堡”、“炸鱼”和“可乐”,其中,“汉堡”所对应的第五概率值为0.9×0.9=0.81、“炸鱼”对应的第五概率值为0.9×0.95=0.855、以及“可乐”所对应的第五概率值为0.75×0.9=0.675。
最后,根据至少一个第五短语、至少一个第五概率值和目标词语库确定至少一个第二词语和至少一个第一概率值。
示例性的,首先,可以在至少一个第五词语中,确定至少一个第二词语,其中,至少一个第二词语为至少一个第五词语中有,且目标词语库中也有的词语;然后,将至少一个第二词语中每个第二词语对应的第五概率值,作为每个第二词语对应的第一概率值。
具体而言,对于确定出的第五短语和第五概率值(汉堡,0.81)、(炸鱼,0.855)和(可乐,0.675),经过和目标词语库的比对,发现在目标词库中没有词语“可乐”。因此,最后得出的第二词语和该第二词语对应的第一概率值为:(汉堡,0.81)和(炸鱼,0.855)。由此,得出的第二词语不但更加精准,且更加契合原句中的上下文。
103:确定第一词语与至少一个第二词语中的每个第二词语之间的第一相似度。
在本实施方式中,给出了一种确定第一词语与至少一个第二词语中的每个第二词语之间的第一相似度的方法,如图5所示,该方法包括:
501:对第一词语进行词嵌入处理,得到第一词向量。
502:对每个第二词语进行词嵌入处理,得到第二词向量:。
503:对第一词向量进行取模,得到第一模。
504:对第二词向量进行取模,得到第二模。
505:确定第一模与第二模的乘积值。
506:确定第一词向量和第二词向量的内积。
507:将内积与乘积值的商,作为第一词语与每个第二词语之间的第一相似度。
示例性的,可以通过点积计算第一词语对应的第一词向量和第二词语对应的第二词向量之间的夹角余弦值,并用该夹角余弦值作为第一词语和第二词语之间的第一相似度。
具体而言,对于第一词语对应的第一词向量A=[a1,a2,…,ai,…,an],和第二词语对应的第二词向量B=[b1,b2,…,bi,…,bn],其中,i=1,2,…,n。夹角余弦值可以通过公式③表示:
Figure PCTCN2021096421-appb-000003
其中,A·B表示第一词向量A与第二词向量B的内积,丨丨为取模符号,丨A丨表示第一词向量A的模,丨B丨表示第二词向量B的模。
进一步的,第一词向量A与第二词向量B的内积可以通过公式④表示:
Figure PCTCN2021096421-appb-000004
进一步的,第一词向量A的模可以通过公式⑤表示:
Figure PCTCN2021096421-appb-000005
最后,将该夹角余弦值作为第一词向量A与第二词向量B之间的第一相似度。示例性的,第一词向量A与第二词向量B之间的相关性系数可以通过公式⑥表示:
p=cosθ…………⑥
由于余弦值的取值范围为【-1,1】,这使得余弦值在高维的情况下依然拥有相同时为1、正交时为0、相反时为-1的性质。即,余弦值越趋近于1,代表两个特征之间的方向越接近,相关性越大;越趋近于-1,他们的方向越相反,相关性越小;接近于0,表示两个特征近乎于正交,可以体现两个特征方向上的相对差异。由此,采用余弦值作为第一词向量与第二词向量之间的相关性系数,可以精确的表示第一词语与第二词语之间的相似度。
104:根据每个第二词语对应的第一概率值和第一相似度,确定每个第二词语的第二概率值。
示例性的,可以将每个第二词语对应的第一概率值和第一相似度进行乘积,将成绩结果作为每个第二词语的第二概率值。
105:确定至少一个第二词语中的至少一个目标第二词语。
在本实施方式中,该至少一个目标第二词语中的每个目标第二词语对用的第二概率值大于第一阈值。
106:分别使用每个目标第二词语替换第一句子中的第一词语。
综上所述,本申请所提供的词语替换方法,通过对至少包括两个单词的第一词语进行掩码操作,得到第二句子,从而将第二句子输入关键词预测模型,预测出多个第二词语和对应的第一概率值。由此,通过同时对至少包括两个单词的第一词语进行掩码操作,相较于传统的单字掩码处理,可以实现对直接对词语行掩码,继而使后续的预测操作更加精准。同时,对于预测出的多个第二词语,本申请实施方式通过计算每个第二词语与第一词语的相似度,再结合每个第二词语对应的第一概率值,生成混合指标第二概率值。最后使用大于第一阈值的第二概率值对应的第二词语替换第一句子中的第一词语。由此,在保证第二词语的语义与第一词语相近的同时,能够更好地符合第一句子中上下文的语境。
参阅图6,图6为本申请实施方式提供的一种词语替换装置的功能模块组成框图。如图6所示,该词语替换装置600包括:
掩码模块601,用于对第一句子中的第一词语进行掩码处理,得到第二句子,其中,第一词语至少包括两个单词;
预测模块602,用于将第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值,其中,至少一个第一概率值中的每个第一概率值用于表征使用每个第一概率值对应的第二词语替换第一词语的合理程度,至少一个第二词语和至少一个第一概率值一一对应;
词语确定模块603,用于确定第一词语与至少一个第二词语中的每个第二词语之间的第一相似度;并根据每个第二词语对应的第一概率值和第一相似度,确定每个第二词语的第二概率值;以及确定至少一个第二词语中的至少一个目标第二词语,至少一个目标第二词语中的每个目标第二词语对用的第二概率值大于第一阈值;
替换模块604,用于分别使用每个目标第二词语替换第一句子中的第一词语。
在本申请的实施方式中,在对第一句子中的第一词语进行掩码处理,得到第二句子之前,掩码模块601,还用于:
对第一句子进行分词处理,得到至少一个第三词语;
对第一句子进行语法分析,得到语法特征;
根据语法特征确定至少一个第三词语中每个第三词语的词性信息;
确定至少一个第三词语中的至少一个目标第三词语,至少一个目标第三词语中的每个目标第三词语的词性信息为名词、动词或数词;
确定每个目标第三词语的逆文档频率;
将逆文档频率大于第二阈值的目标第三词语作为第一词语。
在本申请的实施方式中,在确定每个目标第三词语的逆文档频率方面,掩码模块601,具体用于:
在语料库中确定所有包含有每个目标第三词语的语料的数量,得到第一数量,其中,语料库为存储有与第一句子相关的语料的数据库;
确定语料库中的语料的总数与第一数量的商,得到第一商;
将第一商的对数作为每个目标第三词语的逆文档频率。
在本申请的实施方式中,在将第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值方面,预测模块602,具体用于:
将第二句子和第一词语的词性信息输入关键词预测模型;
根据第一词语的词性信息确定目标词语库,其中,目标词语库中存储的词语的词性信息与第一词语的词性信息一致;
根据第二句子和目标词语库确定至少一个第二词语和至少一个第一概率值。
在本申请的实施方式中,在根据第二句子和目标词语库确定至少一个第二词语和至少一个第一概率值方面,预测模块602,具体用于:
对第二句子进行分割,得到第一短语和第二短语,其中,第一短语为第二句子中位于目标位置之前的所有单词组成的短语,第二短语为第二句子中位于目标位置之后的所有单词组成的短语,目标位置为掩码处理所掩码的位置;
对第一短语进行语义补全,得到至少一个第三短语和至少一个第三概率值,其中,至少一个第三短语和至少一个第三概率值一一对应;
对第二短语进行语义补全,得到至少一个第四短语和至少一个第四概率值,其中,至少一个第四短语和至少一个第四概率值一一对应;
将至少一个第三短语和至少一个第四短语进行求交集,得到至少一个第五短语;
分别将至少一个第五短语中的每个第五短语对应的第三概率值和第四概率值进行乘积,得到至少一个第五概率值,其中,至少一个第五短语和至少一个第五概率值一一对应;
根据至少一个第五短语、至少一个第五概率值和目标词语库确定至少一个第二词语和至少一个第一概率值。
在本申请的实施方式中,在根据至少一个第五短语、至少一个第五概率值和目标词语库确定至少一个第二词语和至少一个第一概率值方面,预测模块602,具体用于:
在至少一个第五词语中,确定至少一个第二词语,其中,至少一个第二词语为至少一个第五词语中有,且目标词语库中也有的词语;
将至少一个第二词语中每个第二词语对应的第五概率值,作为每个第二词语对应的第一概率值。
在本申请的实施方式中,在确定第一词语与至少一个第二词语中的每个第二词语之间的第一相似度方面,词语确定模块603,具体用于:
对第一词语进行词嵌入处理,得到第一词向量;
对每个第二词语进行词嵌入处理,得到第二词向量;
对第一词向量进行取模,得到第一模;
对第二词向量进行取模,得到第二模;
确定第一模与第二模的乘积值;
确定第一词向量和第二词向量的内积;
将内积与乘积值的商,作为第一词语与每个第二词语之间的第一相似度。
参阅图7,图7为本申请实施方式提供的一种电子设备的结构示意图。电子设备包括处理器和存储器。可选的,该电子设备还可包括通信接口,该通信接口可以为收发器或其他输入输出设备。例如,如图7所示,电子设备700包括收发器701、处理器702和存储器703。它们之间通过总线704连接。示例性的,收发器701用于接收待处理的数据至处理器702,以及向外输出处理器702的处理结果,具体而言,在本实施方式中,收发器701可以用于接收第一句子,以及输出用目标第二词语替换了第一词语后的第一句子。存储器703用于存储计算机程序和数据,并可以将存储器703存储的数据传输给处理器702。
处理器702用于读取存储器703中的计算机程序执行以下操作:
对第一句子中的第一词语进行掩码处理,得到第二句子,其中,第一词语至少包括两个单词;
将第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值,其中,至少一个第一概率值中的每个第一概率值用于表征使用每个第一概率值对应的第二词语替换第一词语的合理程度,至少一个第二词语和至少一个第一概率值一一对应;
确定第一词语与至少一个第二词语中的每个第二词语之间的第一相似度;
根据每个第二词语对应的第一概率值和第一相似度,确定每个第二词语的第二概率值;
确定至少一个第二词语中的至少一个目标第二词语,至少一个目标第二词语中的每个目标第二词语对用的第二概率值大于第一阈值;
分别使用每个目标第二词语替换第一句子中的第一词语。
在本申请的实施方式中,在对第一句子中的第一词语进行掩码处理,得到第二句子之前,处理器702,具体用于执行以下操作:
对第一句子进行分词处理,得到至少一个第三词语;
对第一句子进行语法分析,得到语法特征;
根据语法特征确定至少一个第三词语中每个第三词语的词性信息;
确定至少一个第三词语中的至少一个目标第三词语,至少一个目标第三词语中的每个目标第三词语的词性信息为名词、动词或数词;
确定每个目标第三词语的逆文档频率;
将逆文档频率大于第二阈值的目标第三词语作为第一词语。
在本申请的实施方式中,在确定每个目标第三词语的逆文档频率方面,处理器702,具体用于执行以下操作:
在语料库中确定所有包含有每个目标第三词语的语料的数量,得到第一数量,其中,语料库为存储有与第一句子相关的语料的数据库;
确定语料库中的语料的总数与第一数量的商,得到第一商;
将第一商的对数作为每个目标第三词语的逆文档频率。
在本申请的实施方式中,在将第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值方面,处理器702,具体用于执行以下操作:
将第二句子和第一词语的词性信息输入关键词预测模型;
根据第一词语的词性信息确定目标词语库,其中,目标词语库中存储的词语的词性信息与第一词语的词性信息一致;
根据第二句子和目标词语库确定至少一个第二词语和至少一个第一概率值。
在本申请的实施方式中,在根据第二句子和目标词语库确定至少一个第二词语和至少一个第一概率值方面,处理器702,具体用于执行以下操作:
对第二句子进行分割,得到第一短语和第二短语,其中,第一短语为第二句子中位于目标位置之前的所有单词组成的短语,第二短语为第二句子中位于目标位置之后的所有单词组成的短语,目标位置为掩码处理所掩码的位置;
对第一短语进行语义补全,得到至少一个第三短语和至少一个第三概率值,其中,至少一个第三短语和至少一个第三概率值一一对应;
对第二短语进行语义补全,得到至少一个第四短语和至少一个第四概率值,其中,至少一个第四短语和至少一个第四概率值一一对应;
将至少一个第三短语和至少一个第四短语进行求交集,得到至少一个第五短语;
分别将至少一个第五短语中的每个第五短语对应的第三概率值和第四概率值进行乘积,得到至少一个第五概率值,其中,至少一个第五短语和至少一个第五概率值一一对应;
根据至少一个第五短语、至少一个第五概率值和目标词语库确定至少一个第二词语和至少一个第一概率值。
在本申请的实施方式中,在根据至少一个第五短语、至少一个第五概率值和目标词语库确定至少一个第二词语和至少一个第一概率值方面,处理器702,具体用于执行以下操作:
在至少一个第五词语中,确定至少一个第二词语,其中,至少一个第二词语为至少一个第五词语中有,且目标词语库中也有的词语;
将至少一个第二词语中每个第二词语对应的第五概率值,作为每个第二词语对应的第一概率值。
在本申请的实施方式中,在确定第一词语与至少一个第二词语中的每个第二词语之间的第一相似度方面,处理器702,具体用于执行以下操作:
对第一词语进行词嵌入处理,得到第一词向量;
对每个第二词语进行词嵌入处理,得到第二词向量;
对第一词向量进行取模,得到第一模;
对第二词向量进行取模,得到第二模;
确定第一模与第二模的乘积值;
确定第一词向量和第二词向量的内积;
将内积与乘积值的商,作为第一词语与每个第二词语之间的第一相似度。
应理解,本申请中的词语替换装置可以包括智能手机(如Android手机、iOS手机、Windows Phone手机等)、平板电脑、掌上电脑、笔记本电脑、移动互联网设备MID(Mobile Internet Devices,简称:MID)、机器人或穿戴式设备等。上述词语替换装置仅是举例,而 非穷举,包含但不限于上述词语替换装置。在实际应用中,上述词语替换装置还可以包括:智能车载终端、计算机设备等等。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本申请可借助软件结合硬件平台的方式来实现。基于这样的理解,本申请的技术方案对背景技术做出贡献的全部或者部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施方式或者实施方式的某些部分所述的方法。
因此,本申请实施方式还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现如上述方法实施方式中记载的任何一种词语替换方法的部分或全部步骤。例如,所述存储介质可以包括硬盘、软盘、光盘、磁带、磁盘、优盘、闪存等。
可选的,本申请涉及的存储介质如计算机可读存储介质可以是非易失性的,也可以是易失性的。
本申请实施方式还提供一种计算机程序产品,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序可操作来使计算机执行如上述方法实施方式中记载的任何一种词语替换方法的部分或全部步骤。
需要说明的是,对于前述的各方法实施方式,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施方式均属于可选的实施方式,所涉及的动作和模块并不一定是本申请所必须的。
在上述实施方式中,对各个实施方式的描述都各有侧重,某个实施方式中没有详述的部分,可以参见其他实施方式的相关描述。
在本申请所提供的几个实施方式中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施方式仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施方式方案的目的。
另外,在本申请各个实施方式中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件程序模块的形式实现。
所述集成的单元如果以软件程序模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施方式所述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
本领域普通技术人员可以理解上述实施方式的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、只读存储器(英文:Read-Only Memory,简称:ROM)、随机存取器(英文:Random Access Memory,简称:RAM)、磁盘或光盘等。
以上对本申请实施方式进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施方式的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种词语替换方法,其中,所述替换方法包括:
    对第一句子中的第一词语进行掩码处理,得到第二句子,其中,所述第一词语至少包括两个单词;
    将所述第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值,其中,所述至少一个第一概率值中的每个第一概率值用于表征使用所述每个第一概率值对应的第二词语替换所述第一词语的合理程度,所述至少一个第二词语和所述至少一个第一概率值一一对应;
    确定所述第一词语与所述至少一个第二词语中的每个第二词语之间的第一相似度;
    根据所述每个第二词语对应的第一概率值和第一相似度,确定所述每个第二词语的第二概率值;
    确定所述至少一个第二词语中的至少一个目标第二词语,所述至少一个目标第二词语中的每个目标第二词语对用的第二概率值大于第一阈值;
    分别使用所述每个目标第二词语替换所述第一句子中的第一词语。
  2. 根据权利要求1所述的替换方法,其中,在对第一句子中的第一词语进行掩码处理,得到第二句子之前,所述替换方法还包括:
    对所述第一句子进行分词处理,得到至少一个第三词语;
    对所述第一句子进行语法分析,得到语法特征;
    根据所述语法特征确定所述至少一个第三词语中每个第三词语的词性信息;
    确定所述至少一个第三词语中的至少一个目标第三词语,所述至少一个目标第三词语中的每个目标第三词语的词性信息为名词、动词或数词;
    确定所述每个目标第三词语的逆文档频率;
    将所述逆文档频率大于第二阈值的目标第三词语作为所述第一词语。
  3. 根据权利要求2所述的替换方法,其中,所述确定所述每个目标第三词语的逆文档频率,包括:
    在语料库中确定所有包含有所述每个目标第三词语的语料的数量,得到第一数量,其中,所述语料库为存储有与所述第一句子相关的语料的数据库;
    确定所述语料库中的语料的总数与所述第一数量的商,得到第一商;
    将所述第一商的对数作为所述每个目标第三词语的逆文档频率。
  4. 根据权利要求2所述的替换方法,其中,所述将所述第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值,包括:
    将所述第二句子和所述第一词语的词性信息输入所述关键词预测模型;
    根据所述第一词语的词性信息确定目标词语库,其中,所述目标词语库中存储的词语的词性信息与所述第一词语的词性信息一致;
    根据所述第二句子和所述目标词语库确定所述至少一个第二词语和所述至少一个第一概率值。
  5. 根据权利要求4所述的替换方法,其中,所述根据所述第二句子和所述目标词语库确定所述至少一个第二词语和所述至少一个第一概率值,包括:
    对所述第二句子进行分割,得到第一短语和第二短语,其中,所述第一短语为所述第二句子中位于目标位置之前的所有单词组成的短语,所述第二短语为所述第二句子中位于所述目标位置之后的所有单词组成的短语,所述目标位置为所述掩码处理所掩码的位置;
    对所述第一短语进行语义补全,得到至少一个第三短语和至少一个第三概率值,其中,所述至少一个第三短语和所述至少一个第三概率值一一对应;
    对所述第二短语进行语义补全,得到至少一个第四短语和至少一个第四概率值,其中, 所述至少一个第四短语和所述至少一个第四概率值一一对应;
    将所述至少一个第三短语和所述至少一个第四短语进行求交集,得到所述至少一个第五短语;
    分别将所述至少一个第五短语中的每个第五短语对应的第三概率值和第四概率值进行乘积,得到至少一个第五概率值,其中,所述至少一个第五短语和所述至少一个第五概率值一一对应;
    根据所述至少一个第五短语、所述至少一个第五概率值和所述目标词语库确定所述至少一个第二词语和所述至少一个第一概率值。
  6. 根据权利要求5所述的替换方法,其中,所述根据所述至少一个第五短语、所述至少一个第五概率值和所述目标词语库确定所述至少一个第二词语和所述至少一个第一概率值,包括:
    在所述至少一个第五词语中,确定所述至少一个第二词语,其中,所述至少一个第二词语为所述至少一个第五词语中有,且所述目标词语库中也有的词语;
    将所述至少一个第二词语中每个第二词语对应的第五概率值,作为所述每个第二词语对应的第一概率值。
  7. 根据权利要求1所述的替换方法,其中,所述确定所述第一词语与所述至少一个第二词语中的每个第二词语之间的第一相似度,包括:
    对所述第一词语进行词嵌入处理,得到第一词向量;
    对所述每个第二词语进行词嵌入处理,得到第二词向量;
    对所述第一词向量进行取模,得到第一模;
    对所述第二词向量进行取模,得到第二模;
    确定所述第一模与所述第二模的乘积值;
    确定所述第一词向量和所述第二词向量的内积;
    将所述内积与所述乘积值的商,作为所述第一词语与所述每个第二词语之间的第一相似度。
  8. 一种词语替换装置,其中,所述替换装置包括:
    掩码模块,用于对第一句子中的第一词语进行掩码处理,得到第二句子,其中,所述第一词语至少包括两个单词;
    预测模块,用于将所述第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值,其中,所述至少一个第一概率值中的每个第一概率值用于表征使用所述每个第一概率值对应的第二词语替换所述第一词语的合理程度,所述至少一个第二词语和所述至少一个第一概率值一一对应;
    词语确定模块,用于确定所述第一词语与所述至少一个第二词语中的每个第二词语之间的第一相似度;并根据所述每个第二词语对应的第一概率值和第一相似度,确定所述每个第二词语的第二概率值;以及确定所述至少一个第二词语中的至少一个目标第二词语,所述至少一个目标第二词语中的每个目标第二词语对用的第二概率值大于第一阈值;
    替换模块,用于分别使用所述每个目标第二词语替换所述第一句子中的第一词语。
  9. 一种电子设备,其中,包括处理器、存储器、通信接口以及一个或多个程序,其中,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行以实现以下方法:
    对第一句子中的第一词语进行掩码处理,得到第二句子,其中,所述第一词语至少包括两个单词;
    将所述第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值,其中,所述至少一个第一概率值中的每个第一概率值用于表征使用所述每个第一概率值对 应的第二词语替换所述第一词语的合理程度,所述至少一个第二词语和所述至少一个第一概率值一一对应;
    确定所述第一词语与所述至少一个第二词语中的每个第二词语之间的第一相似度;
    根据所述每个第二词语对应的第一概率值和第一相似度,确定所述每个第二词语的第二概率值;
    确定所述至少一个第二词语中的至少一个目标第二词语,所述至少一个目标第二词语中的每个目标第二词语对用的第二概率值大于第一阈值;
    分别使用所述每个目标第二词语替换所述第一句子中的第一词语。
  10. 根据权利要求9所述的电子设备,其中,在对第一句子中的第一词语进行掩码处理,得到第二句子之前,所述处理器还用于执行:
    对所述第一句子进行分词处理,得到至少一个第三词语;
    对所述第一句子进行语法分析,得到语法特征;
    根据所述语法特征确定所述至少一个第三词语中每个第三词语的词性信息;
    确定所述至少一个第三词语中的至少一个目标第三词语,所述至少一个目标第三词语中的每个目标第三词语的词性信息为名词、动词或数词;
    确定所述每个目标第三词语的逆文档频率;
    将所述逆文档频率大于第二阈值的目标第三词语作为所述第一词语。
  11. 根据权利要求10所述的电子设备,其中,执行所述确定所述每个目标第三词语的逆文档频率,包括:
    在语料库中确定所有包含有所述每个目标第三词语的语料的数量,得到第一数量,其中,所述语料库为存储有与所述第一句子相关的语料的数据库;
    确定所述语料库中的语料的总数与所述第一数量的商,得到第一商;
    将所述第一商的对数作为所述每个目标第三词语的逆文档频率。
  12. 根据权利要求10所述的电子设备,其中,执行所述将所述第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值,包括:
    将所述第二句子和所述第一词语的词性信息输入所述关键词预测模型;
    根据所述第一词语的词性信息确定目标词语库,其中,所述目标词语库中存储的词语的词性信息与所述第一词语的词性信息一致;
    根据所述第二句子和所述目标词语库确定所述至少一个第二词语和所述至少一个第一概率值。
  13. 根据权利要求12所述的电子设备,其中,执行所述根据所述第二句子和所述目标词语库确定所述至少一个第二词语和所述至少一个第一概率值,包括:
    对所述第二句子进行分割,得到第一短语和第二短语,其中,所述第一短语为所述第二句子中位于目标位置之前的所有单词组成的短语,所述第二短语为所述第二句子中位于所述目标位置之后的所有单词组成的短语,所述目标位置为所述掩码处理所掩码的位置;
    对所述第一短语进行语义补全,得到至少一个第三短语和至少一个第三概率值,其中,所述至少一个第三短语和所述至少一个第三概率值一一对应;
    对所述第二短语进行语义补全,得到至少一个第四短语和至少一个第四概率值,其中,所述至少一个第四短语和所述至少一个第四概率值一一对应;
    将所述至少一个第三短语和所述至少一个第四短语进行求交集,得到所述至少一个第五短语;
    分别将所述至少一个第五短语中的每个第五短语对应的第三概率值和第四概率值进行乘积,得到至少一个第五概率值,其中,所述至少一个第五短语和所述至少一个第五概率值一一对应;
    根据所述至少一个第五短语、所述至少一个第五概率值和所述目标词语库确定所述至少一个第二词语和所述至少一个第一概率值。
  14. 根据权利要求9所述的电子设备,其中,执行所述确定所述第一词语与所述至少一个第二词语中的每个第二词语之间的第一相似度,包括:
    对所述第一词语进行词嵌入处理,得到第一词向量;
    对所述每个第二词语进行词嵌入处理,得到第二词向量;
    对所述第一词向量进行取模,得到第一模;
    对所述第二词向量进行取模,得到第二模;
    确定所述第一模与所述第二模的乘积值;
    确定所述第一词向量和所述第二词向量的内积;
    将所述内积与所述乘积值的商,作为所述第一词语与所述每个第二词语之间的第一相似度。
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现以下方法:
    对第一句子中的第一词语进行掩码处理,得到第二句子,其中,所述第一词语至少包括两个单词;
    将所述第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值,其中,所述至少一个第一概率值中的每个第一概率值用于表征使用所述每个第一概率值对应的第二词语替换所述第一词语的合理程度,所述至少一个第二词语和所述至少一个第一概率值一一对应;
    确定所述第一词语与所述至少一个第二词语中的每个第二词语之间的第一相似度;
    根据所述每个第二词语对应的第一概率值和第一相似度,确定所述每个第二词语的第二概率值;
    确定所述至少一个第二词语中的至少一个目标第二词语,所述至少一个目标第二词语中的每个目标第二词语对用的第二概率值大于第一阈值;
    分别使用所述每个目标第二词语替换所述第一句子中的第一词语。
  16. 根据权利要求15所述的计算机可读存储介质,其中,在对第一句子中的第一词语进行掩码处理,得到第二句子之前,所述计算机程序被处理器执行时还用于实现:
    对所述第一句子进行分词处理,得到至少一个第三词语;
    对所述第一句子进行语法分析,得到语法特征;
    根据所述语法特征确定所述至少一个第三词语中每个第三词语的词性信息;
    确定所述至少一个第三词语中的至少一个目标第三词语,所述至少一个目标第三词语中的每个目标第三词语的词性信息为名词、动词或数词;
    确定所述每个目标第三词语的逆文档频率;
    将所述逆文档频率大于第二阈值的目标第三词语作为所述第一词语。
  17. 根据权利要求16所述的计算机可读存储介质,其中,执行所述确定所述每个目标第三词语的逆文档频率,包括:
    在语料库中确定所有包含有所述每个目标第三词语的语料的数量,得到第一数量,其中,所述语料库为存储有与所述第一句子相关的语料的数据库;
    确定所述语料库中的语料的总数与所述第一数量的商,得到第一商;
    将所述第一商的对数作为所述每个目标第三词语的逆文档频率。
  18. 根据权利要求16所述的计算机可读存储介质,其中,执行所述将所述第二句子输入关键词预测模型,得到至少一个第二词语和至少一个第一概率值,包括:
    将所述第二句子和所述第一词语的词性信息输入所述关键词预测模型;
    根据所述第一词语的词性信息确定目标词语库,其中,所述目标词语库中存储的词语的词性信息与所述第一词语的词性信息一致;
    根据所述第二句子和所述目标词语库确定所述至少一个第二词语和所述至少一个第一概率值。
  19. 根据权利要求18所述的计算机可读存储介质,其中,执行所述根据所述第二句子和所述目标词语库确定所述至少一个第二词语和所述至少一个第一概率值,包括:
    对所述第二句子进行分割,得到第一短语和第二短语,其中,所述第一短语为所述第二句子中位于目标位置之前的所有单词组成的短语,所述第二短语为所述第二句子中位于所述目标位置之后的所有单词组成的短语,所述目标位置为所述掩码处理所掩码的位置;
    对所述第一短语进行语义补全,得到至少一个第三短语和至少一个第三概率值,其中,所述至少一个第三短语和所述至少一个第三概率值一一对应;
    对所述第二短语进行语义补全,得到至少一个第四短语和至少一个第四概率值,其中,所述至少一个第四短语和所述至少一个第四概率值一一对应;
    将所述至少一个第三短语和所述至少一个第四短语进行求交集,得到所述至少一个第五短语;
    分别将所述至少一个第五短语中的每个第五短语对应的第三概率值和第四概率值进行乘积,得到至少一个第五概率值,其中,所述至少一个第五短语和所述至少一个第五概率值一一对应;
    根据所述至少一个第五短语、所述至少一个第五概率值和所述目标词语库确定所述至少一个第二词语和所述至少一个第一概率值。
  20. 根据权利要求15所述的计算机可读存储介质,其中,执行所述确定所述第一词语与所述至少一个第二词语中的每个第二词语之间的第一相似度,包括:
    对所述第一词语进行词嵌入处理,得到第一词向量;
    对所述每个第二词语进行词嵌入处理,得到第二词向量;
    对所述第一词向量进行取模,得到第一模;
    对所述第二词向量进行取模,得到第二模;
    确定所述第一模与所述第二模的乘积值;
    确定所述第一词向量和所述第二词向量的内积;
    将所述内积与所述乘积值的商,作为所述第一词语与所述每个第二词语之间的第一相似度。
PCT/CN2021/096421 2021-04-26 2021-05-27 词语替换方法、装置、电子设备和存储介质 WO2022227166A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110458707.7A CN113177402B (zh) 2021-04-26 2021-04-26 词语替换方法、装置、电子设备和存储介质
CN202110458707.7 2021-04-26

Publications (1)

Publication Number Publication Date
WO2022227166A1 true WO2022227166A1 (zh) 2022-11-03

Family

ID=76926447

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/096421 WO2022227166A1 (zh) 2021-04-26 2021-05-27 词语替换方法、装置、电子设备和存储介质

Country Status (2)

Country Link
CN (1) CN113177402B (zh)
WO (1) WO2022227166A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115146623A (zh) * 2022-07-26 2022-10-04 北京有竹居网络技术有限公司 文本词替换方法、装置、存储介质及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110196894A (zh) * 2019-05-30 2019-09-03 北京百度网讯科技有限公司 语言模型的训练方法和预测方法
US10402490B1 (en) * 2015-08-14 2019-09-03 Shutterstock, Inc. Edit distance based spellcheck
CN110543639A (zh) * 2019-09-12 2019-12-06 扬州大学 一种基于预训练Transformer语言模型的英文句子简化算法
CN111931492A (zh) * 2020-07-16 2020-11-13 平安科技(深圳)有限公司 数据扩充混合策略生成方法、装置和计算机设备
CN112214989A (zh) * 2020-10-19 2021-01-12 扬州大学 一种基于bert的汉语句子简化方法
CN112528894A (zh) * 2020-12-17 2021-03-19 科大讯飞股份有限公司 一种差异项判别方法及装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108241667B (zh) * 2016-12-26 2019-10-15 百度在线网络技术(北京)有限公司 用于推送信息的方法和装置
KR20190090646A (ko) * 2018-01-25 2019-08-02 필아이티 주식회사 단어 예측을 수행하는 방법 및 모바일 장치

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10402490B1 (en) * 2015-08-14 2019-09-03 Shutterstock, Inc. Edit distance based spellcheck
CN110196894A (zh) * 2019-05-30 2019-09-03 北京百度网讯科技有限公司 语言模型的训练方法和预测方法
CN110543639A (zh) * 2019-09-12 2019-12-06 扬州大学 一种基于预训练Transformer语言模型的英文句子简化算法
CN111931492A (zh) * 2020-07-16 2020-11-13 平安科技(深圳)有限公司 数据扩充混合策略生成方法、装置和计算机设备
CN112214989A (zh) * 2020-10-19 2021-01-12 扬州大学 一种基于bert的汉语句子简化方法
CN112528894A (zh) * 2020-12-17 2021-03-19 科大讯飞股份有限公司 一种差异项判别方法及装置

Also Published As

Publication number Publication date
CN113177402A (zh) 2021-07-27
CN113177402B (zh) 2024-03-01

Similar Documents

Publication Publication Date Title
JP6643555B2 (ja) 曖昧なエンティティワードに基づくテキスト処理方法及び装置
US10255269B2 (en) Graph long short term memory for syntactic relationship discovery
WO2018157789A1 (zh) 一种语音识别的方法、计算机、存储介质以及电子装置
US11929066B2 (en) Intent-based conversational knowledge graph for spoken language understanding system
CN108334490B (zh) 关键词提取方法以及关键词提取装置
WO2017130434A1 (ja) 多言語の固有表現認識モデルの転移を行うコンピュータシステム、方法、およびプログラム
KR101573854B1 (ko) 관계어 기반 확률추정 방법을 이용한 통계적 문맥의존 철자오류 교정 장치 및 방법
CN112395385B (zh) 基于人工智能的文本生成方法、装置、计算机设备及介质
KR20040025642A (ko) 확인 문장을 검색하기 위한 방법 및 시스템
JP7335300B2 (ja) 知識事前訓練モデルの訓練方法、装置及び電子機器
Warjri et al. Part-of-speech (POS) tagging using conditional random field (CRF) model for Khasi corpora
US10592542B2 (en) Document ranking by contextual vectors from natural language query
US20240111956A1 (en) Nested named entity recognition method based on part-of-speech awareness, device and storage medium therefor
CN112347241A (zh) 一种摘要提取方法、装置、设备及存储介质
CN113158687B (zh) 语义的消歧方法及装置、存储介质、电子装置
CN111382571A (zh) 一种信息抽取方法、系统、服务器和存储介质
Sarkar et al. A practical part-of-speech tagger for Bengali
CN110889295B (zh) 机器翻译模型、伪专业平行语料的确定方法、系统及设备
CN111950301A (zh) 一种中译英的英语译文质量分析方法及系统
Zhang et al. Design and implementation of Chinese Common Braille translation system integrating Braille word segmentation and concatenation rules
WO2022227166A1 (zh) 词语替换方法、装置、电子设备和存储介质
RU2672393C2 (ru) Способ и система автоматического создания тезауруса
CN110750967B (zh) 一种发音的标注方法、装置、计算机设备和存储介质
US20220121694A1 (en) Semantic search and response
WO2022198747A1 (zh) 三元组信息的抽取方法、装置、电子设备和存储介质

Legal Events

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

Ref document number: 21938636

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

Country of ref document: EP

Kind code of ref document: A1