A text data processing method, device and equipment and storage medium

By adding association identifiers sequentially from the last of multiple matching keywords in the text to be processed, starting from the last one, the problem of keyword position offset is solved, and the accurate addition of text link information and efficient display of association relationships are achieved.

CN114547336BActive Publication Date: 2026-01-20LIANBAO (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210144727.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-16
Publication Date
2026-01-20
Estimated Expiration
2042-02-16

AI Technical Summary

Technical Problem

When adding links to text from beginning to end using existing technology, the positions of subsequent keywords are shifted, leading to incorrect link placement and even text content corruption.

Method used

By acquiring the text to be processed and a set of keywords, matching analysis is performed to obtain the position information of the keywords. Preset association identification information is then added sequentially from the last of the multiple matching keywords to generate the target display text.

Benefits of technology

It improves the accuracy of adding links in text, and enhances the accuracy and efficiency of building and displaying relationships between texts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114547336B_ABST
    Figure CN114547336B_ABST
Patent Text Reader

Abstract

The application discloses a text data processing method and device, equipment and a storage medium. The method comprises the following steps: obtaining a text to be processed and a keyword set, wherein the keyword set comprises a plurality of keywords and text identifier information of associated texts corresponding to each keyword in the plurality of keywords; performing matching analysis on the text to be processed and the plurality of keywords to obtain a keyword matching result, wherein the keyword matching result comprises a plurality of matching keywords and position information of the plurality of matching keywords in the text to be processed; according to the position information, adding preset associated identifier information of the plurality of matching keywords in the text to be processed from the last matching keyword in the plurality of matching keywords to the front in turn from the back to obtain a target display text; wherein the preset associated identifier information is generated based on the text identifier information of the associated texts corresponding to the plurality of matching keywords. The technical scheme of the application can improve the accuracy of the position of the preset associated identifier information added in the text to be processed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of text processing, and in particular to a text data processing method and device, equipment and a storage medium. BACKGROUND

[0002] With the explosive growth of enterprise information, especially the growth of unstructured text content, the way of text storage and use has also changed. The text storage mode has changed from local storage to cloud storage, and the text collaboration and sharing mode has changed from point-to-point transmission to cloud collaboration and sharing. In this change, the construction and display of the association relationship between cloud texts is a crucial link. In the prior art, when constructing and displaying the association relationship between texts in the background, after confirming the position information of multiple keywords in the text to be processed, link information of the associated text corresponding to the keyword is added at the keyword position from front to back in the text to be processed.

[0003] However, after adding link information in front of the keyword in the text to be processed, the position of the keyword behind will be offset, resulting in incorrect addition of link information of the keyword behind, and even text content disorder. Therefore, a more convenient and accurate technical solution is needed. SUMMARY

[0004] The present application provides a text data processing method, device, equipment and storage medium, which can solve the problem of position offset of the keyword behind caused by adding link information at the keyword position from front to back in the text to be processed, improve the accuracy of the addition position of the link information in the text, and the technical solution of the present application is as follows:

[0005] On the one hand, a text data processing method is provided, and the method comprises:

[0006] obtaining a text to be processed and a keyword set, the keyword set comprising a plurality of keywords and text identifier information of an associated text corresponding to each keyword in the plurality of keywords;

[0007] performing matching analysis on the text to be processed and the plurality of keywords to obtain a keyword matching result, the keyword matching result comprising a plurality of matching keywords and position information of the plurality of matching keywords in the text to be processed;

[0008] According to the position information, from the last matching keyword in the plurality of matching keywords, the preset association identifier information of the plurality of matching keywords is added in the text to be processed from back to front in turn, and a target display text is obtained.

[0009] Wherein, the preset association identifier information is generated based on the text identifier information of the associated text corresponding to each of the plurality of matching keywords.

[0010] In another aspect, a text data processing apparatus is provided, the apparatus comprising:

[0011] an acquisition module configured to acquire a text to be processed and a keyword set, the keyword set comprising a plurality of keywords and text identifier information of associated texts corresponding to each keyword in the plurality of keywords;

[0012] a matching analysis module configured to perform matching analysis on the text to be processed and the plurality of keywords to obtain a keyword matching result, the keyword matching result comprising a plurality of matching keywords and position information of the plurality of matching keywords in the text to be processed;

[0013] an addition module configured to add, according to the position information, preset associated identifier information of the plurality of matching keywords from a last matching keyword in the plurality of matching keywords in the text to be processed in a backward order to obtain a target display text;

[0014] wherein the preset associated identifier information is generated based on the text identifier information of the associated texts corresponding to the plurality of matching keywords.

[0015] In another aspect, a text data processing device is provided, the device comprising a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the text data processing method as described above.

[0016] In another aspect, a computer-readable storage medium is provided, the storage medium storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by a processor to implement the text data processing method as described above.

[0017] The text data processing method, apparatus, device and storage medium provided by the present application have the following technical effects:

[0018] By means of the technical scheme provided in the application, the to-be-processed text and a keyword set are acquired, the keyword set comprising a plurality of keywords and text identifier information of an associated text corresponding to each keyword in the plurality of keywords; then, the to-be-processed text and the plurality of keywords are matched and analyzed to obtain a plurality of matching keywords and position information of the plurality of matching keywords in the to-be-processed text; and according to the position information, preset associated identifier information generated based on the text identifier information of the associated text corresponding to each of the plurality of matching keywords is added in the to-be-processed text from the last matching keyword in the plurality of matching keywords, in a backward direction, to obtain a target display text, which can improve the accuracy of the position of the preset associated identifier information added in the to-be-processed text, thereby improving the accuracy and efficiency of the construction and display of the association between texts. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.

[0020] Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present application;

[0021] Figure 2 is a flowchart of a text data processing method provided by an embodiment of the present application;

[0022] Figure 3 is a flowchart of a keyword set generation method provided by an embodiment of the present application;

[0023] Figure 4 is a flowchart of a keyword extraction method for a plurality of initial texts to obtain a plurality of keywords and at least one associated text corresponding to each keyword in the plurality of keywords provided by an embodiment of the present application;

[0024] Figure 5 is a flowchart of a keyword matching result obtained by matching and analyzing a to-be-processed text and a plurality of keywords provided by an embodiment of the present application;

[0025] Figure 6 is a flowchart of a target display text obtained by adding preset associated identifier information of a plurality of matching keywords in a to-be-processed text from the last matching keyword in the plurality of matching keywords, in a backward direction, according to position information provided by an embodiment of the present application;

[0026] Figure 7is a text data processing device schematic diagram provided by an embodiment of the application;

[0027] Figure 8 is a hardware structure block diagram of a server of a text data processing method provided by an embodiment of the application. DETAILED DESCRIPTION

[0028] The technical solutions in the embodiments of the application will be clearly and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only a part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the application.

[0029] It should be noted that the terms "first", "second", and the like in the specification and claims of the application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or server including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.

[0030] Referring to Figure 1 , please refer to Figure 1 , Figure 1is a schematic diagram of an application environment provided by an embodiment of the present application. The application environment can include a client 10 and a server 20. The client 10 and the server 20 can be directly or indirectly connected through wired or wireless communication. A user can send a text data processing request to the server 20 through the client 10. The text data processing request carries a text to be processed. The server 20 determines the corresponding text to be processed based on the text data processing request, and then obtains a keyword set. The keyword set includes a plurality of keywords and text identifier information of an associated text corresponding to each keyword in the plurality of keywords. Then, the server 20 performs matching analysis on the text to be processed and the plurality of keywords to obtain a keyword matching result. The keyword matching result includes a plurality of matching keywords and position information of the plurality of matching keywords in the text to be processed. Then, according to the position information, the server 20 adds preset associated identifier information of the plurality of matching keywords in the text to be processed from the last matching keyword in the order of back to front to obtain a target display text. The preset associated identifier information is generated based on the text identifier information of the associated text corresponding to each keyword in the plurality of matching keywords. Finally, the server 20 returns the target display text to the client 10. It should be noted that, Figure 1 is only an example.

[0031] The client can be an entity device such as a smart phone, a computer (such as a desktop computer, a tablet computer, a notebook computer), a digital assistant, a smart voice interaction device, a smart wearable device, etc. The client can also be a software such as a computer program running in an entity device. The operating system corresponding to the client can be an Android system, an iOS system (a mobile operating system developed by Apple Inc.), a Linux system, a Microsoft Windows system, etc.

[0032] The server can be a physical server, a server cluster or a distributed system composed of a plurality of physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms. The server can include a network communication unit, a processor, a memory, etc. The server can provide background services for the corresponding client.

[0033] A text data processing method provided by an embodiment of the present application is described below. Figure 2A flowchart of a text data processing method provided in an embodiment of the present application. It should be noted that the present specification provides method operation steps as described in the embodiments or flowcharts, but more or fewer operation steps can be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one of the many execution orders, and does not represent the only execution order. In actual system or product execution, the method order shown in the embodiments or the drawings can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment). Specifically, as shown in Figure 2 The above method can include:

