Text timeliness determination method, device and equipment and computer storage medium
By performing word segmentation and semantic recognition of the target text, combining the position and context information of the time keywords, accurately distinguishing the effective and invalid time types, the accuracy of the timeliness judgment of the content page is solved and the judgment efficiency is improved.
Patent Information
- Application Number
- CN202410175898.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-07
- Publication Date
- 2025-08-08
AI Technical Summary
In the prior art, the timeliness of content pages are not accurate, resulting in misjudgment of the timeliness of content pages.
By performing word segmentation processing on the target text, the position information of the time keyword is obtained, and combined with the overall semantic characteristics and the semantic information of the context, the time keyword is classified and recognized to distinguish between effective time types and invalid time types.
It improves the accuracy of time type judgment of time keywords, simplifies the steps of text timeliness, and improves judgment efficiency.
Smart Images

Figure CN120449875A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus and device for determining text timeliness, and a computer storage medium. Background Art
[0002] With the continuous development of science and technology, the Internet has become the primary way for people to obtain information. Similarly, more and more people are publishing content in the form of pictures, text, and videos on the Internet. If such a large number of content pages are directly browsed by visitors without any screening, they will be flooded with a large amount of meaningless content throughout the browsing process, which will lead to a poor visitor experience.
[0003] To this end, each content access platform will provide a corresponding content recommendation system to provide visitors with content that they may be interested in, so as to improve their platform access experience.
[0004] Typically, when recommending content, a content access platform will determine the priority of the content to be recommended based on the timeliness of the information contained in the content. In this case, the more time-sensitive the content, the higher its recommendation priority.
[0005] However, the current method of obtaining information timeliness from content pages has low accuracy. Due to the complexity of text expression, characters with different meanings may be confused, leading to misjudgment of the timeliness of the content page.
[0006] Therefore, how to improve the accuracy of timeliness judgment for content pages is a technical problem that needs to be solved urgently. Summary of the Invention
[0007] The present application provides a method, apparatus, and device for determining text timeliness, as well as a computer storage medium, for improving the accuracy of timeliness judgment for content pages.
[0008] In a first aspect, the present application provides a method for determining text timeliness, the method comprising:
[0009] Performing word segmentation processing on the target text, and when the obtained word segmentation results contain at least one time keyword, obtaining position information of the at least one time keyword in the target text;
[0010] Performing semantic recognition processing on the target text to obtain overall semantic features of the target text;
[0011] Based on the overall semantic feature and the obtained at least one position information, obtaining a time semantic element corresponding to the at least one time keyword in the overall semantic feature; the time semantic element includes semantic information of the corresponding time keyword and semantic information of the context of the corresponding time keyword;
[0012] Based on the obtained time semantic elements, the at least one time keyword is classified and identified respectively to obtain the time type corresponding to each of the at least one time keyword; wherein the time type includes: an invalid time type that cannot represent the timeliness of the target text and a valid time type used to represent the timeliness of the target text.
[0013] In a second aspect, the present application provides a device for determining text timeliness, the device comprising:
[0014] A word segmentation module is used to perform word segmentation processing on the target text, and when the obtained word segmentation results contain at least one time keyword, obtain the position information of the at least one time keyword in the target text;
[0015] A recognition module, configured to perform semantic recognition processing on the target text to obtain overall semantic features of the target text;
[0016] an extraction module configured to obtain, based on the overall semantic feature and the obtained at least one position information, a time semantic element corresponding to the at least one time keyword in the overall semantic feature; the time semantic element comprising semantic information of the corresponding time keyword and semantic information of a context of the corresponding time keyword;
[0017] A determination module is used to classify and identify the at least one time keyword based on the obtained time semantic elements, and obtain the time type corresponding to each of the at least one time keyword; wherein the time type includes: an invalid time type that cannot represent the timeliness of the target text and a valid time type used to represent the timeliness of the target text.
[0018] In a possible implementation, the recognition module is configured to perform semantic recognition processing on the target text and obtain the overall semantic features of the target text, specifically for:
[0019] Performing vectorization processing on the target text to obtain the word segmentation vector corresponding to each word segmentation result in the target text;
[0020] Based on the separation marks included in the target text, obtaining at least one word segmentation vector set, where each word segmentation vector belonging to the same word segmentation vector set is located between two adjacent separation marks;
[0021] For each obtained word segmentation vector set, the following operations are respectively performed: based on each word segmentation vector included in a word segmentation vector set, semantic recognition processing is performed on each word segmentation vector to obtain a semantic feature element corresponding to each word segmentation vector, each semantic feature element including semantic information of the corresponding word segmentation vector and partial semantic information of each word segmentation vector in the word segmentation vector set;
[0022] Based on the obtained semantic feature elements, the corresponding overall semantic feature is obtained.
[0023] In a possible implementation, the word segmentation module is used to perform word segmentation processing on the target text. When the obtained word segmentation result contains at least one time keyword, obtaining the position information of each of the at least one time keyword in the target text is specifically used to:
[0024] Segmenting the target text, and when a target sentence containing at least one time keyword exists in the obtained sentence segmentation results, segmenting the target sentence and obtaining position information of each of the at least one time keyword in the target sentence;
[0025] The step of performing semantic recognition processing on the target text to obtain the overall semantic features of the target text includes:
[0026] Perform semantic recognition processing on the target sentence to obtain the overall semantic features of the target sentence.
[0027] In a possible implementation, after obtaining the time type corresponding to each of the at least one time keywords, the determining module is further configured to:
[0028] When there is at least one intermediate time keyword whose time type is the valid time type among the at least one time keyword, obtaining time information corresponding to the current moment;
[0029] Based on the time information, selecting a target time keyword whose distance from the time information meets a preset time range requirement from the at least one intermediate time keyword obtained;
[0030] Based on the contextual relationship between the time information and the target time keyword, the timeliness of the target text is obtained.
[0031] In a possible implementation, when the determination module is used to obtain the timeliness of the target document, it is specifically used to:
[0032] When the time corresponding to the target time keyword is after the time corresponding to the time information, determining that the target text is valid content and increasing the recommendation weight corresponding to the target text;
[0033] When the time corresponding to the target time keyword is before the time corresponding to the time information, the target text is determined to be outdated content, and the recommendation weight corresponding to the target text is reduced.
[0034] In a possible implementation, when there is at least one time keyword in the obtained word segmentation result, the word segmentation module is used to obtain the position information of each of the at least one time keyword in the target text, specifically to:
[0035] Performing type recognition processing on each segmentation word in the segmentation result to obtain a type recognition result for each segmentation word in the segmentation result; when it is determined based on the type recognition result that at least one time keyword exists in the segmentation result, obtaining position information of each of the at least one time keyword in the target text; or,
[0036] Based on preset character matching rules, character matching processing is performed on each word in the word segmentation result to obtain the character matching results of each word in the word segmentation result; when it is determined based on the character matching results that there is at least one time keyword in the word segmentation result, the position information of each of the at least one time keywords in the target text is obtained.
[0037] In a third aspect, the present application provides an electronic device comprising a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor implements the steps of any of the above methods.
[0038] In a fourth aspect, the present application also provides a computer-readable storage medium, which includes a computer program. When the computer program runs on an electronic device, the computer program is used to enable the electronic device to execute the steps of any of the above methods.
[0039] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which implements the steps of any of the above methods when executed by a processor.
[0040] The beneficial effects of this application are as follows:
[0041] In this scheme, by obtaining the position information of the time keyword in the target text and the overall semantic features corresponding to the target text, the semantic information corresponding to the time keyword context is integrated into the semantic recognition results corresponding to the time keyword. The context contains the semantics of a relatively complete sentence, and the time type corresponding to the time keyword is judged, thereby improving the accuracy of determining the time type of the time keyword.
[0042] On the other hand, the time types corresponding to time keywords are divided into valid time types and invalid time types to distinguish whether the time keywords can represent the timeliness of the target text, which simplifies the steps of judging the timeliness of the text and improves the efficiency of determining the timeliness of the text. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A schematic diagram of a possible application scenario provided by an embodiment of the present application;
[0044] Figure 2 A training flow chart of the target recognition model provided in the embodiment of the present application;
[0045] Figure 3 A flowchart of a method for determining text timeliness provided in an embodiment of the present application;
[0046] Figure 4A A schematic diagram of a method for obtaining a target text provided in an embodiment of the present application;
[0047] Figure 4B A schematic diagram of another method for obtaining target text provided in an embodiment of the present application;
[0048] Figure 4C A schematic diagram of another method for obtaining target text provided in an embodiment of the present application;
[0049] Figure 5 A schematic diagram of a method for obtaining location information provided in an embodiment of the present application;
[0050] Figure 6 A flowchart of a method for obtaining overall semantic features provided in an embodiment of the present application;
[0051] Figure 7 A schematic diagram of a method for obtaining a word segmentation vector set provided in an embodiment of the present application;
[0052] Figure 8A A schematic diagram of a method for obtaining high-dimensional features provided in an embodiment of the present application;
[0053] Figure 8B A schematic diagram of a method for obtaining time keyword location information provided in an embodiment of the present application;
[0054] Figure 9 A flowchart of a method for obtaining the timeliness of a target text provided in an embodiment of the present application;
[0055] Figure 10 A schematic diagram showing the relationship between the intermediate time keywords and the current time provided in an embodiment of the present application;
[0056] Figure 11A schematic diagram of a method for adjusting recommendation weights provided in an embodiment of the present application;
[0057] Figure 12 A schematic diagram of a method for determining the timeliness of a target text provided in an embodiment of the present application;
[0058] Figure 13 A schematic diagram of the structure of a device for determining text timeliness provided in an embodiment of the present application;
[0059] Figure 14 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application;
[0060] Figure 15 This is a schematic diagram of the hardware structure of another electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other in any way. In addition, although a logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
[0062] It is understood that in the following specific implementation methods of this application, when the relevant data such as the determination of text timeliness is involved, when the various embodiments of this application are applied to specific products or technologies, relevant licenses or consents need to be obtained, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions. For example, when it is necessary to obtain relevant data, relevant volunteers can be recruited and relevant agreements on volunteer authorization data can be signed, and then the data of these volunteers can be used for implementation; or, by implementing within the scope of an authorized organization, the following implementation method can be implemented by using the data of internal members of the organization to conduct relevant identification to internal members; or, the relevant data used in the specific implementation are all simulated data, such as simulated data generated in a virtual scene.
[0063] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0064] The following is a brief introduction to the design concept of the embodiment of this application:
[0065] With the advent of the internet age, information has exploded online, creating a vast amount of information available for visitors to browse. However, visitors have limited energy. Faced with this seemingly infinite amount of content, if they simply search and access it on their own, it will take a long time to obtain effective information, resulting in low efficiency and a poor experience for visitors on the content access platform.
[0066] To this end, each content access platform provides a corresponding content recommendation system to provide visitors with content that may be of interest to them. Typically, one possible approach to content recommendation is to recommend content pages based on the timeliness of the information on the content page. For example, the server can extract time-sensitive keywords from the content page and use these keywords to determine whether the content is a review article or news article with strong timeliness. If so, the content page is recommended and distributed accordingly.
[0067] However, the general method for determining the timeliness of content pages can only simply obtain some time-indicating keywords from the content pages, but cannot accurately identify their specific meanings. This can cause some time keywords that have no time meaning (such as "today" in "the weather is nice today") to be mistakenly identified as time keywords for the content pages.
[0068] In view of this, the present application provides a method for determining the timeliness of a text, which obtains the location information of possible time keywords by performing word segmentation processing on the target text, and then performs semantic recognition processing on the target text to obtain the corresponding overall semantic features. Based on the location information of the time keyword and the overall semantic features corresponding to the target text, the time semantic elements corresponding to the time keyword and containing the semantic information of the time keyword context are obtained, and then the time keywords are classified and identified based on such time semantic elements, and the time type corresponding to the time keyword is determined.
[0069] Specifically, when performing semantic recognition processing on the target text, the word segmentation vectors corresponding to each character in the target text can be separated according to the separation marks contained in the target text, so that the word segmentation vectors between two separation marks belong to the same word segmentation vector set. Then, based on the word segmentation vectors contained in a word segmentation vector set, semantic recognition is performed on each word segmentation vector, so that the semantic feature elements corresponding to each obtained word segmentation vector contain the semantic information of the corresponding word segmentation vector and part of the semantic information of each word segmentation vector in a word segmentation vector set.
[0070] In this way, each feature element in the overall semantic feature obtained after semantic recognition of the target text can include not only the semantic information of the corresponding word segmentation, but also partial semantic information of the context segmentation of the corresponding word segmentation, thereby utilizing the semantic information of the context to further accurately determine the semantics of the word segmentation.
[0071] Therefore, through the position information of the time keyword, the time semantic element corresponding to the time keyword can be obtained from the above-mentioned overall semantic features that include partial semantic information of the context. The time semantic element can determine the meaning of the time keyword through the semantic information of the context of the time keyword, and then make it possible to judge whether the time type corresponding to the time keyword is a valid time type or an invalid time type based on the time semantic element corresponding to the time keyword, thereby judging the timeliness of the target text where the time keyword is located.
[0072] In an embodiment of the present application, the above-mentioned text timeliness determination process is carried out through a target recognition model, and the part of obtaining the target recognition model and adjusting the model parameters involves artificial intelligence (AI) and machine learning (ML) technology, which is designed based on classification technology, feature extraction and machine learning in artificial intelligence.
[0073] Artificial intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also involves studying the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0074] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, pre-trained models, operating / interaction systems, and mechatronics. Pre-trained models, also known as large models or basic models, can be fine-tuned and widely applied to downstream tasks across various AI disciplines. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0075] Machine learning is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning. Pretrained models are the latest development in deep learning, integrating these techniques.
[0076] The following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios described below are only used to illustrate the embodiments of the present application and are not limiting. In the specific implementation process, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.
[0077] It should be noted that the solution provided in the embodiment of the present application can be applied to most content recommendation scenarios. For example, it is applicable to the recommendation and distribution scenarios of news consultation content, the recommendation and distribution scenarios of current affairs commentary content, etc. Figure 1 , is a schematic diagram of a possible application scenario provided by an embodiment of the present application, in which a terminal device 101 and a server 102 may be included.
[0078] The terminal device 101 can be a mobile phone, a tablet computer (PAD), a personal computer (PC), a wearable device, a vehicle-mounted terminal, etc., or a camera, a video camera, etc.
[0079] Server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.
[0080] The server 102 may include one or more processors 1021, a memory 1022, and an I / O interface 1023 for interacting with a terminal. In addition, the server 102 may also be configured with a database 1024, which may be used to store web content information such as article content and image content. The memory 1022 of the server 102 may also store program instructions for the text timeliness determination method provided in the embodiment of the present application. When these program instructions are executed by the processor 1021, they may be used to implement the steps for determining text timeliness provided in the embodiment of the present application, thereby determining the timeliness of the text.
[0081] The terminal device 101 and the server 102 can be directly or indirectly connected to each other through one or more communication networks 103. The communication network 103 can be a wired network or a wireless network, for example, a mobile cellular network or a Wireless Fidelity (WIFI) network, or other possible networks, which are not limited in the present embodiment.
[0082] It should be noted that each method in the embodiments of the present application can be executed by an electronic device, which can be a terminal device 101 or a server 102, that is, each method can be executed separately by the terminal device 101 or the server 102.
[0083] For example, when the text timeliness determination method provided by this application is executed independently by the terminal device 101, the above-mentioned target recognition model can be deployed in the terminal device 101. The target recognition model is used to perform word segmentation processing on the target text, and then the location information of the time keyword is obtained. After the target text is semantically recognized, the time semantic element corresponding to the time keyword is obtained from the obtained overall semantic features, and then the time type corresponding to the time keyword is judged according to the time semantic element to determine whether it is a valid time type or an invalid time type.
[0084] For another example, when the above method is jointly implemented by the terminal device 101 and the server 102, the terminal device 101 can provide the corresponding target text to the server 102, and the server 102 executes the timeliness determination method for the target text to determine whether there are time keywords that can characterize the timeliness of the target text, and then provides feedback to the terminal device 101, so that the terminal device 101 adjusts the recommendation weight of the content corresponding to the target text according to the feedback results, thereby providing corresponding recommended content to the visitor.
[0085] It should be noted that Figure 1The examples shown are only for illustration. In fact, the number and communication mode of terminal devices and servers are not limited and are not specifically limited in the embodiments of this application.
[0086] The following describes the text timeliness determination method provided by the exemplary embodiment of the present application in combination with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation of the present application is not limited in this respect.
[0087] When introducing the text timeliness determination method provided in the embodiment of the present application, it is first necessary to introduce the training process of the target recognition model used to execute the text timeliness determination method.
[0088] See also Figure 2 , is a training flowchart of the target recognition model provided in an embodiment of the present application, which includes the following steps:
[0089] Step S201: Obtain samples to be processed, each of which includes different sample texts and a true label corresponding to each sample text.
[0090] For example, in a sample to be processed, the sample text may contain time keywords or not. The sample text containing time keywords also includes sample text containing time keywords corresponding to invalid time types and sample text containing time keywords corresponding to valid time types. These contents can all be marked by the real labels corresponding to the sample texts.
[0091] Step S202: Using the recognition model to be trained in this iteration, perform text timeliness recognition on the samples to be processed in this iteration to obtain sample recognition results for each sample to be processed.
[0092] In the embodiment of the present application, in each round of iterative training, all the samples to be processed can be used as the input of this round, or a portion of the samples to be processed can be extracted as the input of this round. The process of text timeliness recognition will be described in detail later, so it will not be described in detail here.
[0093] Step S203: Based on the sample recognition result of each sample to be processed and the corresponding true label, determine the model loss value of the recognition model to be trained in this iteration.
[0094] In one possible implementation, the model loss value can be calculated using any possible loss function, such as the cross entropy loss function (Cross Entropy Loss Function), the mean squared error (MSE) loss function, the squared absolute error loss function, the maximum likelihood loss (Likelihood Loss, LHL) function, etc. Of course, other possible loss functions can also be used, and this embodiment of the present application does not limit this.
[0095] Step S204: Determine whether the recognition model to be trained in this iteration has reached the convergence condition.
[0096] In the embodiment of the present application, the convergence condition may include one or more of the following conditions:
[0097] (1) The number of iterations reaches the set threshold.
[0098] (2) The model loss value is less than the set loss threshold.
[0099] Step S205: If the determination process of step S204 is no, the model parameters are adjusted based on the model loss value.
[0100] In the embodiment of the present application, if the number of iterations does not exceed the pre-set number threshold and the model loss value is not less than the set loss threshold, the determination process of step 204 is negative, i.e., it is considered that the current recognition model to be trained does not meet the convergence conditions, and it is necessary to adjust the model parameters to continue training. After the parameter adjustment, the next iterative training process is entered, that is, jumping to step 202.
[0101] In a possible implementation, when the model still does not meet the convergence conditions, the model weight parameters can be updated by the gradient descent method, and the training can be continued with the updated model weight parameters.
[0102] When the number of iterations has exceeded the preset number threshold, or the model loss value is less than the set loss threshold, the determination process of step 204 is yes, that is, it is considered that the current recognition model to be trained has met the convergence conditions, the model training is completed, and the target recognition model is obtained. In order to verify the effect of the trained target recognition model, the embodiment of the present application uses the sample to be processed to test the target recognition model. If the evaluation index reaches the preset evaluation effect, the target recognition model can be used in the actual text timeliness determination process. If the model evaluation fails, it is necessary to continue training and testing until the recognition model to be trained reaches the preset evaluation effect.
[0103] After the model training is completed, the target recognition model can be used to participate in the actual process of determining the timeliness of the text. The following is an illustration of the process of applying the obtained target recognition model:
[0104] See also Figure 3 , which is a flowchart of a method for determining text timeliness provided in an embodiment of the present application. For the convenience of subsequent explanation, the following will take the execution subject as the server as an example to introduce the specific implementation steps of the method. In actual application, the execution subject of the method can be undertaken by the terminal device or server introduced above, and this application does not impose any restrictions on this.
[0105] like Figure 3 As shown, the specific implementation steps of this method are as follows:
[0106] Step S301: performing word segmentation processing on the target text, and when there is at least one time keyword in the obtained word segmentation results, obtaining position information of each of the at least one time keyword in the target text.
[0107] In the method provided in the embodiments of the present application, a primary purpose of determining text timeliness is to determine whether the corresponding content of the text should be recommended or retired. This ensures that the recommended content presented to visitors is largely up-to-date and still meaningful. Therefore, the target text proposed in step S301 is the text content on the content page provided by the content access platform.
[0108] It should be noted that the server can obtain the target text in the following ways, so that the acquisition of the target text is not limited to being obtained from article pages that are all text, thereby expanding the scope of recommended content that can be determined by timeliness.
[0109] Optionally, when the server obtains the target text, Figure 4A As shown, when the content page provided by the content access platform contains all text content, the server can directly obtain all the text in the content page as the target text that needs to be executed in the subsequent text timeliness determination method.
[0110] like Figure 4B As shown, when the content page provided by the content access platform contains image content, the server can perform optical character recognition (OCR) processing on the image contained in the content page, extract text from the image, and then convert the text into target text.
[0111] like Figure 4C As shown, when the content page provided by the content access platform contains video content, the server can obtain each video frame from the video content and perform OCR processing on the text content contained in the video frame to extract the text content. At the same time, the server can obtain each audio frame from the audio content contained in the video content and perform speech recognition technology (Automatic Speech Recognition, ASR) processing on the text content contained in each audio frame to extract the text information contained in the audio content, and then summarize the image in the video content and the text information in the audio into the target text corresponding to the content page.
[0112] In addition, when certain content pages contain at least one of text, image, audio, video, etc., the server can simultaneously use multiple methods to extract the text information in the content page to obtain the corresponding target text.
[0113] In this way, through the above-mentioned method of obtaining the target text, the path to obtaining the target text is broadened, so that the solution provided by this application can be applied to the timeliness determination of more types of content pages, thereby improving the scope of application of this solution and can adapt to various situations without consuming too much training cost.
[0114] After acquiring the target text, the server performs word segmentation on it and, within the segmentation results, determines whether the target text contains at least one time keyword. Only if the target text contains at least one time keyword does the server subsequently determine the timeliness of the target text. If the server determines that the target text does not contain a time keyword, it skips the target text that does not contain the time keyword and continues word segmentation on the remaining target text, determining whether it contains the time keyword.
[0115] Optionally, after obtaining the target text, the server may choose to first segment the target text into sentences, and then perform subsequent word segmentation processing on each sentence, thereby reducing the amount of text that needs to be faced when performing semantic recognition on the target text.
[0116] Specifically, such as Figure 5 As shown, the server may first segment the target text to obtain at least one sentence. The server may then identify the obtained sentence to determine whether it contains a time keyword. If it is determined that a target sentence containing at least one time keyword exists in the obtained sentence results, the server may segment the target sentence to obtain the location information corresponding to the at least one time keyword contained in the target sentence.
[0117] As mentioned above, the server can perform sentence and word segmentation on the target text. When determining the presence of at least one time keyword, it obtains the corresponding position information of each of the at least one time keyword in the target text. Specifically, determining whether the target text contains a time keyword can be achieved through the following method.
[0118] Optionally, regardless of whether the server is performing word segmentation processing on the target text or on the target sentence, after the server obtains the corresponding word segmentation result, the server can perform type identification processing on the word segmentation result, thereby obtaining the type identification result of each word in the word segmentation result.
[0119] For example, when the server obtains the word segmentation results of "tomorrow", "movie", and "release", when performing type recognition processing on these three word segmentations, the three corresponding parts of speech types of time adverbial, subject, and verb can be obtained respectively. Among them, the type recognition result corresponding to the word "today" is: time adverbial. Therefore, the server can determine that "today" is the time keyword in the word segmentation result based on the type recognition result.
[0120] After the server obtains the type identification results corresponding to each word in the word segmentation result, it can determine whether there is at least one time keyword in the word segmentation result based on these type identification results. When the server determines that there is at least one time keyword in the word segmentation result, it obtains the position information of these at least one time keyword in the target text or target sentence. Optionally, the position information can be the order of each character in the time keyword in the target text, or the position information can also be the order of the first character in the time keyword in the target text, as well as the length of the time keyword. This application does not impose any restrictions on this.
[0121] Exemplary, in the specific implementation process of this method, the server can adopt the Python package (referred to as pyltp tool) of language technology platform (LanguageTechnologyPlatform, LTP), carry out corresponding word segmentation processing to the target text, then carry out subsequent classification, integration processing, finally output corresponding time keywords, and output the position information corresponding to the corresponding time keywords. For another example, the server can also adopt the Python interface (referred to as pyhanlp tool) of Chinese language processing package (Han LanguageProcessing, Hanlp), carry out corresponding word segmentation processing to the target text, and carry out corresponding part of speech tagging, so that after obtaining the word segmentation result, the server obtains the position information corresponding to the corresponding time keyword again. For another example, the server can also use Chinese word segmentation tool (jieba) to carry out corresponding word segmentation processing to the target text. This word segmentation tool jieba is a Chinese word segmentation tool based on python, which covers a variety of word segmentation algorithms and can also carry out word segmentation, part of speech tagging and other processing to the target text. It should be noted that the above word segmentation tools are only examples. In actual application, users can adaptively choose different word segmentation tools according to their own needs to identify and obtain the above time keywords.
[0122] Optionally, when determining whether the target text contains the time keyword, the server may also adopt the following implementation method:
[0123] First, based on a preset character matching rule, character matching processing is performed on each segmentation word in the obtained segmentation results, thereby obtaining a character matching result corresponding to each segmentation word in each segmentation result.
[0124] For different forms of time expressions, the preset character matching rules may include multiple different character matching rules at the same time.
[0125] For example, when using Chinese characters such as "today" and "tomorrow" to identify time information, the character matching rules can directly include the characters "today" and "tomorrow". In this way, as long as the target text contains the same characters, the server can determine that the target text contains at least one time keyword.
[0126] For another example, when the text uses a combination of Chinese characters, numbers, identifiers, etc. to identify time information, the character matching rules may include format restrictions. For example, the character matching rules may stipulate that if there is content in the format of "XX year XX month XX day" or "XX:XX" (where XX is a number), the text of the corresponding format contained in the target text can be determined to be a time keyword. Secondly, after obtaining the character matching results corresponding to each word segmentation, when the server determines that there is at least one time keyword in the word segmentation result based on these character matching results, the position information of each of these at least one time keywords in the target text can be obtained. Among them, the acquisition and content of the position information corresponding to these time keywords are similar to the corresponding position information in the above-mentioned type recognition process, and will not be repeated here.
[0127] The present application provides the above two possible methods for determining whether time keywords exist in the target text. They can be used according to different actual needs during actual application, and the present application does not limit this. In this way, the provision of two methods improves the flexibility of the application of this solution. At the same time, by performing type recognition processing on the word segmentation, it can be applied to a variety of different types of target texts. It has a wide range of applications and fewer restrictions, and can identify a variety of different types of time keywords. When the word segmentation results are matched by preset character matching rules, it is possible to quickly determine whether time keywords exist in the word segmentation results with fewer computing resources, thereby improving the efficiency of obtaining the location information corresponding to the time keywords.
[0128] The above describes a method for obtaining the location information of time keywords. The following describes a method for determining the timeliness of text based on the location information of time keywords.
[0129] Step S302: Perform semantic recognition processing on the target text to obtain the overall semantic features of the target text.
[0130] In this step, the server can directly perform semantic recognition on the target text containing the time keyword and obtain the overall semantic features corresponding to the target text, wherein each feature element in the overall semantic features contains the semantic information of its corresponding segmentation and partial semantic information of each segmentation in the target text. Specifically, when performing semantic recognition processing on the target text, each feature element in the overall semantic features obtained by the server corresponds to a character in the target text, and the feature elements corresponding to different characters not only contain the semantic information of the character, but also include partial semantic information of some characters related to the character in the target text. The number of feature elements corresponding to different segmentations is positively correlated with the number of characters contained in the segmentation.
[0131] Optionally, when the above-mentioned method of sentence segmentation of the target text is performed, and then word segmentation is performed on the target sentence containing at least one time keyword in the sentence segmentation result, and the position information of the corresponding time keyword is obtained, when the above-mentioned step S302 is executed, semantic recognition processing can be directly performed on the target sentence to obtain the overall semantic features corresponding to the target sentence.
[0132] In this way, the amount of text that needs to be processed in the semantic recognition process can be reduced, the efficiency of obtaining overall semantic features can be accelerated, and the content of contextual semantic information contained in the time semantic elements corresponding to time keywords in the overall semantic features can be further improved, thereby improving the accuracy of classification and recognition of time keywords.
[0133] In a possible implementation, when obtaining the overall semantic features corresponding to the target text, the server may specifically adopt the following method to obtain the corresponding overall semantic features:
[0134] See also Figure 6 , which is a flow chart of a method for obtaining overall semantic features provided in an embodiment of the present application, such as Figure 6 As shown, the specific implementation steps of this method are as follows:
[0135] Step S601: perform vectorization processing on the target text to obtain the word segmentation vector corresponding to each word segmentation result in the target text.
[0136] When performing semantic recognition processing on the target text, the target text can be vectorized first. In this way, after obtaining the word segmentation vectors corresponding to each word segmentation result, the server can extract the corresponding high-dimensional vectors from these vectors, and perform semantic recognition processing on these word segmentation vectors conveniently and quickly.
[0137] Step S602: Based on the separation marks included in the target text, at least one word segmentation vector set is obtained, and each word segmentation vector belonging to the same word segmentation vector set is located between two adjacent separation marks.
[0138] like Figure 7 As shown, after vectorizing the target text and obtaining the corresponding word segmentation vectors for each word segment, in order to obtain contextual semantic information that is highly correlated with the time keyword, the server can use the separation marks in the target text to obtain a set of word segmentation vectors with highly correlated semantic information. Separation marks can be periods, semicolons, colons, parentheses, quotation marks, dashes, etc., and their specific limitations can be determined by actual application requirements and are not limited in this application.
[0139] It should be noted that this step is performed for the target text that has not been processed by sentence segmentation. In other words, if the target text has been processed by sentence segmentation, then when the method for obtaining the overall semantic feature is executed for the target sentence, all the word vectors corresponding to the target sentence can be directly used as word vectors belonging to a word segmentation vector set for subsequent processing, thereby improving the efficiency of overall semantic recognition acquisition. In addition, if the processing rules for sentence segmentation processing are different from the processing rules for obtaining the word segmentation vector set, the server can also perform these two steps simultaneously, and this application does not impose any restrictions on this.
[0140] After obtaining at least one word segmentation vector set, the server can perform the following operations for each word segmentation vector set:
[0141] Step S603: Based on each word segmentation vector included in a word segmentation vector set, semantic recognition processing is performed on each word segmentation vector to obtain the semantic feature elements corresponding to each word segmentation vector.
[0142] Among them, each semantic feature element includes the semantic information of the corresponding word segmentation vector, as well as partial semantic information of each word segmentation vector in a word segmentation vector set.
[0143] For example, Figure 8A As shown in the figure, assuming that there are five word segmentations A, B, C, D, and E, after these word segmentations are vectorized separately, the server can input them into a bidirectional encoder representation (BidirectionalEncoder Representations from Transformers, Bert) model based on the translation architecture to extract the high-dimensional features corresponding to each word segmentation. These high-dimensional features are used to represent the semantic information of each of the five word segmentations A, B, C, D, and E, as well as some semantic features of other word segmentations.
[0144] Step S604: Based on the obtained semantic feature elements, a corresponding overall semantic feature is obtained.
[0145] After obtaining the semantic feature elements for each word segment, these semantic feature elements can be combined into the corresponding overall semantic feature.
[0146] In this approach, the server acquires the semantic information of a specific word in the target text by performing semantic recognition on the entire set of words rather than on that word alone. This approach allows the server to leverage the relationship between the word and its context, extracting the true semantic information corresponding to the word from the overall language context, thereby improving the accuracy of semantic recognition for each word.
[0147] After completing the acquisition of the overall semantic features, the server can continue to perform the following operations:
[0148] Step S303: Based on the overall semantic feature and the obtained at least one position information, obtain at least one time keyword and the corresponding time semantic element in the overall semantic feature.
[0149] The time semantic element includes semantic information of the corresponding time keyword and semantic information of the context of the corresponding time keyword.
[0150] For example, the BERT model mentioned above is also used as an example. Figure 8B As shown, assuming that the target text is "The new product will be released on October 22", after the target text is vectorized and each word segmentation vector is obtained, the corresponding "cls" token is added to it to mark the beginning of the entire text sentence, and the corresponding "sep" token is added to mark the interval of the entire text sentence. When the obtained word segmentation vectors are input into the BERT model, the BERT model can extract the high-dimensional features corresponding to the features of each word segmentation vector. After obtaining the high-dimensional features corresponding to each word segmentation vector one by one, the server can obtain the high-dimensional features corresponding to the time keyword based on the position information of the time keyword in the target text. The formula of this process is expressed as follows:
[0151]
[0152] Among them, H represents the high-dimensional features corresponding to the word segmentation vector corresponding to the time keyword, and Bert(x) represents the semantic recognition processing of x by the bert model. Represents all x word segmentation vectors, It represents the corresponding position information of the time keyword in all x word segmentation vectors.
[0153] After obtaining the time semantic elements corresponding to these time keywords, the server can continue to perform the following operations based on these obtained time semantic elements:
[0154] Step S304: Based on the obtained time semantic elements, classify and identify at least one time keyword segmentation to obtain the time type corresponding to each of the at least one time keyword.
[0155] The time type includes an invalid time type that cannot represent the timeliness of the target text, and a valid time type used to represent the expiration of the target text.
[0156] For example, for the above two time types, their respective characteristics can be clarified through the following examples.
[0157] See Table 1 for an example of an invalid time type provided in an embodiment of the present application:
[0158] Table 1
[0159] text Time keywords Time Type Today is a good day today Invalid time type Receiving a call at night is always worrying night Invalid time type Tomorrow and tomorrow, how many tomorrows there are tomorrow Invalid time type
[0160] As shown in Table 1, due to the complexity of text representation, although the above texts all contain keywords indicating time, such as "today," "evening," or "tomorrow," the semantic information corresponding to these keywords does not contain the exact time information of any event. For example, the "today" in "Today is a good day" is merely a vague reference, without any specific time information of anything happening. For another example, the "evening" in "Receiving a phone call at night always makes me worry" refers to a state, and it is not clear which specific night it refers to. Therefore, it also does not contain the exact time information of any event. Therefore, time keywords such as those proposed in Table 1, which are merely vague references and do not contain any information about the time when an event occurred, can be classified as invalid time types.
[0161] See Table 2 for an example of a valid time type provided in an embodiment of the present application:
[0162] Table 2
[0163]
[0164] As shown in Table 2, in the text provided in Table 2, time keywords can represent the time when something happens. Therefore, even if a time keyword such as "today" mentioned in Table 1 appears, since it can also represent the time when a movie is released, the time type corresponding to the time keyword "today" is also a valid time type.
[0165] Therefore, combining Table 1 and Table 2, it can be seen that the time keywords corresponding to the valid time type represent the time when an event occurs, and the time when an event occurs is the exact time information, while the time keywords corresponding to the invalid time type cannot represent the exact time information of any event.
[0166] As described above, after obtaining the time semantic elements corresponding to the time keywords, the server can classify and identify the time keywords corresponding to each of the time semantic elements according to the obtained time semantic elements, thereby obtaining the time types corresponding to each of the time keywords.
[0167] For example, in the example of the BERT model above, the server obtains the high-dimensional features corresponding to each word segmentation vector through the BERT model, and obtains the high-dimensional features corresponding to the corresponding time keywords through the location information corresponding to the time keywords. In this way, the server can continue to pool the high-dimensional features corresponding to these time keywords to reduce their dimensionality to one-dimensional features, thereby obtaining the representation vector corresponding to the time keyword. The formula for this process is expressed as follows:
[0168] H time =averagepolling(H i-j ) (Formula 2)
[0169] Among them, H time is a one-dimensional vector representation of the time keyword, averagepolling(x) means pooling the x objects in the brackets, H i-j It represents the vector corresponding to the time keyword in each word segmentation vector.
[0170] After completing the pooling process, the server can perform corresponding classification and recognition processing on the one-dimensional vector representation to obtain the time type corresponding to the time keyword.
[0171] It should be noted that the above-mentioned BERT model for semantic recognition of target text is only an example. In actual applications, users can choose other models that can perform semantic recognition according to their actual needs or advantages to complete the above-mentioned semantic recognition process.
[0172] In this scheme, by obtaining the position information of the time keyword in the target text and the overall semantic features corresponding to the target text, the semantic information corresponding to the time keyword context is integrated into the semantic recognition results corresponding to the time keyword. The context contains the semantics of a relatively complete sentence, and the time type corresponding to the time keyword is judged, thereby improving the accuracy of determining the time type of the time keyword.
[0173] On the other hand, the time types corresponding to time keywords are divided into valid time types and invalid time types to distinguish whether the time keywords can represent the timeliness of the target text, which simplifies the steps of judging the timeliness of the text and improves the efficiency of determining the timeliness of the text.
[0174] Through this solution, in the application scenario of text timeliness determination, the accuracy of text timeliness determination can reach 98%, which significantly improves the accuracy of text timeliness determination.
[0175] The above describes the process of determining the time type of a time keyword. As described above, when it is determined that the time type of a time keyword in a target text is an invalid time type, the server can skip the target text and continue to perform the above operations on subsequent target texts.
[0176] When it is determined that among the time keywords contained in the target text, there is at least one time keyword with a valid time type, in order to quickly implement the subsequent timeliness judgment of the text, the server can also execute the following method to normalize the format of the time keywords corresponding to the obtained valid time type.
[0177] In one possible implementation, the server may normalize the format of the acquired time keywords of the valid time type, converting time keywords with different time expression formats into time keywords with a preset time format. The preset time format may be determined based on the actual needs of the user and is not limited in this application.
[0178] For example, assuming that the time keyword obtained by the server is 12:15 on October 8, 2023, and the preset time format is a pure numeric string of year, month, day, hour and minute, then after the server normalizes the format of the time keyword, it can obtain the string: 202310081215.
[0179] Through the above-mentioned format normalization processing, no matter how many time keywords the server obtains and how many time expression formats these time keywords have, the server can obtain the processed time keywords with a preset time format. In this way, when the server uses the time keywords for subsequent timeliness determination, content recommendation and other steps, it can quickly and conveniently obtain time information from the time keywords to improve the efficiency of timeliness determination, content recommendation, etc.
[0180] After completing the determination of the type of the above time keyword, the server may continue to perform the following operations to continue to determine the timeliness of the text.
[0181] See also Figure 9 , which is a flow chart of a method for obtaining the timeliness of a target text provided in an embodiment of the present application, such as Figure 9 As shown, the specific implementation steps of this method are as follows:
[0182] Step S901: Obtain the time information corresponding to the current moment.
[0183] If the server has determined that at least one time keyword in the target text contains a valid time type, the server can record these time keywords as intermediate keywords. The time types corresponding to these intermediate keywords are all valid time types and can represent the time when a certain event occurred. The relationship between the time of these events and the current time indicates whether the information in the target text is outdated.
[0184] Therefore, when the server further determines the timeliness of the target text, it needs to obtain the time information corresponding to the current moment and then continue to perform the following steps:
[0185] Step S902: Based on the obtained time information, at least one target time keyword whose distance from the time information meets a preset time range requirement is selected from the obtained at least one intermediate time keyword.
[0186] As for the relationship between the intermediate time keyword and the time information corresponding to the current moment, there are the following Figure 10 There are three possibilities shown: one is that the time corresponding to the intermediate time keywords is before the time corresponding to the current moment, one is that the time corresponding to the intermediate time keywords is after the time corresponding to the current moment, and one is that the time corresponding to the intermediate time keywords is distributed on both sides of the time corresponding to the current moment.
[0187] Therefore, when selecting a target time keyword according to a preset time range requirement, at least one target time keyword whose distance from the time corresponding to the current moment meets the requirement can be selected.
[0188] Among them, the value of the specific time range requirement can be determined according to the actual use needs, and this application does not impose any restrictions on this. In a possible implementation, the time range requirement may not be a specific value, but a selection condition. For example, the time range requirement may be: select several intermediate time keywords closest to the current moment as target time keywords. Among them, when the intermediate time keywords are on one side of the current moment, only the intermediate time keyword closest to the current moment can be selected as the target time keyword; and when the intermediate time keywords are distributed on both sides of the current moment, then one intermediate time keyword on each side that is closest to the current moment can be selected as the target time keyword.
[0189] Step S903: Acquire the timeliness of the target text based on the contextual relationship between the time information and at least one target time keyword.
[0190] After obtaining the target time keywords, the server can determine the timeliness of the target text through the contextual relationship between these target time keywords and the time corresponding to the current moment.
[0191] Exemplarily, when there is only one target time keyword, the server may determine whether the time corresponding to the target time keyword is before the current moment or after the current moment.
[0192] When the time corresponding to the target time keyword is after the time corresponding to the time information (ie, the current time), the target text can be determined to be valid content, and the recommendation weight corresponding to the target text can be increased.
[0193] When it is determined that the moment corresponding to the target time keyword is after the current moment, it means that the event corresponding to the target time keyword has not occurred yet. Therefore, the information contained in the target text is still valid content with timeliness. Furthermore, when the server recommends a content page to a visitor, it can increase the recommendation weight corresponding to the content page based on the target time keyword of the target text in the content page, thereby increasing the possibility of the content page being recommended or the exposure rate.
[0194] When the time corresponding to the target time keyword is before the time corresponding to the time information (ie, the current time), the target text can be determined to be outdated content, and the recommendation weight corresponding to the target text can be reduced.
[0195] If the time corresponding to the target time keyword is determined to be before the current time, it indicates that the event corresponding to the target time keyword has already occurred. Therefore, the information contained in the target text is outdated and has no time validity. Therefore, when processing the content page containing this outdated content, the server can lower the recommendation weight corresponding to the content page, thereby reducing the likelihood of the content page being recommended, or modify the content page from recommended content to retired content.
[0196] Exemplarily, when there are two target time keywords, as described above, these two time keywords are respectively located before and after the current moment, and are the two time keywords closest to each other. Therefore, the server can determine that the text information contained in the current content page still contains some time-sensitive content. Therefore, the server can directly select the target time keyword after the current moment, and determine that the content page is valid content, and based on the target time keyword of the target text in the content page, increase the recommendation weight corresponding to the content page, thereby increasing the possibility of the content page being recommended or the exposure rate.
[0197] So, like Figure 11As shown, the timeliness of the content page is judged by the time keywords in the text information in the content page, and then the recommendation weight of the content page is adjusted according to the corresponding timeliness information, so that the content recommended to the visitor is all content pages containing valid content. In addition, the recommendation weight of the page containing outdated content is reduced to avoid the situation where outdated content is still recommended to the visitor, thus effectively improving the effect of content recommendation. The above introduces various possible implementation methods of the text timeliness determination method provided by the embodiment of the present application. It should be understood that the above methods can be applied to the actual content recommendation system in a free combination manner. Therefore, the implementation of a combined method will be introduced below through example content.
[0198] See also Figure 12 , which is a schematic diagram of a method for determining the timeliness of a target text provided in an embodiment of the present application, such as Figure 12 As shown, when a visitor clicks on a content providing platform, the server corresponding to the content providing platform needs to provide the visitor with corresponding recommended content. At this time, the content providing platform faces a large number of content pages and needs to select the corresponding recommended content from them. In the text timeliness determination method provided in the embodiment of the present application, the server can obtain the target text corresponding to each content page from each content page by copying text, OCR recognition or ASR recognition. Then, for each target text, the position information of the time keyword is obtained, and the overall semantic features corresponding to the target text are obtained; then, based on the position information of the time keyword, the time semantic element corresponding to the time keyword is obtained from the overall semantic features. The time semantic element contains the semantic information corresponding to the time keyword and the semantic information corresponding to the time keyword context. Therefore, the server can judge whether the type of the time keyword is a valid time type based on the time semantic element of the time keyword. Finally, the server selects content pages corresponding to valid time types for which the time keyword type is selected, and determines whether the content pages are valid content or outdated content based on the time keywords corresponding to each content page, and increases the recommendation weight of the content pages corresponding to valid content, and decreases the recommendation weight of the content pages corresponding to outdated content. Then, the server sorts the content pages based on the recommendation weights corresponding to each content page, and provides the sorted recommended content pages to the visitor.
[0199] Based on the same inventive concept, the present application also provides a device for determining text timeliness, see Figure 13 , which is a structural diagram of a text timeliness determination device provided in an embodiment of the present application. The device can be the above-mentioned server or a chip or integrated circuit therein, etc. The device includes modules / units / technical means for executing the method executed by the server in the above-mentioned method embodiment.
[0200] Exemplarily, the apparatus 1300 includes:
[0201] The word segmentation module 1301 is configured to perform word segmentation processing on the target text, and when the obtained word segmentation results contain at least one time keyword, obtain position information of each of the at least one time keyword in the target text;
[0202] Recognition module 1302, configured to perform semantic recognition processing on the target text to obtain overall semantic features of the target text;
[0203] Extraction module 1303 is configured to obtain, based on the overall semantic feature and the obtained at least one position information, a time semantic element corresponding to the at least one time keyword in the overall semantic feature; the time semantic element includes semantic information of the corresponding time keyword and semantic information of the context of the corresponding time keyword;
[0204] Determination module 1304 is used to classify and identify the at least one time keyword based on the obtained time semantic elements, and obtain the time type corresponding to each of the at least one time keyword; wherein the time type includes: an invalid time type that cannot represent the timeliness of the target text and a valid time type used to represent the timeliness of the target text.
[0205] In a possible implementation, the recognition module 1302 is configured to perform semantic recognition processing on the target text and obtain the overall semantic features of the target text, specifically for:
[0206] Performing vectorization processing on the target text to obtain the word segmentation vector corresponding to each word segmentation result in the target text;
[0207] Based on the separation marks included in the target text, obtaining at least one word segmentation vector set, where each word segmentation vector belonging to the same word segmentation vector set is located between two adjacent separation marks;
[0208] For each obtained word segmentation vector set, the following operations are respectively performed: based on each word segmentation vector included in a word segmentation vector set, semantic recognition processing is performed on each word segmentation vector to obtain a semantic feature element corresponding to each word segmentation vector, each semantic feature element including semantic information of the corresponding word segmentation vector and partial semantic information of each word segmentation vector in the word segmentation vector set;
[0209] Based on the obtained semantic feature elements, the corresponding overall semantic feature is obtained.
[0210] In a possible implementation, the word segmentation module 1301 is configured to perform word segmentation processing on the target text. When the obtained word segmentation result contains at least one time keyword, obtaining position information of each of the at least one time keyword in the target text is specifically configured to:
[0211] Segmenting the target text, and when a target sentence containing at least one time keyword exists in the obtained sentence segmentation results, segmenting the target sentence and obtaining position information of each of the at least one time keyword in the target sentence;
[0212] The step of performing semantic recognition processing on the target text to obtain the overall semantic features of the target text includes:
[0213] Perform semantic recognition processing on the target sentence to obtain the overall semantic features of the target sentence.
[0214] In a possible implementation, after obtaining the time type corresponding to each of the at least one time keywords, the determining module 1304 is further configured to:
[0215] When there is at least one intermediate time keyword whose time type is the valid time type among the at least one time keyword, obtaining time information corresponding to the current moment;
[0216] Based on the time information, selecting a target time keyword whose distance from the time information meets a preset time range requirement from the at least one intermediate time keyword obtained;
[0217] Based on the contextual relationship between the time information and the target time keyword, the timeliness of the target text is obtained.
[0218] In a possible implementation, when the determining module 1304 is used to obtain the timeliness of the target document, it is specifically used to:
[0219] When the time corresponding to the target time keyword is after the time corresponding to the time information, determining that the target text is valid content and increasing the recommendation weight corresponding to the target text;
[0220] When the time corresponding to the target time keyword is before the time corresponding to the time information, the target text is determined to be outdated content, and the recommendation weight corresponding to the target text is reduced.
[0221] In a possible implementation, when there is at least one time keyword in the obtained word segmentation result, the word segmentation module 1301 is configured to obtain position information of each of the at least one time keyword in the target text, specifically to:
[0222] Performing type recognition processing on each segmentation word in the segmentation result to obtain a type recognition result for each segmentation word in the segmentation result; when it is determined based on the type recognition result that at least one time keyword exists in the segmentation result, obtaining position information of each of the at least one time keyword in the target text; or,
[0223] Based on preset character matching rules, character matching processing is performed on each word in the word segmentation result to obtain the character matching results of each word in the word segmentation result; when it is determined based on the character matching results that there is at least one time keyword in the word segmentation result, the position information of each of the at least one time keywords in the target text is obtained.
[0224] Based on the same inventive concept, the embodiment of the present application also provides an electronic device. In a possible implementation, the electronic device may be a server, such as Figure 1 In this embodiment, the structure of the electronic device 1400 is as follows: Figure 14 As shown, it may include at least a memory 1401 , a communication module 1403 , and at least one processor 1402 .
[0225] Memory 1401 is used to store computer programs executed by processor 1402. Memory 1401 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and programs required for running instant messaging functions, while the data storage area may store various instant messaging messages and operating instruction sets.
[0226] Memory 1401 may be a volatile memory, such as random-access memory (RAM); a non-volatile memory, such as read-only memory, flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); or any other medium capable of carrying or storing a desired computer program in the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 1401 may be a combination of the aforementioned memories.
[0227] The processor 1402 may include one or more central processing units (CPUs) or digital processing units, etc. The processor 1402 is configured to implement the above-mentioned text timeliness determination method when calling the computer program stored in the memory 1401 .
[0228] The communication module 1403 is used to communicate with terminal devices and other servers.
[0229] The specific connection medium between the memory 1401, the communication module 1403 and the processor 1402 is not limited in the embodiment of the present application. Figure 14 In the embodiment, the memory 1401 and the processor 1402 are connected via a bus 1404. Figure 14 The connections between the other components are shown in bold lines for illustration only and are not intended to be limiting. The bus 1404 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Figure 14 The diagram shows a single thick line, but this does not indicate that there is only one bus or one type of bus.
[0230] The memory 1401 stores a computer storage medium, which stores computer-executable instructions for implementing the text timeliness determination method of the embodiment of the present application. The processor 1402 is used to execute the above-mentioned text timeliness determination method.
[0231] In another embodiment, the electronic device may also be other electronic devices, such as Figure 1 The terminal device 101 is shown in FIG. In this embodiment, the structure of the electronic device can be as follows: Figure 15 As shown, it includes: a communication component 1510, a memory 1520, a display unit 1530, a camera 1540, a sensor 1550, an audio circuit 1560, a Bluetooth module 1570, a processor 1580 and other components.
[0232] The communication component 1510 is used to communicate with the server. In some embodiments, it may include a wireless fidelity (WiFi) module. The WiFi module is a short-range wireless transmission technology. The electronic device can help the object send and receive information through the WiFi module.
[0233] The memory 1520 can be used to store software programs and data. The processor 1580 executes various functions and data processing of the terminal device 101 by running the software programs or data stored in the memory 1520. The memory 1520 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The memory 1520 stores an operating system that enables the terminal device 101 to run. In the present application, the memory 1520 can store an operating system and various application programs, and can also store a computer program that executes the text timeliness determination method provided in the embodiment of the present application.
[0234] The display unit 1530 can also be used to display information input by or provided to the subject, as well as a graphical user interface (GUI) of various menus of the terminal device 101. Specifically, the display unit 1530 may include a display screen 1532 disposed on the front of the terminal device 101. The display screen 1532 may be configured in the form of a liquid crystal display, a light-emitting diode, or the like. The display unit 1530 can be used to display the content recommendation interface, model training interface, and the like in the embodiments of the present application.
[0235] The display unit 1530 can also be used to receive input digital or character information and generate signal input related to the object setting and function control of the terminal device 101. Specifically, the display unit 1530 may include a touch screen 1531 set on the front of the terminal device 101, which can collect touch operations of objects on or near it, such as clicking a button, dragging a scroll box, etc.
[0236] The touch screen 1531 can be covered on the display screen 1532, or the touch screen 1531 and the display screen 1532 can be integrated to realize the input and output functions of the physical terminal device 101. The integrated display screen can be simply called a touch screen. In this application, the display unit 1530 can display applications and corresponding operation steps.
[0237] The camera 1540 can be used to capture still images, and the subject can publish the images captured by the camera 1540 through an application. The camera 1540 can be one or more. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transmitted to the processor 1580 for conversion into a digital image signal.
[0238] The physical terminal device may further include at least one sensor 1550, such as an accelerometer 1551, a distance sensor 1552, a fingerprint sensor 1553, and a temperature sensor 1554. The terminal device may also be equipped with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.
[0239] The audio circuit 1560, the speaker 1561, and the microphone 1562 can provide an audio interface between the object and the terminal device 101. The audio circuit 1560 can transmit the electrical signal converted from the received audio data to the speaker 1561, which converts it into a sound signal for output. The physical terminal device 101 can also be equipped with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 1562 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1560 and converted into audio data. The audio data is then output to the communication component 1510 for transmission to, for example, another physical terminal device 101, or the audio data is output to the memory 1520 for further processing.
[0240] The Bluetooth module 1570 is used to exchange information with other Bluetooth devices having a Bluetooth module through the Bluetooth protocol. For example, a physical terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smart watch or smart glasses) that also has a Bluetooth module through the Bluetooth module 1570 to exchange data.
[0241] The processor 1580 is the control center of the physical terminal device. It uses various interfaces and lines to connect various parts of the entire terminal. By running or executing software programs stored in the memory 1520 and calling data stored in the memory 1520, it performs various functions of the terminal device and processes data. In some embodiments, the processor 1580 may include one or more processing units; the processor 1580 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the baseband processor mainly processes wireless communications. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 1580. In this application, the processor 1580 can run the operating system, application programs, user interface display and touch response, as well as the text timeliness determination method of the embodiment of the present application. In addition, the processor 1580 is coupled to the display unit 1530.
[0242] In addition, it should be noted that in the specific implementation of this application, object data related to the timeliness determination model, etc. is involved. When the above embodiments of this application are applied to specific products or technologies, it is necessary to obtain the object's permission or consent, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0243] In some possible implementations, various aspects of the text timeliness determination method provided in the present application can also be implemented in the form of a program product, which includes a computer program. When the program product is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the text timeliness determination method according to various exemplary embodiments of the present application described above in this specification.
[0244] The program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable 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 thereof.
[0245] The program product of the embodiment of the present application may be a portable compact disc read-only memory (CD-ROM) and include a computer program, and can be run on an electronic device. However, the program product of the present application is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with a command execution system, apparatus, or device.
[0246] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a readable computer program. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with a command execution system, apparatus, or device.
[0247] The computer program embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0248] The computer program for performing the operations of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The computer program can be executed entirely on the user electronic device, partially on the user electronic device, as a separate software package, partially on the user electronic device and partially on a remote electronic device, or entirely on the remote electronic device. In cases involving remote electronic devices, the remote electronic device can be connected to the user electronic device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using an Internet service provider to connect through the Internet).
[0249] It should be noted that although several units or subunits of the device are mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, depending on the embodiment of the application, the features and functions of two or more units described above can be embodied in a single unit. Conversely, the features and functions of a single unit described above can be further divided and embodied by multiple units.
[0250] Furthermore, although the operations of the method of the present application are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all illustrated operations must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0251] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0252] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0253] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0254] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0255] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A method for determining text timeliness, characterized in that: include: Performing word segmentation processing on the target text, and when the obtained word segmentation results contain at least one time keyword, obtaining position information of the at least one time keyword in the target text; Performing semantic recognition processing on the target text to obtain overall semantic features of the target text; Based on the overall semantic feature and the obtained at least one position information, obtaining a time semantic element corresponding to the at least one time keyword in the overall semantic feature; the time semantic element includes semantic information of the corresponding time keyword and semantic information of the context of the corresponding time keyword; Based on the obtained time semantic elements, the at least one time keyword is classified and identified respectively to obtain the time type corresponding to each of the at least one time keyword; wherein the time type includes: an invalid time type that cannot represent the timeliness of the target text and a valid time type used to represent the timeliness of the target text.
2. The method according to claim 1, wherein The performing semantic recognition processing on the target text to obtain the overall semantic features of the target text includes: Performing vectorization processing on the target text to obtain the word segmentation vector corresponding to each word segmentation result in the target text; Based on the separation marks included in the target text, obtaining at least one word segmentation vector set, where each word segmentation vector belonging to the same word segmentation vector set is located between two adjacent separation marks; For each obtained word segmentation vector set, the following operations are respectively performed: based on each word segmentation vector included in a word segmentation vector set, semantic recognition processing is performed on each word segmentation vector to obtain a semantic feature element corresponding to each word segmentation vector, each semantic feature element including semantic information of the corresponding word segmentation vector and partial semantic information of each word segmentation vector in the word segmentation vector set; Based on the obtained semantic feature elements, the corresponding overall semantic feature is obtained.
3. The method according to claim 1, wherein The performing word segmentation processing on the target text, and when at least one time keyword exists in the obtained word segmentation results, obtaining position information of each of the at least one time keyword in the target text, includes: Segmenting the target text, and when a target sentence containing at least one time keyword exists in the obtained sentence segmentation results, segmenting the target sentence and obtaining position information of each of the at least one time keyword in the target sentence; The step of performing semantic recognition processing on the target text to obtain the overall semantic features of the target text includes: Perform semantic recognition processing on the target sentence to obtain the overall semantic features of the target sentence.
4. The method according to claim 1, wherein After obtaining the time type corresponding to each of the at least one time keywords, the method further includes: When there is at least one intermediate time keyword whose time type is the valid time type among the at least one time keyword, obtaining time information corresponding to the current moment; Based on the time information, selecting at least one target time keyword from the obtained at least one intermediate time keyword, the target time keyword having a distance from the time information that meets a preset time range requirement; Based on the contextual relationship between the time information and the at least one target time keyword, the timeliness of the target document is obtained.
5. The method according to claim 4, wherein The timeliness of obtaining the target article includes: When the time corresponding to the target time keyword is after the time corresponding to the time information, determining that the target text is valid content and increasing the recommendation weight corresponding to the target text; When the time corresponding to the target time keyword is before the time corresponding to the time information, the target text is determined to be outdated content, and the recommendation weight corresponding to the target text is reduced.
6. The method according to any one of claims 1 to 5, characterized in that When there is at least one time keyword in the obtained word segmentation result, obtaining position information of each of the at least one time keyword in the target text includes: Performing type recognition processing on each segmentation word in the segmentation result to obtain a type recognition result for each segmentation word in the segmentation result; when it is determined based on the type recognition result that at least one time keyword exists in the segmentation result, obtaining position information of each of the at least one time keyword in the target text; or, Based on preset character matching rules, character matching processing is performed on each word in the word segmentation result to obtain the character matching results of each word in the word segmentation result; when it is determined based on the character matching results that there is at least one time keyword in the word segmentation result, the position information of each of the at least one time keywords in the target text is obtained.
7. A device for determining text timeliness, characterized in that: The device comprises: A word segmentation module is used to perform word segmentation processing on the target text, and when the obtained word segmentation results contain at least one time keyword, obtain the position information of the at least one time keyword in the target text; A recognition module, configured to perform semantic recognition processing on the target text to obtain overall semantic features of the target text; an extraction module configured to obtain, based on the overall semantic feature and the obtained at least one position information, a time semantic element corresponding to the at least one time keyword in the overall semantic feature; the time semantic element comprising semantic information of the corresponding time keyword and semantic information of a context of the corresponding time keyword; A determination module is used to classify and identify the at least one time keyword based on the obtained time semantic elements, and obtain the time type corresponding to each of the at least one time keyword; wherein the time type includes: an invalid time type that cannot represent the timeliness of the target text and a valid time type used to represent the timeliness of the target text.
8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores program codes, and when the program codes are executed by the processor, the processor is enabled to perform the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The method comprises a program code, and when the program code is run on a computing device, the program code is used to enable the computing device to execute the steps of the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 6 when the computer program is executed by a processor.