WO2018219261A1 - 文本重组方法、装置、终端设备及计算机可读存储介质 - Google Patents

文本重组方法、装置、终端设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2018219261A1
WO2018219261A1 PCT/CN2018/088789 CN2018088789W WO2018219261A1 WO 2018219261 A1 WO2018219261 A1 WO 2018219261A1 CN 2018088789 W CN2018088789 W CN 2018088789W WO 2018219261 A1 WO2018219261 A1 WO 2018219261A1
Authority
WO
WIPO (PCT)
Prior art keywords
semantic block
semantic
text
block
target
Prior art date
Application number
PCT/CN2018/088789
Other languages
English (en)
French (fr)
Inventor
阮闪闪
钱成
罗根
蔡元锋
李杨
王波
许耀峰
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2018219261A1 publication Critical patent/WO2018219261A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/237Lexical tools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0483Interaction with page-structured environments, e.g. book metaphor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04812Interaction techniques based on cursor appearance or behaviour, e.g. being affected by the presence of displayed objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04842Selection of displayed objects or displayed text elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures

Definitions

  • the present application relates to the field of word processing technologies, and in particular, to a text recombination method, apparatus, terminal, and readable storage medium.
  • terminal devices For a longer period of time, and more important information is obtained by terminal devices. Users also have the need to obtain important information from a certain piece of text that they like or a certain piece of chat content with friends. For example, in order to obtain important information from the chat content, it is usually implemented by selecting, copying, and pasting the chat content into the input box, and pasting the input box, deleting redundant characters, and appropriately adjusting the order of the words. Sequence and so on a series of operations. The operation process is complicated, it is prone to misoperation, and the user experience is not good.
  • the main purpose of the embodiments of the present application is to provide a text reorganization method, device, terminal device, and computer readable storage medium, which are intended to solve the complicated operation process of extracting important information from text in the prior art, and are prone to misoperations. Experience a poor technical problem.
  • a first aspect of the embodiments of the present application provides a text reorganization method, including:
  • the target semantic block and its arrangement order are determined, and the target semantic block is reorganized into new text and displayed according to the arrangement order.
  • a text reorganization device includes:
  • a first determining module configured to determine a text to be reorganized in response to a text selection operation on the display interface
  • a word segmentation module configured to perform word segmentation on the text to be reorganized, obtain a plurality of semantic blocks, and display the same;
  • a recombination module configured to recombine the target semantic block into new text according to the sorting order and display according to the determining target semantic block and its arrangement order in response to the reorganization operation of the semantic block.
  • a third aspect of the embodiments of the present application provides a terminal device, including: a memory, a processor, and a computer program stored on the memory and running on the processor, where the processor performs the In the case of a computer program, various steps in the text recombining method as provided by the first aspect of the embodiment of the present application are implemented.
  • a fourth aspect of the embodiments of the present application provides a computer readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the text provided by the first aspect of the embodiment of the present application is implemented. Refactoring the various steps of the method.
  • 1 is a structural block diagram of a terminal device
  • FIG. 2 is a schematic flowchart of a text reorganization method in an embodiment of the present application
  • FIG. 3 is another schematic flowchart of a text reorganization method according to an embodiment of the present application.
  • 4a is a schematic diagram of a display interface after word segmentation in the embodiment of the present application.
  • FIG. 4b is a schematic diagram of a display interface after performing a selection operation based on FIG. 4a;
  • FIG. 4c is a schematic diagram of a display interface after performing a cursor positioning operation based on FIG. 4b;
  • FIG. 4d is a schematic diagram of a display interface after performing a selection operation based on FIG. 4c;
  • FIG. 5 is a schematic flowchart of a method for adjusting a location of a target semantic block in an embodiment of the present application
  • Figure 6a is a schematic diagram of performing a drag operation based on Figure 4d;
  • Figure 6b is a schematic diagram of the drag operation after performing the drag operation based on Figure 6a;
  • FIG. 7 is another schematic flowchart of a text reorganization method according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a display interface response long press operation in an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of the refinement step of step 603 shown in FIG. 6 in the embodiment of the present application.
  • FIG. 10 is a schematic flowchart of a refinement step of step 604 shown in FIG. 6 in the embodiment of the present application;
  • FIG. 11 is a schematic structural diagram of a text reorganization apparatus according to an embodiment of the present application.
  • FIG. 12 is another schematic structural diagram of a text reorganization apparatus according to an embodiment of the present application.
  • FIG. 13 is another schematic structural diagram of a text reorganization apparatus according to an embodiment of the present application.
  • FIG. 1 is a schematic structural diagram of a terminal device 100.
  • the text reorganization method provided by the embodiment of the present application can be applied to the terminal device 100 shown in FIG. 1.
  • the terminal device 100 can include, but is not limited to, a smart phone or a notebook computer that needs to rely on a battery to maintain normal operation and supports network and download functions. , tablets, smart wearables, and more.
  • the terminal device 100 includes a memory 102, a memory controller 104, one or more (only one shown) processor 106, peripheral interface 108, radio frequency unit 110, button unit 112, and audio unit 114. And a display unit 116. These components communicate with one another via one or more communication bus/signal lines 122.
  • FIG. 1 is merely illustrative and does not limit the structure of the terminal device 100.
  • the terminal device 100 may further include more or less components than those shown in FIG. 1, or have a different configuration from that shown in FIG. 1.
  • the components shown in Figure 1 can be implemented in hardware, software, or a combination thereof.
  • the memory 102 can be used to store a computer program, such as the text reorganization method and the program instruction or module corresponding to the device in the embodiment of the present application.
  • a computer program such as the text reorganization method and the program instruction or module corresponding to the device in the embodiment of the present application.
  • the processor 106 executes the computer program stored in the memory 102, the following FIG. 2 and FIG. 3 are implemented. And the steps in the text recombination method shown in FIG.
  • Memory 102 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • memory 102 can further include memory remotely located relative to processor 106, which can be connected to terminal device 100 over a network. Access to the memory 102 by the processor 106 and other possible components can be performed under the control of the memory controller 104.
  • Peripheral interface 108 couples various input/input devices to processor 106 and memory 102.
  • the processor 106 runs various software, instructions within the memory 102 to perform various functions of the terminal device 100 and perform data processing.
  • peripheral interface 108, processor 106, and memory controller 104 can be implemented in a single chip. In other instances, they can be implemented by separate chips.
  • the radio frequency unit 110 is configured to receive and transmit electromagnetic waves, and realize mutual conversion between electromagnetic waves and electric signals, thereby communicating with a communication network or other devices.
  • the radio frequency unit 110 can include various existing circuit elements for performing these functions.
  • the button unit 112 provides an interface for the user to input to the terminal device 100, and the user can cause the terminal device 100 to perform different functions by pressing different buttons.
  • the audio unit 114 provides an audio interface to the user, which may include one or more microphones, one or more speakers, and audio circuitry.
  • the audio circuit receives sound data from the peripheral interface 108, converts the sound data into electrical information, and transmits the electrical information to the speaker.
  • the speaker converts the electrical information into sound waves that the human ear can hear.
  • the audio circuit also receives electrical information from the microphone, converts the electrical signal to sound data, and transmits the sound data to peripheral interface 108 for further processing. Audio data may be obtained from memory 102 or through radio frequency unit 110. In addition, the audio data may also be stored in the memory 102 or transmitted through the radio frequency unit 110.
  • audio unit 114 may also include a headphone jack for providing an audio interface to a headset or other device.
  • the display unit 116 provides an output interface between the terminal device 100 and the user.
  • display unit 116 displays video output to the user, the content of which may include text, graphics, video, and any combination thereof. Some output results correspond to some user interface objects.
  • an input interface is also provided between the terminal device 100 and the user for receiving user input, such as user's click, slide, and the like, so that the user interface object responds to the input of the user.
  • the technique of detecting user input can be based on resistive, capacitive or any other possible touch detection technique.
  • the embodiment of the present application proposes a text recombination method, which obtains a plurality of semantic blocks by performing word segmentation processing on a text, and recombines important information in the semantic block by a reorganization operation to obtain a new text.
  • a text recombination method which obtains a plurality of semantic blocks by performing word segmentation processing on a text, and recombines important information in the semantic block by a reorganization operation to obtain a new text.
  • FIG. 2 is a schematic flowchart of a text reorganization method in an embodiment of the present application, where the method includes:
  • Step 201 Determine a text to be reorganized in response to a text selection operation on the display interface.
  • the text reorganization method may be implemented by a text reorganization device (hereinafter referred to as a reorganization device), and the reorganization device may be a program instruction or a module in the terminal device shown in FIG.
  • a reorganization device a text reorganization device
  • the reorganization device may be a program instruction or a module in the terminal device shown in FIG.
  • the text reorganization method described above can be used in various scenarios, for example, in a scenario where a user chats with an instant messaging application, a user views a news, reads a book, watches a short message, and the like.
  • the user may trigger the text reorganization method by using a text selection operation, and the reorganization device determines the text to be reorganized in response to the text selection operation when detecting that the user performs a text selection operation on the display interface.
  • the text to be reorganized is different.
  • the text to be reorganized may be one or more pieces of chat content.
  • the text to be reorganized may be All the content displayed on the current page, or a certain piece of content, can be set in the actual application according to the specific scene, which is not limited herein.
  • Step 202 Perform word segmentation processing on the reorganized text to obtain a plurality of semantic blocks and display them;
  • the recombining device performs word segmentation processing on the text to be reorganized to obtain a plurality of semantic blocks and display them.
  • the semantic block is a combination of words with semantics, which can be a word or a phrase.
  • semantics can be a word or a phrase.
  • the phrase "mouse” is a semantic block.
  • Step 203 Respond to the reorganization operation of the semantic block, determine the target semantic block and its arrangement order, reorganize the target semantic block into new text and display according to the arrangement order.
  • the user may select a semantic block for reorganization, and may also perform a series of reorganization operations such as deletion of the semantic block and position adjustment, and the reorganization device
  • the target semantic block is displayed in the order of the target semantic blocks determined by the reorganization operation, to be reorganized into new text, so that the user only needs to select the semantic block belonging to the important information.
  • determining the text to be reorganized in response to the text selection operation on the display interface, determining the text to be reorganized, performing word segmentation processing on the text to be reorganized, obtaining a plurality of semantic blocks and displaying, in response to the reorganization operation on the semantic block, according to the The order of the target semantic blocks determined by the reorganization operation displays the target semantic blocks to be reorganized into new text.
  • a plurality of semantic blocks are obtained by word segmentation processing, and important information in the semantic block is recombined by means of recombination operation to obtain a new text, so that a new text is obtained.
  • important information in the text can be obtained without the operations of selecting, copying, pasting, and deleting redundancy, the operation is simpler, the probability of misoperation is reduced, and the user experience is effectively improved.
  • the display interface may be divided into a first display area and a second display area, and the two display areas may be arranged in a horizontal juxtaposition manner, or may be arranged in a longitudinally juxtaposed manner.
  • the first display area is used to display a plurality of semantic blocks obtained by the word segmentation process.
  • FIG. 3 is another schematic flowchart of a text reorganization method according to an embodiment of the present application, where the method includes:
  • Step 301 Determine a text to be reorganized in response to a text selection operation on the display interface.
  • Step 302 Perform word segmentation processing on the reorganized text to obtain a plurality of semantic blocks and display them in the first display area.
  • Step 303 In response to the selecting operation of the semantic block in the first display area, using the selected semantic block as the target semantic block, and displaying the target semantics in the second display area according to the selection order of the target semantic block or the location of the cursor. Piece.
  • the user may perform a reorganization operation on the displayed semantic block, where the reorganization operation includes selecting a target semantic block for reorganization, and deleting the Select the target semantic block, change the position of the target semantic block in the new text, and so on.
  • the user may perform a selection operation on the semantic block in the first display area, and the recombining device will respond to the selection operation, using the selected semantic block as the target semantic block, and in the second display area according to the selection order of the target semantic block.
  • the target semantic block is displayed inside.
  • the selection operation may be a click operation. If the terminal device is a non-touch device, the click operation may be implemented by a mouse click. If the terminal device is a touch device, the click operation may be implemented by a mouse click or a touch click operation. For example, when the recombining device detects that the user performs a click operation on the semantic block A in the first display area, the semantic block A is taken as the target semantic block, and the semantic block is displayed behind the existing target semantic block in the second display area. A.
  • the reassembly device detects that the user performs a click operation on the semantic block B in the first display area, the semantic block B is taken as the target semantic block, and the semantic block B is displayed behind the semantic block A in the second display area. That is, the newly selected target semantic block is arranged behind the existing target semantic block. It can be understood that, in the embodiment of the present application, the user can perform multiple selection operations on the same semantic block.
  • FIG. 4a is a schematic diagram of a display interface after word segmentation in the embodiment of the present application.
  • the text to be reorganized is “We are already friends, chat together!”, obtained after the text segmentation process to be reorganized
  • the semantic blocks are "we”, “already”, “yes”, “friends”, “la”, “,”, “together”, “chat”, "bar”, "! and "”.
  • the area displayed by the semantic block is the first display area, and the area below the horizontal line is the second display area.
  • FIG. 4b a schematic diagram of a display interface after performing a selection operation based on FIG. 4a in the embodiment of the present application.
  • a user performs a selection operation on a semantic block “friend” in the first display area, and the target semantic block is performed.
  • the "friends” are displayed in the second display area, and then the user performs a selection operation "together” with the semantic blocks within the first display area, and the target semantic blocks "together” are displayed in the second display area.
  • the display will be performed in the order of the selection target semantic block, and if the user uses the cursor, the user is detected to perform the cursor positioning operation. Then, in response to the cursor positioning operation, the cursor is displayed in the second display area, and after the user performs the selection operation, the selected target semantic block is displayed at the position where the cursor is located, so as to achieve the target semantics by cursor positioning. Insertion of the block.
  • the cursor positioning operation may be clicking a target semantic block in the second display area, so that the cursor is positioned in front of the target semantic block. Please refer to FIG.
  • FIG. 4c is a schematic diagram of a display interface after performing a cursor positioning operation based on FIG. 4b in the embodiment of the present application.
  • the user clicks “together” to be between the target semantic blocks “friend” and “together”.
  • FIG. 4d a schematic diagram of a display interface after performing a selection operation based on FIG. 4c in the embodiment of the present application.
  • the target semantic block displayed in the second display area includes a deletion mark, wherein the delete mark may have a plurality of different forms when displayed, and It can be located in different orientations or angles of the semantic block.
  • the deletion mark of the target semantic block in the second display area is a circle in the upper right corner of the target semantic block, and the circle contains "-". It is to be understood that FIG. 4b is only a schematic diagram that is feasible, and does not limit the technical solution of the embodiments of the present application.
  • Step 304 In response to a click operation on the delete flag of the target semantic block in the second display area, delete the specified target semantic block according to the click operation.
  • the recombining device deletes the specified target semantic block according to the click operation in response to the click operation, for example, if the user deletes the target semantic block C
  • the target semantic block C in the second display area is deleted.
  • FIG. 5 it is a schematic flowchart of a method for adjusting a location of a target semantic block in the embodiment of the present application, where the method includes:
  • Step 501 Determine, according to the drag operation of the target semantic block in the second display area, the insertable position of the target semantic block based on the real-time position of the target semantic block dragged by the drag operation, and display the target in the insertable position.
  • Step 502 When it is detected that the drag operation ends, determine whether the overlapping area of the target semantic block and the virtual semantic block is greater than or equal to a preset value;
  • Step 503 If the value is greater than or equal to the preset value, replace the virtual semantic block with the target semantic block;
  • Step 504 If less than the preset value, cancel the display of the virtual semantic block, and restore the target semantic block to the previous position for display.
  • the user may further adjust the positional relationship between the target semantic blocks. It can be understood that the positional relationship of the target semantic block also represents the target. The order of the semantic blocks and the change of the positional relationship indicate that the new text obtained by the reorganization will also change.
  • the real-time position of the target semantic block dragged based on the drag operation displays the virtual semantic block of the dragged target semantic block, specifically, the user is executing
  • the target semantic block dragged by the drag operation will move as the drag operation moves, and in the process of dragging the target semantic block, the recombining device will also be based on the target semantic block in real time.
  • the real-time location determines that the location of the target semantic block can be inserted in the preset area centered on the real-time location, and the virtual semantic block is displayed at all positions where the target semantic block can be inserted, so that the user can better drag the target.
  • the position at which the semantic block needs to be inserted wherein the position at which the target semantic block can be inserted may be the front and rear orientations of the target semantic block.
  • the target semantic blocks "together” in Figure 4d are located after the target semantic block "chat”. If you need to adjust "together” between “friend” and “chat", you can drag "together", at this time, the virtual display block of "together” will be displayed in the second display area, see Figure 6a, A schematic diagram of performing a drag operation based on FIG. 4d in the embodiment of the present application.
  • the drag operation ends, it is determined whether the overlap area of the dragged target semantic block and the virtual semantic block is greater than or equal to a preset value, and the preset value may be an area displayed by the target semantic block.
  • the preset ratio of the size indicates that the user drags the target semantic block to the position of the virtual semantic block, and the virtual semantic block is replaced by the target semantic block.
  • FIG. 6b which is the present application.
  • the target semantic block after the drag operation is performed based on FIG. 6a, as shown in FIG. 6b, the target semantic block "replaces" its virtual semantic block, and the position adjustment is completed.
  • the display of the virtual semantic block is canceled, and the dragged target semantic block is restored to the previous position, where the previous target position is the target semantic block to be dragged before the drag operation is performed.
  • the position for example, if the user ends the drag operation in Fig. 6a, the content displayed in the second display area will be restored to Fig. 4d.
  • step 303 is for the selection of the target semantic block
  • step 304 is for the deletion of the target semantic block
  • steps 501 to 505 are for the position adjustment of the target semantic block.
  • the selection and deletion are not limited.
  • the sequential relationship between the position adjustments, in the case that the target semantic block exists in the second display area, the user may perform any one or more of the above selection, deletion, and position adjustment based on the need thereof, and the plurality of The operations are also independent of each other.
  • the user may perform text reorganization by selecting, deleting, and adjusting the position, and operating It is simple and convenient, it is not easy to cause misoperation, and the user experience is good.
  • FIG. 7 is a schematic flowchart diagram of a text reorganization method according to an embodiment of the present application, where the method includes:
  • Step 701 Determine a selected text in response to a long press operation of the display interface, and display a function item;
  • Step 702 Determine, in response to the selecting operation of the reorganization item in the function item, the selected text as the text to be reorganized;
  • Step 703 Scan a text to be reorganized by using a preset dictionary, and construct a set of all possible directed acyclic graphs of the text to be reorganized based on the scanned semantic block.
  • Step 704 Select a directed acyclic graph that satisfies a preset condition from the set by using a probability of inversely comparing the semantic blocks, and display the semantic block in the selected directed acyclic graph;
  • Step 705 In response to the reorganization operation of the semantic block, display the target semantic block according to the arrangement order of the target semantic blocks determined by the reorganization operation, to be reorganized into new text.
  • the user may trigger the text reorganization method by a specific operation.
  • the user may perform a long press operation on the text on the display interface, and the reorganizing device will respond to the long press operation to determine the selected text and display the function.
  • FIG. 8 is a schematic diagram of a display interface response long press operation in the embodiment of the present application.
  • Display function items including: copy, forward, edit, save, and withdraw.
  • the editing function item is a reorganization item, and the reorganization device can determine that the selected text is the text to be reorganized in response to the selection operation of the editing (reorganization item) in the function item.
  • the long-pressing operation and the selecting operation can effectively trigger the text recombination process, and the triggering effect is better when the text is pressed against the large area of the finger, which depends on the sensitivity of the touch screen and the large-area pressing.
  • a dictionary is stored locally, wherein the dictionary is stored in the form of an offline package, and the offline package is automatically updated in the background every time the user logs in, which saves the user from frequently updating the application.
  • the dictionary contains a large number of records, and each row of records contains at least the frequency of the semantic block and the semantic block, and may also include the part of speech of the semantic block.
  • the frequency of the semantic block is obtained by counting the number of times the semantic block is used, and the frequency can be used to calculate the probability of the semantic block, and the probability of the semantic block is equal to the sum of the frequency and the frequency of all the semantic blocks in the dictionary.
  • the recombining device scans the text to be reorganized by using the above dictionary, and constructs a set of all possible directed acyclic graphs of the text to be reorganized based on the scanned semantic block, wherein the node in the directed acyclic graph It is a semantic block whose direction is the order of the semantic blocks in the text to be reorganized.
  • the set of directed acyclic graphs includes: I ⁇ people ⁇ big ⁇ general ⁇ lower ⁇ noon ⁇ 2 ⁇ point ⁇ left ⁇ right ⁇ out ⁇ send; We ⁇ probably ⁇ afternoon ⁇ 2 ⁇ point ⁇ left ⁇ right ⁇ departure; we ⁇ approximate ⁇ afternoon ⁇ 2 points ⁇ left and right ⁇ departure.
  • the recombining device selects the directed acyclic graph that satisfies the preset condition from the set by using the probability of inversely comparing the semantic blocks, and displays the semantic blocks in the selected directed acyclic graph.
  • the recombining device scans the to-be-reorganized text by using a pre-set dictionary, and constructs a set of all possible directed acyclic graphs of the text to be reorganized, and compares the probability of the semantic block from the set by inversely comparing
  • the directed acyclic graph that satisfies the preset condition is selected, and the selected directed acyclic graph is displayed, so that the word segmentation processing can be effectively implemented, and the accuracy and performance of the word segmentation are improved.
  • FIG. 9 is a schematic flowchart of the refinement step of step 703 shown in FIG. 7 in the embodiment of the present application.
  • the step 703 includes:
  • Step 901 Call a regular expression to scan the text to be reorganized, and use the scanned word or phrase to match the semantic block in the dictionary;
  • a regular expression is a logical formula for text manipulation, using a set of words or phrases set in advance to form a "rule string", which is used to express a filtering logic for the text to be reorganized.
  • Step 902 If yes, divide the word or phrase into semantic blocks of the first category, and calculate the probability of the semantic block of the first category by using the frequency of the semantic block matching the word or the phrase;
  • Step 903 If it is not matched, and the language type of the word or phrase is inconsistent with the language type of the dictionary, determine that the word or phrase is a semantic block of the second category, and calculate the second category by using the Viterbi algorithm in the Markov model. The probability of a semantic block;
  • Step 904 Construct all possible directed acyclic graphs according to the positions of the semantic blocks of the first category and/or the semantic blocks of the second category in the text to be reorganized, and obtain an initial set of directed acyclic graphs.
  • the reorganization device will call the regular expression to scan the text to be reorganized, and use the scanned word or phrase to match the semantic block in the dictionary, for example, if the scanned word is “ I”, use "I” to match the semantic blocks in the dictionary to determine whether the dictionary contains the semantic block of the word "I".
  • the word or phrase is a semantic block
  • the word or phrase is determined to be a semantic block of the first category
  • the first category refers to a category of a language type of the dictionary, for example, if the dictionary is In the Chinese character dictionary, the first category is Chinese characters, and if the dictionary is an English dictionary, the first category is English.
  • the recombining device will also calculate the probability by using the frequency of the matched semantic block. For example, if the word "I" in the text to be reorganized matches in the dictionary, it indicates that "I" is semantic. Block, the probability of using the frequency of "I" in the dictionary will be used.
  • the second category refers to a category different from the first category, for example, if the first category is a Chinese character, the second category is English, numbers, symbols, and the like.
  • the probability of the semantic block of the second category will be calculated using the Viterbi algorithm in the Markov model. For example, if the phrase "friend" is not matched in the Chinese character dictionary, it indicates that the phrase is not a semantic block.
  • the recombining device can obtain all the semantic blocks in the text to be recombined, and the probability of each semantic block. And further, constructing all possible directed acyclic graphs by using all the semantic blocks in the text to be reorganized, including the semantic blocks of the first category and/or the semantic blocks of the second category in the text to be reorganized, The initial set of directed acyclic graphs.
  • an initial set of directed acyclic graphs of the text to be reorganized can be obtained by the above manner, so as to select a directed acyclic graph that satisfies the preset condition, and display the result as the final word segmentation of the text to be reorganized.
  • step 704 includes:
  • Step 1001 Compare a probability of a semantic block of the i-th node that is inverse to the acyclic graph in the mth set;
  • Step 1002 If the probability of only one semantic block is the largest among the semantic blocks of the inverse i-th node, determining the directed acyclic graph where the semantic block with the highest probability is located is a directed acyclic graph satisfying the preset condition. ;
  • a directed acyclic graph that satisfies the preset condition is selected from the initial set. Since the selection process involves loops and is implemented by gradually reducing the set of directed acyclic graphs, for the convenience of description, the initial set is taken as the first set, and the numbers i and m, i and The initial value of m is 1 and is a positive integer. First, the probability of the semantic block of the i-th node in the inverse of the directed acyclic graph in the mth set is compared, that is, the semantic block of the last node is compared.
  • the directed acyclic graph in the mth set If for the directed acyclic graph in the mth set, the probability of only one semantic block in the semantic block of the inverse i-th node is the largest, then the directed acyclic graph in which the semantic block with the highest probability is located is determined.
  • the semantic block included in the directed acyclic graph is the semantic block after the final word segmentation.
  • the probability of at least two semantic blocks in the semantic block of the inverse i-th node is the largest, then the at least two semantic blocks with the highest probability are respectively located.
  • the acyclic graph is used as the m+1th set. For example, for the third set containing 5 directed acyclic graphs, when comparing the semantic blocks of the inverse second node, the semantic block of the reverse second node In the case where three semantic blocks have the same probability and the largest, the directed acyclic graph in which the three semantic blocks are respectively formed constitutes the fourth set.
  • a directed acyclic graph that satisfies a preset condition in the directed acyclic graph set can be found to implement an optimal word segmentation process.
  • FIG. 11 is a schematic structural diagram of a text reorganization apparatus according to an embodiment of the present application, where the apparatus includes:
  • a first determining module 1101 configured to determine a text to be reorganized in response to a text selection operation on the display interface
  • a word segmentation module 1102 configured to perform word segmentation processing on the reorganized text, obtain a plurality of semantic blocks and display;
  • the reorganization module 1103 is configured to display the target semantic block in order of reorganization of the semantic block according to the reorganization operation of the semantic block to reorganize into new text.
  • determining the text to be reorganized in response to the text selection operation on the display interface, determining the text to be reorganized, performing word segmentation processing on the text to be reorganized, obtaining a plurality of semantic blocks and displaying, in response to the reorganization operation on the semantic block, according to the The order of the target semantic blocks determined by the reorganization operation displays the target semantic blocks to be reorganized into new text.
  • a plurality of semantic blocks are obtained by word segmentation processing, and important information in the semantic block is recombined by means of recombination operation to obtain a new text, so that a new text is obtained.
  • important information in the text can be obtained without the operations of selecting, copying, pasting, and deleting redundancy, the operation is simpler, the probability of misoperation is reduced, and the user experience is effectively improved.
  • the display interface may be divided into a first display area and a second display area, and the two display areas may be arranged in a horizontal juxtaposition manner, or may be arranged in a longitudinally juxtaposed manner.
  • the first display area is used to display a plurality of semantic blocks obtained by the word segmentation process.
  • FIG. 12 is another schematic structural diagram of a text reorganization apparatus according to an embodiment of the present application, including: a first determining module 1101, a word segmentation module 1102, and a display reassembly module 1103 in the embodiment shown in FIG. 11, and FIG.
  • the content described in the illustrated embodiment is similar and will not be described here.
  • the display reorganization module 1103 includes:
  • the selection display module 1201 is configured to respond to the selection operation of the semantic block in the first display area, select the selected semantic block as the target semantic block, and follow the selection order of the target semantic block or the location of the cursor in the second display area.
  • the target semantic block is displayed inside.
  • the target semantic block displayed in the second display area includes a deletion mark
  • the display reorganization module 1103 further includes:
  • the deleting module 1202 is configured to delete the specified target semantic block according to a click operation in response to a click operation on the deletion mark of the target semantic block in the second display area.
  • the display reorganization module 1103 further includes:
  • the determining module 1204 is configured to determine, when the drag operation ends, whether the overlapping area of the target semantic block and the virtual semantic block is greater than or equal to a preset value
  • the replacement module 1205 is configured to replace the virtual semantic block with the target semantic block if the value is greater than or equal to the preset value;
  • the canceling restoration module 1206 is configured to cancel the display of the virtual semantic block if less than the preset value, and restore the target semantic block to the previous position, where the previous location refers to the location where the target semantic block is located before the drag operation is performed.
  • the user may perform text reorganization by selecting, deleting, and adjusting the position, and operating It is simple and convenient, it is not easy to cause misoperation, and the user experience is good.
  • FIG. 13 is another schematic structural diagram of a text reorganization apparatus according to an embodiment of the present application, including:
  • the first determining module 1101, the word segmentation module 1102, and the display reorganization module 1103 in the embodiment shown in FIG. 11 are similar to those described in the embodiment shown in FIG. 11, and are not described herein.
  • the first determining module 1101 includes:
  • the second determining module 1302 is configured to determine, according to the selecting operation of the reorganization item in the function item, the selected text as the text to be reorganized.
  • the word segmentation module 1102 includes:
  • a scan construction module 1303, configured to scan a text to be reorganized by using a preset dictionary, and construct a set of all possible directed acyclic graphs of the text to be reorganized based on the scanned semantic block;
  • the selecting module 1304 is configured to select a directed acyclic graph that satisfies a preset condition from the set by using a probability of inversely comparing the semantic blocks, and display a semantic block in the selected directed acyclic graph, wherein the probability of the semantic block is based on The frequency of the semantic block is obtained in the dictionary.
  • the dictionary includes the frequency of the semantic block and the semantic block
  • the scan building module 1303 is specifically configured to:
  • the word or phrase is divided into semantic blocks of the first category, and the probability of the semantic block of the first category is calculated using the frequency of the semantic block matching the word or phrase;
  • the word or phrase is determined to be a semantic block of the second category, and the dimensional block of the second category is calculated by using the Viterbi algorithm in the Markov model. The probability;
  • the selection module 1304 is specifically configured to:
  • the directed acyclic graph in which the semantic block with the largest probability is determined is a directed acyclic graph satisfying the preset condition
  • the recombining device scans the to-be-reorganized text by using a pre-set dictionary, and constructs a set of all possible directed acyclic graphs of the text to be reorganized, and compares the probability of the semantic block from the set by inversely comparing
  • the directed acyclic graph that satisfies the preset condition is selected, and the selected directed acyclic graph is displayed, so that the word segmentation processing can be effectively implemented, and the accuracy and performance of the word segmentation are improved.
  • the recombining device can obtain all the semantic blocks in the text to be recombined, and the probability of each semantic block.
  • the text reorganization device shown in FIG. 11 to FIG. 13 can be applied to the terminal device shown in FIG. 1 for implementing the text recombination method in the foregoing embodiment.
  • the embodiment of the present application further provides a computer readable storage medium, where a computer program is stored thereon, and when the computer program is executed by the processor, the text recombining method in the foregoing embodiment is implemented.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the modules is only a logical function division.
  • there may be another division manner for example, multiple modules or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or module, and may be electrical, mechanical or otherwise.
  • the modules described as separate components may or may not be physically separated.
  • the components displayed as modules may or may not be physical modules, that is, may be located in one place, or may be distributed to multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules if implemented in the form of software functional modules and sold or used as separate products, may be stored in a computer readable storage medium.
  • the medium includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • User Interface Of Digital Computer (AREA)
  • Machine Translation (AREA)

Abstract

本申请实施例公开了一种文本重组方法、装置、终端设备及计算机可读存储介质,方法包括:响应于显示界面上的文本选择操作,确定待重组文本,对该待重组文本进行分词处理,得到多个语义块并显示,响应于对语义块的重组操作,确定目标语义块及其排列顺序,根据所述排列顺序将所述目标语义块重组为新的文本并显示。

Description

文本重组方法、装置、终端设备及计算机可读存储介质
本申请要求于2017年6月1日提交中国专利局、申请号为201710403566.2、申请名称为“文本重组方法、装置、终端设备及计算机可读存储介质”的中国专利申请的优先权。
技术领域
本申请涉及文字处理技术领域,尤其涉及一种文本重组方法、装置、终端及可读存储介质。
发明背景
随着科技的发展,用户使用终端设备的时间越来越长,终端设备获得的重要信息也越多,用户也具有从喜欢的某段文字或与朋友的某段聊天内容中获得重要信息的需求,以从聊天内容中获得重要信息为例,目前通常是通过以下方式实现:对聊天内容进行选择、复制、粘贴到输入框,且粘贴到输入框之后,删除冗余文字,适当调整词语的先后顺序等等一系列的操作。操作过程复杂,容易出现误操作,用户体验不佳。
发明内容
本申请实施例的主要目的在于提供一种文本重组方法、装置、终端设备及计算机可读存储介质,旨在解决现有技术中从文本中提取重要信息的操作过程复杂,容易出现误操作,用户体验不佳的技术问题。
为实现上述目的,本申请实施例第一方面提供一种文本重组方法,包括:
响应于显示界面上的文本选择操作,确定待重组文本;
对所述待重组文本进行分词处理,得到多个语义块并显示;
响应于对所述语义块的重组操作,确定目标语义块及其排列顺序,根据所述排列顺序将所述目标语义块重组为新的文本并显示。
为实现上述目的,本申请实施例第二方面一种文本重组装置,包括:
第一确定模块,用于响应于显示界面上的文本选择操作,确定待重组文本;
分词模块,用于对所述待重组文本进行分词处理,得到多个语义块并显示;
显示重组模块,用于响应于对所述语义块的重组操作,按确定目标语义块及其排列顺序,根据所述排列顺序将所述目标语义块重组为新的文本并显示。
为实现上述目的,本申请实施例第三方面提供一种终端设备,包括:存储器、处理器及存储在所述存储器上且在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如本申请实施例第一方面提供的文本重组方法中的各个步骤。
为实现上述目的,本申请实施例第四方面提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时,实现如本申请实施例第一方面提供的文本重组方法的各个步骤。
附图简要说明
为了更清楚的说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来说,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。其中,
图1为一种终端设备的结构框图;
图2为本申请实施例中文本重组方法的流程示意图;
图3为本申请实施例中文本重组方法的另一流程示意图;
图4a为本申请实施例中分词处理后显示界面的示意图;
图4b为基于图4a执行选择操作后的显示界面的示意图;
图4c为基于图4b执行光标定位操作后的显示界面的示意图;
图4d为基于图4c执行选择操作后的显示界面的示意图;
图5为本申请实施例中对目标语义块的位置进行调整的方法的流程示意图;
图6a为基于图4d执行拖动操作的示意图;
图6b为基于图6a执行完拖动操作后的示意图;
图7为本申请实施例中文本重组方法的另一流程示意图;
图8为本申请实施例中显示界面响应长按操作的示意图;
图9为本申请实施例中图6所示步骤603的细化步骤的流程示意图;
图10为本申请实施例中图6所示步骤604的细化步骤的流程示意图;
图11为本申请实施例中文本重组装置的结构示意图;
图12为本申请实施例中文本重组装置的另一结构示意图;
图13为本申请实施例中文本重组装置的另一结构示意图。
实施方式
为使得本申请的发明目的、特征、优点能够更加的明显和易懂,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而非全部实施例。基于本申请中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
请参阅图1,图1为一种终端设备100的结构示意图。本申请实施例提供的文本重组方法可应用于如图1所示的终端设备100中,终端设备100可以但不限于包括:需依靠电池维持正常运行且支持网络及下载功能的智能手机、笔记本电脑、平板电脑、智能穿戴设备等等。
如图1所示,终端设备100包括存储器102、存储控制器104,一个或多个(图中仅示出一个)处理器106、外设接口108、射频单元110、按键单元112、音频单元114以及显示单元116。这些组件通过一条或多条通讯总线/信号线122相互通讯。
可以理解,图1所示的结构仅为示意,其并不对终端设备100的结构造成限定。例如,终端设备100还可包括比图1所示更多或者更少的组件,或者具有与图1所示不同的配置。图1所示的各组件可以采用硬件、软件或其组合实现。
存储器102可用于存储计算机程序,如本申请实施例中的文本重组方法及装置对应的程序指令或模块,处理器106在执行存储在存储器102内的计算机程序时,实现下述图2、图3及图7所示的文本重组方法中的各个步骤。
存储器102,即计算机可读存储介质,可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器102可进一步包括相对于处理器106远程设置的存储器,这些远程存储器可以通过网络连接至终端设备100。处理器106以及其他可能的组件对存储器102的访问可在存储控制器104的控制下进行。
外设接口108将各种输入/输入装置耦合至处理器106以及存储器102。处理器106运行存储器102内的各种软件、指令以执行终端设备100的各种功能以及进行数据处理。
在一些实例中,外设接口108,处理器106以及存储控制器104可以在单个芯片中实现。在其他一些实例中,他们可以分别由独立的芯片实现。
射频单元110用于接收以及发送电磁波,实现电磁波与电信号的相互转换,从而与通讯网络或者其他设备进行通讯。射频单元110可包括各种现有的用于执行这些功能的电路元件。按键单元112提供用户向终端设备100进行输入的接口,用户可以通过按下不同的按键以使终端设备100执行不同的功能。
音频单元114向用户提供音频接口,其可包括一个或多个麦克风、一个或者多个扬声器以及音频电路。音频电路从外设接口108处接收声音数据,将声音数据转换为电信息,将电信息传输至扬声器。扬声器将电信息转换为人耳能听到的声波。音频电路还从麦克风处接收电信息,将电信号转换为声音数据,并将声音数据传输至外设接口108中以进行进一步的处理。音频数据可以从存储器102处或者通过射频单元110获取。此外,音频数据也可以存储至存储器102中或者通过射频单元110进行发送。在一些实例中,音频单元114还可包括一个耳机播孔,用于向耳机或者其他设备提供音频接口。
显示单元116在终端设备100与用户之间提供一个输出界面。具体地,显示单元116向用户显示视频输出,这些视频输出的内容可包括文字、图形、视频、及其任意组合。一些输出结果是对应于一些用户界面对象。进一步地,还在终端设备100与用户之间提供一个输入界面,用于接收用户的输入,例如用户的点击、滑动等手势操作,以便用户界面对象对这些用户的输入做出响应。检测用户输入的技术可以是基于电阻式、电容式或者其他任意可能的触控检测技术。
由于现有技术中从文本中提取重要信息的操作过程复杂、容易出现 误操作,用户体验不佳的技术问题。
为了解决上述问题,本申请实施例提出一种文本重组方法,通过将文本进行分词处理得到多个语义块,及通过重组操作的方式对语义块中的重要信息进行重新组合,得到新的文本,使得通过语义块重组的方式就能够得到文本中的重要信息,而不需要通过选择、复制、粘贴、删除冗余等操作,操作更加简便,且降低误操作的概率,有效改善用户体验。
请参阅图2,为本申请实施例中文本重组方法的流程示意图,该方法包括:
步骤201、响应于显示界面上的文本选择操作,确定待重组文本;
在本申请实施例中,上述文本重组方法可以通过文本重组装置(以下简称为:重组装置)实现,该重组装置可以为图1所示终端设备中的程序指令或模块。
其中,上述的文本重组方法可以在多种场景下使用,例如,可以应用在用户利用即时通讯应用程序聊天的场景、用户看新闻、看书、看短信等等场景。
其中,用户可以通过文本选择操作触发该文本重组方法,且重组装置在检测到用户在显示界面上执行文本选择操作时,响应于该文本选择操作,确定待重组文本。可以理解的是,在不同场景下,该待重组文本是有差别的,例如,在聊天场景下,该待重组文本可以是一条或多条聊天内容,在看书场景下,该待重组文本可以是当前页面显示的所有内容,或者是某一段内容,在实际应用中可以按照具体的场景设定待重组文本,此处不做限定。
步骤202、对待重组文本进行分词处理,得到多个语义块并显示;
在本申请实施例中,重组装置将该待重组文本进行分词处理,得到多个语义块并显示。
其中,语义块是具有语义的一个文字组合,可以是一个词,也可以是一个词组,例如,“鼠标”这个词组就是一个语义块。
步骤203、响应于对语义块的重组操作,确定目标语义块及其排列顺序,按照排列顺序将目标语义块重组为新的文本并显示。
在本申请实施例中,显示界面上显示分词处理后的多个语义块后,用户可以选择进行重组的语义块,且还可以执行语义块的删除、位置调整等一系列的重组操作,重组装置在检测到重组操作之后,将响应于语义块的重组操作,按照重组操作确定的目标语义块的排列顺序显示目标语义块,以重组为新的文本,使得用户仅需要选择属于重要信息的语义块进行重组,就能够得到所需要的重要信息。
在本申请实施例中,响应于显示界面上的文本选择操作,确定待重组文本,对该待重组文本进行分词处理,得到多个语义块并显示,响应于对语义块的重组操作,按照该重组操作确定的目标语义块的排列顺序显示目标语义块,以重组为新的文本。相对于现有技术,本申请实施例中的技术方案中通过将文本进行分词处理得到多个语义块,及通过重组操作的方式对语义块中的重要信息进行重新组合,得到新的文本,使得通过语义块重组的方式就能够得到文本中的重要信息,而不需要通过选择、复制、粘贴、删除冗余等操作,操作更加简便,且降低误操作的概率,有效改善用户体验。
在本申请实施例中,为了方便操作,可以将显示界面划分为第一显示区域和第二显示区域,且该两个显示区域可以通过横向并列的方式排列,也可以通过纵向并列的方式排列。其中,该第一显示区域用于显示分词处理得到的多个语义块。
请参阅图3,为本申请实施例中文本重组方法的另一流程示意图,该方法包括:
步骤301、响应于显示界面上的文本选择操作,确定待重组文本;
步骤302、对待重组文本进行分词处理,得到多个语义块并在第一显示区域内显示;
步骤303、响应于对第一显示区域内的语义块的选择操作,将选择的语义块作为目标语义块,并按照对目标语义块的选择顺序或光标所在位置在第二显示区域内显示目标语义块。
在本申请实施例中,在第一显示区域内显示待重组文本的多个语义块之后,用户可以对显示的语义块执行重组操作,该重组操作包括选择用于重组的目标语义块,删除已选择的目标语义块,改变目标语义块在新的文本中的位置等等。
其中,用户可对第一显示区域内的语义块执行选择操作,重组装置将响应于该选择操作,将选择的语义块作为目标语义块,并按照对目标语义块的选择顺序在第二显示区域内显示目标语义块。其中选择操作可以是点击操作,若终端设备为非触摸设备,该点击操作可以通过鼠标单击实现,若终端设备为触摸设备,则该点击操作可以通过鼠标点击实现,或者触摸点击操作实现。例如,重组装置在检测到用户对第一显示区域内的语义块A执行点击操作,则将语义块A作为目标语义块,并在第二显示区域内已有的目标语义块的后面显示语义块A,若重组装置接着检测到用户对第一显示区域内的语义块B执行点击操作,则将语义块B作为目标语义块,并在第二显示区域中语义块A的后面显示语义块B。即新选择的目标语义块排列在已有的目标语义块的后面。可以理解的是,在本申请实施例,用户可以对同一个语义块执行多次的选择操作。
请参阅图4a,为本申请实施例中分词处理后显示界面的示意图,在图4a中,待重组文本为“我们已经是好友啦,一起聊天吧!”,该待重组文本分词处理后得到的语义块分别是“我们”、“已经”、“是”、“好 友”、“啦”,“,”、“一起”、“聊天”、“吧”、“!”及“”。且上述语义块显示的区域即为第一显示区域,横线下方的区域即为第二显示区域。
请参阅图4b,为本申请实施例中基于图4a执行选择操作后的显示界面的示意图,在图4b中,用户对第一显示区域中的语义块“好友”执行选择操作,则目标语义块“好友”在第二显示区域内显示,且接着用户对第一显示区域内的语义块“一起”执行选择操作,则目标语义块“一起”在第二显示区域中显示。
需要说明的是,在用户执行选择操作的过程中,若用户未使用到光标,则将按照上述的选择目标语义块的顺序进行显示,若用户使用到光标,即检测到用户执行光标定位操作,则将响应于该光标定位操作,在第二显示区域内显示光标,且在用户执行选择操作之后,将选择的目标语义块显示在该光标所在的位置,以便通过光标定位的方式,实现目标语义块的插入。其中,光标定位操作可以是点击第二显示区域内的目标语义块,以便光标定位在该目标语义块的前面。请参阅图4c,为本申请实施例中基于图4b执行光标定位操作后的显示界面的示意图,在图4b中,用户点击“一起”,以便在目标语义块“好友”及“一起”之间定位光标“|”,若用户对第一显示区域中的语义块“聊天”执行选择操作,则将响应于该选择操作,将目标语义块“聊天”显示在光标所在的位置。如图4d所示,为本申请实施例中基于图4c执行选择操作后的显示界面的示意图。
进一步的,为了实现对第二显示区域内的目标语义块的删除操作,第二显示区域内显示的目标语义块包含删除标记,其中,该删除标记在显示时可以有多种不同的形式,且可以位于语义块的不同方位或角度上。如图4b所示,第二显示区域中的目标语义块的删除标记即为目标语义块的右上角的圆圈,且该圆圈中包含“-”。且可以理解的是,图4b 仅为可行的一个示意图,并不对本申请实施例的技术方案造成限定。
因此,还可以执行以下步骤:
步骤304、响应于对第二显示区域内的目标语义块的删除标记的点击操作,按照点击操作删除指定的目标语义块。
用户对第二显示区域内的目标语义块的删除标记执行点击操作后,重组装置将响应于该点击操作,按照该点击操作删除指定的目标语义块,例如,若用户对目标语义块C的删除标记执行了点击操作,则将第二显示区域内的目标语义块C删除。
进一步的,还可以对第二显示区域中的目标语义块的位置进行调整,请参阅图5,为本申请实施例中对目标语义块的位置进行调整的方法的流程示意图,该方法包括:
步骤501、响应于对第二显示区域内的目标语义块的拖动操作,基于拖动操作拖动的目标语义块的实时位置,确定目标语义块的可插入位置,并在可插入位置显示目标语义块的虚拟语义块;其中,虚拟语义块与目标语义块具有相同的文本内容。
步骤502、检测到拖动操作结束时,则判断目标语义块与虚拟语义块的重叠区域是否大于或等于预设值;
步骤503、若大于或等于预设值,则利用目标语义块替换虚拟语义块;
步骤504、若小于预设值,则取消虚拟语义块的显示,并将目标语义块还原至上一个位置处显示。
在本申请实施例中,对于第二显示区域内的至少两个目标语义块,用户还可以进一步调整目标语义块之间的位置关系,可以理解的是,目标语义块的位置关系也代表着目标语义块的排列顺序,且位置关系发生改变,则表明重组得到的新的文本也将发生改变。
响应于对第二显示区域内的目标语义块的拖动操作,基于该拖动操作拖动的目标语义块的实时位置显示被拖动的目标语义块的虚拟语义块,具体的,用户在执行拖动操作的过程中,该拖动操作拖动的目标语义块将随着拖动操作的移动而移动,且在拖动该目标语义块的过程中,重组装置还将实时根据该目标语义块的实时位置确定以该实时位置为中心的预置区域内,可插入该目标语义块的位置,并在所有可插入目标语义块的位置上显示虚拟语义块,以便用户更好的拖动的目标语义块所需要插入的位置,其中,可插入目标语义块的位置可以是目标语义块的前面、后面等方位上。例如,请参阅图4d,图4d中的目标语义块“一起”位于目标语义块“聊天”的后面。若需要将“一起”调整至“好友”与“聊天”之间,则可拖动“一起”,此时,第二显示区域内将显示“一起”的虚拟语义块,请参阅图6a,为本申请实施例中基于图4d执行拖动操作的示意图。
在本申请实施例中,若拖动操作结束,则将判断被拖动的目标语义块与虚拟语义块的重叠区域是否大于或等于预设值,该预设值可以是目标语义块显示的区域大小的预置比例,若大于或等于预设值,表明用户将目标语义块拖动到其虚拟语义块的位置,将利用该目标语义块替换其虚拟语义块,请参阅图6b,为本申请实施例中基于图6a执行完拖动操作后的示意图,如图6b所示,目标语义块“一起”替换了其虚拟语义块,完成了位置的调整。若小于预设值,则取消虚拟语义块的显示,并将被拖动的目标语义块还原至上一个位置处显示,该上一个位置指拖动操作执行之前,被拖动的目标语义块所在的位置,例如,若在图6a时,用户结束了拖动操作,则第二显示区域显示的内容将还原成图4d。
可以理解的是,上述步骤303是针对目标语义块的选择、步骤304是针对目标语义块的删除、步骤501至505是针对目标语义块的位置调 整,在实际应用中,并不限定选择、删除、位置调整之间执行的先后关系,在第二显示区域内存在目标语义块的情况下,用户可以基于其需要执行上述的选择、删除、位置调整中的任意一个或多个,且该多个操作之间也是互相独立的。
在本申请实施例中,在显示界面上的第一显示区域内显示待重组文本分词处理后得到的多个语义块之后,用户可以通过选择、删除、位置调整的方式进行文本的重组,且操作简单方便,不容易产生误操作,用户体验好。
请参阅图7,为本申请实施例中文本重组方法的流程示意图,该方法包括:
步骤701、响应于显示界面的长按操作,确定选择的文本,并显示功能项;
步骤702、响应于对功能项中的重组项的选择操作,确定选择的文本为待重组文本;
步骤703、利用预先设置的字典扫描待重组文本,基于扫描到的语义块构建待重组文本所有可能的有向无环图的集合;
步骤704、利用逆向比较语义块的概率的方式从集合中选择满足预设条件的有向无环图,显示选择的有向无环图中的语义块;
步骤705、响应于对语义块的重组操作,按照重组操作确定的目标语义块的排列顺序显示目标语义块,以重组为新的文本。
在本申请实施例中,用户可以通过特定的操作触发文本重组方法,例如,用户可以对显示界面上的文本执行长按操作,重组装置将响应该长按操作,确定选择的文本,并显示功能项,例如:请参阅图8,为本申请实施例中显示界面响应长按操作的示意图,如图8所示,用户在对聊天内容“今天中午去哪吃?”执行长按操作之后,将显示功能项,该 功能项包括:复制、转发、编辑、收藏及撤回等等。其中,该编辑功能项即为重组项,重组装置可响应于对功能项中的编辑(重组项)的选择操作,确定选择的文本即为待重组文本。
可以理解的是,通过长按操作及选择操作,能够有效的触发文本重组过程,相对于手指大面积按压文本这种依赖于触摸屏的灵敏性和大面积按压的方式,触发效果更好。
在本申请实施例中,本地保存有字典,其中,该字典以离线包的形式存储,用户每次登陆时后台自动更新离线包,省去用户频繁更新应用程序的烦恼。
其中,字典中包含大量记录,且每一行记录中至少包含语义块及语义块的频数,此外,还可以包含该语义块的词性。其中,语义块的频数是通过对语义块的使用次数进行统计得到的,且该频数可以用于计算语义块的概率,且语义块的概率等于其频数与词典中所有语义块的频数之和的商。
在本申请实施例中,重组装置将利用上述字典扫描待重组文本,基于扫描到的语义块构建待重组文本的所有可能的有向无环图的集合,其中,有向无环图中的节点即为语义块,其方向为语义块在待重组文本中的先后顺序。
例如,若待重组文本为“我们大概下午2点左右出发”的有向无环图的集合包括:我→们→大→概→下→午→2→点→左→右→出→发;我们→大概→下午→2→点→左→右→出发;我们→大概→下午→2点→左右→出发。
重组装置利用逆向比较语义块的概率的方式从集合中选择满足预设条件的有向无环图,显示选择的有向无环图中的语义块。
在本申请实施例中,重组装置通过利用预先设置的字典扫描待重组 文本,并构建该待重组文本的所有可能的有向无环图的集合,通过逆向比较语义块的概率的方式从集合中选择满足预设条件的有向无环图,显示选择的有向无环图,使得能够有效的实现分词处理,且提高分词的准确性及性能。
请参阅图9,为本申请实施例中图7所示步骤703的细化步骤的流程示意图,该步骤703包括:
步骤901、调用正则表达式扫描待重组文本,并利用扫描到的词或词组与字典中的语义块进行匹配;
这里,正则表达式是指对文本操作的一种逻辑公式,使用预先设置的一些词或词组组成一个“规则词串”,这个“规则词串”用来表达对待重组文本的一种过滤逻辑。
步骤902、若匹配到,则将词或词组划分为第一类别的语义块,且利用与词或词组匹配的语义块的频数计算第一类别的语义块的概率;
步骤903、若未匹配到,且词或词组的语言类型与字典的语言类型不一致,则确定词或词组为第二类别的语义块,并利用马尔科夫模型中的维比特算法计算第二类别的语义块的概率;
步骤904、按照第一类别的语义块和/或第二类别的语义块在待重组文本中的位置,构建所有可能的有向无环图,得到有向无环图的初始集合。
在本申请实施例中,对于待重组文本,重组装置将调用正则表达式扫描待重组文本,并利用扫描到的词或词组与字典中的语义块进行匹配,例如,若扫描到的词为“我”,则用“我”与词典中的语义块进行匹配,以确定词典中是否含“我”这个词的语义块。
其中,若匹配到,这表明该词或词组是语义块,且确定该词或词组为第一类别的语义块,其中,该第一类别是指词典的语言类型的类别, 例如,若词典为汉字词典,则第一类别为汉字,若词典为英语词典,则第一类别为英语。进一步的,由于词典中包含语义块的频数,重组装置还将利用匹配的语义块的频数计算概率,例如,待重组文本中的词“我”在词典中匹配到,则表明“我”是语义块,则将利用词典中“我”的频数计算其概率。
其中,若未匹配到,则将进一步判断该词或词组的语言类型与字典的语言类型是否一致,若一致,则确定并不存在该词或词组匹配的语义块,若不一致,则确定该词或词组为第二类别的语义块,该第二类别是指不同于第一类别的类别,例如,若第一类别是汉字,则第二类别是英文、数字、符号等等。且对于第二类别的语义块,将利用马尔科夫模型中的维特比算法计算该第二类别的语义块的概率。例如,若词组“友啦”在汉字词典中未匹配到,则表明还词组并非为语义块,若词组“sorry”在汉字词典中未匹配到,则表明该词组并非为汉字。可以理解的是,词或词组里面包含的所有内容是属于同一种语言类型的,并不存在“我ok”“是488”这种同时包含两种不同语言类型的词或词组,以便能够更好的进行语义块的划分。
通过上述方式,重组装置能够得到待重组文本中的所有语义块,且每一个语义块的概率。并进一步的,利用该待重组文本中的所有语义块,包括第一类别的语义块和/或第二类别的语义块在待重组文本中的位置,构建所有可能的有向无环图,得到有向无环图的初始集合。
在本申请实施例中,通过上述方式能够得到待重组文本的有向无环图的初始集合,以便选择满足预设条件的有向无环图,并作为待重组文本的最终的分词结果进行显示。
请参阅图10,为本申请实施例中图7所示步骤704的细化步骤的流程示意图,该步骤704包括:
步骤1001、比较第m个集合中有向无环图逆向的第i个节点的语义块的概率;
步骤1002、若在逆向的第i个节点的语义块中,仅有一个语义块的概率最大,则确定概率最大的语义块所在的有向无环图为满足预设条件的有向无环图;
步骤1003、若在逆向的第i个节点的语义块中,有至少两个语义块的概率最大,则将概率最大的至少两个语义块分别所在的有向无环图作为第m+1个集合,且令i=i+1,m=m+1,返回步骤1001。
在本申请实施例中,重组装置在得到包含所有可能的有向无环图的初始集合之后,将从该初始集合中选择满足预设条件的有向无环图。由于选择的过程涉及到循环,且是通过逐渐缩小有向无环图的集合的方式实现的,因此,为了描述的方便,将初始集合作为第1个集合,且设置编号i和m,i和m的初始值均为1且为正整数,先比较第m个集合中有向无环图逆向的第i个节点的语义块的概率,即从最后的一个节点的语义块开始比较。
若对于第m个集合中的有向无环图,逆向的第i个节点的语义块中,仅有一个语义块的概率最大,则确定该概率最大的语义块所在的有向无环图是满足预设条件的,该有向无环图中包含的语义块是最终分词处理后的语义块。
若对于第m个集合中的有向无环图,逆向的第i个节点的语义块中,有至少两个语义块的概率最大,则将概率最大的至少两个语义块分别所在的有向无环图作为第m+1个集合,例如,对于包含5个有向无环图的第3个集合,在比较逆向的第2个节点的语义块时,逆向的第2个节点的语义块中,有3个语义块的概率相同且最大,则将该3个语义块分别所在的有向无环图构成第4个集合。其中,在得到第m+1个集合之后, 令i=i+1,m=m+1,返回上述的比较第m个集合中有向无环图逆向的第i个节点的语义块的概率的步骤,即步骤1001。例如,继续对包含3个有向无环图的第4个集合中,有向无环图的第3个节点的语义块进行比较。
在本申请实施例中,通过逆向的循环比较的方式,能够找出有向无环图集合中满足预设条件的有向无环图,以实现最佳的分词处理过程。
请参阅图11,为本申请实施例中文本重组装置的结构示意图,该装置包括:
第一确定模块1101,用于响应于显示界面上的文本选择操作,确定待重组文本;
分词模块1102,用于对待重组文本进行分词处理,得到多个语义块并显示;
显示重组模块1103,用于响应于对语义块的重组操作,按照重组操作确定的目标语义块的排列顺序显示目标语义块,以重组为新的文本。
本申请实施例中的文本重组装置中各程序模块实现各自功能的具体过程,请参见上述图2所示实施例中描述的内容,此处不做赘述。
在本申请实施例中,响应于显示界面上的文本选择操作,确定待重组文本,对该待重组文本进行分词处理,得到多个语义块并显示,响应于对语义块的重组操作,按照该重组操作确定的目标语义块的排列顺序显示目标语义块,以重组为新的文本。相对于现有技术,本申请实施例中的技术方案中通过将文本进行分词处理得到多个语义块,及通过重组操作的方式对语义块中的重要信息进行重新组合,得到新的文本,使得通过语义块重组的方式就能够得到文本中的重要信息,而不需要通过选择、复制、粘贴、删除冗余等操作,操作更加简便,且降低误操作的概率,有效改善用户体验。
在本申请实施例中,为了方便操作,可以将显示界面划分为第一显示区域和第二显示区域,且该两个显示区域可以通过横向并列的方式排列,也可以通过纵向并列的方式排列。其中,该第一显示区域用于显示分词处理得到的多个语义块。
请参阅图12,为本申请实施例中文本重组装置的另一结构示意图,包括:如图11所示实施例中的第一确定模块1101、分词模块1102及显示重组模块1103,且与图11所示实施例中描述的内容相似,此处不做赘述。
在本申请实施例中,显示重组模块1103包括:
选择显示模块1201,用于响应于对第一显示区域内的语义块的选择操作,将选择的语义块作为目标语义块,并按照对目标语义块的选择顺序或光标所在位置在第二显示区域内显示目标语义块。
其中,第二显示区域内显示的目标语义块包含删除标记;
显示重组模块1103还包括:
删除模块1202,用于响应于对第二显示区域内的目标语义块的删除标记的点击操作,按照点击操作删除指定的目标语义块。
进一步的,显示重组模块1103还包括:
拖动插入模块1203,用于响应于对第二显示区域内的目标语义块的拖动操作,基于拖动操作拖动的目标语义块的实时位置,确定目标语义块的可插入位置,并在可插入位置显示目标语义块的虚拟语义块;
判断模块1204,用于检测到拖动操作结束时,则判断目标语义块与虚拟语义块的重叠区域是否大于或等于预设值;
替换模块1205,用于若大于或等于预设值,则利用目标语义块替换虚拟语义块;
取消还原模块1206,用于若小于预设值,则取消虚拟语义块的显示, 并将目标语义块还原至上一个位置处显示,上一个位置指拖动操作执行之前,目标语义块所在的位置。
本申请实施例中的文本重组装置中各程序模块实现各自功能的具体过程,请参见上述图3及图5所示实施例中描述的内容,此处不做赘述。
在本申请实施例中,在显示界面上的第一显示区域内显示待重组文本分词处理后得到的多个语义块之后,用户可以通过选择、删除、位置调整的方式进行文本的重组,且操作简单方便,不容易产生误操作,用户体验好。
请参阅图13,为本申请实施例中文本重组装置的另一结构示意图,包括:
如图11所示实施例中的第一确定模块1101、分词模块1102及显示重组模块1103,且与图11所示实施例中描述的内容相似,此处不做赘述。
在本申请实施例中,第一确定模块1101包括:
确定显示模块1301,用于响应于显示界面的长按操作,确定选择的文本,并显示功能项;
第二确定模块1302,用于响应于对功能项中的重组项的选择操作,确定选择的文本为待重组文本。
在本申请实施例中,分词模块1102包括:
扫描构建模块1303,用于利用预先设置的字典扫描待重组文本,基于扫描到的语义块构建待重组文本所有可能的有向无环图的集合;
选择模块1304,用于利用逆向比较语义块的概率的方式从集合中选择满足预设条件的有向无环图,显示选择的有向无环图中的语义块,其中,语义块的概率基于语义块在字典中的频数得到。
在本申请实施例中,字典包含语义块与语义块的频数;
则扫描构建模块1303具体用于:
调用正则表达式扫描待重组文本,并利用扫描到的词或词组与字典中的语义块进行匹配;
若匹配到,则将词或词组划分为第一类别的语义块,且利用与词或词组匹配的语义块的频数计算第一类别的语义块的概率;
若未匹配到,且词或词组的语言类型与字典的语言类型不一致,则确定词或词组为第二类别的语义块,并利用马尔科夫模型中的维比特算法计算第二类别的语义块的概率;
按照第一类别的语义块和/或第二类别的语义块在待重组文本中的位置,构建所有可能的有向无环图,得到有向无环图的初始集合。
其中,选择模块1304具体用于:
比较第m个集合中有向无环图逆向的第i个节点的语义块的概率,i、m为正整数,且i、m的初始值为1,且第1个集合为初始集合;
若在逆向的第i个节点的语义块中,仅有一个语义块的概率最大,则确定概率最大的语义块所在的有向无环图为满足预设条件的有向无环图;
若在逆向的第i个节点的语义块中,有至少两个语义块的概率最大,则将概率最大的至少两个语义块分别所在的有向无环图作为第m+1个集合,且令i=i+1,m=m+1,返回比较第m个集合中有向无环图逆向的第i个节点的语义块的概率的步骤。
本申请实施例中的文本重组装置中各程序模块实现各自功能的具体过程,请参见上述图3、图5及图7所示实施例中描述的内容,此处不做赘述。
在本申请实施例中,重组装置通过利用预先设置的字典扫描待重组 文本,并构建该待重组文本的所有可能的有向无环图的集合,通过逆向比较语义块的概率的方式从集合中选择满足预设条件的有向无环图,显示选择的有向无环图,使得能够有效的实现分词处理,且提高分词的准确性及性能。且通过上述方式,重组装置能够得到待重组文本中的所有语义块,且每一个语义块的概率。并进一步的,利用该待重组文本中的所有语义块,包括第一类别的语义块和/或第二类别的语义块在待重组文本中的位置,构建所有可能的有向无环图,得到有向无环图的初始集合。
需要说明的是,在本申请实施例中,上述图11至图13所示的文本重组装置可应用于图1所示的终端设备中,用于实现上述实施例中的文本重组方法。
且本申请实施例还提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时,实现上述实施例中的文本重组方法。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模 块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
需要说明的是,对于前述的各方法实施例,为了简便描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其它顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定都是本申请实施例所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。
以上为对本申请实施例所提供的一种文本重组方法、装置、终端及可读存储介质的描述,对于本领域的技术人员,依据本申请实施例的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本申请的限制。