[0034] S201, obtaining a to-be-processed text and a keyword set, the keyword set including a plurality of keywords and text identifier information of associated text corresponding to each keyword in the plurality of keywords.

[0035] In an embodiment of the present specification, the type of the to-be-processed text can include but is not limited to a document, a web page.

[0036] In an embodiment of the present specification, the associated text corresponding to the keyword can be a source text containing the corresponding keyword in the text content, and the text identifier information can be used to identify the associated text. Specifically, the text identifier information can include but is not limited to a text name, a text number.

[0037] In an embodiment of the present specification, as shown in Figure 3 The generation method of the keyword set can include:

[0038] S301, obtaining a plurality of initial texts.

[0039] Specifically, the plurality of initial texts can be source texts pre-entered into the server side, and the plurality of initial texts can be used for keyword extraction and as associated texts corresponding to the keywords.

[0040] S303, keyword extraction is performed on the plurality of initial texts to obtain a plurality of keywords and at least one associated text of each keyword in the plurality of keywords.

[0041] Specifically, the keywords can include but are not limited to main titles, subtitles, various levels of titles inside the text, notes, labels, and authors.

[0042] In a specific embodiment, as shown in Figure 4 The above keyword extraction on the plurality of initial texts to obtain a plurality of keywords and at least one associated text of each keyword in the plurality of keywords can include:

