Disclosure of Invention
The embodiment of the invention solves the technical problems of low text retrieval recommendation efficiency and accuracy in the prior art by providing a text word recommendation method, a text word recommendation device, an electronic device and a readable storage medium.
In a first aspect, an embodiment of the present invention provides a text sentence recommendation method, including:
Obtaining keywords or key sentences, wherein the keywords or key sentences are keywords or key sentences selected in a text or are keywords or key sentences obtained in an input frame;
Recommendation prediction is carried out on the keywords or the key sentences to obtain M recommendation words and sentences, wherein M is a positive integer;
screening N candidate words and sentences meeting preset screening conditions from M recommended words and sentences, wherein N is a positive integer less than or equal to M;
and displaying N candidate words and sentences.
Optionally, the method further comprises:
Determining a target word and sentence, wherein the target word and sentence is one of N candidate words and sentences or is generated according to the N candidate words and sentences;
and displaying the target words and sentences according to a preset display rule.
Optionally, each candidate word and sentence is correspondingly configured with a copy control, and the determining the target word and sentence includes:
responding to a copy operation of a copy control corresponding to a target word and sentence, and obtaining the target word and sentence copied by the copy operation, wherein the target word and sentence is one of N candidate words and sentences;
The displaying the target words and sentences according to the preset display rules comprises:
and responding to the pasting operation, pasting the target words and sentences, and displaying the target words and sentences according to a preset display rule.
Optionally, displaying the target expression according to a preset display rule includes any one of the following:
displaying the target words and sentences at display positions adjacent to the keywords or the keywords;
Displaying the target words and sentences at a preset cursor position;
if the keywords or the key sentences are keywords or key sentences selected in the text, replacing the keywords or the key sentences by using the target words and sentences;
And displaying the target words and sentences in a preset annotation frame of the keywords or the key sentences in a text annotation form.
Optionally, the determining the target phrase includes:
selecting A selected words and sentences from N candidate words and sentences, wherein A is a positive integer less than or equal to N;
and carrying out fusion processing on the A selected words and sentences to obtain the target words and sentences.
Optionally, the fusing the a selected phrases to obtain the target phrase includes:
And carrying out fusion processing on the A selected words and sentences by adopting a preset text fusion algorithm to obtain the target words and sentences.
Optionally, each of the selected words and phrases includes at least one word segment, and the fusing the a selected words and phrases to obtain the target word and phrase includes:
performing similarity calculation on at least one word included in each of the A selected words and sentences to obtain similarity between any two words;
If the similarity between any two segmented words does not exceed the preset similarity, reserving the any two segmented words;
If the similarity between any two segmented words exceeds the preset similarity, reserving any one segmented word of the any two segmented words;
And combining all the reserved segmentation words into the target words and sentences according to syntactic semantics.
Optionally, the preset screening condition includes any one of the following:
The association degree between the candidate words and sentences and the keywords or the key sentences exceeds a first threshold value;
the matching degree between the word and sentence styles of the candidate words and sentences and the text styles of the texts exceeds a second threshold value;
the matching degree between the word and sentence theme of the candidate word and sentence and the text theme of the text exceeds a third threshold value;
The number of words and phrases of the candidate words and phrases is smaller than or equal to a fourth threshold value;
and the word and sentence length of the candidate words and sentences is smaller than or equal to a fifth threshold value.
Optionally, the displaying the N candidate phrases includes:
sorting the N candidate words and sentences according to the screening indexes corresponding to the preset screening conditions to obtain sorting results;
displaying N candidate words and sentences according to the sorting result;
The screening index comprises any one of the following items, namely the association degree between the candidate words and sentences and the keywords or the keywords, the matching degree between the word and sentence styles of the candidate words and sentences and the text styles of the texts, the matching degree between the word and sentence subjects of the candidate words and sentences and the text subjects of the texts, the word and sentence numbers of the candidate words and sentences and the word and sentence lengths of the candidate words and sentences.
Optionally, displaying the N candidate phrases according to the ranking result includes:
When N is smaller than or equal to the preset display number, N candidate words and sentences are unfolded and displayed according to the sorting result, or
When N is larger than the preset display number, expanding and displaying target candidate words and sentences in the sorting result, and folding and displaying other candidate words and sentences except the target candidate words and sentences in the sorting result;
the target candidate words and sentences are the first B candidate words and sentences in the sorting result, and B is determined according to the preset display number.
In a second aspect, an embodiment of the present invention provides a text sentence recommendation device, including:
The acquisition module is used for acquiring keywords or key sentences, wherein the keywords or key sentences are selected keywords or key sentences in the text or are acquired keywords or key sentences in the input frame;
The recommendation module is used for carrying out recommendation prediction on the keywords or the key sentences to obtain M recommendation words and sentences, wherein M is a positive integer;
the screening module is used for screening N candidate words and sentences meeting preset screening conditions from M recommended words and sentences, wherein N is a positive integer smaller than or equal to M;
and the display module is used for displaying the N candidate words and sentences.
The descriptions or not described in the embodiments of the present application may be referred to the relevant descriptions in the foregoing method embodiments, which are not repeated herein.
In a third aspect, an embodiment of the present invention provides an electronic device, including a memory, and one or more programs, where the one or more programs are stored in the memory, and configured to be executed by one or more processors, where the one or more programs include operation instructions for performing an operation instruction corresponding to the text word recommendation method provided in the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements steps corresponding to the text word recommendation method provided in the first aspect.
The one or more technical schemes provided by the embodiment of the invention at least realize the following technical effects or advantages:
According to the scheme provided by the embodiment of the invention, the keywords or the key sentences are obtained, the recommended prediction is carried out on the keywords or the key sentences to obtain M recommended words and sentences, N candidate words and sentences meeting the preset screening conditions are screened out from the M recommended words and sentences, and the N candidate words and sentences are displayed. In the scheme, after word and sentence recommendation is carried out on the keywords or the key sentences, the obtained M recommended words and sentences are screened according to preset screening conditions, and finally N candidate words and sentences meeting the screening conditions are recommended and displayed for the user. Therefore, the accuracy of text word and sentence recommendation can be improved, convenience and intelligence of text word and sentence recommendation are realized, the efficiency of text word and sentence recommendation is improved, and the technical problem of low efficiency and accuracy of text retrieval recommendation in the prior art is solved.
Detailed Description
The invention provides a text word and sentence recommending method, a device, electronic equipment and a readable storage medium, which are used for solving the technical problems of low text retrieval recommending efficiency and accuracy in the prior art, and the general thinking is as follows:
Obtaining keywords or key sentences, wherein the keywords or the key sentences are keywords or key sentences selected in a text or are obtained in an input frame, recommending and predicting the keywords or the key sentences to obtain M recommended words and sentences, wherein M is a positive integer, screening N candidate words and sentences meeting preset screening conditions from the M recommended words and sentences, wherein N is a positive integer smaller than or equal to M, and displaying the N candidate words and sentences.
Through the technical scheme, after word and sentence recommendation is carried out on the keywords or the key sentences, the obtained M recommended words and sentences are screened according to the preset screening conditions, and finally N candidate words and sentences meeting the screening conditions are recommended and displayed for the user. Therefore, the accuracy of text word and sentence recommendation can be improved, convenience and intelligence of text word and sentence recommendation are realized, the efficiency of text word and sentence recommendation is improved, and the technical problem of low efficiency and accuracy of text retrieval recommendation in the prior art is solved.
Fig. 1 is a schematic flow chart of a text word and sentence recommendation method according to an embodiment of the present invention. The method as shown in fig. 1 comprises the following implementation steps:
s101, acquiring keywords or key sentences, wherein the keywords or key sentences are selected from the text or are acquired from an input frame.
The keywords or the keywords sentences are keywords or keywords selected by the user in a self-definition mode in the text, or can be keywords or keywords input by the user in a self-definition mode in an input box, or can be keywords or keywords input by the user in a self-definition mode in the input box, and can be sent by other terminal equipment, and the acquisition mode is not limited. The number of the keywords or the key sentences is not limited, and may be one or more. Typically, to ensure accuracy of system word and sentence recommendation, the number of the keywords or the key sentences is plural. The text may include custom text in any format, such as txt text, doc text, etc., and text obtained by recognition using text recognition techniques. Including but not limited to optical character recognition (optical character recognition, OCR), geometric feature extraction techniques, or other techniques for text or word recognition, etc.
For example, please refer to fig. 2 and fig. 3, which respectively show interface diagrams of two kinds of keyword or keyword sentence acquisition. In the interface shown in fig. 2, when the user selects "select keywords in text to generate recommendation" option, the interface cursor may be dragged in a customized manner to select the input keywords or keywords in text, for example, the keywords selected in text are "on top of the pond with curved and zigzag folds" in the drawing, and the cover the horizon is the leaf of Tian Tian.
In the interface shown in fig. 3, when the user selects the option of "generating a recommendation by inputting keywords by user definition", the corresponding keywords or keywords may be input by user definition in the input box of the interface according to the personal needs or personal preferences of the user, for example, in the illustration, the keywords input by the user in the input box are "autumn of beijing" and so on. Further alternatively, the user may click on a button in the interface, for example "click on generate recommendation", to trigger the system to provide a corresponding recommended phrase function or service, proceeding to step S102.
S102, recommending and predicting the keywords or the key sentences to obtain M recommended words and sentences, wherein M is a positive integer.
In one embodiment, the invention can call a pre-trained language model to conduct recommendation prediction on the keywords or the keywords, and output M recommended words and sentences. The language model includes, but is not limited to, a feedforward neural network model, a convolutional neural network model, a depth residual network model, a recurrent neural network model, a long and short term memory model, or other machine learning model, etc.
In another embodiment, the invention can query M recommended words and sentences matched with the keywords or the keywords from a preset word and sentence database according to the keywords or the keywords and sentences. The word and sentence database stores a plurality of text words and sentences, and the recommended words and sentences are one of the text words and sentences.
The text word and sentence, the recommended word and sentence, and the candidate word and the target word may be divided into words or sentences, and the invention is not limited thereto.
S103, screening N candidate words and sentences meeting preset screening conditions from M recommended words and sentences, wherein N is a positive integer smaller than or equal to M.
The preset screening conditions are conditions which are set by a user and used for screening candidate word segmentation, and the method is not limited. In some embodiments, the preset screening conditions include, but are not limited to, any one of a degree of association between the candidate sentence and the keyword or the keyword exceeding a first threshold, a degree of matching between a sentence style of the candidate sentence and a text style of the text exceeding a second threshold, a degree of matching between a sentence topic of the candidate sentence and a text topic of the text exceeding a third threshold, a number of words of the candidate sentence being less than or equal to a fourth threshold, a word length of the candidate sentence being less than or equal to a fifth threshold, or other screening conditions, etc.
The first threshold, the second threshold, the third threshold, the fourth threshold and the fifth threshold are set by a system or a user in a user-defined manner, for example, the first threshold, the second threshold, the third threshold, the fourth threshold and the fifth threshold may be specifically set by the system according to actual requirements, or an experience value set according to user experience, etc.
The association degree refers to the association degree between the candidate words and sentences and the keywords or the key sentences, and can be understood as the similarity degree or the matching degree between the candidate words and sentences to a certain degree. The matching degree refers to a degree of coincidence between the two, for example, the matching degree between the sentence style of the candidate sentence and the text style of the text may specifically refer to a degree of coincidence between the two styles. The expression style refers to a feature or style of describing or summarizing the expression, and the text style refers to a feature or style of describing or summarizing the text, which may include, but is not limited to, palace, melancholy, martial arts, spoken, written, dialect, naughty, or other custom language styles, etc. The term topic refers to the meaning or central idea of the term used to describe or summarize the candidate term. The text topic refers to a text meaning or a central idea for describing or summarizing text.
S104, displaying N candidate words and sentences.
The invention can display N candidate words and sentences in the preset display area of the target page. Several possible embodiments of step S104 are described below.
In one embodiment, the present invention may sort the N candidate sentences according to a screening index corresponding to the preset screening condition to obtain a sorting result, and specifically, for example, sort the N candidate sentences sequentially according to a sequence of the screening index from a higher order to a lower order. And displaying N candidate sentences according to the sorting result, for example, displaying the N candidate sentences from large to small to a preset display area of a target page according to the sorting result.
The screening indexes are in one-to-one correspondence with the preset screening conditions, and can comprise any one of, but not limited to, the association degree between the candidate words and sentences and the keywords or the keywords, the matching degree between the word and sentence styles of the candidate words and sentences and the text styles of the texts, the matching degree between the word and sentence topics of the candidate words and sentences and the text topics of the texts, the word and sentence numbers of the candidate words and sentences, the word and sentence lengths of the candidate words and sentences, and the like. For example, the preset filtering condition adopted by the candidate words and sentences is the association degree between the candidate words and sentences and the keywords or the keywords, and in step S104, N candidate words and sentences may be ranked according to the association degree between each candidate word and sentence and the keywords or the keywords.
In another embodiment, the specific implementation manner of displaying the N candidate phrases according to the ranking result may be that when N is smaller, for example, smaller than or equal to the preset number of displays supported by the display area, the invention may directly expand and display the N candidate phrases in the display area. On the contrary, when N is larger, for example, larger than the preset number of display supported by the display area, the invention can expand and display the target candidate words and sentences in the sorting result, and fold and display the rest candidate words and sentences except the target candidate words and sentences in the sorting result. The target candidate words and sentences are the first B candidate words and sentences in the sorting result, B is determined according to the preset display number, specifically the preset display number, and B is a positive integer smaller than N.
Some alternative embodiments to which the invention relates are described below.
In some optional embodiments, the present invention may determine a target word and sentence according to the N candidate words and sentences, where the target word and sentence may be any one of the N candidate words and sentences, or may be generated according to the N candidate words and sentences. Several possible embodiments of its existence are presented below.
In one embodiment, the invention is provided with a copy control for each displayed candidate word and sentence in the display area of the target page, and a user can randomly select one copy control to copy the corresponding candidate word and sentence according to own needs or personal preference. Specifically, the invention can respond to the copy operation of the copy control corresponding to the target word and sentence by the user, and the target word and sentence copied by the copy operation can be obtained, wherein the target word and sentence is any one of N candidate words and sentences. The copying operation is used for triggering and operating the copying control to select a target word and sentence corresponding to the copying control. The copy operation may include, but is not limited to, a click (e.g., single click, double click, or triple click, etc.) operation, a long press operation, a drag operation, etc. for the copy control.
For example, please refer to fig. 4, which is a schematic diagram illustrating an interface of one possible target word and sentence selection according to the present invention. In the interface shown in fig. 4, a corresponding copy control (illustrated as a copy) is configured for each candidate phrase. If 5 candidate words and sentences are displayed in the display area of the graphical interface, the user clicks and selects the copy control corresponding to the first candidate word and sentence. In response to clicking operation for the copy control, the method and the device can obtain the first candidate word and sentence corresponding to the copy control to serve as the target word and sentence selected by the user in a self-defining mode.
Alternatively, the user may perform a paste operation for the target phrase at any position on the target page. After detecting the pasting operation of the user, the method can respond to the pasting operation to paste the target words and sentences so as to paste and display the target words and sentences according to a preset display rule, and the specific implementation of the method is described in detail below.
In another embodiment, the present invention may select a selected phrases from the N candidate phrases, a being a positive integer less than or equal to N. Specifically, the selected words and sentences may be selected by the user according to the own needs or personal preference from N candidate words and sentences, or may be selected by the system according to the actual needs from N candidate words and sentences, for example, words and sentences conforming to a certain text style or text theme, etc., which is not limited by the present invention. Further, the invention can perform fusion processing on A selected words and sentences to obtain the final target words and sentences. Several possible embodiments of the fusion process are described below.
In a specific embodiment, the present invention may use a preset text fusion algorithm to perform fusion processing on a selected words and phrases, so as to obtain the target words and phrases. The text fusion algorithm is an algorithm for generating text words and sentences, which is set by a system in a self-defining way, and can include, but is not limited to, a multitasking learning algorithm, a text word and sentence generation algorithm based on a knowledge graph (knowledgegraph), a text word and sentence generation algorithm based on a memory network (memory network), an algorithm for generating text words and sentences by combining distributed-sampling, or other algorithms for generating text words and sentences, and the like.
In another embodiment, each of the selected phrases includes at least one word segment. The invention can calculate the similarity of at least one word included in each of the A selected words and sentences to obtain the similarity between any two words. And then, according to the similarity between any two segmented words, carrying out fusion processing on A selected words and sentences to obtain the final target word and sentence, wherein if the similarity between any two segmented words does not exceed the preset similarity, the method indicates that the difference between any two segmented words is larger, and the any two segmented words are reserved. Otherwise, if the similarity between any two segmented words exceeds the preset similarity, the similarity and the difference between the any two segmented words are not obvious, and at the moment, one segmented word can be optionally reserved from any two segmented words, and the other segmented word is removed. Furthermore, the invention can combine all the reserved segmented words into the target words and sentences according to the original positions of the reserved segmented words and by combining the elements such as syntax, semantics and the like.
The preset similarity is a similarity set by a user or a system in a user-defined manner, for example, the preset similarity may be an empirical value set according to user experience, and for example, the preset similarity may be a similarity value set according to actual requirements of the system, which is not limited in the present invention.
In some alternative embodiments, after obtaining the target word and sentence, the present invention may display the target word and sentence according to a preset display rule. There are several possible embodiments as follows.
In some embodiments, the present invention may display the target sentence in a display position adjacent to the keyword or the keyword, where the display position is adjacent to a position where the keyword or the keyword is located, for example, in a position immediately behind, next to, or last to the keyword or the keyword, etc., and the present invention is not limited thereto.
In other embodiments, the present invention may display the target phrase at a preset cursor position, and in particular may display the target phrase to a cursor position where a current cursor is located in a target page, etc.
In other embodiments, if the keyword or the keyword sentence is a keyword or a keyword sentence selected in text, the present invention may directly use the target word sentence to replace the keyword or the keyword sentence. In other words, in the context of text division of keywords or keywords, the present invention may directly replace the originally divided keywords or keywords with the target word or sentence.
In other embodiments, the present invention may display the target sentence in the form of a text annotation in the keyword or a pre-built annotation box for the keyword. Specifically, the invention can create a corresponding pre-built annotation frame for the keyword or the keyword sentence in advance, the position of the pre-built annotation frame is not limited, and the pre-built annotation frame is preferably built at the position of the keyword or the keyword sentence. And then the invention can display the target words and sentences into the pre-built annotation frame for the user to review.
By implementing the embodiment of the invention, the keyword or the keyword sentence is obtained, the keyword or the keyword sentence is recommended and predicted to obtain M recommended words and sentences, N candidate words and sentences meeting the preset screening condition are screened out from the M recommended words and sentences, and the N candidate words and sentences are displayed. In the scheme, after word and sentence recommendation is carried out on the keywords or the key sentences, the obtained M recommended words and sentences are screened according to preset screening conditions, and finally N candidate words and sentences meeting the screening conditions are recommended and displayed for the user. Therefore, the accuracy of text word and sentence recommendation can be improved, convenience and intelligence of text word and sentence recommendation are realized, the efficiency of text word and sentence recommendation is improved, and the technical problem of low efficiency and accuracy of text retrieval recommendation in the prior art is solved.
Based on the same inventive concept, the embodiment of the invention also provides a text word and sentence recommending device, electronic equipment and a server. Fig. 5 is a schematic structural diagram of a text word and sentence recommendation device according to an embodiment of the present invention. The apparatus 50 shown in fig. 5 includes an obtaining module 501, a recommending module 502, a screening module 503, and a displaying module 504, where:
The obtaining module 501 is configured to obtain keywords or key sentences, where the keywords or key sentences are keywords or key sentences selected by dividing in a text, or are keywords or key sentences obtained in an input box;
the recommendation module 502 is configured to perform recommendation prediction on the keywords or the key sentences to obtain M recommended words and sentences, where M is a positive integer;
the screening module 503 is configured to screen N candidate sentences that satisfy a preset screening condition from M recommended sentences, where N is a positive integer less than or equal to M;
the display module 504 is configured to display N candidate phrases.
Optionally, the apparatus 50 may further comprise a determining module 505, wherein:
the determining module 505 is configured to determine a target sentence, where the target sentence is one of N candidate sentences, or is generated according to the N candidate sentences;
the display module 504 is further configured to display the target sentence according to a preset display rule.
Optionally, each candidate phrase is correspondingly configured with a copy control, and the determining module 505 is specifically configured to:
responding to a copy operation of a copy control corresponding to a target word and sentence, and obtaining the target word and sentence copied by the copy operation, wherein the target word and sentence is one of N candidate words and sentences;
the display module 504 is specifically configured to:
and responding to the pasting operation, pasting the target words and sentences, and displaying the target words and sentences according to a preset display rule.
Optionally, the display module 504 is specifically used for any one of the following:
displaying the target words and sentences at display positions adjacent to the keywords or the keywords;
Displaying the target words and sentences at a preset cursor position;
if the keywords or the key sentences are keywords or key sentences selected in the text, replacing the keywords or the key sentences by using the target words and sentences;
And displaying the target words and sentences in a preset annotation frame of the keywords or the key sentences in a text annotation form.
Optionally, the determining module 505 is further specifically configured to:
selecting A selected words and sentences from N candidate words and sentences, wherein A is a positive integer less than or equal to N;
and carrying out fusion processing on the A selected words and sentences to obtain the target words and sentences.
Optionally, the determining module 505 is specifically configured to:
And carrying out fusion processing on the A selected words and sentences by adopting a preset text fusion algorithm to obtain the target words and sentences.
Optionally, each of the selected phrases includes at least one word, and the determining module 505 is specifically configured to:
performing similarity calculation on at least one word included in each of the A selected words and sentences to obtain similarity between any two words;
If the similarity between any two segmented words does not exceed the preset similarity, reserving the any two segmented words;
If the similarity between any two segmented words exceeds the preset similarity, reserving any one segmented word of the any two segmented words;
And combining all the reserved segmentation words into the target words and sentences according to syntactic semantics.
Optionally, the preset screening condition includes any one of the following:
The association degree between the candidate words and sentences and the keywords or the key sentences exceeds a first threshold value;
the matching degree between the word and sentence styles of the candidate words and sentences and the text styles of the texts exceeds a second threshold value;
the matching degree between the word and sentence theme of the candidate word and sentence and the text theme of the text exceeds a third threshold value;
The number of words and phrases of the candidate words and phrases is smaller than or equal to a fourth threshold value;
and the word and sentence length of the candidate words and sentences is smaller than or equal to a fifth threshold value.
Optionally, the display module 504 is specifically configured to:
sorting the N candidate words and sentences according to the screening indexes corresponding to the preset screening conditions to obtain sorting results;
displaying N candidate words and sentences according to the sorting result;
The screening index comprises any one of the following items, namely the association degree between the candidate words and sentences and the keywords or the keywords, the matching degree between the word and sentence styles of the candidate words and sentences and the text styles of the texts, the matching degree between the word and sentence subjects of the candidate words and sentences and the text subjects of the texts, the word and sentence numbers of the candidate words and sentences and the word and sentence lengths of the candidate words and sentences.
Optionally, the display module 504 is specifically configured to:
When N is smaller than or equal to the preset display number, N candidate words and sentences are unfolded and displayed according to the sorting result, or
When N is larger than the preset display number, expanding and displaying target candidate words and sentences in the sorting result, and folding and displaying other candidate words and sentences except the target candidate words and sentences in the sorting result;
the target candidate words and sentences are the first B candidate words and sentences in the sorting result, and B is determined according to the preset display number.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Based on the same inventive concept, an embodiment of the present invention provides an electronic device 800, and fig. 6 is a block diagram of the electronic device 800 according to an exemplary embodiment. For example, device 800 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to FIG. 6, device 800 may include one or more of a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. Processing element 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interactions between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and the like. The memory 804 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power component 806 provides power to the various components of the device 800. Power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for device 800.
The multimedia component 808 includes a screen between the device 800 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or sliding action, but also the duration and pressure associated with the touch or sliding operation. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 further includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to, a home button, a volume button, an activate button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of the device 800. For example, the sensor assembly 814 may detect an on/off state of the device 800, a relative positioning of the assemblies, such as a display and keypad of the device 800, the sensor assembly 814 may also detect a change in position of the device 800 or one of the assemblies of the device 800, the presence or absence of user contact with the device 800, an orientation or acceleration/deceleration of the device 800, and a change in temperature of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communication between the device 800 and other devices, either wired or wireless. The device 800 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In one exemplary embodiment, the communication part 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 804 including instructions executable by processor 820 of device 800 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Fig. 7 is a schematic diagram of a server in some embodiments of the invention. The server 1900 may vary considerably in configuration or performance and may include one or more central processing units (central processing units, CPUs) 1922 (e.g., one or more processors) and memory 1932, one or more storage mediums 1930 (e.g., one or more mass storage devices) that store applications 1942 or data 1944. Wherein the memory 1932 and storage medium 1930 may be transitory or persistent. The program stored in the storage medium 1930 may include one or more modules (not shown), each of which may include a series of instruction operations on a server. Still further, a central processor 1922 may be provided in communication with a storage medium 1930 to execute a series of instruction operations in the storage medium 1930 on the server 1900.
The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input/output interfaces 1958, one or more keyboards 1956, and/or one or more operating systems 1941, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, and the like.
A non-transitory computer readable storage medium, which when executed by a processor of an apparatus (server or terminal) enables the apparatus to perform the text word recommendation method of the foregoing embodiments, for example, the method includes:
Obtaining keywords or key sentences, wherein the keywords or key sentences are keywords or key sentences selected in a text or are keywords or key sentences obtained in an input frame;
recommendation prediction is carried out on the keywords or the key sentences to obtain M recommendation words and sentences, wherein M is a positive integer;
screening N candidate words and sentences meeting preset screening conditions from M recommended words and sentences, wherein N is a positive integer less than or equal to M;
and displaying N candidate words and sentences.
The technical scheme provided by the embodiment of the invention at least has the following technical effects or advantages that the method acquires the keywords or the key sentences, performs recommendation prediction on the keywords or the key sentences to obtain M recommended words and sentences, screens N candidate words and sentences meeting the preset screening conditions from the M recommended words and sentences, and displays the N candidate words and sentences. In the scheme, after word and sentence recommendation is carried out on the keywords or the key sentences, the obtained M recommended words and sentences are screened according to preset screening conditions, and finally N candidate words and sentences meeting the screening conditions are recommended and displayed for the user. Therefore, the accuracy of text word and sentence recommendation can be improved, convenience and intelligence of text word and sentence recommendation are realized, the efficiency of text word and sentence recommendation is improved, and the technical problem of low efficiency and accuracy of text retrieval recommendation in the prior art is solved.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It is to be understood that the invention is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present invention is to be limited only by the following claims, which are included herein as examples and should not be construed as limiting the invention, but rather as various modifications, substitutions, improvements, etc. within the spirit and principle of the present invention are intended to be included within the scope of the present invention.