Claims (18)

  1. 一种文本重组方法,其特征在于,应用于终端设备,所述方法包括:
    响应于显示界面上的文本选择操作,确定待重组文本;
    对所述待重组文本进行分词处理,得到多个语义块并显示;
    响应于对所述语义块的重组操作,确定目标语义块及其排列顺序,根据所述排列顺序将所述目标语义块重组为新的文本并显示。
  2. 根据权利要求1所述的方法,其特征在于,所述显示界面包含第一显示区域及第二显示区域,所述第一显示区域用于显示分词处理得到的多个语义块;
    则所述响应于对所述语义块的重组操作,确定目标语义块及其排列顺序,根据所述排列顺序将所述目标语义块重组为新的文本并显示包括:
    响应于对所述第一显示区域内的语义块的选择操作,将选择的语义块作为目标语义块,并按照对所述目标语义块的选择顺序在所述第二显示区域内显示所述目标语义块。
  3. 根据权利要求1所述的方法,其特征在于,所述显示界面包含第一显示区域及第二显示区域,所述第一显示区域用于显示分词处理得到的多个语义块;
    则所述响应于对所述语义块的重组操作,确定目标语义块及其排列顺序,根据所述排列顺序将所述目标语义块重组为新的文本并显示包括:
    响应于对所述第一显示区域内的语义块的选择操作,将选择的语义块作为目标语义块,并按照所述选择操作以及光标所在位置在所述第二显示区域内显示所述目标语义块。
  4. 根据权利要求2或者3所述的方法,其特征在于,所述第二显示区域内显示的目标语义块包含删除标记;
    所述方法还包括:
    响应于对所述第二显示区域内的目标语义块的删除标记的点击操作,按照所述点击操作删除指定的目标语义块。
  5. 根据权利要求2或者3所述的方法,其特征在于,所述方法还包括:
    响应于对所述第二显示区域内的目标语义块的拖动操作,基于所述拖动操作拖动的目标语义块的实时位置,确定所述目标语义块的可插入位置,并在所述可插入位置显示所述目标语义块的虚拟语义块;
    检测到所述拖动操作结束时,判断所述目标语义块与所述虚拟语义块的重叠区域是否大于或等于预设值;
    若大于或等于预设值,则利用所述目标语义块替换所述虚拟语义块。
  6. 根据权利要求1所述的方法,其特征在于,所述对所述待重组文本进行分词处理,得到多个语义块并显示的步骤包括:
    利用预先设置的字典扫描所述待重组文本,基于扫描到的语义块构建所述待重组文本所有可能的有向无环图的集合;
    利用逆向比较语义块的概率的方式从所述集合中选择满足预设条件的有向无环图,显示选择的有向无环图中的语义块,其中,所述字典包含语义块与所述语义块的频数;所述语义块的概率基于所述语义块在所述字典中的频数得到。
  7. 根据权利要求6所述的方法,其特征在于,所述利用预先设置的字典扫描所述待重组文本,基于扫描到的语义块构建所述待重组文本所有可能的有向无环图的集合的步骤包括:
    调用正则表达式扫描所述待重组文本,并利用扫描到的词或词组与所述字典中的语义块进行匹配;
    若匹配到,则将所述词或词组划分为第一类别的语义块,且利用与所述词或词组匹配的语义块的频数计算所述第一类别的语义块的概率;
    按照所述第一类别的语义块在所述待重组文本中的位置,构建所有可能的有向无环图,得到有向无环图的初始集合。
  8. 根据权利要求6所述的方法,其特征在于,所述利用预先设置的字典扫描所述待重组文本,基于扫描到的语义块构建所述待重组文本所有可能的有向无环图的集合的步骤包括:
    调用正则表达式扫描所述待重组文本,并利用扫描到的词或词组与所述字典中的语义块进行匹配;
    若未匹配到,且所述词或词组的语言类型与所述字典的语言类型不一致,则确定所述词或词组为第二类别的语义块,并计算所述第二类别的语义块的概率;
    按照所述第二类别的语义块在所述待重组文本中的位置,构建所有可能的有向无环图,得到有向无环图的初始集合。
  9. 根据权利要求6所述的方法,其特征在于,所述利用预先设置的字典扫描所述待重组文本,基于扫描到的语义块构建所述待重组文本所有可能的有向无环图的集合的步骤包括:
    调用正则表达式扫描所述待重组文本,并利用扫描到的词或词组与所述字典中的语义块进行匹配;
    若匹配到,则将所述词或词组划分为第一类别的语义块,且利用与所述词或词组匹配的语义块的频数计算所述第一类别的语义块的概率;
    若未匹配到,且所述词或词组的语言类型与所述字典的语言类型不一致,则确定所述词或词组为第二类别的语义块,并计算所述第二类别 的语义块的概率;
    按照所述第一类别的语义块和所述第二类别的语义块在所述待重组文本中的位置,构建所有可能的有向无环图,得到有向无环图的初始集合。
  10. 根据权利要求7至9中任一项所述的方法,其特征在于,所述利用逆向比较语义块的概率的方式从所述集合中选择满足预设条件的有向无环图,显示选择的有向无环图中的语义块的步骤包括:
    比较第m个集合中有向无环图逆向的第i个节点的语义块的概率,i、m为正整数,且i、m的初始值为1,且第1个集合为所述初始集合;
    若在逆向的所述第i个节点的语义块中,仅有一个语义块的概率最大,则确定概率最大的语义块所在的有向无环图为所述满足预设条件的有向无环图;
    若在逆向的所述第i个节点的语义块中,有至少两个语义块的概率最大,则将概率最大的至少两个语义块分别所在的有向无环图作为第m+1个集合,且令i=i+1,m=m+1,返回所述比较第m个集合中有向无环图逆向的第i个节点的语义块的概率的步骤。
  11. 一种文本重组装置,其特征在于,所述装置包括:
    第一确定模块,用于响应于显示界面上的文本选择操作,确定待重组文本;
    分词模块,用于对所述待重组文本进行分词处理,得到多个语义块并显示;
    显示重组模块,用于响应于对所述语义块的重组操作,确定目标语义块及其排列顺序,根据所述排列顺序将所述目标语义块重组为新的文本并显示。
  12. 根据权利要求11所述的装置,其特征在于,所述显示界面包 含第一显示区域及第二显示区域,所述第一显示区域用于显示分词处理得到的多个语义块;
    则显示重组模块包括:
    选择显示模块,用于响应于对所述第一显示区域内的语义块的选择操作,将选择的语义块作为目标语义块,并按照对所述目标语义块的选择顺序在所述第二显示区域内显示所述目标语义块。
  13. 根据权利要求11所述的装置,其特征在于,所述显示界面包含第一显示区域及第二显示区域,所述第一显示区域用于显示分词处理得到的多个语义块;
    则显示重组模块包括:
    选择显示模块,用于响应于对所述第一显示区域内的语义块的选择操作,将选择的语义块作为目标语义块,并按照所述选择操作以及光标所在位置在所述第二显示区域内显示所述目标语义块。
  14. 根据权利要求12或者13所述的装置,其特征在于,所述第二显示区域内显示的目标语义块包含删除标记;
    所述显示重组模块还包括:
    删除模块,用于响应于对所述第二显示区域内的目标语义块的删除标记的点击操作,按照所述点击操作删除指定的目标语义块。
  15. 根据权利要求12或者13所述的装置,其特征在于,所述显示重组模块还包括:
    拖动插入模块,用于响应于对所述第二显示区域内的目标语义块的拖动操作,基于所述拖动操作拖动的目标语义块的实时位置,确定所述目标语义块的可插入位置,并在所述可插入位置显示所述目标语义块的虚拟语义块;
    判断模块,用于检测到所述拖动操作结束时,则判断所述目标语义 块与所述虚拟语义块的重叠区域是否大于或等于预设值;
    替换模块,用于若大于或等于预设值,则利用所述目标语义块替换所述虚拟语义块。
  16. 根据权利要求11至13任意一项所述的装置,其特征在于,所述分词模块包括:
    扫描构建模块,用于利用预先设置的字典扫描所述待重组文本,基于扫描到的语义块构建所述待重组文本所有可能的有向无环图的集合;
    选择模块,用于利用逆向比较语义块的概率的方式从所述集合中选择满足预设条件的有向无环图,显示选择的有向无环图中的语义块,其中,所述字典包含语义块与所述语义块的频数;所述语义块的概率基于所述语义块在所述字典中的频数得到。
  17. 一种终端设备,包括存储器、处理器及存储在所述存储器上且在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时,实现如权利要求1至10任意一项所述的文本重组方法中的各个步骤。
  18. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时,实现如权利要求1至10任意一项所述的文本重组方法的各个步骤。
PCT/CN2018/088789 2017-06-01 2018-05-29 文本重组方法、装置、终端设备及计算机可读存储介质 WO2018219261A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710403566.2A CN108984071B (zh) 2017-06-01 2017-06-01 文本重组方法、装置、终端设备及计算机可读存储介质
CN201710403566.2 2017-06-01

Publications (1)

Publication Number Publication Date
WO2018219261A1 true WO2018219261A1 (zh) 2018-12-06

Family

ID=64455701

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/088789 WO2018219261A1 (zh) 2017-06-01 2018-05-29 文本重组方法、装置、终端设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN108984071B (zh)
WO (1) WO2018219261A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111427587A (zh) * 2019-05-30 2020-07-17 杭州海康威视数字技术股份有限公司 一种目标删除方法及装置
CN113033211A (zh) * 2021-03-25 2021-06-25 联想(北京)有限公司 一种数据处理方法及装置

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111475093A (zh) * 2019-08-02 2020-07-31 广州三星通信技术研究有限公司 选词方法和电子设备
CN111026714A (zh) * 2019-11-07 2020-04-17 维沃移动通信有限公司 一种重命名方法及电子设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473380A (zh) * 2013-09-30 2013-12-25 南京大学 一种计算机文本情感分类方法
CN104298664A (zh) * 2014-10-12 2015-01-21 王美金 一种将面谈实时记录并转化陈述句的方法和系统
CN105468713A (zh) * 2015-11-19 2016-04-06 西安交通大学 一种多模型融合的短文本分类方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7383500B2 (en) * 2004-04-30 2008-06-03 Microsoft Corporation Methods and systems for building packages that contain pre-paginated documents
CN102999534A (zh) * 2011-09-19 2013-03-27 北京金和软件股份有限公司 一种基于逆向最大匹配的中文分词算法
CN102609208B (zh) * 2012-02-13 2014-01-15 广州市动景计算机科技有限公司 在触屏设备上进行屏幕取词的方法、系统及触屏设备
CN103377239B (zh) * 2012-04-26 2020-08-07 深圳市世纪光速信息技术有限公司 计算文本间相似度的方法和装置
CN102929925A (zh) * 2012-09-20 2013-02-13 百度在线网络技术(北京)有限公司 一种基于浏览内容的搜索方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473380A (zh) * 2013-09-30 2013-12-25 南京大学 一种计算机文本情感分类方法
CN104298664A (zh) * 2014-10-12 2015-01-21 王美金 一种将面谈实时记录并转化陈述句的方法和系统
CN105468713A (zh) * 2015-11-19 2016-04-06 西安交通大学 一种多模型融合的短文本分类方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111427587A (zh) * 2019-05-30 2020-07-17 杭州海康威视数字技术股份有限公司 一种目标删除方法及装置
CN111427587B (zh) * 2019-05-30 2023-08-29 杭州海康威视数字技术股份有限公司 一种目标删除方法及装置
CN113033211A (zh) * 2021-03-25 2021-06-25 联想(北京)有限公司 一种数据处理方法及装置