[0043] S401, according to the layout format of each initial text and the preset keyword regular expression, keyword extraction is performed on the text data of each initial text respectively, and the keyword of each initial text is obtained.

[0044] In an optional embodiment, according to the layout format of each initial text, the preset keyword regular expression corresponding to the layout format is determined, and keyword extraction is performed on the text data of each initial text based on the preset keyword regular expression, and the keyword of each initial text is obtained.

[0045] In a specific embodiment, in the case that the layout format of a certain initial text includes "chapter" and "section", the chapter title or section title of the initial text needs to be extracted as a keyword, therefore, the preset keyword regular expression can include: " / *^(the [first second third fourth fifth sixth seventh eighth ninth tenth zero] chapter\s+)(.+)\n* / ", " / *^(the [first second third fourth fifth sixth seventh eighth ninth tenth zero] section\s+)(.+)\n* / ", and the chapter title in the initial text is extracted by using " / *^(the [first second third fourth fifth sixth seventh eighth ninth tenth zero] chapter\s+)(.+)\n* / ", the section title in the initial text is extracted by using " / *^(the [first second third fourth fifth sixth seventh eighth ninth tenth zero] section\s+)(.+)\n* / ", and the chapter title and the section title are taken as the keyword of the initial text.

[0046] In another optional embodiment, the text metadata of the initial text is obtained, and specifically, the text metadata can include but is not limited to: main title, sub-title, label set when entering, author name, and the text metadata is taken as the keyword of the initial text.

[0047] S403, the keywords of the plurality of initial texts are analyzed and processed, and at least one associated text of each keyword is determined.

[0048] Specifically, the initial text containing a certain keyword is taken as the associated text of the keyword.

