A text processing method, a video processing method, a device and an electronic device
By tagging and adding links to videos and text, the problem of low video positioning efficiency was solved, achieving direct positioning and increased viewership.
Patent Information
- Application Number
- CN202211158473.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-22
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-09-22
AI Technical Summary
When watching videos, users need to manually drag the progress bar to locate the video content they are interested in, resulting in low location efficiency.
The video is divided into multiple segments to be selected, and its characters and events are identified. Combined with the text content, it is divided into subtexts and the tags are matched. A starting playback link is added to directly locate the video content of interest.
It improves video location efficiency and viewership, allowing users to directly locate video content of interest and start watching from the beginning of playback.
Smart Images

Figure CN115408565B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video technology, and in particular to a text processing method, a video processing method, an apparatus, and an electronic device. Background Technology
[0002] With the release of various TV series and movies, video clients offer the function of viewing plot summaries to help users get a general understanding of the plot, such as episode summaries for TV series.
[0003] However, when a user is interested in the video content corresponding to the text content in the episode description, they need to manually drag the progress bar of the video content corresponding to the episode description to the possible playback progress in order to watch the video content of interest, resulting in low efficiency in locating the aforementioned video content. Summary of the Invention
[0004] The purpose of this invention is to provide a text processing method, a video processing method, an apparatus, and an electronic device to locate the video content corresponding to the text content in the plot synopsis, thereby improving video location efficiency. The specific technical solution is as follows:
[0005] In a first aspect of this invention, a text processing method is provided, the method comprising:
[0006] Based on the video content of the video to be processed, the video to be processed is divided into multiple segments to be selected, and a first tag is determined for each segment to be selected; wherein, the first tag includes: a person tag and an event tag;
[0007] Based on the text content of the target text used to describe the video to be processed, the target text is divided into multiple sub-texts, and a second tag is determined for each sub-text; wherein, the second tag includes: a person tag and an event tag;
[0008] Tag matching is performed on the first tag of each candidate segment and the second tag of each target subtext in the plurality of subtexts to obtain each candidate combination; wherein, each candidate combination includes at least one candidate segment and one target subtext, and the person tag and event tag of the candidate segment included in each candidate combination are matched with the person tag and event tag of the target subtext included in the candidate combination, respectively.
[0009] For each target combination among the various candidate combinations, a target playback link about the candidate segment in the target combination is added to the target subtext of the target combination in the target text; wherein, the target playback link is used to indicate that the video to be processed will start playing from the start playback time of the candidate segment in the target combination in the video to be processed.
[0010] Optionally, in one specific implementation, the step of dividing the target text into multiple sub-texts based on the text content used to describe the video to be processed, and determining a second tag for each sub-text, includes:
[0011] Based on a predetermined delimiter, the target text used to describe the video to be processed is divided to obtain individual sentences in the target text;
[0012] Each sentence is segmented to obtain at least one keyword in that sentence;
[0013] According to the order of the positions of each keyword in the target text, keyword category identification is performed on each keyword in turn. When a first keyword about a person and a second keyword about an event are identified, the sentence to which the first keyword and the second keyword belong is divided into a subtext, and the first keyword and the second keyword are respectively determined as the person tag and the event tag of the subtext, thus obtaining the second tag of the subtext.
[0014] Optionally, in one specific implementation, the step of performing tag matching on the first tag of each segment to be selected and the second tag of each target subtext in the plurality of subtexts to obtain each combination to be selected includes:
[0015] For each target subtext, calculate the matching degree group between the target subtext and each candidate segment; wherein each matching degree group includes: the person tag and event tag of the target subtext, and the first matching degree and the second matching degree with the person tag and event tag of a candidate segment, respectively;
[0016] For each target subtext, based on each matching degree group, the tag matching degree between the target subtext and each candidate segment is calculated, and the target subtext and the candidate segments whose tag matching degree with the target subtext reaches a preset matching degree are determined as candidate combinations, thus obtaining each candidate combination.
[0017] Optionally, in one specific implementation, calculating the matching degree group between each target sub-text and each segment to be selected includes:
[0018] For each target subtext, perform the following steps:
[0019] Determine the first number of keywords included in the person tags of the target subtext and the second number of keywords included in the event tags of the subtext;
[0020] For each segment to be selected, determine the third number of matching keywords in the person tags of the target subtext and the person tags of the segment to be selected, and the fourth number of matching keywords in the event tags of the target subtext and the event tags of the segment to be selected.
[0021] For each segment to be selected, the ratio of the third quantity to the target sum is calculated as the first matching degree between the person tag of the target subtext and the person tag of the segment to be selected; and the ratio of the fourth quantity to the target sum is calculated as the second matching degree between the event tag of the target subtext and the event tag of the segment to be selected; wherein, the target sum is the sum of the first quantity and the second quantity.
[0022] Optionally, in one specific implementation, adding a target playback link about the selected segment in the target segment to the target subtext of the target text for each of the candidate combinations includes:
[0023] For each target combination, perform the following operations:
[0024] If the target combination includes a segment to be selected, then add a target playback link about the segment to be selected in the target combination to the target subtext of the target text in the target text;
[0025] If the target combination includes multiple segments to be selected, then based on a preset selection method, a target segment is selected from the multiple segments to be selected in the target combination, and a specified playback link about the target segment is added to the target subtext of the target combination in the target text; wherein, the specified playback link is used to indicate that the video to be processed will start playing from the start time of the target segment in the video to be processed.
[0026] Optionally, in one specific implementation, selecting the target segment from the multiple segments to be selected included in the target combination based on a preset selection method includes:
[0027] Obtain a selection instruction, and determine the segment to be selected indicated by the selection instruction as the target segment; or,
[0028] Among the multiple selectable segments included in the target combination, the selectable segment with the highest tag matching degree with the target subtext included in the target combination is determined as the target segment.
[0029] In a second aspect of the present invention, a video processing method is also provided, the method comprising:
[0030] Determine the target text; wherein each target subtext in the target text is associated with a target playback link, and the target playback link associated with each target subtext is added based on the text processing method provided in the first aspect;
[0031] When a selection operation is detected for a target playback link associated with a specified subtext in each of the target subtexts, the system jumps to the playback interface of the target video described by the target text and starts playing the target video from the time indicated by the target playback link associated with the specified subtext.
[0032] In a third aspect of the invention, a text processing apparatus is also provided, the apparatus comprising:
[0033] The first tag determination module is used to divide the video to be processed into multiple selectable segments based on the video content of the video to be processed, and to determine the first tag of each selectable segment; wherein, the first tag includes: person tag and event tag;
[0034] The second tag determination module is used to divide the target text into multiple sub-texts based on the text content of the target text used to describe the video to be processed, and to determine a second tag for each sub-text; wherein the second tag includes: a person tag and an event tag;
[0035] The candidate combination determination module is used to perform tag matching on the first tag of each candidate segment and the second tag of each target subtext in the plurality of subtexts to obtain each candidate combination; wherein, each candidate combination includes at least one candidate segment and one target subtext, and the person tag and event tag of the candidate segment included in each candidate combination are matched with the person tag and event tag of the target subtext included in the candidate combination, respectively.
[0036] The link adding module is used to add a target playback link about the selected segment in the target text for each target combination in the various selectable combinations; wherein, the target playback link is used to indicate that the video to be processed will start playing from the start playback time of the selected segment in the target combination in the video to be processed.
[0037] Optionally, in one specific implementation, the second label determining module is specifically used for:
[0038] Based on a predetermined delimiter, the target text used to describe the video to be processed is divided to obtain individual sentences in the target text;
[0039] Each sentence is segmented to obtain at least one keyword in that sentence;
[0040] According to the order of the positions of each keyword in the target text, keyword category identification is performed on each keyword in turn. When a first keyword about a person and a second keyword about an event are identified, the sentence to which the first keyword and the second keyword belong is divided into a subtext, and the first keyword and the second keyword are respectively determined as the person tag and the event tag of the subtext, thus obtaining the second tag of the subtext.
[0041] Optionally, in one specific implementation, the module for determining the combination to be selected includes:
[0042] The calculation submodule is used to calculate the matching degree group between each target subtext and each candidate segment for each target subtext; wherein each matching degree group includes: the person tag and event tag of the target subtext, and the first matching degree and the second matching degree with the person tag and event tag of a candidate segment, respectively;
[0043] The submodule for determining the selected combination is used to calculate the tag matching degree between the target subtext and each selected segment based on each matching degree group for each target subtext, and determine the target subtext and the selected segments whose tag matching degree with the target subtext reaches a preset matching degree as selected combinations, thus obtaining each selected combination.
[0044] Optionally, in one specific implementation, the computation submodule is specifically used for:
[0045] For each target subtext, perform the following steps:
[0046] Determine the first number of keywords included in the person tags of the target subtext and the second number of keywords included in the event tags of the subtext;
[0047] For each segment to be selected, determine the third number of matching keywords in the person tags of the target subtext and the person tags of the segment to be selected, and the fourth number of matching keywords in the event tags of the target subtext and the event tags of the segment to be selected.
[0048] For each segment to be selected, the ratio of the third quantity to the target sum is calculated as the first matching degree between the person tag of the target subtext and the person tag of the segment to be selected; and the ratio of the fourth quantity to the target sum is calculated as the second matching degree between the event tag of the target subtext and the event tag of the segment to be selected; wherein, the target sum is the sum of the first quantity and the second quantity.
[0049] Optionally, in one specific implementation, the module for determining the combination to be selected includes a selection submodule, which is specifically used for:
[0050] For each target combination, perform the following operations:
[0051] If the target combination includes a segment to be selected, the link addition module is triggered;
[0052] If the target combination includes multiple segments to be selected, then the selection submodule is triggered;
[0053] The selection submodule is used to select a target segment from multiple selectable segments included in the target combination based on a preset selection method, and add a specified playback link about the target segment to the target subtext of the target combination in the target text; wherein, the specified playback link is used to indicate that the video to be processed will start playing from the start time of the target segment in the video to be processed.
[0054] Optionally, in one specific implementation, the selection submodule is specifically used for:
[0055] Obtain a selection instruction and determine the segment to be selected indicated by the selection instruction as the target segment; or, among the multiple segments to be selected included in the target combination, determine the segment with the highest tag matching degree with the target subtext included in the target combination as the target segment.
[0056] In a fourth aspect of the invention, a video processing apparatus is also provided, the apparatus comprising:
[0057] A text determination module is used to determine target text; wherein each target subtext in the target text is associated with a target playback link, and the target playback link associated with each target subtext is added based on the text processing method provided in the first aspect;
[0058] The video playback module is configured to, upon detecting a selection operation for a target playback link associated with a specified subtext in each of the target subtexts, jump to the playback interface of the target video described in the target text, and start playing the target video from the time indicated by the target playback link associated with the specified subtext.
[0059] In another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements any of the text processing methods provided in the first aspect above.
[0060] In another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the video processing method provided in the second aspect above.
[0061] In another aspect of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the text processing methods provided in the first aspect above.
[0062] In another aspect of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the video processing method described in the second aspect above.
[0063] Applying the solution provided in this embodiment of the invention, firstly, the video to be processed is divided into multiple selectable segments based on its video content. Then, based on the video content, a first tag, including a person tag and an event tag, is determined for each selectable segment. Next, based on the text content of the target text describing the video to be processed, the target text is divided into multiple sub-texts. Based on the text content, a second tag, including a person tag and an event tag, is determined for each sub-text. In this way, tag matching can be performed on the first tag of each selectable segment and the second tag of each target sub-text in the multiple sub-texts to obtain various selectable combinations. Each selectable combination includes at least one selectable segment and one target sub-text. Furthermore, while the person tags of the selectable segments included in each selectable combination match the person tags of the target sub-text, the event tags of the selectable segments included in each selectable combination also match the event tags of the target sub-text. Therefore, for each target combination in each candidate combination, a target playback link can be added to the target subtext of the target text in the target text, indicating that the video to be processed will start playing from the start time of the candidate segment in the candidate combination in the video to be processed.
[0064] Based on this, the solution provided by the embodiments of the present invention can divide the text describing the video into multiple subtexts, and add a playback link to each subtext indicating the start time of the corresponding video frame in the complete video. In this way, when a user is interested in the video content corresponding to a subtext, they can directly locate the video content corresponding to that subtext in the complete video through the playback link, and start playing the complete video from the start time of that video content in the complete video. This improves video location efficiency and, consequently, increases video viewership. Attached Figure Description
[0065] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0066] Figure 1 A flowchart illustrating a text processing method provided in an embodiment of the present invention;
[0067] Figure 2 This is a schematic diagram illustrating the effect of an embodiment of the present invention;
[0068] Figure 3 A flowchart illustrating a video processing method provided in an embodiment of the present invention;
[0069] Figure 4 This is a schematic diagram of the structure of a text processing device provided in an embodiment of the present invention;
[0070] Figure 5 This is a schematic diagram of the structure of a video processing device provided in an embodiment of the present invention;
[0071] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention;
[0072] Figure 7 This is a schematic diagram of another electronic device provided in an embodiment of the present invention. Detailed Implementation
[0073] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention.
[0074] With the release of various TV series and movies, video clients offer the function of viewing plot summaries, such as episode summaries for TV series, to help users understand the general plot. However, when users are interested in the video content corresponding to the text content in the episode summary, they need to manually drag the progress bar of the corresponding video content to the possible playback progress to watch the video content of interest, resulting in low efficiency in locating the relevant video content.
[0075] To address the aforementioned technical problems, embodiments of the present invention provide a text processing method.
[0076] This method is applicable to various application scenarios requiring video location-based playback. For example, when a TV series' episode synopsis contains text that a user is interested in, the user can directly locate and play the video content corresponding to that text. Furthermore, this method can be applied to various electronic devices such as laptops, tablets, and desktop computers (hereinafter referred to as electronic devices). Therefore, this embodiment of the invention does not limit the application scenarios or the executing entity of this method.
[0077] An embodiment of the present invention provides a text processing method, which may include the following steps:
[0078] Based on the video content of the video to be processed, the video to be processed is divided into multiple segments to be selected, and a first tag is determined for each segment to be selected; wherein, the first tag includes: a person tag and an event tag;
[0079] Based on the text content of the target text used to describe the video to be processed, the target text is divided into multiple sub-texts, and a second tag is determined for each sub-text; wherein, the second tag includes: a person tag and an event tag;
[0080] Tag matching is performed on the first tag of each candidate segment and the second tag of each target subtext in the plurality of subtexts to obtain each candidate combination; wherein, each candidate combination includes at least one candidate segment and one target subtext, and the person tag and event tag of the candidate segment included in each candidate combination are matched with the person tag and event tag of the target subtext included in the candidate combination, respectively.
[0081] For each target combination among the various candidate combinations, a target playback link about the candidate segment in the target combination is added to the target subtext of the target combination in the target text; wherein, the target playback link is used to indicate that the video to be processed will start playing from the start playback time of the candidate segment in the target combination in the video to be processed.
[0082] As can be seen from the above, the solution provided by the embodiments of the present invention first divides the video to be processed into multiple selectable segments based on the video content, and determines a first tag for each selectable segment, including a person tag and an event tag, based on the video content. Then, based on the text content of the target text used to describe the video to be processed, the target text is divided into multiple sub-texts, and a second tag for each sub-text, including a person tag and an event tag, is determined based on the text content. In this way, tag matching can be performed on the first tag of each selectable segment and the second tag of each target sub-text in the multiple sub-texts to obtain each selectable combination. Each selectable combination includes at least one selectable segment and one target sub-text, and the person tags of the selectable segments included in each selectable combination match the person tags of the target sub-texts, while the event tags of the selectable segments included in each selectable combination match the event tags of the target sub-texts. Therefore, for each target combination in each candidate combination, a target playback link can be added to the target subtext of the target text in the target text, indicating that the video to be processed will start playing from the start time of the candidate segment in the candidate combination in the video to be processed.
[0083] Based on this, the solution provided by the embodiments of the present invention can divide the text describing the video into multiple subtexts, and add a playback link to each subtext indicating the start time of the corresponding video frame in the complete video. In this way, when a user is interested in the video content corresponding to a subtext, they can directly locate the video content corresponding to that subtext in the complete video through the playback link, and start playing the complete video from the start time of that video content in the complete video. This improves video location efficiency and, consequently, increases video viewership.
[0084] The following description, in conjunction with the accompanying drawings, details a text processing method provided by an embodiment of the present invention.
[0085] Figure 1 This is a flowchart illustrating a text processing method provided in an embodiment of the present invention, as shown below. Figure 1 The method includes the following steps S101-S104.
[0086] S101: Based on the video content of the video to be processed, divide the video to be processed into multiple segments to be selected, and determine the first tag of each segment to be selected;
[0087] The first category includes: people tags and event tags.
[0088] To facilitate users' viewing of video content corresponding to text content of interest, the first step is to acquire the video to be processed, such as a single episode of a TV series or the full movie.
[0089] Furthermore, the story presented in each video to be processed is driven by a series of storylines, and for each storyline, the most important information is the character information and the event information. Therefore, for the video content of a video to be processed, the character tag and event tag are indispensable in the tags corresponding to the video segments of each storyline.
[0090] In this way, after obtaining the video to be processed, the video can be divided into multiple segments to be selected based on its content. Then, for each segment to be selected, a first tag including a person tag and an event tag is determined based on the video content.
[0091] Furthermore, to more accurately segment the selected segments, the first tag may also include a time tag, a location tag, etc. This embodiment of the invention does not specifically limit this aspect.
[0092] The information about the people in the video to be processed can be obtained through facial recognition algorithms. Specifically, facial recognition algorithms can be used to capture faces in each frame of the video to obtain the information about the people present in each frame. Alternatively, it can be obtained through plot analysis or manual identification.
[0093] Optionally, the segment to be selected can be divided in the following ways:
[0094] Based on the video to be processed, the information of the people present in each video frame of the video to be processed is determined. Then, for each person present in the video to be processed, based on the above information, the video frame containing that person is determined as the first type of video frame.
[0095] For example, if a video contains characters A, B, and C, and for character A, the video frames containing character A are the 10th video frame, the 15th-50th video frames, and the 85th-100th video frames, then these video frames are considered as the first type of video frames for character A.
[0096] In this way, the segments containing the person can be determined based on the first-class video frames containing the person and the time difference between the first-class video frames.
[0097] Therefore, segmenting the video to be processed based on the person's information can efficiently and accurately determine the segments to be selected in the video.
[0098] The time difference between each type of first-class video frame can be determined by the number of video frames existing between them. When the time difference between two type-first-class video frames is greater than a preset threshold, the two type-first-class video frames are not in the same segment to be selected.
[0099] Optionally, to more accurately segment the selected segments, further processing can be performed on each segment after segmenting for each individual character. For example, based on the segmented segments for each character, a comprehensive analysis can be conducted to determine the remaining segments of the video to be processed. Alternatively, the segmented segments can be further adjusted by considering their corresponding background and music. For instance, multiple segments with the same background music can be treated as a single segment.
[0100] In this way, the first tag of each segment to be selected can be determined based on the video content corresponding to each segment.
[0101] Optionally, for each video audio segment to be selected, based on speech recognition technology, the corresponding audio text of the video segment is identified from the video audio of the segment to be selected, and keyword recognition is performed on the identified audio text to obtain each keyword in the audio text. Then, according to the order of each keyword in the audio text from front to back, keyword category recognition is performed on each keyword in turn. When a first keyword about a person and a second keyword about an event are identified, the first keyword and the second keyword are respectively determined as the person tag and event tag of the segment to be selected, thus obtaining the first tag of the segment to be selected.
[0102] For example, when performing keyword recognition on spoken text, if keyword p1 is recognized, it is the first keyword related to a person; if keyword p2 is recognized, it is the first keyword related to a person; and if keyword p3 is recognized, it is the second keyword related to an event. Therefore, sentences 1 and 2, to which keywords p1, p2, and p3 belong, can be classified as subtext 1, and keywords p1, p2, and p3 can be identified as the first label of subtext 1.
[0103] Continuing the identification process, when keyword p4 is identified, it is the primary keyword related to a person; when keyword p5 is identified, it is the secondary keyword related to an event. Therefore, sentence 3, to which keywords p4 and p5 belong, can be divided into subtext 2, and keywords p4 and p5 can be identified as the primary tags of subtext 1.
[0104] Optionally, for each candidate segment's subtitles, based on text processing technology, the subtitle text corresponding to the video segment is identified from the candidate segment's subtitles, and keyword recognition is performed on the identified subtitle text to obtain each keyword in the subtitle text. Then, according to the order of each keyword's position in the subtitle text from front to back, keyword category recognition is performed on each keyword. When a first keyword about a person and a second keyword about an event are identified, the first keyword and the second keyword are respectively determined as the person tag and event tag of the candidate segment, thus obtaining the first tag of the candidate segment.
[0105] S102: Based on the text content of the target text used to describe the video to be processed, divide the target text into multiple sub-texts and determine the second tag of each sub-text;
[0106] The second category includes: people tags and event tags.
[0107] After identifying multiple selectable segments of the video to be processed and the first tag of each selectable segment, the target text used to describe the video to be processed can be obtained.
[0108] Optionally, the target text may be generated by an electronic device, and thus, the process by which the electronic device generates the target text is the process by which the electronic device acquires the target text.
[0109] Optionally, the target text can be written by the user. The user can input the written target text into the electronic device, and the electronic device can then obtain the target text input by the user.
[0110] Furthermore, after obtaining the target text, the electronic device can further determine the various subtexts included in the target text.
[0111] Furthermore, the story content described in each target text is driven by a series of plot points, and for each plot point, the most important information is character information and event information. Therefore, for the text content of a target text, the character tag and event tag are indispensable in the tags corresponding to the subtexts of each plot point.
[0112] Therefore, after obtaining the target text, it can be divided into multiple subtexts based on its text content. In this way, for each subtext, a second tag, including person and event tags, can be determined.
[0113] Furthermore, to more accurately segment the subtext, the second tag may also include time tags, location tags, etc. This embodiment of the invention does not specifically limit this aspect.
[0114] For example, if the text content of subtext a is: "After the banquet, Ning Yi and Feng Zhiwei met in the private room", then the second tags of subtext a include: "After the banquet": time tag; "Ning Yi" and "Feng Zhiwei": character tags; "met": event tag; "private room": location tag.
[0115] S103: Perform tag matching on the first tag of each segment to be selected and the second tag of each target subtext in multiple subtexts to obtain each combination to be selected;
[0116] Each candidate combination includes at least one candidate segment and one target subtext. The person tags and event tags of the candidate segments included in each candidate combination are matched with the person tags and event tags of the target subtext included in that candidate combination, respectively.
[0117] Since the target text includes multiple subtexts, however, the audience may not be interested in the content of all the subtexts. Therefore, after obtaining multiple subtexts, in order to cater to the audience's needs, the multiple subtexts can be filtered to determine each target subtext. This reduces the workload of users in processing the target text and thus improves the efficiency of text processing.
[0118] The aforementioned target subtexts can be all or part of the target text. This embodiment of the invention does not impose specific limitations on this.
[0119] Therefore, after determining the first label of each segment to be selected and the second label of each subtext, we can perform label matching on each first label and the second label of each target subtext in multiple subtexts to obtain each combination to be selected.
[0120] Since each candidate segment may contain multiple video segments reflecting the same or similar plots, meaning that a target subtext may correspond to multiple candidate segments reflecting the text content of that subtext, each resulting candidate combination includes at least one candidate segment and one target subtext.
[0121] In each candidate combination, the character tags and event tags of the candidate segments are matched with the character tags and event tags of the target subtexts included in that candidate combination.
[0122] For clarity, examples of how to specify step S103 on an electronic device will be provided later, and will not be repeated here. However, the matching method described here is not limited to the matching method described below.
[0123] S104: For each target combination in each candidate combination, add a target playback link about the candidate segment in the target combination to the target subtext of the target combination in the target text;
[0124] The target playback link is used to indicate that the video to be processed will start playing from the start time of the selected segment in the target combination within the video to be processed.
[0125] After obtaining each candidate combination based on tag matching, the candidate segment in each candidate combination can be used as the candidate segment corresponding to the target subtext in that candidate combination.
[0126] To improve the accuracy and efficiency of video positioning, target combinations can be determined from the aforementioned candidate combinations based on audience needs.
[0127] Optionally, if there is still text content in the target sub-text of each of the determined candidate combinations that is not of interest to the audience, then after obtaining each candidate combination, in order to cater to the audience's needs, the candidate combinations can be filtered to determine each target combination. This reduces the workload of users in processing the target text, thereby improving the accuracy and efficiency of video positioning.
[0128] Optionally, if the video length of the segment to be selected in the selection combination is too short, it will affect the viewing experience. Therefore, to improve the viewing experience, a preset duration can be set. If the video length of the segment to be selected is not less than the preset duration, the selection combination to which that segment belongs can be determined as the target combination. This allows for further filtering of the selection combination, reducing the workload of text processing for the target text and further improving the accuracy and efficiency of video positioning.
[0129] For example, the preset duration is 3 seconds. The combination to be selected Q includes the segment to be selected A and the target subtext q, where the video duration of the segment to be selected A is 5 seconds. 3 < 5, indicating that the video duration of the segment to be selected A is less than the preset duration, so the combination to be selected Q can be determined as the target combination.
[0130] In this way, the electronic device can add a target playback link to the target subtext of the target text for each target combination in each of the candidate combinations, which indicates that the video to be processed will start playing from the start time of the candidate segment in the video to be processed.
[0131] The target playback link can be presented in the form of a preset graphic icon or a URL link, etc. The embodiments of the present invention do not make specific limitations in this regard.
[0132] Optionally, for each target combination, the position associated with the target sub-text within that target text is determined. This could be, for example, the position before the first word of the target sub-text, the position after the last word of the target sub-text, or other positions associated with the target sub-text. This embodiment of the invention does not specifically limit the choice of these positions. In this way, the target playback link for the selected segment within the target combination can be added to the aforementioned position.
[0133] To facilitate users in explicitly adding playback links to individual target sub-texts within the target text, re-rendering can be performed at each of these sub-texts. This allows users to directly locate the desired segment within the target combination to which each sub-text belongs in the video to be processed by clicking on individual target sub-texts or pre-defined icons within the target text. This enables playback of the video to begin at the start time of the desired segment within the target combination to which each sub-text belongs, thereby improving video location efficiency.
[0134] For example, such as Figure 2 The diagram shown is an example of an effect provided by an embodiment of the present invention. Figure 2 200 is Figure 2 The preset graphic icon 200 shows the playback link for episode 3 of the TV series. Figure 2 In this context, 203 refers to the target sub-text 203 in the episode summary of episode 3 above, and 201 refers to the preset graphic icon 201 of the target playback link corresponding to the target sub-text 203. Figure 2 In the above-mentioned episode 3 summary, 204 refers to the target sub-text 204, and 202 refers to the preset graphic icon 202 of the target playback link corresponding to the target sub-text 204.
[0135] As can be seen from the above, the solution provided by the embodiments of the present invention first divides the video to be processed into multiple selectable segments based on the video content, and determines a first tag for each selectable segment, including a person tag and an event tag, based on the video content. Then, based on the text content of the target text used to describe the video to be processed, the target text is divided into multiple sub-texts, and a second tag for each sub-text, including a person tag and an event tag, is determined based on the text content. In this way, tag matching can be performed on the first tag of each selectable segment and the second tag of each target sub-text in the multiple sub-texts to obtain each selectable combination. Each selectable combination includes at least one selectable segment and one target sub-text, and the person tags of the selectable segments included in each selectable combination match the person tags of the target sub-texts, while the event tags of the selectable segments included in each selectable combination match the event tags of the target sub-texts. Therefore, for each target combination in each candidate combination, a target playback link can be added to the target subtext of the target text in the target text, indicating that the video to be processed will start playing from the start time of the candidate segment in the candidate combination in the video to be processed.
[0136] Based on this, the solution provided by the embodiments of the present invention can divide the text describing the video into multiple subtexts, and add a playback link to each subtext indicating the start time of the corresponding video frame in the complete video. In this way, when a user is interested in the video content corresponding to a subtext, they can directly locate the video content corresponding to that subtext in the complete video through the playback link, and start playing the complete video from the start time of that video content in the complete video. This improves video location efficiency and, consequently, increases video viewership.
[0137] Optionally, in one specific implementation, step S102 above, which divides the target text into multiple sub-texts based on the text content used to describe the target text to be processed, and determines the second tag of each sub-text, may include the following steps 1021-1023:
[0138] Step 1021: Based on the predetermined delimiter, the target text used to describe the video to be processed is divided to obtain the sentences in the target text;
[0139] Step 1022: Perform word segmentation on each sentence to obtain at least one keyword in the sentence;
[0140] Step 1023: According to the order of each keyword in the target text from front to back, perform keyword category identification on each keyword in turn. When the first keyword about a person and the second keyword about an event are identified, divide the sentence to which the first keyword and the second keyword belong into a subtext, and determine the first keyword and the second keyword as the person tag and event tag of the subtext respectively, and obtain the second tag of the subtext.
[0141] In this specific implementation, after obtaining the target text used to describe the video to be processed, the target text can be divided based on a predetermined delimiter to obtain the sentences in the target text.
[0142] The predetermined delimiters mentioned above may include at least one of the symbols used to divide characters in the target text, such as "," ".", ";", "?", and "!". This embodiment of the invention does not specifically limit the delimiters. For example, "." can be used as a delimiter, or "," ".", ";", "?", and "!" can all be used as delimiters.
[0143] The delimiters included in the target text can be detected first. Thus, the text from the first character to the first delimiter in the target text can be identified as the first sentence in the target text; the text from the last character to the last delimiter can be identified as the last sentence in the target text; and the text between the two delimiters in each of the texts other than the first and last sentences can be identified as a sentence in the target text.
[0144] For example, if the target text is "On a dark and stormy night, the legendary duo of killers descended from the sky, disrupting the peaceful life of the inn. G, from a prominent family and pampered since childhood, whose father is a great hero, has always been overshadowed by her. Competitive from a young age, she resolutely chose to run away from home and venture into the world alone, but at her first stop, she was detained at the inn, thus beginning her arduous and demanding life as a servant.", then using "." as the separator in the target text, we can obtain three sentences from the target text, which are: the first sentence: "On a dark and stormy night, the legendary duo of killers descended from the sky, disrupting the peaceful life of the inn."; the second sentence: "G, from a prominent family and pampered since childhood, whose father is a great hero, has always been overshadowed by her."; and the third sentence: "Competitive from a young age, she resolutely chose to run away from home and venture into the world alone, but at her first stop, she was detained at the inn, thus beginning her arduous and demanding life as a servant."
[0145] In this way, after identifying each sentence in the target text, each sentence can be segmented to obtain at least one keyword in that sentence.
[0146] Since the development of a story is determined by characters and events, character tags and event tags are indispensable in a relatively complete storyline.
[0147] In this way, according to the order of the positions of each keyword in the target text, the keyword category is identified in turn. When the first keyword about a person and the second keyword about an event are identified, the sentence to which the first keyword and the second keyword belong can be divided into a subtext. The first keyword and the second keyword are respectively determined as the person tag and the event tag of the subtext, thus obtaining the second tag of the subtext.
[0148] For example, the target text P is divided into sentences 1, 2, and 3. The order of sentences 1, 2, and 3 in the target text is: Sentence 1, Sentence 2, and Sentence 3. Sentence 1 contains keywords p1 and p2, sentence 2 contains keyword p3, and sentence 3 contains keywords p4 and p5. Furthermore, keywords p1, p2, p3, p4, and p5 are arranged in the order they appear in the target text P, resulting in the keyword order: Keyword p1, Keyword p2, Keyword p3, Keyword p4, and Keyword p5.
[0149] Therefore, when keyword p1 is identified, it is the primary keyword related to a person; when keyword p2 is identified, it is the primary keyword related to a person; and when keyword p3 is identified, it is the secondary keyword related to an event. Thus, sentences 1 and 2, to which keywords p1, p2, and p3 belong, can be classified as subtext 1, and keywords p1, p2, and p3 can be identified as the secondary tags of subtext 1.
[0150] Continuing the identification process, when keyword p4 is identified, it is the primary keyword related to a person; when keyword p5 is identified, it is the secondary keyword related to an event. Therefore, sentence 3, to which keywords p4 and p5 belong, can be divided into subtext 2, and keywords p4 and p5 can be identified as the secondary tags of subtext 1.
[0151] Since each candidate segment may contain multiple video segments reflecting the same or similar plots, meaning that a subtext may correspond to multiple candidate segments reflecting the text content of that subtext, each resulting candidate combination includes at least one candidate segment and one subtext.
[0152] Based on this, in one optional implementation, step S103 above, which involves tag matching of the first tag of each segment to be selected and the second tag of each target subtext in the multiple subtexts to obtain each combination to be selected, may include the following steps 1031-1032:
[0153] Step 1031: For each target subtext, calculate the matching degree group between that target subtext and each segment to be selected;
[0154] Each matching degree group includes: the person tag and event tag of the target subtext, and the first matching degree and the second matching degree of the person tag and event tag of a segment to be selected, respectively.
[0155] In this specific implementation, after determining the first label of each segment to be selected and the second label of each target subtext in the multiple subtexts, the matching degree group between the target subtext and each segment to be selected can be calculated for each target subtext.
[0156] Since both the first and second tags include person tags and event tags, after determining the first tag for each segment to be selected and the second tag for each target subtext, we can calculate the first matching degree between the person tags of the target subtext and the person tags of each segment to be selected for each target subtext, and then calculate the second matching degree between the event tags of the target subtext and the event tags within each segment to be selected. In this way, for each subtext, we can obtain a set of matching degrees between the target subtext and each segment to be selected.
[0157] Optionally, in one specific implementation, step 1031 above may include the following steps:
[0158] For each target subtext, perform the following steps 11-13:
[0159] Step 11: Determine the first number of keywords included in the person tags of the target subtext and the second number of keywords included in the event tags of the subtext;
[0160] Step 12: For each segment to be selected, determine the third number of matching keywords in the person tags of the target subtext and the person tags of the segment to be selected, and the fourth number of matching keywords in the event tags of the target subtext and the event tags of the segment to be selected.
[0161] Step 13: For each segment to be selected, calculate the ratio of the third quantity to the target sum value as the first matching degree between the person tag of the target subtext and the person tag of the segment to be selected; and calculate the ratio of the fourth quantity to the target sum value as the second matching degree between the event tag of the target subtext and the event tag of the segment to be selected; wherein, the target sum value is the sum of the first quantity and the second quantity.
[0162] In this specific implementation, after determining the first tag of each segment to be selected and the second tag of each target subtext in the multiple subtexts, the first number of keywords included in the person tag of the target subtext and the second number of keywords included in the event tag of the target subtext can be determined for each target subtext. Then, for each segment to be selected, the third number of matching keywords in the person tag of the target subtext and the person tag of the segment to be selected, and the fourth number of matching keywords in the event tag of the target subtext and the event tag of the segment to be selected can be determined.
[0163] In this way, the sum of the first and second quantities can be determined as the target sum.
[0164] Then, for each segment to be selected, the ratio of the third quantity to the above target sum value is calculated as the first matching degree between the person tag of the target subtext and the person tag of the segment to be selected, and the ratio of the fourth quantity to the above target sum value is calculated as the second matching degree between the event tag of the target subtext and the event tag of the segment to be selected.
[0165] Since a target subtext may correspond to multiple candidate segments reflecting the text content of the target subtext, each matching degree group includes: the person tag and event tag of the target subtext, and the first matching degree and the second matching degree with the person tag and event tag of a candidate segment, respectively.
[0166] Step 1032: For each target subtext, based on each matching degree group, calculate the tag matching degree between the target subtext and each candidate segment, and determine the target subtext and the candidate segments whose tag matching degree with the target subtext reaches the preset matching degree as candidate combinations, thus obtaining each candidate combination.
[0167] In this specific implementation, after obtaining the matching degree groups for the target subtext and each selected segment, the tag matching degree between the target subtext and each selected segment can be calculated for each target subtext based on the calculated matching degree groups.
[0168] Since a target subtext may correspond to multiple text segments that reflect the content of the target subtext, in order to improve the working efficiency of electronic devices, the matching degree can be preset. In this way, for each target subtext, after obtaining the tag matching degree between the target subtext and each segment to be selected, it can be determined whether the tag matching degree of the target subtext meets the preset matching degree.
[0169] If there is a candidate segment among the various tag matching degrees of the target subtext that meets the above preset matching degree, it indicates that the target subtext is highly likely to match the candidate segment. Therefore, the target subtext and the candidate segment whose tag matching degree with the target subtext reaches the preset matching degree can be identified as candidate combinations to obtain each candidate combination.
[0170] If there is no selected segment that meets the above preset matching degree among the various tag matching degrees of the target subtext, it indicates that the probability of the target subtext matching the selected segment is low. Therefore, the target subtext and the selected segment cannot be determined as a selected combination.
[0171] In this way, among the multiple text segments that may correspond to a target subtext and reflect the content of that target subtext, the combination of the target subtext and the selected segments with the highest probability of matching the target subtext can be determined as the selected combination.
[0172] Optionally, for each target subtext, the tag matching degree between the target subtext and each candidate segment can be calculated using the following formula; where the formula is:
[0173]
[0174] Among them, s1 i S2 represents the i-th target subtext. j M represents the j-th segment to be selected. ij (s1 i ,s2 j ) represents the tag matching degree between the i-th target subtext and the j-th segment to be selected, n represents the number of tag items included in the first and second tags, and w k The weight of the k-th label in the first label of the i-th target subtext and the second label of the j-th segment to be selected, m ik (s1 i ,s2 j The first tag in the first tag of the i-th target subtext matches the second tag in the j-th segment to be selected.
[0175] and,
[0176]
[0177] It should be noted that the value range of k is determined by the number of tag items n included in the first and second tags. That is, when the first and second tags include person tags and event tags, n=2, and the value range of k is 1 and 2; when the first and second tags include person tags, event tags, location tags, and time tags, n=4, and the value range of k is 1, 2, 3, and 4. This embodiment of the invention does not specifically limit this.
[0178] To facilitate understanding of the above embodiments, the following will specifically describe the concept of "person tag" as the first item included in the first and second tags, and "event tag" as the second item included in the first and second tags.
[0179] When k=1, the first label and the first item included in the first label are person labels; when k=2, the first label and the second item included in the first label are event labels.
[0180] At this point, when k=1, the first matching degree m between the person tag in the first tag of the i-th target sub-text and the person tag in the second tag of the j-th segment to be selected is... i1 (s1 i ,s2 j )for:
[0181]
[0182] When k=2, the second matching degree m between the event label in the first label of the i-th target subtext and the event label in the second label of the j-th segment to be selected is... i2 (s1 i ,s2 j )for:
[0183]
[0184] Thus, for each target subtext, the tag matching degree between the target subtext and each candidate segment can be calculated using the following formula: [Formula omitted for brevity]
[0185] M ij (s1 i ,s2 j )=w1*m i1 (s1 i ,s2 j )+w2*m i2 (s1 i ,s2 j )
[0186] Among them, Mij (s1 i ,s2 j w1 represents the tag matching degree between the i-th target subtext and the j-th candidate segment; w2 represents the weight of the person tag in the first tag of the i-th target subtext and the second tag of the j-th candidate segment; w2 represents the weight of the event tag in the first tag of the i-th target subtext and the second tag of the j-th candidate segment.
[0187] To improve the user experience, a target playback link for the selected segment within each target combination can be added to the target text. This allows users to directly locate the selected segment within the target combination in the video being processed via the aforementioned target playback link. This enables playback of the video to begin at the start time of the selected segment within the target combination to which each target subtext belongs, thereby improving video location efficiency and ultimately increasing video viewership.
[0188] Therefore, in one optional implementation, step S104 above—adding a target playback link about the selected segment in each target combination to the target subtext of that target combination in the target text—may include the following steps:
[0189] For each target combination, perform the following step 21:
[0190] Step 21: If the target combination includes a segment to be selected, add a target playback link about the segment to be selected in the target subtext of the target combination in the target text.
[0191] In this specific implementation, for each target combination, if the target combination includes a segment to be selected, it indicates that there is a segment to be selected in the target combination that matches the target subtext. Therefore, a target playback link about the segment to be selected in the target combination can be added to the target subtext in the target text.
[0192] Furthermore, since multiple video segments reflecting the same or similar plots may appear among the various candidate segments, meaning that one target subtext may correspond to multiple candidate segments reflecting the text content of that target subtext, a preset selection method can be used to select the target segment from among the candidate segments. This increases the accuracy of matching the target subtext with the candidate segments, thereby improving video positioning efficiency and ultimately increasing video viewership.
[0193] Based on this, for each target combination, perform the following step 22:
[0194] Step 22: If the target combination includes multiple segments to be selected, then based on the preset selection method, select the target segment from the multiple segments to be selected included in the target combination, and add a specified playback link about the target segment to the target subtext of the target combination in the target text; wherein, the specified playback link is used to indicate that the video to be processed will start playing from the start time of the target segment in the video to be processed.
[0195] In this specific implementation, for each target combination, if the target combination includes multiple segments to be selected, it indicates that there are multiple segments to be selected that match the target subtext. Therefore, based on a preset selection method, a target segment can be selected from the multiple segments to be selected included in the target combination, and a specified playback link about the target segment can be added to the target subtext of the target combination in the target text, so that the user can play the video to be processed from the start time of the target segment in the video to be processed through the specified playback link.
[0196] Optionally, in one specific implementation, step 22 above, selecting the target segment from the multiple segments to be selected in the target combination based on a preset selection method, may include the following step 31:
[0197] Step 31: Obtain the selection instruction and determine the segment to be selected indicated by the selection instruction as the target segment.
[0198] In this specific implementation, for each target combination, if the target combination includes multiple segments to be selected, the segment to be selected indicated by the above selection instruction can be determined as the target segment based on the acquired selection instruction.
[0199] For example, the combination to be selected Q includes subtext a, segment A, segment B, and segment C. Based on the obtained selection instructions, segment A, indicated by the selection instructions, is determined as the target segment.
[0200] Optionally, a selection command can be sent to the electronic device based on the user's selection operation, so that the electronic device can obtain the selection command.
[0201] Optionally, in one specific implementation, step 22 above, selecting the target segment from the multiple segments to be selected in the target combination based on a preset selection method, may include the following step 32:
[0202] Step 32: Among the multiple selectable segments included in the target combination, the selectable segment with the highest tag matching degree with the target subtext included in the target combination is determined as the target segment.
[0203] In this specific implementation, for each target combination, if the target combination includes multiple selectable segments, the selectable segment with the highest tag matching degree with the target subtext included in the target combination can be determined as the target segment.
[0204] For example, target combination Q includes target subtext a, candidate segment A, candidate segment B, and candidate segment C. The tag matching degree between target subtext a and candidate segment A is 90%, between target subtext a and candidate segment B is 88%, and between target subtext a and candidate segment C is 80%. Among the tag matching degrees between target subtext a and candidate segments A, B, and C, 90 > 88 > 80. Therefore, candidate segment A can be identified as the target segment.
[0205] Corresponding to the text processing method provided in the above embodiments of the present invention, the present invention also provides a video processing method.
[0206] Figure 3 This is a flowchart illustrating a video processing method provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the method may include the following steps S301-S302.
[0207] S301: Determine the target text;
[0208] Each target subtext in the target text is associated with a target playback link, and the target playback link associated with each target subtext is added based on the text processing method provided in the embodiments of the present invention.
[0209] With the release of various TV series and movies, video clients offer the function of viewing plot summaries to allow users to gain a general understanding of the storyline. Furthermore, to facilitate users' viewing of video content corresponding to text content of interest, a text processing method provided in this invention can be used to add a target playback link associated with each target subtext of the target text to which the aforementioned text content belongs.
[0210] In this way, when playing a video, the target text to which the text content of interest belongs can be determined first.
[0211] S302: When a selection operation is detected for the target playback link associated with the specified subtext in each target subtext, jump to the playback interface of the target video described in the target text, and start playing the target video from the time indicated by the target playback link associated with the specified subtext.
[0212] After determining the target text, the electronic device can detect whether there is a selection operation for the target playback link associated with the specified subtext in each target subtext.
[0213] In this way, when the electronic device detects a selection operation for the target playback link associated with the specified subtext in each target subtext, it can jump to the playback interface of the target video described by the target text and start playing the video from the time indicated by the target playback link associated with the specified subtext. This completes the location of the video content corresponding to the specified subtext, thereby improving video location efficiency and increasing video viewership.
[0214] Based on this, by applying the solution provided in the embodiments of the present invention, when a user is interested in the video content corresponding to a subtext in a text, they can directly locate the video content corresponding to the subtext in the complete video corresponding to the text content through the playback link corresponding to the subtext, and start playing the complete video from the start time of the video content in the complete video, thereby improving the efficiency of video positioning and thus increasing the video viewing rate.
[0215] Corresponding to the text processing method provided in the above embodiments of the present invention, the present invention also provides a text processing device.
[0216] Figure 4 This is a schematic diagram of the structure of a text processing device provided in an embodiment of the present invention, as shown below. Figure 4 As shown, the device includes the following modules:
[0217] The first tag determination module 410 is used to divide the video to be processed into multiple selectable segments according to the video content of the video to be processed, and determine the first tag of each selectable segment; wherein, the first tag includes: person tag and event tag;
[0218] The second tag determination module 420 is used to divide the target text into multiple sub-texts based on the text content of the target text used to describe the video to be processed, and to determine a second tag for each sub-text; wherein the second tag includes: a person tag and an event tag;
[0219] The candidate combination determination module 430 is used to perform tag matching on the first tag of each candidate segment and the second tag of each target subtext in the plurality of subtexts to obtain each candidate combination; wherein, each candidate combination includes at least one candidate segment and one target subtext, and the person tag and event tag of the candidate segment included in each candidate combination are matched with the person tag and event tag of the target subtext included in the candidate combination, respectively.
[0220] The link adding module 440 is used to add a target playback link about the selected segment in the target text of each target combination in the target text for each target combination in the respective selection combinations; wherein, the target playback link is used to indicate that the video to be processed will start playing from the start playback time of the selected segment in the target combination in the video to be processed.
[0221] As can be seen from the above, the solution provided by the embodiments of the present invention first divides the video to be processed into multiple selectable segments based on the video content, and determines a first tag for each selectable segment, including a person tag and an event tag, based on the video content. Then, based on the text content of the target text used to describe the video to be processed, the target text is divided into multiple sub-texts, and a second tag for each sub-text, including a person tag and an event tag, is determined based on the text content. In this way, tag matching can be performed on the first tag of each selectable segment and the second tag of each target sub-text in the multiple sub-texts to obtain each selectable combination. Each selectable combination includes at least one selectable segment and one target sub-text, and the person tags of the selectable segments included in each selectable combination match the person tags of the target sub-texts, while the event tags of the selectable segments included in each selectable combination match the event tags of the target sub-texts. Therefore, for each target combination in each candidate combination, a target playback link can be added to the target subtext of the target text in the target text, indicating that the video to be processed will start playing from the start time of the candidate segment in the candidate combination in the video to be processed.
[0222] Based on this, the solution provided by the embodiments of the present invention can divide the text describing the video into multiple subtexts, and add a playback link to each subtext indicating the start time of the corresponding video frame in the complete video. In this way, when a user is interested in the video content corresponding to a subtext, they can directly locate the video content corresponding to that subtext in the complete video through the playback link, and start playing the complete video from the start time of that video content in the complete video. This improves video location efficiency and, consequently, increases video viewership.
[0223] Optionally, in one specific implementation, the second label determining module 420 is specifically used for:
[0224] Based on a predetermined delimiter, the target text used to describe the video to be processed is divided to obtain individual sentences in the target text;
[0225] Each sentence is segmented to obtain at least one keyword in that sentence;
[0226] According to the order of the positions of each keyword in the target text, keyword category identification is performed on each keyword in turn. When a first keyword about a person and a second keyword about an event are identified, the sentence to which the first keyword and the second keyword belong is divided into a subtext, and the first keyword and the second keyword are respectively determined as the person tag and the event tag of the subtext, thus obtaining the second tag of the subtext.
[0227] Optionally, in one specific implementation, the module 430 for determining the combination to be selected includes:
[0228] The calculation submodule is used to calculate the matching degree group between each target subtext and each candidate segment for each target subtext; wherein each matching degree group includes: the person tag and event tag of the target subtext, and the first matching degree and the second matching degree with the person tag and event tag of a candidate segment, respectively;
[0229] The submodule for determining the selected combination is used to calculate the tag matching degree between the target subtext and each selected segment based on each matching degree group for each target subtext, and determine the target subtext and the selected segments whose tag matching degree with the target subtext reaches a preset matching degree as selected combinations, thus obtaining each selected combination.
[0230] Optionally, in one specific implementation, the computation submodule is specifically used for:
[0231] For each target subtext, perform the following steps:
[0232] Determine the first number of keywords included in the person tags of the target subtext and the second number of keywords included in the event tags of the subtext;
[0233] For each segment to be selected, determine the third number of matching keywords in the person tags of the target subtext and the person tags of the segment to be selected, and the fourth number of matching keywords in the event tags of the target subtext and the event tags of the segment to be selected.
[0234] For each segment to be selected, the ratio of the third quantity to the target sum is calculated as the first matching degree between the person tag of the target subtext and the person tag of the segment to be selected; and the ratio of the fourth quantity to the target sum is calculated as the second matching degree between the event tag of the target subtext and the event tag of the segment to be selected; wherein, the target sum is the sum of the first quantity and the second quantity.
[0235] Optionally, in one specific implementation, the candidate combination determination module 430 includes a selection submodule, and the candidate combination determination module 430 is specifically used for:
[0236] For each target combination, perform the following operations:
[0237] If the target combination includes a segment to be selected, the link addition module 440 is triggered;
[0238] If the target combination includes multiple segments to be selected, then the selection submodule is triggered;
[0239] The selection submodule is used to select a target segment from multiple selectable segments included in the target combination based on a preset selection method, and add a specified playback link about the target segment to the target subtext of the target combination in the target text; wherein, the specified playback link is used to indicate that the video to be processed will start playing from the start time of the target segment in the video to be processed.
[0240] Optionally, in one specific implementation, the selection unit is specifically used for:
[0241] Obtain a selection instruction and determine the segment to be selected indicated by the selection instruction as the target segment; or, among the multiple segments to be selected included in the target combination, determine the segment with the highest tag matching degree with the target subtext included in the target combination as the target segment.
[0242] Corresponding to the video processing method provided in the above embodiments of the present invention, the present invention also provides a video processing apparatus.
[0243] Figure 5 This is a schematic diagram of the structure of a video processing device provided in an embodiment of the present invention, as shown below. Figure 5 As shown, the device includes the following modules:
[0244] The text determination module 510 is used to determine target text; wherein each target subtext in the target text is associated with a target playback link, and the target playback link associated with each target subtext is added based on the text processing method provided in the first aspect;
[0245] The video playback module 520 is configured to, when detecting a selection operation for a target playback link associated with a specified subtext in each of the target subtexts, jump to the playback interface of the target video described by the target text, and start playing the target video from the time indicated by the target playback link associated with the specified subtext.
[0246] Based on this, by applying the solution provided in the embodiments of the present invention, when a user is interested in the video content corresponding to a subtext in a text, they can directly locate the video content corresponding to the subtext in the complete video corresponding to the text content through the playback link corresponding to the subtext, and start playing the complete video from the start time of the video content in the complete video, thereby improving the efficiency of video positioning and thus increasing the video viewing rate.
[0247] Corresponding to the text processing method provided in the above embodiments of the present invention, the present invention also provides an electronic device, such as... Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603, and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.
[0248] Memory 603 is used to store computer programs;
[0249] When the processor 601 executes the program stored in the memory 603, it implements the steps of any of the text processing methods provided in the above embodiments of the present invention.
[0250] Corresponding to the video processing method provided in the above embodiments of the present invention, the present invention also provides an electronic device, such as... Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703, and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.
[0251] Memory 703 is used to store computer programs;
[0252] When the processor 701 executes the program stored in the memory 703, it implements the steps of any of the video processing methods provided in the above embodiments of the present invention.
[0253] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0254] The communication interface is used for communication between the aforementioned terminal and other devices.
[0255] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0256] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0257] In another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the steps of any of the text processing methods in the above embodiments.
[0258] In another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the steps of any of the video processing methods in the above embodiments.
[0259] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the steps of any of the text processing methods described in the above embodiments.
[0260] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the steps of any of the video processing methods described above.
[0261] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0262] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0263] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments, electronic device embodiments, computer-readable storage medium embodiments, and computer program product embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0264] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A text processing method, characterized in that, The method is applied to application scenarios that require video positioning and playback. The method includes: Based on the video content of the video to be processed, the video to be processed is divided into multiple selectable segments, and a first tag is determined for each selectable segment; wherein, the first tag includes: a person tag and an event tag; the method of dividing the selectable segments includes: based on the video to be processed, determining the person information of the people present in each video frame of the video to be processed, and for each person present in the video to be processed, based on the person information, determining the video frame containing the person as a first type of video frame, and, based on each first type of video frame containing the person and the time difference between each first type of video frame, determining the selectable segment containing the person; Based on the text content of the target text used to describe the video to be processed, the target text is divided into multiple sub-texts, and a second tag is determined for each sub-text; wherein, the second tag includes: a person tag and an event tag; Tag matching is performed on the first tag of each candidate segment and the second tag of each target subtext in the plurality of subtexts to obtain each candidate combination; wherein, each candidate combination includes at least one candidate segment and one target subtext, and the person tag and event tag of the candidate segment included in each candidate combination are matched with the person tag and event tag of the target subtext included in the candidate combination, respectively. For each target combination, perform the following operations: If the target combination includes a segment to be selected, then a target playback link about the segment to be selected in the target combination is added to the target subtext of the target text in the target text; wherein, the target playback link is used to indicate that the video to be processed will start playing from the start time of the segment to be selected in the target combination in the video to be processed; If the target combination includes multiple segments to be selected, then based on a preset selection method, a target segment is selected from the multiple segments to be selected in the target combination, and a specified playback link about the target segment is added to the target subtext of the target combination in the target text; wherein, the specified playback link is used to indicate that the video to be processed will start playing from the start time of the target segment in the video to be processed.
2. The method according to claim 1, characterized in that, The step of dividing the target text into multiple sub-texts based on the text content used to describe the video to be processed, and determining a second tag for each sub-text, includes: Based on a predetermined delimiter, the target text used to describe the video to be processed is divided to obtain individual sentences in the target text; Each sentence is segmented to obtain at least one keyword in that sentence; According to the order of the positions of each keyword in the target text, keyword category identification is performed on each keyword in turn. When a first keyword about a person and a second keyword about an event are identified, the sentence to which the first keyword and the second keyword belong is divided into a subtext, and the first keyword and the second keyword are respectively determined as the person tag and the event tag of the subtext, thus obtaining the second tag of the subtext.
3. The method according to claim 1, characterized in that, The step of matching the first tag of each segment to be selected with the second tag of each target subtext in the plurality of subtexts to obtain each combination to be selected includes: For each target subtext, calculate the matching degree group between the target subtext and each candidate segment; wherein each matching degree group includes: the person tag and event tag of the target subtext, and the first matching degree and the second matching degree with the person tag and event tag of a candidate segment, respectively; For each target subtext, based on each matching degree group, the tag matching degree between the target subtext and each candidate segment is calculated, and the target subtext and the candidate segments whose tag matching degree with the target subtext reaches a preset matching degree are determined as candidate combinations, thus obtaining each candidate combination.
4. The method according to claim 3, characterized in that, The step of calculating the matching degree group between each target subtext and each segment to be selected includes: For each target subtext, perform the following steps: Determine the first number of keywords included in the person tags of the target subtext and the second number of keywords included in the event tags of the subtext; For each segment to be selected, determine the third number of matching keywords in the person tags of the target subtext and the person tags of the segment to be selected, and the fourth number of matching keywords in the event tags of the target subtext and the event tags of the segment to be selected. For each segment to be selected, the ratio of the third quantity to the target sum is calculated as the first matching degree between the person tag of the target subtext and the person tag of the segment to be selected; and the ratio of the fourth quantity to the target sum is calculated as the second matching degree between the event tag of the target subtext and the event tag of the segment to be selected; wherein, the target sum is the sum of the first quantity and the second quantity.
5. The method according to claim 1, characterized in that, The step of selecting a target segment from multiple segments to be selected in the target combination based on a preset selection method includes: Obtain a selection instruction, and determine the segment to be selected indicated by the selection instruction as the target segment; or, Among the multiple selectable segments included in the target combination, the selectable segment with the highest tag matching degree with the target subtext included in the target combination is determined as the target segment.
6. A video processing method, characterized in that, The method includes: Determine the target text; wherein each target subtext in the target text is associated with a target playback link, and the target playback link associated with each target subtext is added based on the text processing method according to any one of claims 1-5; When a selection operation is detected for a target playback link associated with a specified subtext in each of the target subtexts, the system jumps to the playback interface of the target video described by the target text and starts playing the target video from the time indicated by the target playback link associated with the specified subtext.
7. A text processing device, characterized in that, The device is used in application scenarios that require video positioning and playback. The device includes: The first tag determination module is used to divide the video to be processed into multiple selectable segments based on the video content of the video to be processed, and determine a first tag for each selectable segment; wherein, the first tag includes: a person tag and an event tag; the division method of the selectable segments includes: based on the video to be processed, determining the person information of the people present in each video frame of the video to be processed, and for each person present in the video to be processed, determining the video frame containing the person as a first type of video frame based on the person information, and determining the selectable segment containing the person based on each first type of video frame containing the person and the time difference between each first type of video frame; The second tag determination module is used to divide the target text into multiple sub-texts based on the text content of the target text used to describe the video to be processed, and to determine a second tag for each sub-text; wherein the second tag includes: a person tag and an event tag; The candidate combination determination module is used to perform tag matching on the first tag of each candidate segment and the second tag of each target subtext in the plurality of subtexts to obtain each candidate combination; wherein, each candidate combination includes at least one candidate segment and one target subtext, and the person tag and event tag of the candidate segment included in each candidate combination are matched with the person tag and event tag of the target subtext included in the candidate combination, respectively. The link-adding module is used to perform the following operations for each target combination: If the target combination includes one segment to be selected, a target playback link about the segment to be selected in the target combination is added to the target subtext of the target text in the target text; wherein, the target playback link is used to indicate that the video to be processed will start playing from the start playback time of the segment to be selected in the video to be processed; If the target combination includes multiple segments to be selected, a target segment is selected from the multiple segments to be selected in the target combination based on a preset selection method, and a specified playback link about the target segment is added to the target subtext of the target text in the target text; wherein, the specified playback link is used to indicate that the video to be processed will start playing from the start playback time of the target segment in the video to be processed.
8. A video processing apparatus, characterized in that, The device includes: A text determination module is used to determine target text; wherein each target subtext in the target text is associated with a target playback link, and the target playback link associated with each target subtext is added based on the text processing method according to any one of claims 1-5; The video processing module is configured to, upon detecting a selection operation for a target playback link associated with a specified subtext in each of the target subtexts, jump to the playback interface of the target video described in the target text, and start playing the target video from the time indicated by the target playback link associated with the specified subtext.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-5.
10. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the steps of the method described in claim 6.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-5.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in claim 6.
Citation Information
Patent Citations
Video generation method and device
CN108933970A
Video playing node positioning method and device, equipment and storage medium
CN111988663A
Video title generation method and device
CN113378000A
Text concrete method, device and equipment and computer readable storage medium
CN114528437A