Also Published As

Publication number Publication date
CN108984071A (zh) 2018-12-11
CN108984071B (zh) 2022-09-30

Similar Documents

Publication Publication Date Title
US11844123B2 (en) Point-to-point ad hoc voice communication
US10089056B2 (en) Device, method, and graphical user interface for collaborative editing in documents
US20230004264A1 (en) User interface for multi-user communication session
WO2018219261A1 (zh) 文本重组方法、装置、终端设备及计算机可读存储介质
EP3352438B1 (en) User terminal device for recommending response message and method therefor
WO2019120191A1 (zh) 多段文本复制方法及移动终端
US20230153274A1 (en) File sharing method and apparatus, terminal, and storage medium
CN107066188B (zh) 一种发送截屏图片的方法及终端
WO2022052832A1 (zh) 应用程序的界面显示方法、装置、设备及介质
US11237848B2 (en) View playback to enhance collaboration and comments
WO2016022737A1 (en) Phone call context setting
CN108139895A (zh) 字体字型预览
US20220236837A1 (en) View Display Method and Electronic Device
US20170168686A1 (en) Method and electronic device for processing list item operation
CN107066115A (zh) 一种补充语音消息的方法及终端
WO2023083181A1 (zh) 即时通讯软件的内容输入方法、装置、设备和介质
CN111966257A (zh) 信息处理方法、装置及电子设备
CN107302617A (zh) 一种数据管理方法及终端
US20150347008A1 (en) Method for controlling virtual keyboard and electronic device implementing the same
CN108829301A (zh) 复制粘贴的方法和移动终端
CN114491087A (zh) 文本处理方法、装置、电子设备以及存储介质
US20170220231A1 (en) Mobile Terminal, and Mobile Terminal Webpage Window Processing Method and Electronic Device
US20240137998A1 (en) Point-to-Point Ad Hoc Voice Communication
WO2022252872A1 (zh) 设备控制方法、装置、电子设备及存储介质
WO2020029210A1 (zh) 一种复制内容选择方法、终端及存储介质

Legal Events

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

Ref document number: 18810591

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18810591

Country of ref document: EP

Kind code of ref document: A1