[0049] As can be seen from the above embodiments, according to the layout format and the preset keyword regular expression, keyword extraction is performed on the text data of the initial text, which can effectively extract the keyword of the initial text, so as to facilitate subsequent generation of the keyword set.

[0050] S305, based on the plurality of keywords and the text identification information of at least one associated text, a keyword set is generated.

[0051] Specifically, the keyword and the text identification information of at least one associated text are stored in the form of inverted index, and the keyword set is obtained.

[0052] As can be seen from the above embodiments, the storage mode of the inverted index can quickly obtain the text identification information containing the keyword according to the keyword, and improve the query efficiency of the keyword set.

[0053] In S203, the to-be-processed text is matched with the plurality of keywords to obtain a keyword matching result, and the keyword matching result includes a plurality of matching keywords and position information of the plurality of matching keywords in the to-be-processed text.

[0054] Specifically, the matching keyword can be a keyword contained in the to-be-processed text in the plurality of keywords.

[0055] In a specific embodiment, as shown in FIG. 2, the above-mentioned matching the to-be-processed text with the plurality of keywords to obtain the keyword matching result can include: Figure 5

[0056] In S501, the regular expressions corresponding to the plurality of keywords are respectively matched with the to-be-processed text to determine the plurality of matching keywords of the to-be-processed text and the start position information and the end position information of each matching keyword in the to-be-processed text.

[0057] In S503, the position information of each matching keyword is obtained according to the start position information and the end position information.

[0058] Specifically, the regular expression can be used to search whether the to-be-processed text contains the corresponding keyword.

[0059] In a specific embodiment, the regular expression is matched with the to-be-processed text to determine whether the to-be-processed text contains the keyword corresponding to the regular expression. In the case where the to-be-processed text contains the keyword, the keyword is taken as the matching keyword, and the start position information and the end position information of the matching keyword appearing in the to-be-processed text are determined. The start position information and the end position information are taken as the position information of the matching keyword.

[0060] In an optional embodiment, based on the start position information, the end position information, the matching keyword, and the text identification information of the at least one associated text, a matching record of the matching keyword is generated, for example: [103, 108, “company management regulations”, “202001001”].

[0061] As can be seen from the above embodiments, the regular expressions corresponding to the plurality of keywords are respectively matched with the to-be-processed text, which can improve the keyword matching efficiency and accuracy.

[0062] ​S205, according to the position information, from the last matching keyword in the plurality of matching keywords, the plurality of matching keywords are added in the target display text from back to front in the to-be-processed text in sequence. The preset association identification information is generated based on the text identification information of the association text corresponding to each of the plurality of matching keywords.

[0063] In the embodiments of the present specification, the preset association identification information can be used to identify the association text of the matching keyword in the to-be-processed text. Specifically, the preset association identification information can include: an anchor point and text identification information of the association text, wherein the anchor point can be a preset identifier used to mark the matching keyword in the to-be-processed text. Optionally, the anchor point can be a hyperlink tag For example, the matching keyword is the company management regulation, the text identification information of the associated text is the text number 202001001, and the corresponding preset associated identification information can be <a href=”#tid:202001001”>Company management regulation .

[0064] In the embodiments of the present specification, as shown in Figure 6 the above-mentioned according to the position information, from the last matching keyword in the plurality of matching keywords, the plurality of matching keywords are added in the target display text from back to front in the to-be-processed text in sequence. The preset association identification information is generated based on the text identification information of the association text corresponding to each of the plurality of matching keywords.

[0065] S601, according to the position information, the plurality of matching keywords are sorted from back to front in the to-be-processed text, and target sequence information is obtained.

[0066] In one specific embodiment, the above-mentioned according to the position information, the plurality of matching keywords are sorted from back to front in the to-be-processed text, and target sequence information is obtained. It can include: according to the starting position information, the plurality of matching keywords are sorted from back to front in the to-be-processed text, and target sequence information is obtained.

[0067] In one specific embodiment, the matching record of the matching keyword of the to-be-processed text includes: [67, 70, “project declaration”, “202001009”] and [103, 108, “company management regulations”, “202001001”]. According to the starting position information of the matching keyword, the target sequence information obtained is {[103, 108, “company management regulations”, “202001001”], [67, 70, “project declaration”, “202001009”]}.

