CN115204124A - Word example sentence generation method and device and electronic equipment - Google Patents
Word example sentence generation method and device and electronic equipment Download PDFInfo
- Publication number
- CN115204124A CN115204124A CN202210913508.5A CN202210913508A CN115204124A CN 115204124 A CN115204124 A CN 115204124A CN 202210913508 A CN202210913508 A CN 202210913508A CN 115204124 A CN115204124 A CN 115204124A
- Authority
- CN
- China
- Prior art keywords
- sentence
- word
- target
- words
- paraphrase
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/335—Filtering based on additional data, e.g. user or group profiles
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/237—Lexical tools
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/284—Lexical analysis, e.g. tokenisation or collocates
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Machine Translation (AREA)
Abstract
The embodiment of the application discloses a method and a device for generating word example sentences and electronic equipment. One embodiment of the method comprises: acquiring words and definitions of the words, and determining target definitions of the words based on the definitions of the words; searching candidate sentences from a preset corpus by using the words, wherein the candidate sentences comprise the words; determining a target sentence from the candidate sentences based on the words and the target paraphrases of the words; and filtering the target sentence, and determining the sentence obtained by filtering as an example sentence of the word. The implementation mode can efficiently generate the example sentences, improves the quality of the generated example sentences, and saves the labor consumption for writing the example sentences.
Description
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a method and a device for generating word example sentences and electronic equipment.
Background
Words and expressions, also called words and phrases, are the collective terms of words and phrases, including words (including words and compound words) and phrases (also called phrases), and are the minimum word-forming structural units constituting sentence articles. The word example sentence can be used for explaining the meaning and the usage of the word, and the high-quality word example sentence is helpful for understanding, memorizing, distinguishing, operating and the like of the word.
Disclosure of Invention
This disclosure is provided to introduce concepts in a simplified form that are further described below in the detailed description. This disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In a first aspect, an embodiment of the present disclosure provides a method for generating word example sentences, including: acquiring the words and the definitions of the words, and determining the target definitions of the words based on the definitions of the words; searching candidate sentences from a preset corpus by using the words, wherein the candidate sentences comprise the words; determining a target sentence from the candidate sentences based on the words and the target paraphrases of the words; and filtering the target sentence, and determining the sentence obtained by filtering as an example sentence of the words.
In a second aspect, an embodiment of the present disclosure provides a word example sentence generating apparatus, including: the acquisition unit is used for acquiring words and paraphrases of the words and determining target paraphrases of the words based on the paraphrases of the words; the retrieval unit is used for retrieving candidate sentences from a preset corpus by using the words, wherein the candidate sentences comprise the words; a determining unit for determining a target sentence from the candidate sentences based on the words and the target paraphrases of the words; and the filtering unit is used for filtering the target sentence and determining the sentence obtained by filtering as an example sentence of the word.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor; a storage device for storing at least one program which, when executed by at least one processor, causes the at least one processor to implement the word illustrative sentence generating method as in the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the steps of the word example sentence generation method according to the first aspect.
According to the word example sentence generating method, the word example sentence generating device and the electronic equipment, the target paraphrase of the word is determined by acquiring the word and the paraphrase of the word and based on the paraphrase of the word; searching a candidate sentence from a preset corpus by using the word, wherein the candidate sentence comprises the word; determining a target sentence from the candidate sentences based on the words and the target paraphrases of the words; and filtering the target sentence, and determining the sentence obtained by filtering as an example sentence of the word. By the method, the word example sentence can be efficiently generated, the quality of the generated word example sentence is improved, and the labor consumption for writing the example sentence is saved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is a flow diagram of one embodiment of a method of word example sentence generation in accordance with the present disclosure;
FIG. 2 is a flow diagram of yet another embodiment of a method of word example sentence generation in accordance with the present disclosure;
FIG. 3 is a flow diagram of one embodiment of filtering a target sentence in a word example sentence generation method in accordance with the present disclosure;
FIG. 4 is a schematic diagram of an embodiment of a word example sentence generation apparatus according to the present disclosure;
FIG. 5 is an exemplary system architecture diagram in which various embodiments of the present disclosure may be applied;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing an electronic device of an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein is intended to be open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Referring to FIG. 1, a flow 100 of one embodiment of a word example sentence generation method in accordance with the present disclosure is shown. The method for generating the example sentence comprises the following steps of:
In this embodiment, the execution subject of the word example sentence generation method may obtain the word and the paraphrase of the word. The above words are typically the words of the illustrative sentence to be generated. Paraphrasing is generally the meaning of interpreting a word.
Thereafter, the execution body may determine a target paraphrase of the term based on the paraphrase of the term. Here, the execution body may determine the definition of the word as a target definition of the word.
In this embodiment, the execution subject may retrieve the candidate sentence from the predetermined corpus by using the word, so that the retrieved candidate sentence includes the word.
Here, the corpus generally includes preset sentences that can be word example sentences.
In this embodiment, the executing entity may determine a target sentence from the candidate sentences based on the word and the target paraphrase of the word. Here, for each of the candidate sentences, the execution subject may determine a meaning of the word in the candidate sentence; thereafter, it may be determined whether the meaning of the word in the candidate sentence is consistent with the target paraphrase of the word; if so, the candidate sentence may be determined as the target sentence.
Here, for each of the candidate sentences, the execution agent may input the word, the candidate sentence, and the target paraphrase of the word into a pre-trained word sense disambiguation model to obtain a matching result of whether the meaning of the word in the candidate sentence matches the target paraphrase of the word. The matching result includes a matching result for characterizing that the meaning of the word in the candidate sentence matches the target paraphrase of the word and a matching result for characterizing that the meaning of the word in the candidate sentence does not match the target paraphrase of the word.
The training data for the above word sense disambiguation model may be a sample set containing sentences, words, and corresponding word senses. The training data may be derived from an existing dictionary or from a manually labeled training set.
And 104, filtering the target sentence, and determining the sentence obtained by filtering as an example sentence of the word.
In this embodiment, the execution subject may filter the target sentence, and determine the filtered sentence as an example sentence of a word. Here, the execution subject may score the target sentence for each of the target sentences; target sentences with scores below a preset score threshold may then be filtered out. As an example, the execution subject may score the target sentence based on the length of the sentence, the difficulty level of the sentence, whether the rarely used word is contained in the sentence, and other factors.
The method provided by the embodiment of the disclosure determines the target paraphrase of the word based on the paraphrase of the word by acquiring the word and the paraphrase of the word; searching a candidate sentence from a preset corpus by using the word, wherein the candidate sentence comprises the word; determining a target sentence from the candidate sentences based on the words and the target paraphrases of the words; and filtering the target sentence, and determining the sentence obtained by filtering as an example sentence of the word. By the method, the word example sentence can be efficiently generated, the quality of the generated word example sentence is improved, and the labor consumption for writing the example sentence is saved.
In some alternative implementations, the executing subject may filter the target sentence by: the execution subject may determine a text quality of the target sentence, and obtain a text quality evaluation result of the target sentence. Here, for each of the target sentences, the executing entity may input the target sentence into a text quality evaluation model trained in advance to obtain a text quality evaluation result of the target sentence. The text quality evaluation model can be used for representing the corresponding relation between the text and the corresponding text quality evaluation result. Then, the execution subject may filter the target sentence by using the text quality evaluation result. Here, the text quality evaluation result may be represented as an evaluation score, and a higher evaluation score may represent a better text quality, and a lower evaluation score may represent a worse text quality. The executing body may filter out sentences whose evaluation scores are lower than a preset score threshold value from the target sentences, and leave sentences whose evaluation scores are higher than or equal to the score threshold value from the target sentences.
In some optional implementations, the executing entity may determine the text quality of the target sentence by at least one of: the executing body may input the target sentence into a pre-trained text topic recognition model to obtain a text topic corresponding to the target sentence. The text topic identification model can be used for representing the corresponding relation between the text and the text topic corresponding to the text. The execution subject may input the target sentence into a pre-trained text difficulty recognition model to obtain a text difficulty label corresponding to the target sentence. The text difficulty can be divided into a plurality of grades in advance, and the text difficulty is generally the reading difficulty of the text. The text difficulty recognition model can be used for representing the corresponding relation between the text and the text difficulty label corresponding to the text.
In some alternative implementations, the executing entity may determine the target sentence from the candidate sentences based on the words and the target paraphrases of the words by: the execution agent may input the word, the target paraphrase of the word, and the candidate sentence into a pre-trained paraphrase matching model to obtain a matching result of the meaning of the word in the candidate sentence and the target paraphrase of the word. The paraphrase matching model can be used for representing the corresponding relation among the words, the paraphrases of the words and the sentences corresponding to the words and the matching results of the meanings of the words in the corresponding sentences and the paraphrases of the words. The matching result may include a match and a mismatch. If the matching result is matching, it indicates that the meaning of the word in the candidate sentence matches the target paraphrase of the word. If the matching result is not matched, the meaning of the word in the candidate sentence is not matched with the target paraphrase of the word. Then, the executing entity may determine a target sentence from the candidate sentences using the matching result. Here, the execution body may determine a sentence, of which the matching result is a match, as the target sentence among the candidate sentences.
With further reference to fig. 2, a flow 200 of yet another embodiment of a word example sentence generation method in accordance with the present disclosure is shown. The method for generating the word example sentence comprises the following steps of:
In this embodiment, step 201 may be performed in a similar manner to step 101, and is not described herein again.
In this embodiment, the execution subject of the word example sentence generation method may search at least one paraphrase corresponding to the word in a preset paraphrase database.
The paraphrase database typically contains words and paraphrases corresponding to the words. Words and paraphrases in the existing dictionary can be collected in advance, and different paraphrases of the same word are combined to form a paraphrase database. It should be noted that the words and definitions may be in different languages, some words may correspond to definitions in different languages, and definitions in multiple languages may be regarded as a set of equivalent definitions.
In this embodiment, the execution body may determine whether there is a paraphrase matching the paraphrase of the word from among the at least one paraphrase. Specifically, for each paraphrase in the at least one paraphrase, the executing body may match the paraphrase with the paraphrase of the acquired word, that is, determine whether the meanings of the paraphrases are equivalent.
Here, the execution agent may input the paraphrase and the paraphrase of the acquired word into a paraphrase matching model trained in advance, and obtain a matching result of the paraphrase and the paraphrase of the acquired word. The matching result may include a matching result used for representing that the paraphrase is matched with the paraphrase of the obtained word and a matching result used for representing that the paraphrase is not matched with the paraphrase of the obtained word.
If it is determined that there is a paraphrase that matches the paraphrase of the term, the executing entity may perform step 204.
In this embodiment, if it is determined in step 203 that there is a paraphrase matching the paraphrase of the word, the executing body may determine the paraphrase matching the paraphrase of the word as the target paraphrase of the word.
It should be noted that the paraphrases matching the paraphrases of the above words may be a set of equivalent paraphrases, and the set of equivalent paraphrases may be composed of paraphrases in different languages.
In step 205, candidate sentences are retrieved from the predetermined corpus using the words.
At step 206, a target sentence is determined from the candidate sentences based on the words and the target paraphrases of the words.
And step 207, filtering the target sentence, and determining the sentence obtained by filtering as an example sentence of the word.
In this embodiment, steps 205-207 may be performed in a manner similar to steps 102-104, and are not described herein again.
As can be seen from fig. 2, compared with the embodiment corresponding to fig. 1, the process 200 of the term example sentence generation method in this embodiment embodies a step of searching whether there is a paraphrase matching the obtained paraphrase of the term from a preset paraphrase database, and determining the searched paraphrase as a target paraphrase if there is a paraphrase matching the obtained paraphrase of the term. Because the paraphrases in the paraphrase database are usually standard paraphrases, the scheme described in the embodiment can obtain more standard paraphrases corresponding to words, so that more accurate word example sentences can be generated.
In some optional implementations, after determining whether there is a paraphrase that matches the paraphrase of the word from the at least one paraphrase, if it is determined that there is no paraphrase that matches the paraphrase of the word, the execution body may determine the obtained paraphrase of the word as the target paraphrase of the word.
With continued reference to FIG. 3, a flow 300 of one embodiment of filtering a target sentence in a word example sentence generation method according to the present disclosure is shown. The process of filtering the target sentence comprises the following steps:
In this embodiment, the execution subject of the word example sentence generation method may input the target sentence into a text topic identification model trained in advance, so as to obtain a text topic corresponding to the target sentence. The text topic identification model can be used for representing the corresponding relation between the text and the text topic corresponding to the text.
In this embodiment, the executing entity may input the target sentence into a pre-trained text difficulty recognition model to obtain a text difficulty label corresponding to the target sentence. The text difficulty can be divided into a plurality of grades in advance, and the text difficulty is generally the reading difficulty of the text. The text difficulty recognition model can be used for representing the corresponding relation between the text and the text difficulty label corresponding to the text.
In this embodiment, the executing entity may filter out a sentence corresponding to at least one of the following sentences from the target sentence: the corresponding text topics are sentences of preset text topics (e.g., ethnic topics, religious topics, and political topics) and the corresponding text difficulty labels are sentences of preset text difficulty labels (e.g., labels representing text with greater difficulty).
The method provided by the above embodiment of the present disclosure identifies the text topic and the text difficulty of the sentence, and filters the target sentence by using these factors. In this way, the quality of the generated word example sentence can be further improved.
With further reference to fig. 4, as an implementation of the method shown in the above-mentioned figures, the present application provides an embodiment of a word example sentence generating apparatus, which corresponds to the embodiment of the method shown in fig. 1, and which may be specifically applied to various electronic devices.
As shown in fig. 4, the word example sentence generating apparatus 400 of the present embodiment includes: an acquisition unit 401, a retrieval unit 402, a determination unit 403, and a filtering unit 404. The obtaining unit 401 is configured to obtain a word and a paraphrase of the word, and determine a target paraphrase of the word based on the paraphrase of the word; the retrieving unit 402 is configured to retrieve a candidate sentence from a predetermined corpus by using the word, where the candidate sentence includes the word; the determining unit 403 is configured to determine a target sentence from the candidate sentences based on the words and the target paraphrases of the words; the filtering unit 404 is configured to filter the target sentence, and determine a sentence obtained by filtering as an example sentence of the word.
In this embodiment, the specific processing of the obtaining unit 401, the retrieving unit 402, the determining unit 403 and the filtering unit 404 of the word illustrative sentence generating apparatus 400 may refer to step 201, step 202, step 203 and step 204 in the corresponding embodiment of fig. 2.
In some alternative implementations, the filtering unit 404 may be further configured to filter the target sentence by: determining the text quality of the target sentence to obtain a text quality evaluation result of the target sentence; and filtering the target sentence by using the text quality evaluation result.
In some alternative implementations, the filtering unit 404 may be further configured to determine the text quality of the target sentence, and obtain a text quality evaluation result of the target sentence by at least one of: inputting the target sentence into a pre-trained text topic identification model to obtain a text topic corresponding to the target sentence; and inputting the target sentence into a pre-trained text difficulty recognition model to obtain a text difficulty label corresponding to the target sentence.
In some alternative implementations, the filtering unit 404 may be further configured to filter the target sentence by using the text quality evaluation result as follows: filtering sentences which meet at least one of the following conditions from the target sentences: the corresponding text topic is a sentence of a preset text topic and the corresponding text difficulty label is a sentence of a preset text difficulty label.
In some alternative implementations, the obtaining unit 401 may be further configured to determine the target paraphrase of the word based on the paraphrase of the word by: searching at least one paraphrase corresponding to the words in a preset paraphrase database; determining whether there is a paraphrase matching the paraphrase of the word from the at least one paraphrase; if so, determining the paraphrase matched with the paraphrase of the word as the target paraphrase of the word.
In some optional implementations, the above-mentioned word example sentence generating apparatus 400 may further include: an object definition determination unit (not shown in the figure). The target paraphrase determination unit may be configured to determine the paraphrase of the word as the target paraphrase of the word if no paraphrase matching the paraphrase of the word exists.
In some alternative implementations, the determining unit 403 may be further configured to determine the target sentence from the candidate sentences based on the word and the target paraphrase of the word by: inputting the words, the target paraphrases of the words and the candidate sentences into a pre-trained paraphrase matching model to obtain a matching result of the meanings of the words in the candidate sentences and the target paraphrases of the words; and determining a target sentence from the candidate sentences by using the matching result.
Fig. 5 illustrates an exemplary system architecture 500 to which an embodiment of the word example sentence generation method of the present disclosure may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 5011, 5012, 5013, a network 502, and a server 503. The network 502 is the medium used to provide communication links between the terminal devices 5011, 5012, 5013 and the server 503. Network 502 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 503 over the network 502 using the terminal devices 5011, 5012, 5013 to send or receive messages and the like, e.g., the terminal devices 5011, 5012, 5013 may obtain a pre-set corpus from the server 503. Various communication client applications, such as word query tools, instant messaging software, and the like, can be installed on the terminal devices 5011, 5012, and 5013.
The terminal devices 5011, 5012, and 5013 may first obtain the words and the definitions of the words, and determine the target definitions of the words based on the definitions of the words; then, the candidate sentences can be searched from a preset corpus by utilizing the words; then, a target sentence can be determined from the candidate sentences based on the words and the target paraphrases of the words; finally, the target sentence can be filtered, and the sentence obtained by filtering is determined as the example sentence of the word.
The terminal devices 5011, 5012, and 5013 may be hardware or software. When the terminal devices 5011, 5012, 5013 are hardware, they may be various electronic devices having a display screen and supporting information interaction, including but not limited to smart phones, tablet computers, laptop computers, and the like. When the terminal devices 5011, 5012, 5013 are software, they can be installed in the electronic devices listed above. It may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 503 may be a server that provides various services. For example, it may be a background server that generates illustrative sentences of words. The server 503 may first obtain the term and the paraphrase of the term, and determine the target paraphrase of the term based on the paraphrase of the term; then, the candidate sentences can be retrieved from a preset corpus by utilizing the words; then, a target sentence can be determined from the candidate sentences based on the words and the target paraphrases of the words; finally, the target sentence can be filtered, and the sentence obtained by filtering is determined as the example sentence of the word.
The server 503 may be hardware or software. When the server 503 is hardware, it may be implemented as a distributed server cluster composed of multiple servers, or may be implemented as a single server. When the server 503 is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be further noted that the word example sentence generation method provided in the embodiment of the present disclosure may be executed by the server 503, and at this time, the word example sentence generation apparatus may be disposed in the server 503; the term example sentence generating method may also be executed by the terminal devices 5011, 5012, 5013, in which case the term example sentence generating means may be provided in the terminal devices 5011, 5012, 5013.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to fig. 6, shown is a schematic diagram of an electronic device (e.g., a terminal device or a server of fig. 5) suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the electronic device may include a processing device (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage device 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may be alternatively implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of embodiments of the present disclosure.
It should be noted that the computer readable medium of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a word and the definition of the word, and determining the target definition of the word based on the definition of the word; searching a candidate sentence from a preset corpus by using the word, wherein the candidate sentence comprises the word; determining a target sentence from the candidate sentences based on the words and the target paraphrases of the words; and filtering the target sentence, and determining the sentence obtained by filtering as an example sentence of the word.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The name of a unit does not in some cases constitute a limitation on the unit itself, and for example, the retrieval unit may also be described as "a unit that retrieves candidate sentences from a preset corpus using words".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other combinations of features described above or equivalents thereof without departing from the spirit of the disclosure. For example, the above features and the technical features disclosed in the present disclosure (but not limited to) having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Claims (10)
1. A method for generating word example sentences is characterized by comprising the following steps:
acquiring a word and a paraphrase of the word, and determining a target paraphrase of the word based on the paraphrase of the word;
using the words, retrieving candidate sentences from a preset corpus, wherein the candidate sentences comprise the words;
determining a target sentence from the candidate sentences based on the words and the target paraphrases of the words;
and filtering the target sentence, and determining the sentence obtained by filtering as an example sentence of the word.
2. The method of claim 1, wherein the filtering the target sentence comprises:
determining the text quality of the target sentence to obtain a text quality evaluation result of the target sentence;
and filtering the target sentence by utilizing the text quality evaluation result.
3. The method of claim 2, wherein the determining the text quality of the target sentence, and obtaining the text quality evaluation result of the target sentence, comprises at least one of:
inputting the target sentence into a pre-trained text topic identification model to obtain a text topic corresponding to the target sentence;
and inputting the target sentence into a pre-trained text difficulty recognition model to obtain a text difficulty label corresponding to the target sentence.
4. The method of claim 3, wherein the filtering the target sentence using the text quality assessment result comprises:
filtering out sentences which meet at least one of the following conditions from the target sentences: the corresponding text topic is a sentence of a preset text topic and the corresponding text difficulty label is a sentence of a preset text difficulty label.
5. The method of claim 1, wherein determining the target paraphrase for the term based on the paraphrase for the term comprises:
searching at least one paraphrase corresponding to the word in a preset paraphrase database;
determining from the at least one paraphrase whether there is a paraphrase that matches the paraphrase of the word;
if so, determining a paraphrase that matches the paraphrase of the word as the target paraphrase for the word.
6. The method of claim 5, wherein after said determining from said at least one paraphrase whether there is a paraphrase that matches the paraphrase of the word, the method further comprises:
if not, determining the definition of the word as the target definition of the word.
7. The method of any of claims 1-6, wherein determining a target sentence from the candidate sentences based on the words and target paraphrases of the words comprises:
inputting the words, the target paraphrases of the words and the candidate sentences into a pre-trained paraphrase matching model to obtain matching results of the meanings of the words in the candidate sentences and the target paraphrases of the words;
and determining a target sentence from the candidate sentences by using the matching result.
8. A word example sentence generating device is characterized by comprising:
the acquisition unit is used for acquiring words and paraphrases of the words and determining target paraphrases of the words based on the paraphrases of the words;
the retrieval unit is used for retrieving a candidate sentence from a preset corpus by using the word, wherein the candidate sentence comprises the word;
a determining unit configured to determine a target sentence from the candidate sentences based on the words and the target paraphrases of the words;
and the filtering unit is used for filtering the target sentence and determining the sentence obtained by filtering as the example sentence of the word.
9. An electronic device, comprising:
at least one processor;
a storage device having at least one program stored thereon,
when executed by the at least one processor, cause the at least one processor to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210913508.5A CN115204124A (en) | 2022-07-29 | 2022-07-29 | Word example sentence generation method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210913508.5A CN115204124A (en) | 2022-07-29 | 2022-07-29 | Word example sentence generation method and device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115204124A true CN115204124A (en) | 2022-10-18 |
Family
ID=83586488
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210913508.5A Pending CN115204124A (en) | 2022-07-29 | 2022-07-29 | Word example sentence generation method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115204124A (en) |
-
2022
- 2022-07-29 CN CN202210913508.5A patent/CN115204124A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110971969B (en) | Video dubbing method and device, electronic equipment and computer readable storage medium | |
CN110969012B (en) | Text error correction method and device, storage medium and electronic equipment | |
CN111767740B (en) | Sound effect adding method and device, storage medium and electronic equipment | |
CN111767371A (en) | Intelligent question and answer method, device, equipment and medium | |
CN110516159B (en) | Information recommendation method and device, electronic equipment and storage medium | |
CN110059172B (en) | Method and device for recommending answers based on natural language understanding | |
CN112819512B (en) | Text processing method, device, equipment and medium | |
CN111883117A (en) | Voice wake-up method and device | |
CN111667810B (en) | Method and device for acquiring polyphone corpus, readable medium and electronic equipment | |
CN113011169B (en) | Method, device, equipment and medium for processing conference summary | |
CN111178056A (en) | Deep learning based file generation method and device and electronic equipment | |
CN112906381B (en) | Dialog attribution identification method and device, readable medium and electronic equipment | |
CN113488050B (en) | Voice wakeup method and device, storage medium and electronic equipment | |
CN112906380A (en) | Method and device for identifying role in text, readable medium and electronic equipment | |
CN112182255A (en) | Method and apparatus for storing media files and for retrieving media files | |
CN111460288B (en) | Method and device for detecting news event | |
CN111078849A (en) | Method and apparatus for outputting information | |
CN114357325A (en) | Content search method, device, equipment and medium | |
CN114298007A (en) | Text similarity determination method, device, equipment and medium | |
CN113138677A (en) | Method and device for determining candidate words of input method, electronic equipment and storage medium | |
CN112069786A (en) | Text information processing method and device, electronic equipment and medium | |
CN111444813A (en) | Method, device, equipment and storage medium for identifying attribute classification of target object | |
CN111382365A (en) | Method and apparatus for outputting information | |
CN110750994A (en) | Entity relationship extraction method and device, electronic equipment and storage medium | |
CN112257459B (en) | Language translation model training method, translation method, device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |