Text processing method and device, storage medium and electronic equipment
By monitoring the text and operations entered by users, the text processing model is used to optimize the text to be processed, and alternative text is provided to improve text quality, solving the problem of errors in text input, and improving the readability and user experience of the text.
Patent Information
- Application Number
- CN202411237423.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2025-01-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
During the text input process, users are prone to inappropriate word use, typos and grammatical errors, which affects the accurate communication of information and the reading experience.
By monitoring the text content and operations entered by the user, after determining the trigger conditions, the to be processed using a preset text processing model, providing replaceable text and displaying it according to user selection and historical priorities to optimize the text content.
It effectively avoids text errors, improves the readability and quality of text, and enhances the user's writing experience, especially in scenarios where fast and accurate text is required.
Smart Images

Figure CN119294365A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a text processing method, device, storage medium and electronic device. Background Art
[0002] With the application and development of computers, text input has become an important part of daily life and work. Whether it is writing documents, sending emails, writing articles or chatting online, text input is indispensable.
[0003] However, people often make inappropriate use of words, typos, and grammatical errors when inputting text, which not only affects the accurate transmission of information, but also may reduce the reading experience and even affect the smooth completion of the user's work.
[0004] Therefore, how to improve the quality of text input by users is an urgent problem to be solved. Summary of the invention
[0005] This specification provides a text processing method, device, storage medium and electronic device to partially solve the above-mentioned problems existing in the prior art.
[0006] This manual adopts the following technical solutions:
[0007] This manual provides a text processing method, including:
[0008] Get the original text entered by the user;
[0009] When it is determined that the original text meets the triggering condition for executing text processing, a text to be processed is determined based on the original text, and a processing process for executing a processing operation on the text to be processed is determined;
[0010] Executing the processing process to input the text to be processed into a preset text processing model;
[0011] The text to be processed is processed by using the text processing model.
[0012] Optionally, the step of determining whether the original text meets a trigger condition for executing text processing specifically includes:
[0013] If it is detected that the last text character input by the user is a designated character, it is determined that the trigger condition is met.
[0014] Optionally, the step of determining whether the original text meets a trigger condition for executing text processing specifically includes:
[0015] If it is monitored that the number of characters in the text input by the user after the last execution of text processing exceeds a preset number, it is determined that the trigger condition is met.
[0016] Optionally, the step of determining whether the original text meets a trigger condition for executing text processing specifically includes:
[0017] If it is monitored that the user performs a selection operation on the input text when inputting text, it is determined that the trigger condition is met;
[0018] The step of determining the text to be processed according to the original text specifically includes:
[0019] The text selected by the user in the original text when performing the selection operation is determined as the text to be processed.
[0020] Optionally, the step of determining whether the original text meets a trigger condition for executing text processing specifically includes:
[0021] If it is monitored that the user performs a screenshot operation on the input text while inputting text, it is determined that the trigger condition is met;
[0022] The step of determining the text to be processed according to the original text specifically includes:
[0023] Text recognition is performed on the image captured when the user performs the screenshot operation, and the recognized text is used as the text to be processed.
[0024] Optionally, the step of processing the text to be processed by the text processing model specifically includes:
[0025] Determining, by means of the text processing model, several replaceable texts for the text to be processed, and presenting them to the user;
[0026] In response to the selection operation performed by the user on each text processing information, the replaceable text selected by the user is determined as the processed text corresponding to the text to be processed.
[0027] Optionally, the step of determining, by means of the text processing model, several types of replaceable texts for the text to be processed and presenting them to the user specifically includes:
[0028] By using the text processing model, several types of text processing information for the text to be processed are determined, and a processing type corresponding to each type of text processing information is determined. For each replaceable text, the processing type corresponding to the replaceable text is used to indicate a processing method used to obtain the replaceable text after processing the text to be processed;
[0029] Determining the priority of the processing type corresponding to each replaceable text according to the historical replaceable texts selected by the user for the historical text to be processed;
[0030] According to the priority, at least part of the replaceable text is displayed in a specified display manner.
[0031] This specification provides a text processing device, including:
[0032] The acquisition module is used to obtain the original text input by the user;
[0033] A trigger module, for determining a text to be processed based on the original text and determining a processing process for performing a processing operation on the text to be processed when it is determined that the original text meets a trigger condition for performing text processing;
[0034] An execution module, used for executing the processing process to input the text to be processed into a preset text processing model;
[0035] The processing module is used to process the text to be processed through the text processing model.
[0036] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned text processing method is implemented.
[0037] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned text processing method when executing the program.
[0038] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0039] In the text processing method provided in this specification, the original text input by the user is obtained; when it is determined that the original text meets the triggering condition for executing text processing, the text to be processed is determined according to the original text, and the processing process for performing processing operations on the text to be processed is determined; the processing process is executed to input the text to be processed into a preset text processing model; and the text to be processed is processed by the text processing model. This solution realizes automatic optimization of text content during the process of user inputting text, effectively improving the readability and text quality of the text.
[0040] It can be seen from the above method that when this scheme determines that the original text input by the user meets the trigger conditions for executing text processing, the obtained original text will be processed through the text processing model, which effectively avoids the occurrence of text errors and realizes automatic optimization of text content during the process of user inputting text, effectively improving the readability and quality of the text. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0042] Figure 1 A flowchart of a text processing method provided in this specification;
[0043] Figure 2 A schematic diagram of a text processing process provided in this manual;
[0044] Figure 3 A schematic diagram of a text processing device provided in this specification;
[0045] Figure 4 A method corresponding to the Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0047] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0048] Figure 1 A flowchart of a text processing method provided in this specification includes the following steps:
[0049] S101: Acquire the original text input by the user.
[0050] In the digital age, text input is one of the core links of human-computer interaction, and its efficiency and convenience directly affect the user experience and information processing efficiency. With the continuous advancement of technology, text input technology has evolved from traditional physical keyboards to virtual keyboards, and then to more intelligent and personalized input methods.
[0051] However, in the process of writing texts, users often make mistakes in the text they input due to their own negligence or limitations in their writing skills, which seriously affects the quality of the texts written by users and the readability of the texts.
[0052] Based on this, this specification provides a text processing method, which automatically obtains the text to be optimized and optimizes it through a neural network model when it is detected that the trigger conditions for executing text processing are met.
[0053] In this specification, the execution entity used to implement a text processing method can be a terminal device such as a laptop computer, a desktop computer, a mobile phone, and a tablet computer. Of course, it can also be a client installed on the above-mentioned terminal device. For the sake of ease of description, the following will only take the terminal device as the execution entity as an example to illustrate a text processing method provided in this specification.
[0054] The user may start a process for executing text processing in the background of the terminal device in advance, and the process may be implemented by a software program, script or tool for performing text processing installed on the terminal device.
[0055] When the user inputs text, the terminal device can obtain the text input by the user as original text.
[0056] S102: When it is determined that the original text meets the triggering condition for executing text processing, a text to be processed is determined according to the original text, and a processing process for executing a processing operation on the text to be processed is determined.
[0057] The terminal device can monitor the original text input by the user and the operations performed by the user when entering the original text. When it is determined that the original text meets the pre-set trigger conditions for executing text processing based on the content input by the user and / or the operations performed by the user, the terminal device can determine the text to be processed based on the original text.
[0058] In this specification, there are multiple ways to determine the trigger conditions for executing text processing. Under different trigger conditions, the way to obtain the text to be processed is also different. Among them:
[0059] The terminal device can monitor the text characters input by the user. If it is monitored that the last text character input by the user is a designated character, it is determined that the trigger condition is met, and the original text between the designated character and the last designated character is used as the text to be optimized.
[0060] For example, when the designated character is a "period", every time the user inputs a period, it is determined that the above trigger condition is met, and the text input by the user between the period and the previous period is taken as the text to be optimized.
[0061] The above-mentioned designated characters may be set by the terminal device. Of course, the user may also customize the characters, which is not specifically limited in this specification.
[0062] The terminal device may monitor the number of characters in the text input by the user, and if it is monitored that the number of characters in the text input by the user after the last text processing is performed exceeds a preset number, it is determined that the trigger condition is met.
[0063] For example, whenever the preset number is N, whenever it is monitored that the user inputs N characters after the last text processing, it is determined that the trigger condition is met, and the original text corresponding to the N characters most recently input by the user is used as the text to be processed.
[0064] The above-mentioned preset number can be set by the terminal device. Of course, the user can also customize it, and this manual does not make any specific restrictions on this.
[0065] The terminal device can monitor the operations performed by the user when inputting text. If it is monitored that the user performs a selection operation on the input text when inputting text, it is determined that the trigger condition is met, and then the text selected by the user in the original text when performing the selection operation is determined as the text to be processed.
[0066] For example, when the user selects text content by sliding the mouse or touching the screen, it is determined that the above trigger condition is met, and the original text selected by the user is used as the text to be processed.
[0067] In addition, if it is monitored that the user performs a screenshot operation on the input text while inputting text, it is determined that the above trigger condition is met, and then text recognition is performed on the image captured when the user performs the screenshot operation, and the recognized text is used as the text to be processed.
[0068] Among them, the user can use optical character recognition (OCR) technology to recognize the captured image to obtain the text to be processed. Of course, the user can also input the text to be recognized into a pre-trained text recognition model, so as to recognize the text to be processed contained in the screenshot through the text recognition model.
[0069] In addition, the user may also trigger text processing in other ways. For example, the terminal device may display a corresponding control to the user. When it is detected that the user triggers the control, it is determined that the trigger condition for executing the text processing is met.
[0070] For another example, the terminal device may display an input window to the user. When the user inputs the text to be processed into the window by dragging or copying and pasting, it is determined that the triggering condition for executing text processing is met.
[0071] The terminal device can then determine a processing process for performing a processing operation on the text to be processed and run the process.
[0072] It should be noted that the above processing process may start running after the user starts the process. Of course, it may start in a standby state after the user starts it, and start running when it detects that the trigger conditions for executing text processing are met.
[0073] S103: Execute the processing process to input the text to be processed into a preset text processing model.
[0074] S104: Processing the text to be processed by using the text processing model.
[0075] After determining the text to be processed, the terminal device can execute the above processing process, so that the text to be processed is input into a preset text processing model through the processing process.
[0076] In this specification, the above-mentioned text processing model can be a large language model. When the processing process inputs the text to be processed into the model, the corresponding description sentence can also be input so that the large language model processes the text to be processed under the guidance of the description sentence.
[0077] For example, while inputting the text to be processed, you can also input a description statement such as "Please optimize the input text content and list different optimization strategies, including but not limited to typos, grammar, word order, and word usage, etc."
[0078] Among them, the above-mentioned description sentence can be automatically generated by the processing process. Of course, the above-mentioned description sentence can also be pre-stored in a local database of the terminal device. When the processing process inputs the text to be processed, it can directly retrieve the description sentence from the database, collect the text to be processed and adjust it, and then input the adjusted description sentence and the text to be processed into the large language model together.
[0079] Of course, the above text processing model can also be a pre-trained neural network model. After the text to be processed is input into the model, the model can directly output the optimization result.
[0080] During the training of the model, texts containing typos, grammar, word order, and word usage can be used as training samples, with the actual optimization strategy of the text as the label. After inputting the training samples into the model, a prediction result can be obtained. Then, the model is trained with the goal of minimizing the deviation between the prediction result and the label.
[0081] For ease of understanding, this specification provides a schematic diagram of a text processing process, as Figure 2 shown.
[0082] Figure 2 It is a schematic diagram of a text processing process provided in this specification.
[0083] Among them, the terminal device can monitor the text content input by the user and the operations performed during the user's input of text. When it is determined that the trigger condition is met based on the characters input by the user, the number of characters, and the operations performed (including selection operations and screenshot operations), the processing process and the text to be optimized are determined, and the text to be optimized is input into the text processing model, so that the text optimization model processes the text to be optimized.
[0084] In practical applications, the same error in a text often corresponds to multiple different processing strategies. For example, when a user wants to express that a person is conservative and not progressive, but wrongly uses the word "reform and innovation", which is obviously inconsistent with the semantics the user originally wanted to express, this is a case of "improper word usage". After the text to be processed is input into the text processing model in the processing process, multiple replaceable texts for "reform and innovation" can be obtained, including: "stick to old ways", "be conservative", "stubborn", "inflexible", etc.
[0085] In addition, for the optimization of grammar and word order errors, there may also be multiple replaceable texts. For example, for the replacement of the same description, there can be two replacement schemes of "ba sentence" and "bei sentence" at the same time.
[0086] In this case, when the terminal device determines several replaceable texts for the text to be processed, it can display them to the user in ways such as pop-up windows and prompt boxes. Then, in response to the selection operations performed by the user on each text processing information, the replaceable text selected by the user is determined as the processed text corresponding to the text to be processed, so as to replace the text to be processed.
[0087] Furthermore, the terminal device can determine several text processing information for the text to be processed through the text processing model, and determine the processing type corresponding to each text processing information.
[0088] Among them, for each replaceable text, the processing type corresponding to the replaceable text is used to represent the processing method adopted to obtain the replaceable text after processing the text to be processed.
[0089] The terminal device can determine the historical replaceable text selected by the user for the historical text to be processed in the past, and determine the priority of the processing type corresponding to each replaceable text.
[0090] Taking the incorrect use of "reform and innovate" as an example when the user wants to express that a person is conservative and does not seek progress. After determining multiple replaceable texts such as "sticking to old ways", "rigidly adhering to established rules", "stubborn", and "inflexible", the terminal device can further obtain the historical replaceable text selected by the user for the historical text to be processed in the past. If it is found that the user has a higher frequency of using idioms for replacement in the past, "sticking to old ways" and "rigidly adhering to established rules" can be set with a higher priority, while the non-idiomatic "stubborn" and "inflexible" can be set with a lower priority.
[0091] For another example, when there is a grammar error in the text to be processed and two replaceable texts of the sentence patterns of "ba-sentence" and "bei-sentence" are determined, if it is found according to the historical replaceable text selected by the user for the historical text to be processed in the past that the user has a higher frequency of selecting the replaceable text of the "ba-sentence" pattern, the replaceable text of the "ba-sentence" pattern can be set with a higher priority, while the replaceable text of the "bei-sentence" pattern can be set with a lower priority.
[0092] It should be noted that in actual applications, there are also other processing types and their corresponding replaceable texts, which are not listed one by one in this specification.
[0093] After determining the priority corresponding to each replaceable text, the terminal device can display at least some of the replaceable texts in a specified display manner.
[0094] For example, the terminal device can sort each replaceable text in descending order of priority and display the sorted list to the user through methods such as pop-up windows and tooltips.
[0095] For another example, the terminal device can display replaceable texts with different priorities according to the depth of color.
[0096] In addition, the terminal device can also determine the N replaceable texts with the highest priority and mark these N replaceable texts by means of highlighting, bold font, etc.
[0097] It should be pointed out that when there is only one processing strategy for the text to be processed, the text to be processed can be directly replaced with the replacement text obtained through this processing strategy.
[0098] As can be seen from the above method, this solution improves the correctness and readability of the text, reduces typos and grammatical errors, enhances the user's writing experience, especially in scenarios that require fast and accurate text, and improves the quality of text in professional and formal occasions.
[0099] The above are one or more text processing methods implemented in this specification. Based on the same idea, this specification also provides a corresponding text processing device, such as Figure 3 shown.
[0100] Figure 3 A schematic diagram of a text processing device provided for this specification includes:
[0101] The acquisition module 301 is used to acquire the original text input by the user;
[0102] The trigger module 302 is used to determine the text to be processed based on the original text and determine the processing process for performing the processing operation on the text to be processed when it is determined that the original text meets the trigger condition for performing text processing;
[0103] An execution module 303 is used to execute the processing process to input the text to be processed into a preset text processing model;
[0104] The processing module 304 is used to process the text to be processed through the text processing model.
[0105] Optionally, the trigger module 302 is specifically configured to determine that the trigger condition is satisfied if it is detected that the last text character input by the user is a designated character.
[0106] Optionally, the trigger module 302 is specifically configured to determine that the trigger condition is satisfied if it is monitored that the number of characters in the text input by the user after the last text processing is performed exceeds a preset number.
[0107] Optionally, the trigger module 302 is specifically used to determine that the trigger condition is met if it is monitored that the user performs a selection operation on the input text when inputting text; and determine the text selected in the original text when the user performs the selection operation as the text to be processed.
[0108] Optionally, the trigger module 302 is specifically used to determine that the trigger condition is met if it is monitored that the user performs a screenshot operation on the input text when entering text; perform text recognition on the image captured when the user performs the screenshot operation, and use the recognized text as the text to be processed.
[0109] Optionally, the processing module 304 is specifically used to determine, through the text processing model, several types of replaceable texts for the text to be processed, and display them to the user; in response to the user's selection operation on each text processing information, determine the replaceable text selected by the user as the processed text corresponding to the text to be processed.
[0110] Optionally, the processing module 304 is specifically used to determine, through the text processing model, several types of text processing information for the text to be processed, and determine the processing type corresponding to each type of text processing information; for each replaceable text, the processing type corresponding to the replaceable text is used to indicate the processing method adopted for obtaining the replaceable text after processing the text to be processed; determine the priority of the processing type corresponding to each replaceable text based on the historical replaceable texts selected by the user for the historical text to be processed; and display at least part of the replaceable text in a specified display method based on the priority.
[0111] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 Provides a text processing method.
[0112] This manual also provides Figure 4 The one shown corresponds to Figure 1 A schematic diagram of the electronic device. Figure 4 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 Of course, in addition to the software implementation, this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0113] For the improvement of a technology, it can be clearly distinguished whether it is a hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or a software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0114] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0115] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0116] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0117] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0118] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0119] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0120] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0121] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0122] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0123] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0124] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0125] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0126] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0127] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0128] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A text processing method, characterized in that: include: Get the original text entered by the user; When it is determined that the original text meets the triggering condition for executing text processing, a text to be processed is determined based on the original text, and a processing process for executing a processing operation on the text to be processed is determined; Executing the processing process to input the text to be processed into a preset text processing model; The text to be processed is processed by using the text processing model.
2. The method according to claim 1, characterized in that The step of determining that the original text meets the triggering condition for executing text processing specifically includes: If it is detected that the last text character input by the user is a designated character, it is determined that the trigger condition is met.
3. The method according to claim 1, characterized in that The step of determining that the original text meets the triggering condition for executing text processing specifically includes: If it is monitored that the number of characters in the text input by the user after the last execution of text processing exceeds a preset number, it is determined that the trigger condition is met.
4. The method according to claim 1, characterized in that The step of determining that the original text meets the triggering condition for executing text processing specifically includes: If it is monitored that the user performs a selection operation on the input text when inputting text, it is determined that the trigger condition is met; The step of determining the text to be processed according to the original text specifically includes: The text selected by the user in the original text when performing the selection operation is determined as the text to be processed.
5. The method according to claim 1, characterized in that The step of determining that the original text meets the triggering condition for executing text processing specifically includes: If it is monitored that the user performs a screenshot operation on the input text while inputting text, it is determined that the trigger condition is met; The step of determining the text to be processed according to the original text specifically includes: Text recognition is performed on the image captured when the user performs the screenshot operation, and the recognized text is used as the text to be processed.
6. The method according to claim 1, characterized in that The step of processing the text to be processed by the text processing model specifically includes: Determining, by means of the text processing model, several replaceable texts for the text to be processed, and presenting them to the user; In response to the selection operation performed by the user on each text processing information, the replaceable text selected by the user is determined as the processed text corresponding to the text to be processed.
7. The method according to claim 6, characterized in that The step of determining, by means of the text processing model, several replaceable texts for the text to be processed and presenting them to the user specifically comprises: Determine, through the text processing model, several types of text processing information for the text to be processed, and determine the processing type corresponding to each type of text processing information; for each replaceable text, the processing type corresponding to the replaceable text is used to indicate the processing method adopted to obtain the replaceable text after processing the text to be processed; Determining the priority of the processing type corresponding to each replaceable text according to the historical replaceable texts selected by the user for the historical text to be processed; According to the priority, at least part of the replaceable text is displayed in a specified display manner.
8. A text processing device, characterized in that: include: The acquisition module is used to obtain the original text input by the user; A trigger module, for determining a text to be processed based on the original text and determining a processing process for performing a processing operation on the text to be processed when it is determined that the original text meets a trigger condition for performing text processing; An execution module, used for executing the processing process to input the text to be processed into a preset text processing model; The processing module is used to process the text to be processed through the text processing model.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and apparatus for language processing
CN101346717A
Character replacement method and apparatus
CN105608064A
Method and device for replacing specific text element of electronic book
CN108519966A
Text error correction processing method and device, electronic equipment and storage medium
CN112597753A
Text error correction method and device, electronic equipment and storage medium
CN113935317A