[0068] S603, according to the target sequence information, the plurality of matching keywords are traversed.

[0069] S605, according to the position information of the currently traversed matching keyword, the preset association identification information corresponding to the currently traversed matching keyword is added in the to-be-processed text, and an initial display text is obtained.

[0070] In a specific embodiment, the current matched keyword being traversed is replaced by the preset associated identification information corresponding to the current matched keyword in the text to be processed, to obtain an initial display text.

[0071] Optionally, the preset associated identification information corresponding to the plurality of matched keywords can be generated before the plurality of matched keywords are traversed, and the preset associated identification information corresponding to the current matched keyword being traversed can also be generated in the process of traversing the plurality of matched keywords.

[0072] S607, performing text association processing on the preset associated identification information corresponding to the plurality of matched keywords in the initial display text, to obtain a target display text.

[0073] In a specific embodiment, the above-mentioned text association processing on the preset associated identification information corresponding to the plurality of matched keywords in the initial display text, to obtain a target display text can include: converting the preset associated identification information corresponding to the plurality of matched keywords in the initial display text into link information of the associated text corresponding to the plurality of matched keywords, respectively, to obtain the target display text.

[0074] Specifically, the link information can represent the connection relationship between the text to be processed and the corresponding associated text. In an optional embodiment, in response to an associated text display instruction triggered based on the link information, the associated text corresponding to the matched keyword can be jumped from the target display text; in another optional embodiment, in response to an associated text display instruction triggered based on the link information, the associated text corresponding to the matched keyword can be displayed in a first target display area. Specifically, the first target display area can be a new page or a new tab page.

[0075] In another specific embodiment, in the case where the preset associated identification information corresponding to the target matched keyword includes text identification information of a plurality of associated texts, the target matched keyword is any one of the plurality of matched keywords, and the above-mentioned method can further include: converting the preset associated identification information corresponding to the target matched keyword in the initial display text into link address information of the plurality of associated texts, to generate the target display text, and the link address information is used to trigger the display of the link information of the plurality of associated texts.

[0076] Specifically, the link address information can be an operation object used to trigger the display of the link information of the plurality of associated texts. In a specific embodiment, in response to a link information display instruction triggered based on the link address information, the link information of the corresponding plurality of associated texts is displayed in a second target display area. Optionally, the second target display area can be a link information display list.

[0077] In actual application, the server end can perform text association processing on the preset association identifier information corresponding to the plurality of matching keywords in the initial display text to obtain a target display text, and send the target display text to the client end, so as to facilitate the user to browse and use the target display text. The server end can also send the initial display text to the client end, so that the client end performs text association processing on the preset association identifier information corresponding to the plurality of matching keywords in the initial display text to obtain a target display text.

[0078] As can be seen from the above embodiments, on the one hand, according to the position information, the plurality of matching keywords in the to-be-processed text are sorted from back to front to obtain target sequence information, and according to the target sequence information, the preset association identifier information of the plurality of matching keywords is added from back to front in the to-be-processed text, thereby improving the accuracy of adding the preset association identifier information of the plurality of matching keywords in the text. On the other hand, according to the number of association texts corresponding to the matching keywords, the preset association identifier information is converted into link information of a single association text or link address information of a plurality of association texts, so as to facilitate the display of the association texts and improve the user experience.

[0079] As can be seen from the above embodiments, on the one hand, according to the position information, the plurality of matching keywords in the to-be-processed text are sorted from back to front to obtain target sequence information, and according to the target sequence information, the preset association identifier information of the plurality of matching keywords is added from back to front in the to-be-processed text, thereby improving the accuracy of adding the preset association identifier information of the plurality of matching keywords in the text. On the other hand, according to the number of association texts corresponding to the matching keywords, the preset association identifier information is converted into link information of a single association text or link address information of a plurality of association texts, so as to facilitate the display of the association texts and improve the user experience.

[0080] The embodiments of the present application provide a text data processing apparatus, as shown in Figure 7 The above apparatus can include:

