Text labeling method and apparatus based on social media entity localization and search matching
By identifying hashtags, URLs, and mentions in social media text, adding redirect link styles, and building HTML documents that support user-specified search keywords, the problem of text positioning errors and entity recognition ambiguity in social media is solved, achieving more accurate search matching and clear hierarchical tagging effects.
Patent Information
- Application Number
- CN202310735903.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-20
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2043-06-20
AI Technical Summary
In social media, existing technologies suffer from text localization errors, entity recognition ambiguity, inaccurate search keyword matching, and difficulty in handling overlapping HTML content.
By analyzing social media text content, identifying hashtags, URLs, and mentions, adding redirect link styles, building HTML documents that support user-specified search keywords, and displaying them in an overlapping manner to achieve hierarchical tagging.
It improves the accuracy and flexibility of entity extraction, supports user customization needs, follows search engine matching rules, and provides a better user experience and visualization effects.
Smart Images

Figure CN116680485B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a text tagging method, device, and electronic device based on social media entity positioning and search matching. Background Art
[0002] When using social media software, users may encounter the following problems:
[0003] (1) For complex text content, there may be positioning errors or omissions.
[0004] (2) Ambiguity in entity recognition: When processing hashtags, URLs, domains, and mentions, there is a challenge of entity ambiguity. For example, some words may be used as both mention entities and general text.
[0005] (3) Accuracy of search keyword matching: Matching user-specified search keywords with content requires following the search engine's document matching rules. However, these rules can be difficult to accurately implement due to the complexity of search engine algorithms. For polysemous words, misspellings, or synonyms, the matching results may not be accurate enough.
[0006] (4) Handling of overlapping HTML content: Overlapping two layers of HTML content and adjusting their styles may cause layout and display issues. Summary of the Invention
[0007] In view of this, embodiments of the present invention provide a text tagging method, device, and electronic device based on social media entity positioning and search matching, which at least partially solve the problems existing in the prior art.
[0008] In a first aspect, an embodiment of the present invention provides a text tagging method based on social media entity positioning and search matching, comprising:
[0009] By analyzing and processing the text content, the hashtag, URL and mention entities are located and identified, the location information of the hashtag, URL and mention entities is returned, and the corresponding jump link style is added to each entity;
[0010] Based on the location information and jump style of the entity, the text content is assembled into a first HTML document, so that the assembled first HTML document has a click jump effect when displayed on the page;
[0011] Constructing a second HTML document that supports matching the user-specified search keyword with the content, wherein the second HTML document highlights the user-specified search keyword;
[0012] After the first HTML document and the second HTML document are positioned according to a predetermined algorithm, they are displayed overlappingly to display the content specified by the layered mark.
[0013] According to a specific implementation of an embodiment of the present disclosure, analyzing and processing text content to locate and identify hashtags, URLs, and mentions entities therein includes:
[0014] According to the search engine document matching rules, the position of the search keyword in the text content is determined, the search keyword is highlighted, and specific CSS styles or HTML tags are used to highlight the keywords.
[0015] According to a specific implementation of the embodiment of the present disclosure, the analysis and processing of text content to locate and identify hashtags, URLs, and mentions entities therein further includes:
[0016] Checks whether the text is empty or contains the # symbol. If the condition is not met, an empty array is returned.
[0017] Create an empty array tags to store the extracted hashtag entities;
[0018] Traverse all matching hashtags and get their text and location information;
[0019] Check if the text after hashtag is connected to other characters, if so, skip the current match;
[0020] Calculate the starting and ending positions of the hashtag and add its text and position information to the tags array;
[0021] Returns the final result array.
[0022] According to a specific implementation of the embodiment of the present disclosure, the analysis and processing of text content to locate and identify hashtags, URLs, and mentions entities therein further includes:
[0023] Use the while loop to traverse the text and use the regular expression extractUrl to match;
[0024] During the matching process, regular expressions are used to obtain specific parts of the matching results, including the characters before the URL, the extracted URL, the protocol, the domain name, and the path;
[0025] Depending on the different situations of the extracted URL, corresponding processing is performed:
[0026] If the URL does not have a protocol part, that is, it does not start with "http: / / " or "https: / / ", decide whether to continue processing the URL based on the option settings and the previous character matching rules. If the URL without a protocol is allowed to be extracted and meets the matching rules, it will be added to the result array;
[0027] If the URL has a protocol part, add it directly to the result array;
[0028] Add the extracted URL and its starting and ending position information in the text to the result array and return the final result array.
[0029] According to a specific implementation of the embodiment of the present disclosure, the analysis and processing of text content to locate and identify hashtags, URLs, and mentions entities therein further includes:
[0030] Checks if the text is empty or contains an @ symbol. If the condition is not met, an empty array is returned.
[0031] Create an empty array possibleNames to store the extracted possible @mention entities;
[0032] Traverse all matched @mention entities and obtain their associated usernames and location information;
[0033] Check if the text after the @mention entity is connected to other characters, if so, skip the current match;
[0034] Add the username and location information to the possibleNames array;
[0035] Returns the final possibleNames array, which contains the extracted @mention entities and their location information.
[0036] According to a specific implementation of the embodiment of the present disclosure, assembling text content into a first HTML document based on entity location information and jump style includes:
[0037] After sorting the entity's location information, locate the entity's location, hashtags, and menstions based on the social platform and entity type, and splice the corresponding entity's jump URL.
[0038] According to a specific implementation of the embodiment of the present disclosure, constructing a second HTML document that supports matching user-specified search keywords with content includes:
[0039] After sorting the positions of the extracted keywords, locate the keyword positions, highlight the styles for the keyword packaging, and splice the HTML fragments.
[0040] According to a specific implementation of the embodiment of the present disclosure, positioning the first HTML document and the second HTML document according to a predetermined algorithm and then displaying them in an overlapping manner to display the content specified by the hierarchical markup includes:
[0041] Obtaining a first HTML document for displaying entity information of social media content and a second HTML document for highlighting a user-specified search keyword;
[0042] Use the positioning properties in CSS to overlay the first and second HTML documents.
[0043] Use the stacking order property in CSS to control the display order of the first HTML document and the second HTML document, ensuring that the search keyword highlighting effect is above the social media content.
[0044] In a second aspect, an embodiment of the present invention provides a text tagging device based on social media entity positioning and search matching, comprising:
[0045] The recognition module is used to locate and identify hashtags, URLs, and mentions by analyzing and processing the text content, returning the location information of the hashtags, URLs, and mentions entities, and adding corresponding jump link styles for each entity;
[0046] An assembly module, configured to assemble the text content into a first HTML document based on the entity's location information and the jump style, so that the assembled first HTML document has a click-to-jump effect when displayed on the page;
[0047] A construction module, configured to construct a second HTML document that supports matching of user-specified search keywords with content, wherein the second HTML document highlights the user-specified search keywords;
[0048] The display module is used to position the first HTML document and the second HTML document according to a predetermined algorithm and then display them overlappingly to show the content specified by the layered mark.
[0049] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0050] at least one processor; and,
[0051] a memory communicatively connected to the at least one processor; wherein,
[0052] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the text tagging method based on social media entity positioning and search matching in any of the aforementioned first aspects or any implementation of the first aspect.
[0053] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the text tagging method based on social media entity positioning and search matching in the aforementioned first aspect or any implementation of the first aspect.
[0054] In a fifth aspect, an embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the text tagging method based on social media entity positioning and search matching in the aforementioned first aspect or any implementation of the first aspect.
[0055] The text tagging scheme based on social media entity positioning and search matching in an embodiment of the present invention includes: locating and identifying hashtags, URLs, and mentions entities by analyzing and processing the text content, returning the location information of the hashtags, URLs, and mentions entities, and adding a corresponding jump link style for each entity; assembling the text content into a first HTML document based on the entity's location information and jump style, so that the assembled first HTML document has a click-to-jump effect when displayed on the page; constructing a second HTML document that supports matching user-specified search keywords with content, and the second HTML document highlights the user-specified search keywords; after locating the first HTML document and the second HTML document according to a predetermined algorithm, they are displayed overlappingly to display the content specified by the hierarchical tag. Compared with the existing technology, the present invention has more comprehensive, accurate, and flexible entity extraction and highlighting functions, can meet the user's customization needs, and follow the search engine's matching rules to provide a better user experience and visualization effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0057] Figure 1A flowchart of a text tagging method based on social media entity positioning and search matching provided by an embodiment of the present invention;
[0058] Figure 2 A flowchart of another text tagging method based on social media entity positioning and search matching provided by an embodiment of the present invention;
[0059] Figure 3 A flowchart of another text tagging method based on social media entity positioning and search matching provided by an embodiment of the present invention;
[0060] Figure 4 A flowchart of another text tagging method based on social media entity positioning and search matching provided by an embodiment of the present invention;
[0061] Figure 5 A schematic structural diagram of a text tagging device based on social media entity positioning and search matching provided by an embodiment of the present invention;
[0062] Figure 6 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0063] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0064] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0065] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on this disclosure, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement an apparatus and / or practice a method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this apparatus and / or practice this method.
[0066] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The illustrations only show components related to the present disclosure and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component can be changed at will, and the component layout type may also be more complicated.
[0067] Additionally, in the following description, specific details are provided to provide a thorough understanding of the examples. However, one skilled in the art will appreciate that the aspects described can be practiced without these specific details.
[0068] The disclosed embodiments provide a text tagging method based on social media entity location and search matching. The text tagging method based on social media entity location and search matching provided in this embodiment can be performed by a computing device, which can be implemented as software or a combination of software and hardware, and can be integrated into a server, terminal device, or the like.
[0069] See also Figure 1 , Figure 2 , Figure 3 and Figure 4 The present disclosure provides a text tagging method based on social media entity positioning and search matching, including:
[0070] S101, by analyzing and processing the text content, locate and identify the hashtag, url and mention entities therein, return the location information of the hashtag, url and mention entities, and add a corresponding jump link style for each entity.
[0071] The text content is the text content that needs to be processed. It is pure text. The social platform needs to splice and generate the URL of the corresponding entity according to different social platform rules; according to the search engine document matching rules, determine the position of the search keyword in the text content, highlight the search keyword, and use specific CSS styles or HTML tags to highlight the keywords.
[0072] Locate and extract hashtags, URLs, and mentions from text, including:
[0073] Hashtag extraction:
[0074] Checks if the text is empty or contains a # symbol, and returns an empty array if the condition is not met.
[0075] Create an empty array tags to store the extracted hashtag entities.
[0076] Iterate over all matching hashtags and get their text and location information.
[0077] Check if the text after the hashtag is connected to other characters, if so, skip the current match.
[0078] Calculate the start and end positions of the hashtag and add its text and position information to the tags array.
[0079] Returns the final result array.
[0080] URL extraction:
[0081] Iterate through the text through a while loop and use the regular expression extractUrl to match.
[0082] During the matching process, regular expressions are used to obtain specific parts of the matching results, including the characters before the URL, the extracted URL, protocol, domain name, path, etc.
[0083] Verify the validity of the extracted URL.
[0084] Depending on the different situations of the extracted URL, corresponding processing is performed:
[0085] If the URL does not have a protocol part, that is, it does not start with "http: / / " or "https: / / ", the option settings and the previous character matching rules are used to determine whether to continue processing the URL. If the URL without a protocol is allowed to be extracted and the matching rules are met, it is added to the result array.
[0086] If the URL has a protocol part, add it directly to the result array.
[0087] Finally, the extracted URL and its starting and ending position in the text are added to the result array.
[0088] Returns the final result array.
[0089] Mentions extraction:
[0090] Checks if the text is empty or contains an @ symbol, and returns an empty array if the condition is not met.
[0091] Create an empty array possibleNames to store the extracted possible @mention entities.
[0092] Iterate over all matched @mention entities and get their associated username and location information.
[0093] Checks if the text after the @mention entity is connected to other characters, and if so, skips the current match.
[0094] Add the username and location information to the possibleNames array.
[0095] Returns the final possibleNames array, which contains the extracted @mention entities and their location information.
[0096] S102: assemble the text content into a first HTML document based on the entity's location information and the jump style, so that the assembled first HTML document has a click-to-jump effect when displayed on a page.
[0097] After sorting the above location information, locate the entity's location. Hashtags and mentions need to be combined based on the social platform and entity type, and the corresponding redirect URL should be spliced. The URL itself can be used as the redirect URL. These URLs are then pieced together from front to back to form an HTML fragment.
[0098] According to the above rules, the entity positions are traversed to generate an HTML fragment (the first HTML document), which includes a jump link style entity.
[0099] S103: Construct a second HTML document that supports matching the search keyword specified by the user with the content, and highlight the search keyword specified by the user in the second HTML document.
[0100] Utilize regular expression matching to implement search engine document matching rules and obtain the location of the specified search keyword. Generate a second HTML fragment (a second HTML document) containing the search keyword highlighting effect. After sorting the extracted keyword positions, locate the keyword position, highlight the keyword packaging style, and begin splicing the HTML fragments.
[0101] S104: Position the first HTML document and the second HTML document according to a predetermined algorithm, and then display them overlappingly to display the content specified by the layered markup.
[0102] According to the above steps, two HTML fragments are obtained. One is used to display the entity information of the social media content, and the other is used to highlight the search keywords specified by the user.
[0103] Use CSS positioning properties (such as position: absolute) to overlay the two HTML snippets. Adjust their position and size so that they overlap and display the desired effect.
[0104] Use CSS stacking order properties (such as z-index) to control the display order of the two HTML snippets. Ensure that the search keyword highlighting appears above the social media content. As needed, use other CSS style properties to further adjust the display, such as color, font style, and background color.
[0105] Compared with the prior art, the present invention has the following beneficial effects:
[0106] 1) Comprehensive processing of multiple entities: This method can simultaneously process multiple entity types, including hashtags, URLs, domains, and mentions. Compared to methods that only target specific entity types, this method has wider applicability and flexibility.
[0107] 2) High Positioning Accuracy: The present invention accurately determines the location of entities by performing position analysis on text content. This helps ensure the precise application of jump links and highlighting effects, providing a better user experience.
[0108] 3) Support for user customization: This invention can support the matching of user-specified search keywords with content. Users can customize search keywords so that they are highlighted in the displayed HTML content, improving user experience and satisfying customization needs.
[0109] 4) Comply with search engine matching rules: The matching rules of the present invention comply with search engine document matching rules, ensuring that the matching and highlighting effects of search keywords are consistent with those of the search engine. This helps to improve the accuracy and reliability of search results.
[0110] 5) Clear layered markup: By overlaying two layers of HTML content and adjusting their styles, the present invention achieves the need for layered markup of specified content. This ensures that the jump style of entities and the highlighting effect of user-specified search keywords are clearly visible, improving the readability and visual effect of the content.
[0111] In summary, compared with the existing technology, the present invention has more comprehensive, accurate and flexible entity extraction and highlighting functions, can meet the customized needs of users, follow the matching rules of search engines, and provide better user experience and visualization effects.
[0112] According to a specific implementation of an embodiment of the present disclosure, analyzing and processing text content to locate and identify hashtags, URLs, and mentions entities therein includes:
[0113] According to the search engine document matching rules, the position of the search keyword in the text content is determined, the search keyword is highlighted, and specific CSS styles or HTML tags are used to highlight the keywords.
[0114] See also Figure 2 According to a specific implementation of the embodiment of the present disclosure, the analysis and processing of text content to locate and identify hashtags, URLs, and mentions entities therein further includes:
[0115] S201, checks whether the text is empty or contains the # symbol. If the condition is not met, returns an empty array;
[0116] S202, creating an empty array tags for storing the extracted hashtag entities;
[0117] S203, traverse all matched hashtags and obtain their text and location information;
[0118] S204, checking whether the text after the hashtag is connected to other characters, if so, skipping the current matching item;
[0119] S205, calculating the starting position and ending position of the hashtag, and adding its text and position information to the tags array;
[0120] S206, returning the final result array.
[0121] See also Figure 3 According to a specific implementation of the embodiment of the present disclosure, the analysis and processing of text content to locate and identify hashtags, URLs, and mentions entities therein further includes:
[0122] S301, traverse the text through a while loop and use the regular expression extractUrl to match;
[0123] S302, during the matching process, using regular expressions to obtain specific parts of the matching results, including the characters before the URL, the extracted URL, the protocol, the domain name, and the path;
[0124] S303: Perform corresponding processing according to different situations of the extracted URL:
[0125] If the URL does not have a protocol part, that is, it does not start with "http: / / " or "https: / / ", decide whether to continue processing the URL based on the option settings and the previous character matching rules. If the URL without a protocol is allowed to be extracted and meets the matching rules, it will be added to the result array;
[0126] If the URL has a protocol part, add it directly to the result array;
[0127] S304: Add the extracted URL and its starting and ending position information in the text to the result array, and return the final result array.
[0128] See also Figure 4 According to a specific implementation of the embodiment of the present disclosure, the analysis and processing of text content to locate and identify hashtags, URLs, and mentions entities therein further includes:
[0129] S401, check whether the text is empty or contains the @ symbol, and if the condition is not met, return an empty array;
[0130] S402, creating an empty array possibleNames for storing the extracted possible @mention entities;
[0131] S403, traverse all matched @mention entities and obtain their related user names and location information;
[0132] S404, checking whether the text after the @mention entity is connected to other characters, and if so, skipping the current matching item;
[0133] S405, adding the user name and location information to the possibleNames array;
[0134] S406: Return the final possibleNames array, which contains the extracted @mention entities and their location information.
[0135] According to a specific implementation of the embodiment of the present disclosure, assembling text content into a first HTML document based on entity location information and jump style includes:
[0136] After sorting the entity's location information, locate the entity's location, hashtags, and menstions based on the social platform and entity type, and splice the corresponding entity's jump URL.
[0137] According to a specific implementation of the embodiment of the present disclosure, constructing a second HTML document that supports matching user-specified search keywords with content includes:
[0138] After sorting the positions of the extracted keywords, locate the keyword positions, highlight the styles for the keyword packaging, and splice the HTML fragments.
[0139] According to a specific implementation of the embodiment of the present disclosure, positioning the first HTML document and the second HTML document according to a predetermined algorithm and then displaying them in an overlapping manner to display the content specified by the hierarchical markup includes:
[0140] Obtaining a first HTML document for displaying entity information of social media content and a second HTML document for highlighting a user-specified search keyword;
[0141] Use the positioning properties in CSS to overlay the first and second HTML documents.
[0142] Use the stacking order property in CSS to control the display order of the first HTML document and the second HTML document, ensuring that the search keyword highlighting effect is above the social media content.
[0143] See also Figure 5 The embodiment of the present invention further discloses a text tagging device 50 based on social media entity positioning and search matching, comprising:
[0144] Identification module 501 is used to locate and identify hashtags, URLs, and mentions by analyzing and processing the text content, returning the location information of the hashtags, URLs, and mentions entities, and adding corresponding jump link styles for each entity;
[0145] An assembly module 502 is configured to assemble the text content into a first HTML document based on the entity's location information and the jump style, so that the assembled first HTML document has a click-to-jump effect when displayed on a page;
[0146] A construction module 503 is used to construct a second HTML document that supports matching the search keyword specified by the user with the content, and the second HTML document highlights the search keyword specified by the user;
[0147] The display module 504 is used to position the first HTML document and the second HTML document according to a predetermined algorithm and then display them overlappingly to show the content specified by the layered mark.
[0148] See also Figure 6 , an embodiment of the present invention further provides an electronic device 60, the electronic device comprising:
[0149] at least one processor; and,
[0150] a memory communicatively connected to the at least one processor; wherein,
[0151] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the text tagging method based on social media entity positioning and search matching in the aforementioned method embodiment.
[0152] An embodiment of the present invention further provides a non-transitory computer-readable storage medium, which stores computer instructions. The computer instructions are used to enable the computer to execute the aforementioned method embodiment.
[0153] An embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, which, when executed by a computer, enable the computer to execute the text tagging method based on social media entity positioning and search matching in the aforementioned method embodiment.
[0154] Figure 6 The device shown can perform Figure 1-4 For the method of the embodiment shown in FIG. 1 , reference may be made to the description of the part not described in detail in the embodiment. Figure 1-4 The relevant description of the illustrated embodiment will not be repeated here.
[0155] Reference below Figure 6 , which shows a schematic structural diagram of an electronic device 60 suitable for implementing the embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0156] like Figure 6 As shown, the electronic device 60 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 60 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0157] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 60 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 60 is shown with various devices, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have instead.
[0158] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0159] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0160] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0161] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains at least two Internet Protocol addresses; sends a node evaluation request including the at least two Internet Protocol addresses to a node evaluation device, wherein the node evaluation device selects an Internet Protocol address from the at least two Internet Protocol addresses and returns it; receives the Internet Protocol address returned by the node evaluation device; wherein the obtained Internet Protocol address indicates an edge node in a content distribution network.
[0162] Alternatively, the computer-readable medium carries one or more programs, which, when executed by the electronic device, causes the electronic device to: receive a node evaluation request including at least two Internet Protocol addresses; select an Internet Protocol address from the at least two Internet Protocol addresses; and return the selected Internet Protocol address; wherein the received Internet Protocol address indicates an edge node in a content distribution network.
[0163] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0164] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0165] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0166] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware or a combination thereof.
[0167] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A text tagging method based on social media entity positioning and search matching, characterized in that: include: By analyzing and processing the text content, the hashtag, URL and mention entities are located and identified, the location information of the hashtag, URL and mention entities is returned, and the corresponding jump link style is added to each entity; Based on the location information and jump style of the entity, the text content is assembled into a first HTML document, so that the assembled first HTML document has a click jump effect when displayed on the page; Constructing a second HTML document that supports matching the user-specified search keyword with the content, wherein the second HTML document highlights the user-specified search keyword; Positioning the first HTML document and the second HTML document according to a predetermined algorithm, and then displaying them in an overlapping manner to display the content specified by the hierarchical markup; in The analysis and processing of text content to locate and identify hashtags, URLs, and mentions includes: Checks if the text is empty or contains an @ symbol. If the condition is not met, an empty array is returned. Create an empty array possibleNames to store the extracted possible @mention entities; Traverse all matched @mention entities and obtain their associated usernames and location information; Check if the text after the @mention entity is connected to other characters, if so, skip the current match; Add the username and location information to the possibleNames array; Returns the final possibleNames array, which contains the extracted @mention entities and their location information.
2. The method according to claim 1, characterized in that The analysis and processing of text content to locate and identify hashtags, URLs, and mentions includes: According to the search engine document matching rules, the position of the search keyword in the text content is determined, the search keyword is highlighted, and specific CSS styles or HTML tags are used to highlight the keywords.
3. The method according to claim 2, characterized in that The analysis and processing of text content to locate and identify hashtags, URLs, and mentions entities therein also includes: Checks whether the text is empty or contains the # symbol. If the condition is not met, an empty array is returned. Create an empty array tags to store the extracted hashtag entities; Traverse all matching hashtags and get their text and location information; Check if the text after hashtag is connected to other characters, if so, skip the current match; Calculate the starting and ending positions of the hashtag and add its text and position information to the tags array; Returns the final result array.
4. The method according to claim 3, characterized in that The analysis and processing of text content to locate and identify hashtags, URLs, and mentions entities therein also includes: Use the while loop to traverse the text and use the regular expression extractUrl to match; During the matching process, regular expressions are used to obtain specific parts of the matching results, including the characters before the URL, the extracted URL, the protocol, the domain name, and the path; Depending on the different situations of the extracted URL, corresponding processing is performed: If the URL does not have a protocol part, that is, it does not start with "http: / / " or "https: / / ", decide whether to continue processing the URL based on the option settings and the previous character matching rules. If the URL without a protocol is allowed to be extracted and meets the matching rules, it will be added to the result array; If the URL has a protocol part, add it directly to the result array; Add the extracted URL and its starting and ending position information in the text to the result array and return the final result array.
5. The method according to claim 1, wherein The step of assembling the text content into a first HTML document based on the entity location information and the jump style includes: After sorting the entity's location information, locate the entity's location, hashtags, and menstions based on the social platform and entity type, and splice the corresponding entity's jump URL.
6. The method according to claim 1, characterized in that The constructing of the second HTML document supporting matching of user-specified search keywords and content includes: After sorting the positions of the extracted keywords, locate the keyword positions, highlight the styles for the keyword packaging, and splice the HTML fragments.
7. The method according to claim 1, characterized in that The first HTML document and the second HTML document are positioned according to a predetermined algorithm and then displayed in an overlapping manner to display the content specified by the hierarchical markup, including: Obtaining a first HTML document for displaying entity information of social media content and a second HTML document for highlighting a user-specified search keyword; Use the positioning properties in CSS to overlay the first and second HTML documents. Use the stacking order property in CSS to control the display order of the first HTML document and the second HTML document, ensuring that the search keyword highlighting effect is above the social media content.
8. A text tagging device based on social media entity positioning and search matching, characterized in that: include: The recognition module is used to analyze and process the text content, locate and identify the hashtag, URL, and mention entities, return the location information of the hashtag, URL, and mention entities, and add the corresponding jump link style for each entity; An assembly module, configured to assemble the text content into a first HTML document based on the entity's location information and the jump style, so that the assembled first HTML document has a click-to-jump effect when displayed on the page; A construction module, configured to construct a second HTML document that supports matching of user-specified search keywords with content, wherein the second HTML document highlights the user-specified search keywords; A display module is used to position the first HTML document and the second HTML document according to a predetermined algorithm and then display them overlappingly to show the content specified by the layered mark; in The analysis and processing of text content to locate and identify hashtags, URLs, and mentions includes: Checks if the text is empty or contains an @ symbol. If the condition is not met, an empty array is returned. Create an empty array possibleNames to store the extracted possible @mention entities; Traverse all matched @mention entities and obtain their associated usernames and location information; Check if the text after the @mention entity is connected to other characters, if so, skip the current match; Add the username and location information to the possibleNames array; Returns the final possibleNames array, which contains the extracted @mention entities and their location information.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the text tagging method based on social media entity positioning and search matching according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for identifying user click behavior and gateway equipment
CN103825772A
Highlighting method and device based on rich text
CN112380337A