Method, apparatus, device, medium and product for progressive replacement visualization of text optimization
By displaying a dynamic boundary between the optimized text and the remaining text in the display interface, the problem of users having difficulty intuitively perceiving the progress during the streaming optimization process is solved, and real-time optimization progress feedback and interactive experience are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING MIANBI INTELLIGENT TECH CO LTD
- Filing Date
- 2026-05-18
- Publication Date
- 2026-07-31
AI Technical Summary
In the current streaming optimization process, users cannot intuitively perceive the optimization progress, and the interactive experience needs to be improved.
The first area of the display interface shows the acquired optimized text, and the second area shows the remaining text that has not yet been optimized. The boundary is determined by the ratio of the length of the acquired optimized text to the length of the original text, and the two areas are adjacent to each other, distinguished by standard and highlight styles.
Users can perceive the optimization progress in real time and receive intuitive feedback without waiting for completion, which reduces implementation costs and improves interaction stability and experience.
Smart Images

Figure CN122489755A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a progressive replacement visualization method, apparatus, device, medium, and product for text optimization. Background Technology
[0002] In text optimization scenarios, language processing services often return optimization results in a streaming manner. Currently, there are two main ways to visualize streaming output: one is to display a loading indicator on the client side, replacing the original text with the complete optimized text all at once after the entire streaming response has finished; the other is to display the streaming output content only in a separate scrolling area.
[0003] The above methods make it difficult for users to intuitively perceive the optimization progress during streaming output, and the interactive experience needs to be improved. Summary of the Invention
[0004] This invention provides a progressive replacement visualization method, apparatus, device, medium, and product for text optimization, to solve the technical problem that users find it difficult to intuitively perceive the optimization progress in existing streaming optimization processes.
[0005] According to one aspect of the present invention, a progressive replacement visualization method for text optimization is provided, the method comprising: Get the original text that is being optimized, and get the optimized text that the language processing service returns in a streaming manner; The optimized text that has been obtained is displayed in the first area of the display interface, and the remaining text in the original text that has not yet been optimized is displayed in the second area of the display interface. The first region is adjacent to the second region, and the boundary between the first region and the second region is determined by the ratio of the length of the optimized text to the length of the original text.
[0006] According to another aspect of the present invention, a text-optimized progressive replacement visualization apparatus is provided, the apparatus comprising: The text acquisition module is used to acquire the original text that is the object of optimization, as well as the optimized text returned by the language processing service in a streaming manner. The text display module is used to display the acquired optimized text in the first area of the display interface, and at the same time display the remaining text in the original text that has not yet been optimized in the second area of the display interface; The first region is adjacent to the second region, and the boundary between the first region and the second region is determined by the ratio of the length of the optimized text to the length of the original text.
[0007] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method described in any one of the present invention.
[0008] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the method described in any one of the present invention.
[0009] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in any one of the present invention.
[0010] This invention acquires the original text to be optimized, and the optimized text returned in a streaming manner by a language processing service; it displays the acquired optimized text in a first area of the display interface, and simultaneously displays the remaining unoptimized text from the original text in a second area of the display interface; wherein the first and second areas are adjacent, and the boundary between the first and second areas is determined by the ratio of the length of the acquired optimized text to the length of the original text. The beneficial effects are: Firstly, during the streaming optimization process, users can simultaneously observe the optimized text and the remaining unoptimized parts of the original text. Through the dynamic changes in the boundary between the first and second regions, they can perceive the progress of the optimization relative to the length of the original text in real time. They can obtain intuitive progress feedback without waiting for the optimization to be fully completed, thereby improving the interactive experience.
[0011] Secondly, the boundary determination method does not rely on character-level alignment between the optimized text and the original text, thus avoiding the complex calculations and potential semantic risks of alignment algorithms in scenarios of unequal length rewriting, reducing implementation costs, and improving interaction stability.
[0012] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 A flowchart illustrating a progressive replacement visualization method for text optimization provided in Embodiment 1 of the present invention; Figure 2A This is a flowchart of a method for determining regional boundaries provided in Embodiment 2 of the present invention; Figure 2B This is a schematic diagram of a region boundary provided in Embodiment 2 of the present invention; Figure 2C This is a schematic diagram of another region boundary provided in Embodiment 2 of the present invention; Figure 3A A flowchart of another method for determining region boundaries provided in Embodiment 3 of the present invention; Figure 3B This is a schematic diagram of another region boundary provided in Embodiment 3 of the present invention; Figure 4 This is a schematic diagram of the structure of a text optimization progressive replacement visualization device provided in Embodiment 4 of the present invention; Figure 5 This is a schematic diagram of the structure of an electronic device that implements the progressive replacement visualization method for text optimization according to embodiments of the present invention. Detailed Implementation
[0015] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0016] It should be noted that the terms "first," "second," "third," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0017] In another existing technical solution, the system hides the original or new text during streaming reception, and then replaces the entire interface text with the optimized text all at once after the language processing service is completed. This solution avoids the complexity of intermediate layout, but it has the abrupt experience of sudden changes after a long period of no change, and the user cannot compare the incremental output with the original text before completion.
[0018] Example 1 Figure 1 This is a flowchart of a progressive replacement visualization method for text optimization provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where optimized text and the remaining original text are simultaneously displayed during streaming optimization. This method can be executed by a progressive replacement visualization device for text optimization, which can be implemented in hardware and / or software, such as through a client application. Figure 1 As shown, the method includes: S101. Obtain the original text as the object of optimization, and obtain the optimized text returned by the language processing service in a streaming manner.
[0019] The optimization object refers to the original content that needs text optimization processing, such as a user-dictated draft, a selected paragraph in a document, or pasted sentences that need polishing. This object is the basic material for all subsequent optimization operations and is usually provided by the user or obtained from the target application.
[0020] The original text, or the textual form of the optimization object, is the initial text before it has been processed by the language processing service. Throughout the optimization process, the original text remains unchanged as a reference benchmark, used to compare with the progressively returned optimization results and help users evaluate the optimization quality.
[0021] Language processing services refer to computational services capable of semantic-level understanding, generation, or transformation of text. Examples include text polishing, expansion, summarization, style transfer, and grammar correction services based on Large Language Models (LLMs). These services are typically deployed in the cloud or locally and are accessible to clients via Application Programming Interfaces (APIs).
[0022] Streaming refers to a transmission method where language processing services generate and output text fragments as they are produced, before generating the complete result. Clients continuously receive these fragments through channels such as server push events, WebSocket, or gRPC streams, without waiting for the entire result to be generated, thus reducing perceived latency for the user.
[0023] Optimized text refers to the resulting text generated after the language processing service optimizes the original text. This text is returned gradually in a streaming manner, and the portion that the client has received and assembled is the "acquired optimized text". As the streaming continues, the acquired optimized text grows from nothing to something, from short to long, until it covers the optimization goals of the original text.
[0024] In one implementation, the client first listens for text selection events in the current application (such as a text editor, browser input box, or instant messaging window). When the user selects a piece of text by dragging with the mouse or using a keyboard shortcut, the client dynamically displays an interactive control near the selection area, such as a floating button or context menu option. This control is used to trigger text optimization functionality. After the user clicks the control, the client immediately reads the complete text content selected by the user and stores it as the raw text in a temporary buffer.
[0025] Subsequently, the client sends a streaming request carrying the original text to the language processing service via Hypertext Transfer Protocol (HTTP), explicitly declaring in the request header that it accepts a streaming response format. Upon receiving the request, the language processing service begins semantic understanding and optimization of the original text, returning the optimized results in a streaming manner, word by word, sentence by sentence, or segment by segment. The client continuously receives these segments through the server push event interface, appending each received segment to its internal buffer to form the acquired optimized text.
[0026] In another implementation, the client registers a system clipboard listener upon startup to monitor the format and changes of the clipboard content in real time. When a user performs a copy operation in another application, the client automatically retrieves the plain text content from the clipboard. To avoid false triggers caused by frequent copying, the client sets a debouncing timer to ensure that only the last stable text content is processed when the user copies continuously. The client uses the retrieved text as the original text and proactively initiates a full-duplex connection request based on the WebSocket protocol to the language processing service. After the WebSocket connection is established, the client sends an optimization request message containing the original text.
[0027] During processing, the language processing service pushes optimized text segments to the client in real time as message frames via the same WebSocket connection. Each time the client receives a message frame, it parses the text segments within it and appends them to the already acquired optimized text buffer.
[0028] Compared to the first implementation method, the WebSocket method offers lower communication latency and two-way interaction capabilities, allowing users to send supplementary instructions or cancel requests at any time during the optimization process, making it suitable for scenarios that require more flexible control.
[0029] Suppose a user is writing a work report, the original text of which is: "Last month's performance was okay, but there were a few issues that the client was somewhat dissatisfied with." The user wants to refine it into a more formal expression.
[0030] Implementation Method 1: The user selects the sentence in a word processing software and clicks the floating "Optimize" button. The client retrieves the original text and calls the language processing service. The server returns the following segments sequentially in a streaming manner: "Last Month," "Performance," "Overall," "Good," "But Several Issues Exist," and "Customer Feedback Needs Improvement." As these segments are returned, the client gradually assembles the complete optimized text: "Last month's overall performance was good, but several issues exist, and customer feedback needs improvement."
[0031] Implementation Method Two: Users simply copy the text in any application. The client automatically detects the clipboard change and silently triggers the optimization process. The server also returns the above fragment in a streaming manner, and the client finally obtains the complete optimized text: "Last month's performance was generally good, but there were several issues, and customer feedback indicates areas for improvement." This method requires no manual button clicks and is suitable for quickly processing multiple segments of text scattered across different applications.
[0032] S102. Display the acquired optimized text in the first area of the display interface, and simultaneously display the remaining unoptimized text in the original text in the second area of the display interface; wherein the first area and the second area are adjacent, and the boundary between the first area and the second area is determined by the ratio of the text length of the acquired optimized text to the text length of the original text.
[0033] The display interface refers to the screen area in a client application used to present visual content to the user, such as an application window, dialog box, or web page canvas. This interface is used to display text content and visual feedback during the optimization process.
[0034] The first area refers to a sub-area within the display interface, used to dynamically display optimized text obtained from the language processing service. This area expands gradually as streaming data arrives, and is typically presented using standard text styles (such as default fonts and colors).
[0035] The acquired optimized text refers to the optimized text fragment that the client has received and assembled from the streaming response of the language processing service up to the current moment. This text is part of the optimization result, and its content gradually increases as the streaming continues until it completely covers the optimization target of the original text. For example, the original text is "The weather is nice today, let's go for a walk in the park." The language processing service returns the optimized text fragment in a streaming manner. The client first receives the fragments "today," "weather," and "sunny," and after splicing, the acquired optimized text is "The weather is sunny today." Subsequently, it receives fragments such as "we," "go," "park," and "let's go for a walk," and the acquired optimized text is finally expanded to "The weather is sunny today, let's go for a walk in the park." Throughout the process, the acquired optimized text gradually accumulates from nothing until it is complete.
[0036] The second area refers to another sub-area in the display interface that is immediately adjacent to the first area. It is used to display the remaining part of the original text that has not yet been covered by the optimization progress. This area shrinks accordingly as the first area expands, and is usually presented with a highlighted style that is visually distinguishable from the first area, to remind the user that this part of the content still needs to be optimized.
[0037] The remaining unoptimized text in the original text refers to the suffix portion of the original text that has not yet been covered by the current optimization progress. This portion dynamically shortens as optimized text is gradually acquired, until it disappears completely upon completion of optimization. For example, if the original text is "The weather is nice today, let's go for a walk in the park." Assuming the acquired optimized text is "The weather is sunny today," then the remaining unoptimized text in the original text is "Let's go for a walk in the park." That is, the portion of the original text not corresponding to the current optimization result.
[0038] The first and second areas are adjacent, meaning that in the display interface, the first and second areas are right next to each other without any gap or overlap, and they share a common boundary line (i.e., a dividing line). This adjacent layout allows users to intuitively view the two areas as a continuous reading flow, thus clearly comparing optimized content with content that needs optimization.
[0039] The boundary between the first and second regions refers to the visual boundary line used to separate the two regions. This boundary can be an explicit line, a color difference, or simply the meeting of the edges of the two regions. The position of the boundary changes dynamically to reflect the current optimization progress relative to the original text length.
[0040] The length of the optimized text obtained refers to the number of characters (or the number of Unicode scalars) of the optimized text that the client has received and assembled from the streaming response of the language processing service up to the current moment. This length is a dynamically increasing value, starting from 0, until it reaches or approaches the length of the original text (but the two are not necessarily equal).
[0041] Original text length: refers to the total number of complete characters in the original text that is being optimized (using the same unit of measurement as "Text Length of the Optimized Text Obtained"). This length remains constant throughout the optimization process and is used as a benchmark for calculating optimization progress.
[0042] In one implementation, the client pre-creates two vertically arranged containers in the display interface, designated as a first area and a second area, respectively. The two containers are closely adjacent in layout, without gaps or overlap. The client continuously monitors the ratio of the length of the acquired optimized text to the length of the original text to obtain a replacement ratio. Subsequently, the client dynamically calculates the percentage of the first container's height relative to the total height of the display interface based on this ratio, and uses this percentage as the actual height of the first container; the second container automatically occupies the remaining height.
[0043] The first container scrolls through the optimized text that has been acquired, while the second container scrolls through the remaining unoptimized text from the original text. As streaming segments arrive, the replacement ratio gradually increases, the height of the first container increases, and the height of the second container decreases, thus creating a visual effect where the first area expands downwards and the second area contracts upwards.
[0044] In another implementation, the client manages the text content of both the first and second regions uniformly within a scrollable canvas. The client first acquires the original text and calculates its total length. Whenever a new optimized text fragment is received, the client updates the length of the acquired optimized text and recalculates the replacement ratio.
[0045] Then, the client draws two pieces of text on the same canvas: the first piece is the optimized text that has been obtained, using the standard style; the second piece is the remaining text in the original text that has not yet been optimized, using the highlight style.
[0046] The client determines a dividing coordinate based on the replacement ratio (e.g., in a vertical layout, dividing coordinate = total canvas height × replacement ratio), dividing the canvas into upper and lower parts. The upper part corresponds to the first area, and the lower part corresponds to the second area. As the replacement ratio increases, the dividing coordinate moves downward, and the user observes the standard style area expanding and the highlight style area shrinking, creating a smooth sweeping effect.
[0047] For example, suppose the original text is "The weather is nice today, let's go for a walk in the park." (18 characters). The language processing service returns the optimized text in a streaming manner. The client receives three segments: "today," "weather," and "sunny." The optimized text obtained so far is "The weather is sunny today," which has 6 characters. At this point, the replacement ratio is 6 / 18 ≈ 0.333. Based on this ratio, the client allocates approximately one-third of the display screen to the first area to display "The weather is sunny today," and the remaining two-thirds to the second area to display the remaining text from the original text that has not yet been optimized: "Let's go for a walk in the park."
[0048] As subsequent segments arrive, the replacement ratio gradually increases, the first area expands downwards, and the second area shrinks accordingly until the optimization is complete and the second area disappears completely. The entire interface then displays only the complete optimized text: "The weather is sunny today, let's go for a walk in the park."
[0049] This invention, through obtaining the original text as the optimization target and the optimized text returned by a language processing service in a streaming manner, displays the obtained optimized text in a first area of the display interface, while simultaneously displaying the remaining unoptimized text from the original text in a second area of the display interface. The first and second areas are adjacent, and the boundary between them is determined by the ratio of the length of the obtained optimized text to the length of the original text. The beneficial effects are: Firstly, during the streaming optimization process, users can simultaneously observe the optimized text and the remaining unoptimized parts of the original text. Through the dynamic changes in the boundary between the first and second regions, they can perceive the progress of the optimization relative to the length of the original text in real time. They can obtain intuitive progress feedback without waiting for the optimization to be fully completed, thereby improving the interactive experience.
[0050] Secondly, the boundary determination method does not rely on character-level alignment between the optimized text and the original text, thus avoiding the complex calculations and potential semantic risks of alignment algorithms in scenarios of unequal length rewriting, reducing implementation costs, and improving interaction stability.
[0051] Optionally, the optimized text in the first area is displayed in a standard text style, while the remaining text in the second area is displayed in a highlighted style that is visually distinguishable from the first area.
[0052] Standard text style refers to the text displayed using the application's default appearance, typically including system-preset font, font size, color, transparent or white background, and no additional decorative effects. Standard style is used to indicate text that has been finally confirmed or is in a normal reading state, without giving the user any special prompts.
[0053] Highlighting refers to presenting text with visual attributes that are significantly different from the standard style to attract user attention or indicate a special state of the text. Common highlighting styles include, but are not limited to: light background, underline, italics, and light gray background. Highlighting styles are used to indicate to the user that this part of the text has not yet been optimized and is still in a pending state.
[0054] In one implementation, the client applies different text styles to the first and second regions when rendering them. For the optimized text in the first region, the client directly uses the standard text style currently being used by the system or application. For the remaining original text in the second region, the client sets a separate highlight style, while keeping the foreground color consistent with the standard style or slightly darkening it to ensure readability. The two regions are naturally separated by their adjacent layout, allowing users to easily distinguish between the "optimized main text" and the "original text fragments awaiting optimization."
[0055] For example, the original text is "The weather is nice today, let's go for a walk in the park." This contains 18 characters. The optimized text obtained by the client is "Today's weather," which contains 4 characters. The replacement ratio is approximately 0.22. The first area displays "Today's weather" in the standard style, while the second area displays the remaining unoptimized text from the original text, "It's nice, let's go for a walk in the park," in a highlighted style. Users can clearly identify the optimized portion on the left / top area and the unoptimized portion on the right / bottom area through the difference in background color.
[0056] As the streaming continues, when the retrieved optimized text expands to "The weather is nice today," the remaining text becomes "Let's go for a walk in the park."; when the complete optimized text "The weather is nice today, let's go for a walk in the park." is finally retrieved, the second area disappears, and the entire interface displays only the complete optimized text in the standard style.
[0057] By setting the optimized text in the first area to be displayed in a standard text style, and the remaining text in the second area to be displayed in a highlighted style that is visually distinguishable from the first area, the beneficial effects are: Firstly, by visually distinguishing between standard and highlighted styles, users can easily identify which content has been optimized and which remains in its original state. They can quickly locate text areas that have not yet been optimized without having to compare word by word, thus reducing the cognitive burden on users.
[0058] Secondly, the highlight style provides users with clear visual cues, guiding them to focus on the remaining parts of the original text to be processed. Meanwhile, the optimization result area of the standard style provides users with the main content to read and confirm. The two complement each other, allowing users to maintain a clear perception of the overall progress throughout the optimization process, further enhancing the intuitiveness and user-friendliness of the interactive experience.
[0059] Optionally, the highlight style is a semi-transparent background, and the color of the semi-transparent background is a warm tone.
[0060] In one implementation, when rendering the remaining text in the second region, the client first creates a separate drawing layer for that region. The client sets a semi-transparency parameter (e.g., 30% transparency) and a warm color (e.g., light orange with RGB values of (255, 200, 150)).
[0061] The client first fills the second area with a warm-toned, semi-transparent rectangle on this drawing layer, then draws the foreground color of the remaining text on top of this rectangle (usually the same or slightly darker color as the standard text). Because the background is semi-transparent, the underlying interface background color or grid lines can still be faintly seen, creating a soft visual cue. The client does not apply any background fill to the first area, ensuring that the first area has a standard background-free style. The two areas are placed adjacent to each other, allowing users to immediately distinguish between the optimized text and the original text that still needs optimization by the presence or absence of background color.
[0062] Setting the highlight style to a semi-transparent background with a warm color has the following benefits: Firstly, warm colors can gently attract users' attention, indicating that the text in that area is still in a state of optimization, without creating overly glaring visual stimulation.
[0063] Secondly, the semi-transparent nature prevents the background from completely obscuring the underlying elements of the interface, maintaining the overall transparency and consistency of the interface, while reducing the visual weight of the highlighted areas and preventing user fatigue from prolonged staring.
[0064] This setting provides a clear yet subtle contrast to the standard style of the first area, effectively distinguishing between the two text states while maintaining the aesthetics and comfort of the interface, further enhancing the user experience.
[0065] Optionally, the method also includes: In response to the user's dragging operation on the boundary, the boundaries of the first and second regions are redefined based on the position of the boundary after dragging.
[0066] Drag and drop refers to the interactive behavior of users pressing and moving the cursor or touch point on the display interface using input devices such as a mouse, touch screen, or stylus. Specifically, in this solution, the user positions the cursor on the boundary between the first and second areas, presses the mouse button (or touches) and moves it vertically (in a top-bottom layout) or horizontally (in a left-right layout) to change the position of the boundary.
[0067] The post-drag boundary position refers to the final location where the boundary stops after the user completes the drag operation. This position is manually specified by the user and may differ from the theoretical boundary position corresponding to the current optimization progress. The client recalculates the actual range of the first and second regions based on this position and refreshes the display.
[0068] In one implementation, the client binds an interactive event to the boundary between the first and second areas in the display interface. When the user moves the mouse pointer near the boundary, the client changes the mouse pointer style to indicate to the user that the boundary can be dragged.
[0069] When the user presses and moves the left mouse button, the client obtains the current coordinates of the mouse pointer in real time and calculates the new dividing point position based on the layout direction (e.g., in a top-bottom layout, the dividing point is the pixel value from the top of the display screen). The client uses this new position as the dividing line to redivide the first and second regions: the first region occupies the area from the top to the new dividing point, and the second region occupies the area from the new dividing point to the bottom.
[0070] The client refreshes the interface, displaying the optimized text that has been obtained in the first adjusted area, and displaying the remaining text in the original text that has not yet been optimized in the second adjusted area.
[0071] During this process, the client does not change the underlying optimized text content and original text content, but only changes the visual range of the two areas, thereby enabling the user to manually intervene in the display layout.
[0072] For example, suppose the original text contains 1000 characters, and the currently acquired optimized text is 300 characters long. The theoretical replacement ratio is 0.3, and the dividing point should be located at 30% of the total height of the display interface. The user believes the optimization progress is faster than expected and wants to see more optimization results sooner, so they drag the dividing line down to 50% of the total height. The client responds to the drag operation, expanding the first area to occupy half the height of the interface, and the second area shrinks accordingly. At this time, the first area still displays the acquired 300 characters of optimized text, but occupies more screen space, making it easier for the user to read; the second area displays the remaining part of the original text starting from the 301st character. Although the length of the remaining text remains unchanged, the display area is smaller, and the user may need to scroll to view it. The user obtains a more comfortable reading layout through the drag operation without affecting the actual optimization progress.
[0073] By responding to the user's dragging action on the boundary, and redefining the boundaries of the first and second regions based on the dragged boundary position, the beneficial effects are: This allows users to manually adjust the ratio between the displayed area of the optimized text and the remaining area of the original text, based on their reading needs or areas of focus. When the optimized text is long or requires detailed review, users can expand the first area for closer reading; when more contextual information from the original text is needed, users can expand the second area. This interactive method enhances users' control over the display layout, adapts to flexible display needs in different usage scenarios, and does not alter the underlying optimization progress or text data, thus decoupling display intervention from data processing.
[0074] Optionally, the method also includes: When the ratio of the length of the optimized text to the length of the original text reaches a preset threshold, all the acquired optimized text is organized into the final output, and the second region is controlled to disappear.
[0075] The preset threshold refers to the final value reached when the language processing service completes the streaming return of all optimized text, at which point the ratio of the optimized text length to the original text length is reached. This final value is determined by the actual length of the optimized result and may be equal to 1, greater than 1, or less than 1, rather than a pre-specified fixed value.
[0076] In one implementation, the client continuously monitors the ratio of the length of the acquired optimized text to the length of the original text. When the ratio equals a preset threshold, the client determines that the language processing service has returned all the optimized text. The client then retrieves all the currently acquired optimized text from the receiving buffer and processes it according to preset rules, such as removing extra spaces, standardizing punctuation, and adjusting line breaks, to form the final result.
[0077] The client then outputs the final result to a specified target, such as replacing the original text, saving it to a file, copying it to the system clipboard, or sending it to the target application. Simultaneously, the client controls the removal of the second region from the view, retaining only the first region, which displays the complete optimized text without any highlighted backgrounds or separators.
[0078] For example, assuming a preset threshold of 1, the original text is "The weather is nice today, let's go for a walk in the park." (18 characters). The client gradually receives optimized text fragments, and the final optimized text is "The weather is sunny today, let's go for a walk in the park." When the client detects that the ratio of the length of the acquired optimized text (18 characters) to the length of the original text (18 characters) reaches 1, the client organizes the complete optimized text into the final result, outputs it to the target document to replace the original text, and simultaneously controls the second area to disappear from the display interface, leaving only the first area on the entire interface, displaying the complete optimized text "The weather is sunny today, let's go for a walk in the park." in a standard style.
[0079] When the ratio of the optimized text length to the original text length reaches a preset threshold, all the acquired optimized text is organized into the final output, and the disappearance of the second region is controlled. The beneficial effects are: Firstly, the client automatically detects and optimizes the conditions for completion, eliminating the need for manual judgment or triggering by the user. It can then organize all the optimized text into the final result and output it, simplifying the user's operation process and improving the completion efficiency.
[0080] Secondly, by controlling the disappearance of the second area, the highlighted areas and boundaries used to indicate the remaining text during the optimization process are eliminated, allowing the display interface to return to a simple, pure result state, and avoiding irrelevant visual elements from interfering with the user's reading of the final optimized text.
[0081] In another type of existing technical solution, the system simultaneously displays the original text and the optimized text in a left-right column or inline difference comparison format, usually relying on character-level or word-level alignment algorithms. This solution is suitable for offline batch processing scenarios, but in streaming scenarios, alignment calculations need to be repeatedly performed as new text arrives, resulting in high computational costs; moreover, when the optimized text deviates significantly from the original text in terms of structure or length, the alignment algorithm struggles to establish a stable correspondence, easily leading to misleading labeling.
[0082] In view of the above-mentioned existing technical solutions, optionally, the boundary between the first region and the second region in the embodiments of the present invention does not depend on the character-level or word-level alignment between the optimized text and the original text, but is determined only by the ratio of the obtained text length of the optimized text to the text length of the original text.
[0083] By setting the boundary between the first and second regions independently of character-level or word-level alignment between the optimized and original texts, and solely determined by the ratio of the length of the optimized text to the length of the original text, the following advantages are available: Compared to dual-column or diff views that rely on character-level or word-level alignment, this invention determines the boundary solely based on the length ratio, eliminating the need to re-perform alignment calculations each time new text arrives, resulting in low computational overhead. Furthermore, when the optimized text deviates significantly from the original text length, it will not produce misalignment or misleading markings due to forced alignment, and the boundary always progresses smoothly.
[0084] Example 2 Figure 2A This is a flowchart of a method for determining a region boundary according to Embodiment 2 of the present invention. It further optimizes and expands the method for determining the "boundary between the first region and the second region" in the above technical solution, and can be combined with the various optional implementation methods described above. For example... Figure 2A As shown, the method includes: S201. Use the ratio of the length of the optimized text to the length of the original text as the replacement ratio.
[0085] The replacement ratio refers to the ratio of the length of the optimized text to the length of the original text, with a value ranging from 0 to 1. This ratio is used to quantify the current optimization progress, that is, the proportion of the original text that has been covered by the optimization results.
[0086] S202. If the first area and the second area are arranged vertically, the replacement ratio is multiplied by the total height of the display interface to obtain the dividing point position.
[0087] The vertical arrangement refers to the first and second areas being arranged vertically in the display interface, with the first area at the top and the second area at the bottom, separated by a horizontal dividing line.
[0088] The total height of the display interface refers to the total number of pixels (or logical units) in the vertical direction of the visible area used by the client to display text content.
[0089] The dividing point location refers to the specific coordinates of the boundary in the vertical direction, usually expressed in pixels (or logical units) from the top edge of the display interface. This location divides the display interface into upper and lower parts.
[0090] S203. Control the first area to display the range from the top of the display interface to the dividing point, and control the second area to display the range from the dividing point to the bottom of the display interface.
[0091] The top of the display interface refers to the upper boundary of the display interface, corresponding to the starting point of the vertical coordinate (usually 0). The bottom of the display interface refers to the lower boundary of the display interface, corresponding to the maximum value of the vertical coordinate, which is the total height of the display interface.
[0092] In one implementation, the client first calculates the replacement ratio, which is the length of the optimized text divided by the length of the original text. When the first and second regions are arranged vertically, the client obtains the total height of the display interface. The client multiplies the replacement ratio by the total height of the display interface to obtain the dividing point position.
[0093] The client then controls the display extent of the first region: the area from the top of the display screen to the dividing point is used to display the acquired optimized text. The client controls the display extent of the second region: the area from the dividing point to the bottom of the display screen is used to display the remaining text in the original text that has not yet been optimized. The two regions are adjacent along the dividing point, forming a continuous visual flow.
[0094] When streaming data arrives and the replacement ratio increases, the client recalculates the boundary point position and updates the display range of the two areas in real time, achieving a dynamic effect of the first area expanding downward and the second area shrinking upward.
[0095] For example, if the original text has a total length of 1000 characters and the optimized text length is 300 characters, then the replacement ratio is 0.3. The total height of the display interface is 600 pixels. The client calculates the dividing point position as 0.3 × 600 = 180 pixels. The client controls the first area to occupy the area from the top 0 pixels to 180 pixels, displaying the 300 characters of optimized text; it controls the second area to occupy the area from 180 pixels to the bottom 600 pixels, displaying the remaining part of the original text starting from the 301st character. When the length of the subsequently acquired optimized text increases to 500 characters, the replacement ratio becomes 0.5, the dividing point position is updated to 300 pixels, the first area expands to a height of 300 pixels, and the second area shrinks to a height of 300 pixels, allowing the user to intuitively see the optimization progress.
[0096] The replacement ratio is used by comparing the length of the optimized text to the length of the original text. If the first and second regions are arranged vertically, the replacement ratio is multiplied by the total height of the display interface to obtain the dividing point position. Controlling the display range of the first region from the top of the display interface to the dividing point position, and controlling the display range of the second region from the dividing point position to the bottom of the display interface, has the following advantages: By linearly mapping the replacement ratio to the dividing point position in the display interface, and dynamically dividing the vertical range of the first and second regions at this position, users can intuitively perceive the proportional change in optimization progress relative to the original text length from the speed and distance of the dividing point's movement. This implementation method is computationally simple, responds in real time, does not rely on the specific text layout or alignment information, and reduces the rendering complexity on the client side.
[0097] At the same time, the vertical division conforms to the natural reading order from top to bottom, making the visual semantics of "optimized content on top and original text to be optimized below" easy to understand, improving the efficiency of progress information transmission and the naturalness of user interaction.
[0098] Figure 2B This is a schematic diagram of a region boundary provided in Embodiment 2 of the present invention, as shown below. Figure 2B As shown, when the replacement ratio is 0, 200 represents the second region at this time, and there is no first region; when the replacement ratio is 0.33, 201 represents the first region at this time, and 202 represents the second region at this time; when the replacement ratio is 0.66, 203 represents the first region at this time, and 204 represents the second region at this time; when the replacement ratio is 1, 205 represents the first region at this time, and there is no second region.
[0099] Optionally, the display interface also includes a third area, which is located below and adjacent to the second area, and is used to display the newly generated speech-recognized text after optimization is triggered and during the process of uninterrupted speech acquisition.
[0100] The third area refers to another sub-area located below the second area in the display interface, adjacent to the second area. This area is used to display newly generated speech-recognized text after optimization is triggered and during uninterrupted speech acquisition. The third area uses the same standard text style as the first area (without a highlighted background) to indicate that it is newly added normal input content.
[0101] An optimization trigger refers to the action or event that initiates the text optimization process. For example, it could be triggered by a user clicking the "Optimize" button, the system detecting a silent timeout and automatically triggering the process, or the user using a command key. After optimization is triggered, the system begins sending the original text to the language processing service and enters the streaming optimization process.
[0102] Uninterrupted voice capture means that after optimization is triggered, the underlying audio capture device (such as a microphone) continues to work, allowing the user to continue speaking and dictating new content without stopping. This feature differs from the limitation of traditional serial solutions that require "voice input to be stopped during optimization."
[0103] The newly generated speech-recognition text refers to the text content obtained in real time through ASR (Automatic Speech Recognition) technology after the optimization is triggered, as the user continues to speak. This text is not part of the original text for this optimization, but rather new material added during the optimization process, and usually needs to be merged with the optimization result after the optimization is completed.
[0104] In one implementation, the client pre-plans three vertically arranged areas on the display interface: the first area is at the top, the second area is in the middle, and the third area is at the bottom. When optimization is triggered, the client enters concurrent acquisition mode. At this time, the voice acquisition module continuously listens to the user's speech and transmits the recognition results to the client in real time in a streaming manner. Each time the client receives a new speech-recognized text segment, it is appended to the third area and displayed in a standard text style. The third area is adjacent to the second area, but the display range and boundary calculation of the second area are not affected by the existence of the third area, and are still determined only by the replacement ratio between the first and second areas. The user can see the new content of their real-time speech in the third area while observing the gradual generation of optimized text in the first area and the gradual shrinking of the remaining original text in the second area. When optimization is complete (the replacement ratio reaches 1), the client controls the second area to disappear and merges the first area (complete optimized text) and the third area (newly recognized text) into a unified standard style text stream, with the two areas separated by a line break.
[0105] Figure 2C This is a schematic diagram of another region boundary provided in Embodiment 2 of the present invention, as shown below. Figure 2C As shown, at a certain moment, 206 represents the first region corresponding to that moment, 207 represents the second region corresponding to that moment, and 208 represents the third region corresponding to that moment.
[0106] For example, the user's original text is "The weather is nice today." After optimization is triggered, the language processing service starts returning the optimized text "The weather is sunny today." During the optimization process, the user continues to utter "Let's go to the park together." The client displays the new text "Let's go to the park together." recognized by ASR in real time in the third area. At this time, the first area gradually displays "The weather is sunny today," the second area displays the remaining part of the original text (empty after optimization), and the third area displays "Let's go to the park together." When the optimization is complete, the client controls the second area to disappear, and the first and third areas merge into the complete text "The weather is sunny today. Let's go to the park together." The display interface also includes a third area, located below and adjacent to the second area. This third area is used to display the newly generated speech-recognized text after optimization triggering and while speech acquisition is uninterrupted. Its advantages include: Users can continue speaking new content without waiting for optimization to complete, enabling concurrent execution of optimization and data collection. Simultaneously, the layout of the third and second areas adjacent to each other allows users to simultaneously observe the optimization progress (the dynamic boundary between the first and second areas) and the newly added spoken content (the third area), forming a coherent multi-layered information flow. This avoids the experience gap caused by the traditional approach of "having to stop speaking during optimization," significantly improving the smoothness of interaction and the continuity of information in continuous voice input scenarios.
[0107] Example 3 Figure 3A This is a flowchart of another method for determining regional boundaries provided in Embodiment 3 of the present invention. It further optimizes and expands the method for determining the "boundary between the first region and the second region" in the above technical solution, and can be combined with the various optional implementation methods described above. For example... Figure 3A As shown, the method includes: S301. Use the ratio of the length of the optimized text to the length of the original text as the replacement ratio.
[0108] S302. If the first area and the second area are arranged side by side, the replacement ratio is multiplied by the total width of the display interface to obtain the dividing point position.
[0109] The left-right arrangement refers to the first and second areas being arranged horizontally in the display interface, with the first area on the left and the second area on the right, separated by a vertical dividing line.
[0110] The total width of the display interface refers to the total number of pixels (or logical units) in the horizontal direction of the visible area used by the client to display text content. This width can be the width of the entire window or the width of a sub-area specifically used for text display.
[0111] S303. Control the first area to display the range from the left side of the display interface to the dividing point, and control the second area to display the range from the dividing point to the right side of the display interface.
[0112] The left side of the display interface refers to the left boundary of the display interface, corresponding to the starting point of the horizontal coordinate (usually 0). The right side of the display interface refers to the right boundary of the display interface, corresponding to the maximum value of the horizontal coordinate, which is the total width of the display interface.
[0113] In one implementation, the client first calculates the replacement ratio, which is the length of the optimized text divided by the length of the original text. When the first and second regions are arranged horizontally, the client obtains the total width of the display interface. The client multiplies the replacement ratio by the total width of the display interface to obtain the dividing point position. The client then controls the display range of the first region: the area from the left side of the display interface to the dividing point position is used to display the optimized text. The client controls the display range of the second region: the area from the dividing point position to the right side of the display interface is used to display the remaining unoptimized text in the original text. The two regions are adjacent along the dividing point, forming a continuous visual flow. As streaming data arrives and the replacement ratio increases, the client recalculates the dividing point position and updates the display range of the two regions in real time, achieving a dynamic effect of the first region expanding to the right and the second region shrinking to the left.
[0114] For example, assuming the original text has a total length of 1000 characters and the optimized text length is 300 characters, the replacement ratio is 0.3. The total width of the display interface is 800 pixels. The client calculates the dividing point position as 0.3 × 800 = 240 pixels. The client controls the first area to occupy the area from 0 pixels on the left to 240 pixels, displaying the 300 characters of optimized text; it controls the second area to occupy the area from 240 pixels on the left to 800 pixels on the right, displaying the remaining part of the original text starting from the 301st character. When the length of the subsequently acquired optimized text increases to 500 characters, the replacement ratio becomes 0.5, the dividing point position is updated to 400 pixels, the first area expands to a width of 400 pixels, and the second area shrinks to a width of 400 pixels, allowing the user to visually see the optimization progress advancing to the right.
[0115] The replacement ratio is used by comparing the length of the optimized text with the length of the original text. If the first and second regions are arranged horizontally, the replacement ratio is multiplied by the total width of the display interface to obtain the dividing point position. Controlling the display range of the first region from the left side of the display interface to the dividing point position, and controlling the display range of the second region from the dividing point position to the right side of the display interface, has the following advantages: The left-right layout is suitable for widescreen displays or scenarios where horizontal reading is preferred, providing users with an alternative visual solution to the top-bottom layout. This enhances the adaptability and flexibility of the embodiments of the present invention under different display environments and user preferences. This implementation is also computationally simple, responds in real time, and does not rely on specific text layout or alignment information, maintaining the technical advantage of low complexity.
[0116] Figure 3B This is a schematic diagram of another region boundary provided in Embodiment 3 of the present invention, as shown below. Figure 3BAs shown, when the replacement ratio is 0, 300 represents the second region at this time, and there is no first region; when the replacement ratio is 0.33, 301 represents the first region at this time, and 302 represents the second region at this time; when the replacement ratio is 0.66, 303 represents the first region at this time, and 304 represents the second region at this time; when the replacement ratio is 1, 305 represents the first region at this time, and there is no second region.
[0117] Optionally, in another alternative implementation, the visual distinction between the first and second regions may not be achieved through explicit highlighting, but rather through an overall transparency gradient or a blur gradient.
[0118] Specifically, within a single-style text container, different opacity or blurring effects are applied to different parts of the text based on the ratio of the text length optimized by the text-optimized progressive replacement visualization to the text length of the original text. Specifically, the portion covered by the optimized progressive replacement visualization is rendered completely opaque or clear; the portion of the original text not yet covered is rendered semi-transparent or blurred. Thus, the text as a whole presents a gradual transition from the confirmed new content to the old content yet to be replaced, without explicitly drawing the boundary between the first and second areas in the interface. This alternative is visually smoother and, in some implementations, reduces the complexity of column layouts; however, compared to an explicit dual-area highlight style, the user's intuitive perception of the remaining amount of original text to be replaced may be somewhat diminished.
[0119] As an alternative technical solution to the calculation method of the ratio of the optimized text length to the original text length in the above embodiments, in another optional embodiment, the length measurement unit used for the numerator and denominator of the ratio may not be limited to the number of characters or Unicode scalar length, but may be replaced by any one or a combination of the following measurement units: word count, byte count, normalized code point sequence length, or an explicit progress value issued by the language processing service.
[0120] Specifically, when word count is used as the metric, the ratio is the ratio of the number of words in the optimized text to the number of words in the original text. When an explicit progress value is used, this value is calculated in real time by the language processing service during processing and sent along with the streaming data; the client directly uses this value as the ratio. Different units of measurement will change the sense of progression between the first and second regions—for example, when progressing in words, the movement of the boundary may appear as intermittent jumps rather than a smooth character-by-character progression. Using an explicit progress value sent by the server can eliminate the risk of deviation between the client and the server due to different length definitions, but requires corresponding streaming protocol extensions for support. Under conditions feasible only on the client side, the ratio based on character count or Unicode scalar length is the default measurement method used in the various embodiments of this specification.
[0121] In an alternative modular implementation, the method involved in this example can be implemented collaboratively by the following four logical modules: Module A – Streaming Concatenator. It receives optimized text fragments returned in streaming form from the language processing service, concatenates these fragments in the order they arrive to form the acquired optimized text, and maintains the integrity of the original text.
[0122] Module B – Replacement Proportion Calculator. Connects to the streaming stitcher to calculate in real time the ratio of the length of the acquired optimized text to the length of the original text, and outputs this ratio to the dual-region layout renderer.
[0123] Module C – Dual-Region Layout Renderer. It receives the length ratio output from the replacement ratio calculator, determines the boundary position between the first and second regions based on this ratio, and drives the display interface to show the optimized text in the first region and the remaining unoptimized text in the second region of the original text. During the streaming return process, the boundary is continuously updated according to the change in the length ratio.
[0124] Module D – Completion State Switching Module. This module listens for the streaming completion event from the language processing service. When all optimized text has been received, it controls the disappearance of the second area, organizes all acquired optimized text into the final output, and causes the display interface to converge to a single display state of optimized text.
[0125] In the above modules, the streaming splicer provides the spliced optimized text to the replacement ratio calculator and the dual-region layout renderer respectively; the replacement ratio calculator outputs the calculated length ratio to the dual-region layout renderer to drive the boundary update; the completion state switching module takes over the output of the dual-region layout renderer when the conditions are met, and completes the interface convergence.
[0126] Example 4 Figure 4This is a schematic diagram of a progressive replacement visualization device for text optimization provided in Embodiment 4 of the present invention. It can be applied to simultaneously displaying the optimized text and the remaining original text during streaming optimization, such as... Figure 4 As shown, the device includes: The text acquisition module 41 is used to acquire the original text as the object of optimization, and to acquire the optimized text returned by the language processing service in a streaming manner. The text display module 42 is used to display the acquired optimized text in the first area of the display interface, and at the same time display the remaining text in the original text that has not yet been optimized in the second area of the display interface; The first region is adjacent to the second region, and the boundary between the first region and the second region is determined by the ratio of the length of the optimized text to the length of the original text.
[0127] Optionally, the optimized text in the first area is displayed using a standard text style, and the remaining text in the second area is displayed using a highlight style that is visually distinguishable from the first area.
[0128] Optionally, the first region and the second region are arranged vertically, and the boundary between the first region and the second region is determined in the following way: The ratio of the length of the optimized text to the length of the original text is used as the replacement ratio; Multiply the replacement ratio by the total height of the display interface to obtain the dividing point position; The first area is controlled to display the range from the top of the display interface to the dividing point, and the second area is controlled to display the range from the dividing point to the bottom of the display interface.
[0129] Optionally, the first region and the second region are arranged horizontally, and the boundary between the first region and the second region is determined in the following way: The ratio of the length of the optimized text to the length of the original text is used as the replacement ratio; Multiply the replacement ratio by the total width of the display interface to obtain the dividing point position; The first area is controlled to display the range from the left side of the display interface to the dividing point, and the second area is controlled to display the range from the dividing point to the right side of the display interface.
[0130] Optionally, the highlight style is a semi-transparent background, and the color of the semi-transparent background is a warm tone.
[0131] Optionally, the display interface further includes a third area located below and adjacent to the second area, used to display the newly generated speech-recognized text after optimization triggering and while speech acquisition is uninterrupted.
[0132] Optionally, the device further includes a boundary customization module, specifically used for: In response to the user's dragging operation on the boundary, the ranges of the first region and the second region are redefined based on the boundary position after dragging.
[0133] Optionally, the device further includes an optimized text output module, specifically used for: When the ratio of the length of the optimized text to the length of the original text reaches a preset threshold, all the acquired optimized text is organized into the final output, and the second region is controlled to disappear.
[0134] Optionally, the boundary between the first region and the second region does not depend on the character-level or word-level alignment between the optimized text and the original text, but is determined solely by the ratio of the length of the optimized text to the length of the original text.
[0135] The text optimization progressive replacement visualization device provided in this embodiment of the invention can execute the text optimization progressive replacement visualization method provided in this embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0136] According to embodiments of this disclosure, embodiments of the present invention also provide an electronic device, a readable storage medium, and a computer program product.
[0137] Figure 5 A schematic diagram of an electronic device 50 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0138] like Figure 5As shown, the electronic device 50 includes at least one processor 51 and a memory, such as a read-only memory (ROM) 52 and a random access memory (RAM) 53, communicatively connected to the at least one processor 51. The memory stores computer programs executable by the at least one processor. The processor 51 can perform various appropriate actions and processes based on the computer program stored in the ROM 52 or loaded from storage unit 58 into the RAM 53. The RAM 53 can also store various programs and data required for the operation of the electronic device 50. The processor 51, ROM 52, and RAM 53 are interconnected via a bus 54. An input / output (I / O) interface 55 is also connected to the bus 54.
[0139] Multiple components in electronic device 50 are connected to I / O interface 55, including: input unit 56, such as keyboard, mouse, etc.; output unit 57, such as various types of monitors, speakers, etc.; storage unit 58, such as disk, optical disk, etc.; and communication unit 59, such as network card, modem, wireless transceiver, etc. Communication unit 59 allows electronic device 50 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0140] Processor 51 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 51 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 51 performs the various methods and processes described above, such as a progressive replacement visualization method for text optimization.
[0141] In some embodiments, the text-optimized progressive replacement visualization method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 58. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 50 via ROM 52 and / or communication unit 59. When the computer program is loaded into RAM 53 and executed by processor 51, one or more steps of the text-optimized progressive replacement visualization method described above may be performed. Alternatively, in other embodiments, processor 51 may be configured to perform the text-optimized progressive replacement visualization method by any other suitable means (e.g., by means of firmware).
[0142] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0143] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0144] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0145] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0146] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0147] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product within the cloud computing service system to address the shortcomings of traditional physical hosts and virtual private servers, such as high management difficulty and weak business scalability.
[0148] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0149] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for visualizing a progressive replacement of text optimization, characterized in that, The method includes: Get the original text that is being optimized, and get the optimized text that the language processing service returns in a streaming manner; The optimized text that has been obtained is displayed in the first area of the display interface, and the remaining text in the original text that has not yet been optimized is displayed in the second area of the display interface. The first region is adjacent to the second region, and the boundary between the first region and the second region is determined by the ratio of the length of the optimized text to the length of the original text.
2. The method of claim 1, wherein, The optimized text in the first area is displayed in a standard text style, while the remaining text in the second area is displayed in a highlighted style that is visually distinguishable from the first area.
3. The method of claim 1, wherein, The first region and the second region are arranged vertically, and the boundary between the first region and the second region is determined as follows: The ratio of the length of the optimized text to the length of the original text is used as the replacement ratio; Multiply the replacement ratio by the total height of the display interface to obtain the dividing point position; The first area is controlled to display the range from the top of the display interface to the dividing point, and the second area is controlled to display the range from the dividing point to the bottom of the display interface.
4. The method of claim 1, wherein, The first region and the second region are arranged side by side, and the boundary between the first region and the second region is determined as follows: The ratio of the length of the optimized text to the length of the original text is used as the replacement ratio; Multiply the replacement ratio by the total width of the display interface to obtain the dividing point position; The first area is controlled to display the range from the left side of the display interface to the dividing point, and the second area is controlled to display the range from the dividing point to the right side of the display interface.
5. The method of claim 2, wherein, The highlighted style has a semi-transparent background, and the color of the semi-transparent background is a warm tone.
6. The method of claim 3, wherein, The display interface also includes a third area, which is located below and adjacent to the second area, and is used to display the newly generated speech recognition text after optimization triggering and during the process of uninterrupted speech acquisition.
7. The method of claim 1, wherein, The method further includes: In response to the user's dragging operation on the boundary, the ranges of the first region and the second region are redefined based on the boundary position after dragging.
8. The method of claim 1, wherein, The method further includes: When the ratio of the length of the optimized text to the length of the original text reaches a preset threshold, all the acquired optimized text is organized into the final output, and the second region is controlled to disappear.
9. The method of claim 1, wherein, The boundary between the first region and the second region does not depend on the character-level or word-level alignment between the optimized text and the original text, but is determined solely by the ratio of the length of the optimized text to the length of the original text.
10. An apparatus for visualizing a progressive replacement of text optimization, characterized in that, The device includes: The text acquisition module is used to acquire the original text that is the object of optimization, as well as the optimized text returned by the language processing service in a streaming manner. The text display module is used to display the acquired optimized text in a first area of the display interface, and at the same time display the remaining text in the original text that has not yet been optimized in a second area of the display interface; The first region is adjacent to the second region, and the boundary between the first region and the second region is determined by the ratio of the length of the optimized text to the length of the original text.
11. An electronic device, comprising: The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to perform the method of any one of claims 1-9.
13. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-9.