[0081] The acquisition module 710 is configured to acquire a to-be-processed text and a keyword set, the keyword set including a plurality of keywords and text identifier information of an association text corresponding to each keyword in the plurality of keywords.

[0082] The matching analysis module 720 is configured to perform matching analysis on the to-be-processed text and the plurality of keywords, to obtain keyword matching results, the keyword matching results including a plurality of matching keywords and position information of the plurality of matching keywords in the to-be-processed text.

[0083] The adding module 730 is configured to add, according to the position information, preset association identification information of the plurality of matching keywords in the to-be-processed text from the last matching keyword of the plurality of matching keywords in turn from back to front, to obtain the target display text.

[0084] The preset association identification information is generated based on text identification information of the association text corresponding to each of the plurality of matching keywords.

[0085] In the embodiments of the present disclosure, the apparatus described above can further include:

[0086] The initial text acquisition module is configured to acquire a plurality of initial texts.

[0087] The keyword extraction module is configured to perform keyword extraction on the plurality of initial texts, to obtain a plurality of keywords and at least one association text of each keyword in the plurality of keywords.

[0088] The keyword set generation module is configured to generate a keyword set based on text identification information of the plurality of keywords and the at least one association text.

[0089] In a specific embodiment, the keyword extraction module described above can include:

[0090] The keyword unit is configured to perform keyword extraction on text data of each initial text respectively according to a layout format of each initial text and a preset keyword regular expression, to obtain a keyword of each initial text.

[0091] The analysis processing unit is configured to perform analysis processing on the keywords of the plurality of initial texts, to determine at least one association text of each keyword.

[0092] In a specific embodiment, the matching analysis module 720 described above can include:

[0093] The regular matching unit is configured to perform regular matching of regular expressions corresponding to the plurality of keywords on the to-be-processed text respectively, to determine a plurality of matching keywords of the to-be-processed text and starting position information and ending position information of each matching keyword in the plurality of matching keywords in the to-be-processed text.

[0094] The position information unit is configured to obtain position information of each matching keyword according to the starting position information and the ending position information.

[0095] In the embodiments of the present disclosure, the adding module 730 described above can include:

[0096] The sorting unit is configured to sort the plurality of matching keywords from back to front in the to-be-processed text according to the position information, to obtain target sequence information.

[0097] The traversing unit is configured to traverse the plurality of matching keywords according to the target sequence information.

[0098] The initial display text unit is configured to add preset associated identifier information corresponding to the currently traversed matching keyword in the to-be-processed text according to position information of the currently traversed matching keyword, to obtain initial display text.

[0099] The target display text unit is configured to perform text association processing on the preset associated identifier information corresponding to the plurality of matching keywords in the initial display text, to obtain target display text.

[0100] In one specific embodiment, the target display text unit described above can include:

[0101] The first conversion unit is configured to convert the preset associated identifier information corresponding to the plurality of matching keywords in the initial display text into link information of associated text corresponding to the plurality of matching keywords respectively, to obtain the target display text.

[0102] In another specific embodiment, in a case where the preset associated identifier information corresponding to the target matching keyword includes text identifier information of a plurality of associated texts, the target matching keyword is any one of the plurality of matching keywords, and the target display text unit described above can further include:

[0103] The second conversion unit is configured to convert the preset associated identifier information corresponding to the target matching keyword in the initial display text into link address information of the plurality of associated texts, to generate the target display text, and the link address information is used to trigger display of the link information of the plurality of associated texts.

[0104] It should be noted that the device in the device embodiment and the method embodiment are based on the same inventive concept.

[0105] Embodiments of the present application provide a text data processing device, which includes a processor and a memory. The memory stores at least one instruction or at least one program, which is loaded and executed by the processor to implement the text data processing method provided in the above method embodiments.

[0106] The memory can be used to store software programs and modules, and the processor executes various function applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; and the data storage area can store data created according to the use of the above-mentioned device, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.

[0107] The method embodiments provided by the embodiments of the present application can be executed in a mobile terminal, a computer terminal, a server or a similar computing device, that is, the above-mentioned computer device can include a mobile terminal, a computer terminal, a server or a similar computing device. Taking the case of running on a server as an example, Figure 8 is a hardware structure block diagram of a server of a text data processing method provided by the embodiments of the present application. As Figure 8 shown, the server 800 can have a large difference due to different configurations or performances, and can include one or more central processing units (CPU) 810 (the processor 810 can include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 830 for storing data, one or more storage media 820 (such as one or more mass storage devices) for storing application programs 823 or data 822. Among them, the memory 830 and the storage medium 820 can be temporary storage or persistent storage. The programs stored in the storage medium 820 can include one or more modules, each of which can include a series of instruction operations in the server. Further, the central processing unit 810 can be configured to communicate with the storage medium 820 and execute a series of instruction operations in the storage medium 820 on the server 800. The server 800 can also include one or more power supplies 860, one or more wired or wireless network interfaces 850, one or more input / output interfaces 840, and / or one or more operating systems 821, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0108] The input / output interface 840 can be configured to receive or transmit data via a network. The network can include a wireless network provided by a communication provider of the server 800. In an example, the input / output interface 840 includes a network interface controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet. In an example, the input / output interface 840 can be a radio frequency (RF) module configured to communicate with the Internet through a wireless manner.

[0109] Those skilled in the art can understand that, Figure 8 The structure shown is only schematic, and does not limit the structure of the electronic device. For example, the server 800 can further include more or less components than those shown, or have a different configuration of components than those shown. Figure 8 The structure shown is only schematic, and does not limit the structure of the electronic device. For example, the server 800 can further include more or less components than those shown, or have a different configuration of components than those shown. Figure 8 The structure shown is only schematic, and does not limit the structure of the electronic device. For example, the server 800 can further include more or less components than those shown, or have a different configuration of components than those shown.

[0110] The embodiment of the present application further provides a storage medium, which can be arranged in a server to save at least one instruction or at least one program for implementing a text data processing method in the method embodiment, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the text data processing method provided by the method embodiment.

[0111] Optionally, in the embodiment, the storage medium can be located in at least one of a plurality of network servers in a computer network. Optionally, in the embodiment, the storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media capable of storing program codes.

[0112] It can be seen from the above embodiments of the text data processing method, device, equipment or storage medium provided in the application that, by using the technical solutions provided in the embodiments of the present specification, on the one hand, the key words of the initial text can be effectively extracted to generate a key word set by extracting the key words of the text data of the initial text according to the layout format and the preset key word regular expression; on the other hand, the matching key words and the position information can be obtained by respectively performing regular matching on the regular expressions corresponding to the plurality of key words and the to-be-processed text, so as to improve the key word matching efficiency and accuracy; on the other hand, the target order information can be obtained by sorting the plurality of matching key words from back to front in the to-be-processed text according to the position information, and the preset association identification information of the plurality of matching key words can be added from back to front in the to-be-processed text according to the target order information, so as to improve the accuracy of adding the preset association identification information of the plurality of matching key words in the text; on the other hand, the preset association identification information can be converted into link information of a single associated text or link address information of a plurality of associated texts according to the number of associated texts corresponding to the matching key words, so as to improve the accuracy and efficiency of displaying the association relationship between texts, thereby improving the user experience.

[0113] It should be noted that the above-mentioned embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are possible or can be advantageous.

[0114] Each of the embodiments in the present specification is described in a progressive manner, and the same or similar parts of each embodiment can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts are referred to the part of the method embodiment.

[0115] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by a program instructing related hardware to complete. The above-mentioned program can be stored in a computer readable storage medium, and the above-mentioned storage medium can be a read-only memory, a disk or an optical disk.

[0116] The above is only the preferred embodiment of the present application, and does not limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method of processing text data, characterized by, The method comprises: obtaining a to-be-processed text and a keyword set, the keyword set comprising a plurality of keywords and text identification information of associated text corresponding to each keyword in the plurality of keywords; performing matching analysis on the to-be-processed text and the plurality of keywords to obtain a keyword matching result, the keyword matching result comprising a plurality of matching keywords and position information of the plurality of matching keywords in the to-be-processed text; according to the position information, adding preset associated identification information corresponding to each of the plurality of matching keywords in the to-be-processed text from the last matching keyword in the plurality of matching keywords to the front in sequence to obtain an initial display text; converting the preset associated identification information corresponding to each matching keyword in the initial display text into link information of the associated text corresponding to each matching keyword to obtain a target display text; wherein the preset associated identification information corresponding to each matching keyword is generated based on the text identification information of the associated text corresponding to each matching keyword.

2. The method of claim 1, wherein, According to the position information, adding preset associated identification information corresponding to each of the plurality of matching keywords in the to-be-processed text from the last matching keyword in the plurality of matching keywords to the front in sequence to obtain an initial display text: according to the position information, sorting the plurality of matching keywords from the back to the front in the to-be-processed text to obtain target order information; according to the target order information, traversing the plurality of matching keywords; according to the position information of the currently traversed matching keyword, adding the preset associated identification information corresponding to the currently traversed matching keyword in the to-be-processed text to obtain the initial display text.

3. The method of claim 1, wherein, In the case where the preset associated identification information corresponding to a target matching keyword comprises text identification information of a plurality of associated texts, the target matching keyword is any matching keyword in the plurality of matching keywords, and the method further comprises: converting the preset associated identification information corresponding to the target matching keyword in the initial display text into link address information of the plurality of associated texts to generate the target display text, and the link address information is used to trigger the display of the link information of the plurality of associated texts.

4. The method of claim 2, wherein, The matching analysis on the to-be-processed text and the plurality of keywords to obtain a keyword matching result comprises: performing regular matching on the plurality of keywords and the to-be-processed text respectively to determine the plurality of matching keywords of the to-be-processed text and the starting position information and the ending position information of each matching keyword in the plurality of matching keywords in the to-be-processed text; obtaining the position information of each matching keyword according to the starting position information and the ending position information; According to the position information, sorting the plurality of matching keywords from the back to the front in the to-be-processed text to obtain target order information comprises: according to the starting position information, sorting the plurality of matching keywords from the back to the front in the to-be-processed text to obtain the target order information.

5. The method according to any one of claims 1 to 4, characterized in that, Before the obtaining of the text to be processed and the keyword set, the method further comprises: obtaining a plurality of initial texts; performing keyword extraction on the plurality of initial texts to obtain the plurality of keywords and at least one associated text of each keyword in the plurality of keywords; generating the keyword set based on the plurality of keywords and the text identification information of the at least one associated text.

6. The method of claim 5, wherein, The keyword extraction on the plurality of initial texts to obtain the plurality of keywords and at least one associated text of each keyword in the plurality of keywords comprises: performing keyword extraction on the text data of each initial text according to the layout format of the initial text and a preset keyword regular expression to obtain the keyword of the initial text; performing analysis and processing on the keywords of the plurality of initial texts to determine at least one associated text of each keyword.

7. A text data processing apparatus characterized by comprising: The device comprises: an obtaining module configured to obtain a text to be processed and a keyword set, the keyword set comprising a plurality of keywords and text identification information of an associated text corresponding to each keyword in the plurality of keywords; a matching analysis module configured to perform matching analysis on the text to be processed and the plurality of keywords to obtain a keyword matching result, the keyword matching result comprising a plurality of matching keywords and position information of the plurality of matching keywords in the text to be processed; an adding module configured to add, according to the position information, preset associated identification information corresponding to each of the plurality of matching keywords in the text to be processed from the last matching keyword in the order of back to front to obtain an initial display text; a first conversion module configured to convert the preset associated identification information corresponding to each matching keyword in the initial display text into link information of the associated text corresponding to the matching keyword to obtain a target display text; wherein the preset associated identification information corresponding to each matching keyword is generated based on the text identification information of the associated text corresponding to the matching keyword.

8. A text data processing apparatus, characterized by comprising: The device comprises a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the text data processing method of any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the text data processing method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Information retrieval method and system thereof

    CN102023989A

  • Text processing method and device, computer equipment and storage medium

    CN108399150A