Book label adding method, electronic device and storage medium
The method automates the process of updating book tags using a tag detection model and mapping rules, enhancing efficiency by replacing outdated tags with new ones, thus streamlining the tagging process.
Patent Information
- Application Number
- CN202111613859.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2041-12-27
AI Technical Summary
In the prior art, the process of replacing book tags is complicated and the workload is large, making it difficult to efficiently update into a new tag that conforms to the trend.
By detecting whether the book has preset tags, and using preset tag mapping rules and pre-trained tag detection models, the preset tags are automatically replaced with tags under the tag system to be used to achieve automated tag updates.
Improve the efficiency of book label updates, reduce the time cost of manual intervention, and ensure the timeliness and accuracy of labels.
Smart Images

Figure CN114297413B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and in particular, to a method for adding book tags, an electronic device, and a storage medium. Background Art
[0002] Currently, in order to facilitate users to quickly search for and select books they are interested in, when books are put into storage, tags that match their content are usually determined and added to each book through manual editing.
[0003] However, with the development of the times, the old tags added to books may become outdated. At this time, it is necessary to replace the old tags with new tags that conform to the trend. If the old tags are replaced with new tags through manual editing, the process is complex and the workload is large. Therefore, there is an urgent need for a method that can efficiently add tags to books. Summary of the Invention
[0004] To solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method for adding book tags, an electronic device, and a storage medium.
[0005] In a first aspect, the present disclosure provides a method for adding book tags, including:
[0006] Detecting whether a target book has a preset tag;
[0007] If it is detected that the target book has a preset tag, detecting whether the preset tag is a tag under a tag system to be replaced;
[0008] If it is detected that the preset tag is a tag under the tag system to be replaced, replacing the preset tag with a first tag; wherein, the first tag is a tag under a tag system to be used, and the first tag is obtained by mapping the preset tag based on a preset tag mapping rule and detecting the target book based on a pre-trained tag detection model.
[0009] In a second aspect, the present disclosure provides an electronic device, including a processor and a memory, where the memory is used to store executable instructions, and the executable instructions cause the processor to perform the following operations:
[0010] Detecting whether a target book has a preset tag;
[0011] If it is detected that the target book has a preset tag, detecting whether the preset tag is a tag under a tag system to be replaced;
[0012] If it is detected that the preset tag is a tag under the tag system to be replaced, replacing the preset tag with a first tag; wherein, the first tag is a tag under a tag system to be used, and the first tag is obtained by mapping the preset tag based on a preset tag mapping rule and detecting the target book based on a pre-trained tag detection model.
[0013] In a third aspect, the present disclosure provides a computer-readable storage medium storing a computer program, which when executed by a processor, causes the processor to implement the book label adding method of the first aspect.
[0014] The technical solutions provided by the embodiments of the present disclosure have the following advantages compared with the prior art:
[0015] The book label determination method, electronic device and storage medium according to the embodiments of the present disclosure can detect whether a target book has a preset label; if it is detected that the target book has a preset label, it is detected whether the preset label is a label under the to-be-replaced label system; if it is detected that the preset label is a label under the to-be-replaced label system, the preset label is replaced with a first label; wherein, the first label is a label under the to-be-used label system, and the first label is obtained by mapping the preset label based on a preset label mapping rule and detecting the target book based on a pre-trained label detection model. It can be seen that according to the embodiments of the present disclosure, when the target book has a preset label under the to-be-replaced label system, the first label can be obtained based on the preset label mapping rule and the pre-trained label detection model, and the original preset label under the to-be-replaced label system can be automatically replaced with the first label, saving the time cost of manually replacing the preset label with the first label and improving the efficiency of labeling books. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In combination with the accompanying drawings and with reference to the following detailed description, the above and other features, advantages and aspects of the various embodiments of the present disclosure will become more apparent. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the elements and components are not necessarily drawn to scale.
[0017] Figure 1 FIG. shows a flowchart of a book label adding method provided by an embodiment of the present disclosure;
[0018] Figure 2 FIG. shows a flowchart of another book label adding method provided by an embodiment of the present disclosure;
[0019] Figure 3 FIG. shows a flowchart of yet another book label adding method provided by an embodiment of the present disclosure;
[0020] Figure 4 FIG. shows a flowchart of still another book label adding method provided by an embodiment of the present disclosure;
[0021] Figure 5 FIG. shows a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0022] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Instead, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.
[0023] It should be understood that the various steps recited in the method embodiments of the present disclosure can be executed in a different order and / or executed in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.
[0024] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to". The term "based on" is "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0025] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of functions executed by these devices, modules or units or their interdependent relationships.
[0026] It should be noted that the modifications of "one" and "plural" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise clearly specified in the context, it should be understood as "one or more".
[0027] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.
[0028] The embodiments of the present disclosure provide a method, an electronic device, and a storage medium for adding book tags that can improve the efficiency of adding tags to books.
[0029] First, the method for adding book tags provided by the embodiments of the present disclosure will be described in conjunction with Figures 1-4 the following.
[0030] The book label adding method provided by the embodiments of the present disclosure can be executed by an electronic device capable of providing the function of adding book labels. Among them, the electronic device may include, but is not limited to, mobile terminals such as smart phones, laptop computers, personal digital assistants (PDAs), tablet computers (TABLET PCs), portable multimedia players (PMPs), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable devices, etc., and fixed terminals such as digital TVs, desktop computers, and smart home devices.
[0031] Figure 1 FIG. 4 shows a schematic flowchart of a book label adding method provided by the embodiments of the present disclosure.
[0032] As Figure 1 shown, the book label adding method may include the following steps.
[0033] S110. Detect whether the target book has a preset label.
[0034] In the embodiments of the present disclosure, when the electronic device adds a label under the to-be-used label system to the target book, it may first detect whether the target book has a preset label.
[0035] Specifically, the target book may be any book to which a label under the to-be-used system is to be added.
[0036] Specifically, the target book may have a preset label, that is, the target book has been labeled; the target book may also not have any labels, that is, the target book has not been labeled yet. The embodiments of the present disclosure do not limit this.
[0037] Specifically, the label is used to describe the category to which the target book belongs from a certain dimension. By reading the label, the user can quickly understand the substantial content included in the target book in this dimension.
[0038] Specifically, the preset label may be a label under any label system.
[0039] Specifically, the preset label may be a label under the to-be-replaced label system, or may be a label under other label systems different from the to-be-replaced label system. The embodiments of the present disclosure do not limit this.
[0040] Specifically, the specific content of the preset label is related to the label system to which it belongs, and is not specifically limited here.
[0041] S120. If it is detected that the target book has a preset label, detect whether the preset label is a label under the to-be-replaced label system.
[0042] In the embodiments of the present disclosure, when the electronic device detects that the target book has a preset tag, it can further detect whether the preset tag is a tag under the tag system to be replaced, so as to determine how to replace the preset tag with a tag under the tag system to be used.
[0043] Specifically, the tag system to be replaced can be any tag system different from the tag system to be used.
[0044] Specifically, the tag system to be replaced can include a multi-level tag system such as a first-level, second-level, third-level, or fourth-level tag system, or the tag system to be replaced can include at least one type of tag, but is not limited thereto.
[0045] Exemplarily, the tag system to be replaced can be a four-level tag system. The first-level tags can include two classification tags, namely "male-oriented" and "female-oriented"; the second-level and third-level tags can include multiple classification tags such as "urban", "athletics", "fan works", "tomb raiding and adventure", "modern romance", "youth campus", etc.; the fourth-level tags can include multiple classification tags such as "content theme - entertainment circle", "content theme - reunion", "identity - entertainment star", "writing style - CEO romance", etc., but is not limited thereto.
[0046] Exemplarily, the tag system to be replaced can include multiple types of tags such as writing style, golden finger, protagonist identity, plot, content theme, etc. The tags of the writing style type can include multiple classification tags such as "writing style - female supremacy" and "writing style - baby romance"; the tags of the golden finger type can include multiple classification tags such as "golden finger: pill"; the protagonist identity type can include multiple classification tags such as "identity - entertainment star" and "identity - poison doctor"; the content theme can include multiple classification tags such as "content theme - CEO romance" and "content theme - workplace".
[0047] It can be understood that the tags under the tag system to be replaced are, on the one hand, relatively outdated, and on the other hand, when the tag sources are miscellaneous, there may be unreasonable classification of the tag system to be replaced or unreasonable classification of multiple types of tags included in the tag system to be replaced, resulting in chaotic tags added to the book.
[0048] S130. If it is detected that the preset tag is a tag under the tag system to be replaced, replace the preset tag with the first tag.
[0049] In the embodiments of the present disclosure, when the electronic device detects that the preset tag is a tag under the tag system to be replaced, it can map the preset tag based on the preset tag mapping rule and detect the target book based on the pre-trained tag detection model to obtain the tags under the tag system to be used, and replace the preset tag with the tags under the tag system to be used.
[0050] Specifically, the tag system to be used can be any tag system different from the tag system to be replaced.
[0051] Exemplarily, the tag system to be used can be a multi-level tag system. For example, the tag system to be used can be a three-level tag system. The first-level tags include two classification tags, namely "male-oriented" and "female-oriented"; the second-level tags include tags of theme types; the third-level tags include tags of plot and character types. Among them, the first-level classification tags can be used to distinguish whether the target book belongs to "male-oriented" or "female-oriented" and do not need to be added to the target book. The second-level tags and the third-level tags respectively describe the target book from the dimensions of theme, plot, and character, facilitating users to quickly understand the book content and can be added to the target book. However, it is not limited to this.
[0052] Among them, the first tag is a tag under the tag system to be used, and the first tag is obtained by mapping the preset tags based on the preset tag mapping rules and detecting the target book based on the pre-trained tag detection model.
[0053] Specifically, the preset tag mapping rules include the correspondence between the tags under the tag system to be replaced and the tags under the tag system to be used. It should be noted that for the specific content of the preset tag mapping rules, those skilled in the art can set them according to the tag system to be replaced and the tag system to be used, and no limitation is imposed here.
[0054] Exemplarily, Table 1 shows a kind of preset tag mapping rule. Among them, the content outside the brackets is the tag under the tag system to be used, and the content inside the brackets is the tag to be replaced under the tag system.
[0055]
[0056] Specifically, the tag detection model can be any model that can detect the target book and output the tags under the tag system to be used.
[0057] Exemplarily, inputting the book information of the target book into the tag detection model, the tag detection model can output the tags of the target book under the tag system to be used.
[0058] In some embodiments, all the first tags can be obtained by mapping the preset tags based on the preset tag mapping rules.
[0059] In some other embodiments, all the first tags can be obtained by detecting the target book based on the pre-trained tag detection model.
[0060] In some other embodiments, a partial quantity of the first labels can be obtained by mapping preset labels based on preset label mapping rules; another partial quantity of the first labels can be obtained by detecting a target book based on a pre-trained label detection model.
[0061] The method for determining book labels according to the embodiments of the present disclosure can detect whether a target book has a preset label; if it is detected that the target book has a preset label, it is detected whether the preset label is a label under the to-be-replaced label system; if it is detected that the preset label is a label under the to-be-replaced label system, the preset label is replaced with a first label; wherein, the first label is a label under the to-be-used label system, and the first label is obtained by mapping the preset label based on preset label mapping rules and detecting the target book based on a pre-trained label detection model. It can be seen that according to the embodiments of the present disclosure, when the target book has a preset label under the to-be-replaced label system, the first label can be obtained based on the preset label mapping rules and the pre-trained label detection model, and the original preset label under the to-be-replaced label system can be automatically replaced with the first label, saving the time cost of manually replacing the preset label with the first label and improving the efficiency of labeling books.
[0062] Figure 2 FIG. shows a schematic flowchart of another method for adding book labels provided by the embodiments of the present disclosure. Among them, the embodiments of the present disclosure are optimized based on the above embodiments, and the embodiments of the present disclosure can be combined with each optional solution in one or more of the above embodiments.
[0063] Such as Figure 2 shown, the method for adding book labels may include the following steps.
[0064] S210. Detect whether the target book has a preset label.
[0065] Specifically, S210 is similar to S110, and details are not described herein again.
[0066] S220. If it is detected that the target book has a preset label, detect whether the preset label is a label under the to-be-replaced label system.
[0067] Specifically, S220 is similar to S110, and details are not described herein again.
[0068] S230. If it is detected that the preset label is a label under the to-be-replaced label system, perform a mapping process on the first type of labels based on the label mapping rules to obtain a first mapping result.
[0069] Wherein, the preset label includes a first type of labels, and the first type of labels corresponds to a first label conversion type.
[0070] In an embodiment of the present disclosure, the preset tags may include a first type of tags. For the first type of tags, the electronic device may first perform a mapping process on the first type of tags to obtain a first mapping result.
[0071] Specifically, the first type of tags corresponds to a first tag conversion type. The first tag conversion type may be at least one type in the tag system to be replaced, or the first tag conversion type may be the type corresponding to at least one level of tags in the tag system to be replaced.
[0072] Exemplarily, the first tag conversion type may be the type corresponding to the second-level tags and third-level tags in the tag system to be replaced. At this time, "fan works", "odd news", etc. in Table 1 are all first type of tags.
[0073] Specifically, for each first type of tag in the preset tags, based on the tag mapping rule, perform a mapping process on the first type of tag. If the mapping rule includes the mapping relationship corresponding to the first type of tag, the first sub-tag corresponding to the first type of tag can be obtained, where the first sub-tag is a tag in the tag system to be used; if the mapping rule does not include the mapping relationship corresponding to the first type of tag, the first sub-tag corresponding to the first type of tag cannot be obtained through the mapping process.
[0074] Exemplarily, the preset tags include the first type of tag "fan works". Based on the tag mapping rule, perform a mapping process on "fan works", and "anime fan works" can be obtained.
[0075] S240. If the first mapping result is that there is a first sub-tag corresponding to the first type of tag, use the first sub-tag as the first tag.
[0076] In an embodiment of the present disclosure, if the electronic device performs a mapping process on the first type of tag based on the tag mapping rule and the mapping result is that there is a first sub-tag corresponding to the first type of tag, the first sub-tag can be used as the first tag.
[0077] In some embodiments, the first mapping result is that there is one first sub-tag, and the first sub-tag can be used as the first tag.
[0078] In other embodiments, the first mapping result is that there are multiple first sub-tags. One first quantity of first sub-tags can be randomly selected as the first tag; or the multiple first sub-tags can be used as the first tag; where the specific value of the first quantity can be set by those skilled in the art according to the actual situation and is not limited here.
[0079] Optionally, if the first sub-tag belongs to the tags of the theme type in the tag system to be used, one first sub-tag can be selected as the first tag.
[0080] It can be understood that a book usually has a theme. Selecting a first sub-tag as the first tag can clarify the theme of the target book, facilitating users to quickly and accurately understand the theme of the target book.
[0081] S250. If the first mapping processing result is that there is no first sub-tag corresponding to the first type of tag, input the book information of the target book into each first tag sub-detection model to obtain the second sub-tags output by each first tag sub-detection model.
[0082] Among them, the first tag conversion type corresponds to at least one first tag type, and the tag detection model includes the first tag sub-detection models corresponding to each first tag type; among them, the second sub-tag is a tag under the tag system to be used.
[0083] In the embodiments of the present disclosure, if the electronic device does not obtain the first sub-tag based on the tag mapping rule, the book information of the target book can be input into each first tag sub-detection model to obtain the second sub-tags output by each first tag sub-detection model.
[0084] Specifically, the first tag conversion type corresponds to at least one first tag type. The first tag type can be a type under the tag system to be used, and each first tag type corresponds to a first tag sub-detection model.
[0085] In one example, the first tag conversion type corresponds to the theme type.
[0086] In another example, the first tag conversion type corresponds to the theme type under the male frequency or the theme type under the female frequency. The theme type under the male frequency corresponds to a first tag sub-detection model, and the theme type under the female frequency corresponds to a first tag sub-detection model.
[0087] Specifically, the book information of the target book may include the feature vector of the first type of tag, the feature vector of the book name, the feature vector of the book introduction, etc., but is not limited thereto.
[0088] Specifically, the feature vector of the first type of tag, the feature vector of the book name, and the feature vector of the book introduction can be obtained by means such as vectorization (Embedding), but are not limited thereto.
[0089] Specifically, the first tag sub-detection model can be any model that can output the second sub-tag according to the input book information of the target book.
[0090] Specifically, the first sub-tag detection model may include a classification model such as the Fasttext model, but is not limited thereto. Among them, the training process of the first sub-tag detection model may be as follows: obtain the sample tags of the sample books, where the sample tags are the tags under the tag system to be used; obtain the book information of the sample books, where the book information may include the feature vectors of the first type of tags, the feature vectors of the book names, the feature vectors of the book introductions, etc.; based on the sample tags and book information of the sample books, train the first sub-tag detection model to be trained until the training end condition is reached, and then the trained first sub-tag detection model can be obtained.
[0091] Specifically, input the book information of the target book into the first sub-tag detection model, and the second sub-tag corresponding to the first tag type output by the first sub-tag detection model can be obtained.
[0092] Exemplarily, input the book information of the target book into the first sub-tag detection model corresponding to the theme type under the male category, and the second sub-tag belonging to the theme type under the male category can be obtained. For example, the tag "Fantasy" can be obtained. Input the book information of the target book into the first sub-tag detection model corresponding to the theme type under the female category, and the second sub-tag belonging to the theme type under the female category can be obtained. For example, the tag "Ancient Romance" can be obtained.
[0093] It can be understood that the books preferred by male readers and female readers are usually different. For example, most male readers like to read books with themes such as games and martial arts, and most female readers like to read books with themes such as romance and campus. Therefore, the tags of the theme types under the male category and the tags of the theme types under the female category usually have little overlap. Therefore, the tag detection model can be set to include the first sub-tag detection model corresponding to the theme type under the male category and the first sub-tag detection model corresponding to the theme type under the female category respectively. In this way, it is not only beneficial to quickly train these two first sub-tag detection models, but also beneficial to improve the detection accuracy of the trained first sub-tag detection model for the target book and output the second sub-tag that is more in line with the theme of the target book.
[0094] S260. Take the second sub-tag output by each first sub-tag detection model as the first tag.
[0095] In the embodiments of the present disclosure, the electronic device may take the second sub-tags output by each first sub-tag detection model as the first tag.
[0096] In some embodiments, if the first sub-tag detection model outputs a first sub-tag, this first sub-tag can be taken as the first tag.
[0097] In some other embodiments, the first sub-label detection model outputs a plurality of first sub-labels. A second quantity of the first sub-labels can be randomly selected as the first label, or all of the plurality of first sub-labels can be used as the first label. The specific value of the second quantity can be set by those skilled in the art according to the actual situation and is not limited herein.
[0098] Optionally, the first sub-label detection model can also output probability values corresponding to the second sub-labels, and the second sub-labels can be selected according to the probability values of the second sub-labels. The probability value is used to represent the degree of association between the second sub-label and the target book, and the greater the degree of association, the greater the probability value.
[0099] Optionally, if the first sub-detection model corresponds to the theme type in the male-oriented category or the theme type in the female-oriented category, the first sub-detection model can be set to output one second sub-label, or select one second sub-label from the plurality of second sub-labels output by the first sub-label as the first label.
[0100] S270. Replace the preset label with the first label.
[0101] In the embodiments of the present disclosure, after obtaining the first label, the electronic device can replace the preset label with the first label.
[0102] In some embodiments, the first mapping processing result is that there are first sub-labels corresponding to the first type of label. S270 can specifically include: replacing the first type of label body in the preset label with the first sub-label.
[0103] In some other embodiments, the first mapping processing result is that there are no first sub-labels corresponding to the first type of label. S270 can specifically include: replacing the first type of label in the preset label with the second sub-label.
[0104] It should be noted that in the embodiments of the present disclosure, for the convenience of understanding, the first label type is taken as the theme type as an example for description, but it is not limited thereto. The first label type can also be other label types. In addition, in the present disclosure, the theme type is exemplarily shown to specifically include the theme type in the male-oriented category and the theme type in the female-oriented category, but it is not limited thereto. For example, the theme type can be set to specifically include the theme type for infants and toddlers, the theme type for teenagers, the theme type for the middle-aged and elderly, etc.
[0105] The label adding method provided by the embodiments of the present disclosure, when obtaining the first sub-label by performing mapping processing on the first type of label, takes the first sub-label as the first label. When the first sub-label is not obtained, the book information of the target book is input into each first label sub-detection model, and the second sub-label output by each first label sub-detection model is taken as the first label. When the first label can be obtained through mapping processing, there is no need to detect the target book based on the first label sub-detection model. In this way, it is beneficial to improve the efficiency of determining the first label, and further improve the efficiency of labeling the target book.
[0106] Figure 3 FIG. shows a flowchart of another book label adding method provided by the embodiments of the present disclosure. Among them, the embodiments of the present disclosure are optimized on the basis of the above embodiments, and the embodiments of the present disclosure can be combined with each optional solution in one or more of the above embodiments.
[0107] As Figure 3 shown, the book label adding method may include the following steps.
[0108] S310. Detect whether the target book has a preset label.
[0109] Specifically, S310 is similar to S110, and details are not described herein again.
[0110] S320. If it is detected that the target book has a preset label, detect whether the preset label is a label under the to-be-replaced label system.
[0111] Specifically, S320 is similar to S110, and details are not described herein again.
[0112] S330. If it is detected that the preset label is a label under the to-be-replaced label system, perform mapping processing on the second type of label based on the label mapping rule to obtain a second mapping processing result.
[0113] Among them, the preset label includes the second type of label, and the second type of label corresponds to a second label conversion type.
[0114] In the embodiments of the present disclosure, the preset label may include the second type of label. For the second type of label, the electronic device may perform mapping processing on the second type of label to obtain a second mapping processing result.
[0115] Specifically, the second type of label corresponds to a second label conversion type, and the second label conversion type may be at least one type under the to-be-replaced label system, or the second label conversion type may be a type corresponding to at least one level of label under the to-be-replaced label system.
[0116] Exemplarily, the second label conversion type may be the type corresponding to the fourth-level label under the to-be-replaced label system. At this time, "thriller literature", "antiques appraisal", etc. in Table 1 are all second-type labels.
[0117] Specifically, for each second-type label in the preset labels, based on the label mapping rule, mapping processing is performed on the second-type label. If the label mapping rule includes the mapping relationship corresponding to the second-type label, the fourth sub-label corresponding to the second-type label can be obtained, where the fourth sub-label is a label under the to-be-used label system; if the label mapping rule does not include the mapping relationship corresponding to the second-type label, the fourth sub-label corresponding to the second-type label cannot be obtained through mapping processing.
[0118] Exemplarily, the preset labels include the second-type label "system literature". Based on the label mapping rule, mapping processing is performed on "system literature", and "system" can be obtained.
[0119] S340. Input the book information of the target book into each second-label sub-detection model to obtain the third sub-label output by each second-label sub-detection model.
[0120] Among them, the second label conversion type corresponds to at least one second label type, and the label detection model includes second-label sub-detection models corresponding to each second label type; among them, the third sub-label is a label under the to-be-used label system.
[0121] In the embodiments of the present disclosure, the electronic device may also input the book information of the target book into each second-label sub-detection model to obtain the third sub-label output by each second-label sub-detection model.
[0122] Specifically, the second label conversion type corresponds to at least one second label type. The second label type may be a type under the to-be-used label system, and each second label type corresponds to a second-label sub-detection model.
[0123] In one example, the second label conversion type corresponds to at least one of the plot type and the character type, and the plot type and the character type respectively correspond to a second-label sub-detection model.
[0124] In another example, the second label conversion type corresponds to at least one of the plot type in the male frequency, the plot type in the female frequency, the character type in the male frequency, and the character type in the female frequency. The plot type in the male frequency, the plot type in the female frequency, the character type in the male frequency, and the character type in the female frequency respectively correspond to a second-label sub-detection model.
[0125] Specifically, the book information of the target book may include the feature vector of the second-type label, the feature vector of the book name, the feature vector of the book introduction, etc., but is not limited thereto.
[0126] Specifically, the feature vectors of the second type of tags, the feature vectors of the book names, and the feature vectors of the book introductions can be obtained by means such as vectorization (Embedding), but are not limited thereto.
[0127] Specifically, the second sub-detection model of tags can be any model that can output the third sub-tag according to the book information of the target book input.
[0128] Specifically, the second sub-detection model of tags can include classification models such as the Fasttext model, but is not limited thereto. Among them, the training process of the second sub-detection model of tags is the same as that of the first sub-detection model of tags, which will not be elaborated here.
[0129] Specifically, by inputting the book information of the target book into the second sub-detection model of tags, the third sub-tag of the second tag type corresponding to it output by the second sub-detection model of tags can be obtained.
[0130] Exemplarily, the second tag conversion type corresponds to the plot type under the male-oriented category and / or the character type under the male-oriented category. At this time, by inputting the book information of the target book into the second sub-detection model of tags corresponding to the plot type under the male-oriented category, the second sub-tag belonging to the plot type under the male-oriented category can be obtained. For example, tags such as "rural" and "spiritual" can be obtained; and / or; by inputting the book information of the target book into the second sub-detection model of tags corresponding to the character type under the male-oriented category, the second sub-tag belonging to the character type under the male-oriented category can be obtained. For example, tags such as "worthless" can be obtained.
[0131] Exemplarily, the second tag conversion type corresponds to the plot type under the female-oriented category and / or the character type under the female-oriented category. At this time, by inputting the book information of the target book into the second sub-detection model of tags corresponding to the plot type under the female-oriented category, the second sub-tag belonging to the plot type under the female-oriented category can be obtained. For example, tags such as "female-dominated" and "tragic love" can be obtained; and / or; by inputting the book information of the target book into the second sub-detection model of tags corresponding to the character type under the female-oriented category, the second sub-tag belonging to the character type under the female-oriented category can be obtained. For example, tags such as "star" and "president" can be obtained.
[0132] It can be understood that the books that male readers like to read are usually different from those that female readers like to read, so that the tags of plot or character types in the male-oriented category and those in the female-oriented category usually have little overlap. Therefore, the tag detection model can be set to include second sub-tag detection models corresponding to the plot types in the male-oriented category, the plot types in the female-oriented category, the character types in the male-oriented category, and the character types in the female-oriented category respectively. In this way, it is not only beneficial to quickly train each second sub-tag detection model, but also beneficial to improving the detection accuracy of the trained second sub-tag detection model for the target book, and outputting a third sub-tag that better fits the theme of the target book.
[0133] It should be noted that S330 and S340 can be carried out successively or simultaneously. The present disclosure does not limit this.
[0134] S350. Determine the first tag according to the second mapping processing result and the third sub-tag.
[0135] In the embodiments of the present disclosure, after the electronic device obtains the second mapping processing result and the third sub-tag, it can determine the first tag based on the second mapping processing result and the third sub-tag.
[0136] In some embodiments, S350 may include: S3511. If the second mapping processing result is that there is a fourth sub-tag corresponding to the second type of tag and the difference between the number of the fourth sub-tags and the preset number is not zero, select the number of fifth sub-tags equal to the difference in the third sub-tags; S3512. Use the fourth sub-tag and the fifth sub-tag as the first tag.
[0137] Specifically, those skilled in the art can set the specific value of the preset number according to the actual situation, and this is not limited here. For example, the preset number is equal to 2, but it is not limited thereto.
[0138] Specifically, the difference between the number of the fourth sub-tags and the preset number not being zero indicates that the number of the fourth sub-tags is less than the preset number. At this time, the number of fifth sub-tags equal to the difference can be selected from the third sub-tags. In this way, the sum of the number of the fourth sub-tags and the number of the fifth sub-tags can be made equal to the preset number.
[0139] In one example, selecting the number of fifth sub-tags equal to the difference from the third sub-tags may include: randomly selecting the number of third sub-tags equal to the difference from the third sub-tags as the fifth sub-tags.
[0140] In another example, the second sub-tag detection model can also output the probability values corresponding to each third sub-tag, where the probability value is used to characterize the degree of association between the third sub-tag and the target book, and the greater the degree of association, the greater the probability value; sort the probability values of the third sub-tags from large to small, and select the first number of third sub-tags corresponding to the probability values as the fifth sub-tags.
[0141] Exemplarily, the second label conversion type corresponds to the plot type in the male-oriented category, and the preset quantity is 2. By performing mapping processing on the second type of labels, 1 fourth sub-label is obtained. Through the second sub-label detection model corresponding to the plot type in the male-oriented category, 2 third sub-labels are obtained. One of the 2 third sub-labels can be selected as the fifth sub-label, and then both the third sub-label and the fifth sub-label are used as the first label.
[0142] It can be understood that the second type of labels are the original labels of the target book, and their degree of fit with the target book is usually high. Therefore, the fourth sub-labels obtained based on the preset label mapping rules have a high degree of fit with the target book. First, the fourth sub-labels are used as the first label, and then the third sub-labels are used to fill the missing first labels, which can make the overall degree of fit of the preset quantity of first labels with the target book high.
[0143] In some other embodiments, S350 may include: S3531. If the second mapping processing result is that there are fourth sub-labels corresponding to the second type of labels and the difference between the quantity of the fourth sub-labels and the preset quantity is zero, the fourth sub-labels are used as the first label.
[0144] Specifically, the difference between the quantity of the fourth sub-labels and the preset quantity being zero indicates that the quantity of the fourth sub-labels is equal to the preset quantity. At this time, each of the fourth sub-labels can be used as the first label.
[0145] It can be understood that, as described above, the fourth sub-labels have a high degree of fit with the target book. Prioritizing the use of the fourth sub-labels as the first label can make the overall degree of fit of the preset quantity of first labels with the target book high.
[0146] In still some other embodiments, S350 may include: S3531. If the second mapping processing result is that there are fourth sub-labels corresponding to the second type of labels, select a preset quantity of seventh sub-labels from the third sub-labels and the fourth sub-labels; S3532. Use the seventh sub-labels as the first label.
[0147] Specifically, when selecting a preset quantity of seventh sub-labels from the third sub-labels and the fourth sub-labels, it can be randomly selected. But it is not limited to this.
[0148] It can be understood that the method of selecting a preset quantity of seventh sub-labels from the third sub-labels and the fourth sub-labels is simple and easy to implement.
[0149] In yet some other embodiments, S350 may include: S3541. If the second mapping processing result is that there are no fourth sub-labels corresponding to the second type of labels and the quantity of the third sub-labels is less than or equal to the preset quantity, the third sub-labels are used as the first label.
[0150] In some other embodiments, S350 may include: S3551. If the second mapping processing result is that there is no fourth sub-tag corresponding to the second type of tag and the number of third sub-tags is greater than a preset number, select an eighth sub-tag from the third sub-tags; S3552. Use the eighth sub-tag as the first tag.
[0151] In one example, selecting an eighth sub-tag from the third sub-tags may include: randomly selecting a preset number of eighth sub-tags from the third sub-tags as the first tag.
[0152] In another example, the second sub-tag detection model may further output probability values corresponding to each third sub-tag; sort the probability values of the third sub-tags from largest to smallest, and select the third sub-tags corresponding to the top preset number of probability values as the eighth sub-tags. In this way, the overall fit of the preset number of first tags finally obtained to the target book can be relatively high.
[0153] S360. Replace the preset tag with the first tag.
[0154] Specifically, S360 is similar to S130 and will not be elaborated here.
[0155] The tag adding method provided by the embodiments of the present disclosure, by performing mapping processing on the second type of tag and inputting the book information of the target book into each second tag sub-detection model, and then determining the first tag based on the second mapping processing result and the third sub-tags, can ensure that enough first tags can be finally obtained, so that the number of tags added to the target book is sufficient, facilitating the user to have a relatively comprehensive understanding of the target book.
[0156] Figure 4 The flowchart shows another book tag adding method provided by the embodiments of the present disclosure. Among them, the embodiments of the present disclosure are optimized on the basis of the above embodiments, and the embodiments of the present disclosure can be combined with various alternative solutions in one or more of the above embodiments.
[0157] As Figure 4 shown, the book tag adding method may include the following steps.
[0158] S410. Detect whether the target book has a preset tag.
[0159] Specifically, S410 is similar to S110 and will not be elaborated here.
[0160] S420. If it is detected that the target book does not have a preset tag, detect the target book based on the tag detection model to obtain the second tag corresponding to the target book.
[0161] Among them, the second tag is a tag under the tag system to be used.
[0162] In an embodiment of the present disclosure, when the electronic device detects that the target book does not have a preset tag, the target book can be detected based on a tag detection model to obtain a second tag corresponding to the target book.
[0163] Specifically, the book information of the target book may include a feature vector of the book name, a feature vector of the book introduction, etc., but is not limited thereto.
[0164] Specifically, the feature vector of the book name and the feature vector of the book introduction can be obtained by means such as Embedding, but is not limited thereto.
[0165] In some embodiments, the target book information is input into a tag detection model to obtain a second tag.
[0166] In other embodiments, the tag detection model includes a plurality of sub-tag detection models, and each sub-tag detection model corresponds to a tag type; wherein, S420 may include: S421, inputting the book information of the target book into each sub-tag detection model respectively to obtain a sixth sub-tag output by each sub-tag detection model; S422, using the sixth sub-tags output by each sub-tag detection model as the second tag.
[0167] Specifically, each tag type corresponds to a sub-tag detection model.
[0168] In one example, the tag system to be used includes at least one of a theme type, a plot type, and a character type, and the theme type, the plot type, and the character type respectively correspond to a sub-tag detection model.
[0169] In another example, the tag system to be used includes at least one of a theme type under male-oriented content, a theme type under female-oriented content, a plot type under male-oriented content, a plot type under female-oriented content, a character type under male-oriented content, and a character type under female-oriented content, and the theme type under male-oriented content, the theme type under female-oriented content, the plot type under male-oriented content, the plot type under female-oriented content, the character type under male-oriented content, and the character type under female-oriented content respectively correspond to a sub-tag detection model.
[0170] Specifically, the sub-tag detection model can be any model that can output a second tag according to the input book information of the target book.
[0171] Specifically, the sub-tag detection model may include a classification model such as a Fasttext model, but is not limited thereto. Among them, the training process of the sub-tag detection model is the same as that of the first tag sub-detection model, which will not be elaborated here.
[0172] Specifically, input the book information of the target book into the sub-label detection model, and the sixth sub-label of the corresponding label type output by the sub-label detection model can be obtained.
[0173] Exemplarily, input the book information of the target book into the sub-label detection model corresponding to the theme type under the male-oriented category, and the sixth sub-label belonging to the theme type under the male-oriented category can be obtained. For example, the label "Fantasy" can be obtained. At the same time, input the book information of the target book into the sub-label detection model corresponding to the plot type under the male-oriented category, and the sixth sub-label belonging to the plot type under the male-oriented category can be obtained. For example, the labels "Rural", "Spiritual" and so on can be obtained. At the same time, input the book information of the target book into the sub-label detection model corresponding to the character type under the male-oriented category, and the sixth sub-label belonging to the character type under the male-oriented category can be obtained. For example, the label "Worthless" and so on can be obtained.
[0174] Exemplarily, input the book information of the target book into the sub-label detection model corresponding to the theme type under the female-oriented category, and the sixth sub-label belonging to the theme type under the female-oriented category can be obtained. For example, the label "Ancient Romance" can be obtained. At the same time, input the book information of the target book into the sub-label detection model corresponding to the plot type under the female-oriented category, and the sixth sub-label belonging to the plot type under the female-oriented category can be obtained. For example, the labels "Female Domination", "Tragic Love" and so on can be obtained. At the same time, input the book information of the target book into the sub-label detection model corresponding to the character type under the female-oriented category, and the sixth sub-label belonging to the character type under the female-oriented category can be obtained. For example, the labels "Star", "CEO" and so on can be obtained.
[0175] It should be noted that the above examples only exemplarily output inputting the book information of the target book into the sub-label detection models corresponding to different label types at the same time, but it is not limited to this. For example, the book information of the target book can also be input into the sub-label detection models corresponding to different label types in sequence.
[0176] It can be understood that the books preferred by male readers and female readers are usually different, so that the labels of the theme, plot, and character types under the male-oriented category and the labels of the theme, plot, and character types under the female-oriented category usually have little overlap. Therefore, the label detection model can be set to include the sub-label detection models corresponding to the theme, plot, and character types under the male-oriented category and the sub-label detection models corresponding to the theme, plot, and character types under the female-oriented category respectively. In this way, it is not only beneficial to quickly train each sub-label detection model, but also beneficial to improving the detection accuracy of the trained sub-label detection model for the target book and outputting the second sub-label that is more suitable for the target book.
[0177] In some embodiments, S422 includes: for each sixth sub-label output by the sub-label detection model, if the number of sixth sub-labels is less than or equal to a third number, each sixth sub-label output by the sub-label detection model is used as the second label; wherein, the third number is the number of labels corresponding to the label type of the sub-label detection model, and the specific value of the third number can be set by those skilled in the art according to the actual situation and is not limited herein.
[0178] In some other embodiments, S422 includes: for each sixth sub-label output by the sub-label detection model, if the number of sixth sub-labels is greater than the third number, select a third number of ninth sub-labels from the sixth sub-labels, and use the ninth sub-labels as the second labels.
[0179] In another example, selecting a third number of ninth sub-labels from the sixth sub-labels may include: randomly selecting a third number of ninth sub-labels from the sixth sub-labels.
[0180] In yet another example, the sub-label detection model may further output probability values corresponding to each sixth sub-label; sort the probability values of the sixth sub-labels from largest to smallest, and select the sixth sub-labels corresponding to the top third number of probability values as the ninth sub-labels. In this way, the overall fit of the finally obtained third number of second labels to the target book can be relatively high.
[0181] S430. Add the second label to the target book.
[0182] In the embodiments of the present disclosure, after obtaining the second label, the electronic device can automatically add the second label to the target book.
[0183] Specifically, after determining the second label, the electronic device adds the second label to the target book.
[0184] The label adding method provided by the embodiments of the present disclosure can input the book information of the target book into each sub-label detection model when the target book does not have a preset label, and then determine the second label based on the labels output by each sub-label detection model, so as to add a corresponding second label to the target book that does not have a label itself.
[0185] In another implementation manner of the present disclosure, if it is detected that the preset label is not a label under the to-be-replaced label system, the target book is detected based on the label detection model to obtain a third label corresponding to the target book; replace the preset label with the third label; the third label is a label under the to-be-used label system.
[0186] In the embodiments of the present disclosure, when the electronic device detects that the preset label is not a label under the to-be-replaced label system, it can detect the target book based on the label detection model to obtain a third label corresponding to the target book.
[0187] In some embodiments, the target book information is input into a label detection model to obtain a third label.
[0188] In some other embodiments, the label detection model includes multiple sub-label detection models, and each sub-label detection model corresponds to a label type; wherein, detecting the target book based on the label detection model to obtain the third label corresponding to the target book may include: inputting the book information of the target book into each sub-label detection model respectively to obtain a tenth sub-label output by each sub-label detection model; using the tenth sub-labels output by each sub-label detection model as the third label.
[0189] Specifically, the specific manner of obtaining the third label through the sub-label detection model is similar to the specific implementation manner of obtaining the second label through the sub-label detection model, and will not be elaborated here. Among them, those skilled in the art can understand that when inputting the target information of the target book into the label detection model, the book information of the target book may include: the feature vector of the preset label, the feature vector of the book name, the feature vector of the book introduction, etc., but is not limited thereto.
[0190] Specifically, the specific implementation manner of replacing the preset label with the third label is similar to the specific implementation manner of replacing the preset label with the first label, and will not be elaborated here either.
[0191] It can be understood that when the preset label of the target book does not belong to the to-be-replaced label system, the book information of the target book can be input into the label detection model, and then, the third label is determined based on the label output by the label detection model, so as to add the corresponding third label to the target book that itself has a label that does not belong to the to-be-replaced label system.
[0192] In another implementation manner of the present disclosure, the method further includes: adding a source identifier to the labels under each to-be-used label system of the target book.
[0193] In the embodiments of the present disclosure, when the electronic device replaces the preset label with the first label or adds the second label to the target book, it can also add a source identifier to the labels under each to-be-used label system of the target book.
[0194] In some embodiments, when replacing the preset label with the first label, the source identifier of the first label can be added simultaneously.
[0195] In some other embodiments, when adding the second label to the target book, the source identifier of the second label can be added simultaneously.
[0196] In one example, when the first tag is obtained by mapping a preset tag, its source identifier can be the first identifier; when the first tag or the second tag is detected from the target book by a tag detection model, its source identifier can be the second identifier.
[0197] It should be noted that those skilled in the art can set the specific forms of the first identifier and the second identifier according to the actual situation, which are not limited herein. For example, the first identifier is A and the second identifier is B.
[0198] Exemplarily, after adding tags to the target book, the target book has a theme tag "Fantasy (A)", plot tags "Sword Kendo (B)" and "Seize Hegemony (A)", and character tags "Sword Emperor (B)" and "Waste Wood (A)".
[0199] It can be understood that after adding source identifiers to the tags under each tag system to be used for the target book, the tags output by the tag detection model can be determined, and it can be determined whether the tags output by the tag detection model match the specific content of the target book according to the specific content of the target book, which is beneficial to further optimizing the tag detection model.
[0200] Figure 5 FIG. shows a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
[0201] The electronic device provided by the embodiment of the present disclosure may include an electronic device supporting e-book reading functions. The electronic device may include, but is not limited to, mobile terminals such as smart phones, laptop computers, personal digital assistants (PDAs), tablet computers (PADs), portable multimedia players (PMPs), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc. It should be noted that the execution subject of the book tag adding method in the embodiment of the present disclosure may also be other devices with audio adjustment functions, such as an electronic reading platform supporting audio adjustment functions or a text-to-speech (TTS) engine, etc., which are not limited herein.
[0202] It should be noted that Figure 5 The electronic device diagram 500 shown is only an example and should not bring any limitation to the functions and usage scope of the embodiment of the present disclosure.
[0203] The electronic device in FIG. 500 conventionally includes a processor in FIG. 510 and a computer program product or computer-readable medium in the form of a memory in FIG. 520. The memory in FIG. 520 can be an electronic memory such as flash memory, EEPROM (electrically erasable programmable read-only memory), EPROM, hard disk, or ROM. The memory in FIG. 520 has a storage space in FIG. 521 for executable instructions (or program code) in FIG. 5211 for performing any of the method steps in the above-described note processing method. For example, the storage space in FIG. 521 for the executable instructions can include respective executable instructions in FIG. 5211 for implementing the various steps in the above note processing method. These executable instructions can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, optical discs (CDs), memory cards, or floppy disks. Such computer program products are typically portable or fixed storage units. The storage unit can have a storage segment or storage space, etc., arranged similarly to the memory in FIG. 520 in the electronic device in FIG. 500. The executable instructions can be compressed in an appropriate form, for example. Generally, the storage unit includes executable instructions for performing the steps of the note processing method according to the present disclosure, that is, code that can be read by a processor such as the processor in FIG. 510, and when run by the electronic device in FIG. 500, causes the electronic device in FIG. 500 to execute the respective steps in the note processing method described above. Figure 5 The storage segment or storage space, etc., in the electronic device in FIG. 500 can be arranged similarly to the memory in FIG. 520. The executable instructions can be compressed in an appropriate form, for example. Generally, the storage unit includes executable instructions for performing the steps of the note processing method according to the present disclosure, that is, code that can be read by a processor such as the processor in FIG. 510, and when run by the electronic device in FIG. 500, causes the electronic device in FIG. 500 to execute the respective steps in the note processing method described above.
[0204] Of course, for simplicity, Figure 5 only some of the components in the electronic device in FIG. 500 related to the present disclosure are shown, and components such as buses, input / output interfaces, input devices, and output devices, etc., are omitted. In addition, according to specific application scenarios, the electronic device in FIG. 500 can also include any other appropriate components.
[0205] Embodiments of the present disclosure also provide a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are run by a processor, the processor is caused to execute the note processing method provided by the embodiments of the present disclosure.
[0206] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0207] The above computer-readable medium may be included in the above electronic device; or may exist separately without being assembled into the electronic device.
[0208] In an embodiment of the present disclosure, program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The above programming languages include, for example, but are not limited to, object-oriented programming languages - such as Java, Smalltalk, C++, and also include conventional procedural programming languages - such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network - including a local area network (LAN) or a wide area network (WAN) - or may be connected to an external computer (for example, by connecting through an Internet service provider via the Internet).
[0209] This application discloses:
[0210] 1A. A method for adding book tags, wherein the method includes:
[0211] Detect whether a target book has a preset tag;
[0212] If it is detected that the target book has the preset tag, detect whether the preset tag is a tag under a tag system to be replaced;
[0213] If it is detected that the preset tag is a tag under the tag system to be replaced, replace the preset tag with a first tag; wherein the first tag is a tag under a tag system to be used, and the first tag is obtained by mapping the preset tag based on a preset tag mapping rule and detecting the target book based on a pre-trained tag detection model.
[0214] 2A. The method according to 1A, wherein the preset label includes a first type of label, and the first type of label corresponds to a first label conversion type;
[0215] Wherein, before replacing the preset label with the first label, the method further includes:
[0216] Performing a mapping process on the first type of label based on the label mapping rule to obtain a first mapping result;
[0217] If the first mapping result indicates the existence of a first sub-label corresponding to the first type of label, using the first sub-label as the first label; wherein the first sub-label is a label in the to-be-used label system.
[0218] 3A. The method according to 2A, wherein the first label conversion type corresponds to at least one first label type, and the label detection model includes a first label sub-detection model corresponding to each first label type;
[0219] Wherein, after performing the mapping process on the first type of label based on the label mapping rule, the method further includes:
[0220] If the first mapping result indicates the non-existence of a first sub-label corresponding to the first type of label, inputting the book information of the target book into each first label sub-detection model to obtain a second sub-label output by each first label sub-detection model; wherein the second sub-label is a label in the to-be-used label system;
[0221] Using the second sub-label output by each first label sub-detection model as the first label.
[0222] 4A. The method according to any one of 1A to 3A, wherein the preset label includes a second type of label, the second type of label corresponds to a second label conversion type, the second label conversion type corresponds to at least one second label type, and the label detection model includes a second label sub-detection model corresponding to each second label type;
[0223] Wherein, before replacing the preset label with the first label, the method further includes:
[0224] Performing a mapping process on the second type of label based on the label mapping rule to obtain a second mapping result;
[0225] Inputting the book information of the target book into each second label sub-detection model to obtain a third sub-label output by each second label sub-detection model; wherein the third sub-label is a label in the to-be-used label system;
[0226] Determine the first label according to the second mapping processing result and the third sub-label.
[0227] 5A. The method according to 4A, wherein determining the first label according to the second mapping processing result and the third sub-label includes:
[0228] If the second mapping processing result is that there is a fourth sub-label corresponding to the second type of label and the difference in the number of the fourth sub-labels from the preset number is not zero, select the number of fifth sub-labels equal to the difference in the third sub-label.
[0229] Use the fourth sub-label and the fifth sub-label as the first label.
[0230] 6A. The method according to 5A, wherein determining the first label according to the second mapping processing result and the third sub-label includes:
[0231] If the second mapping processing result is that there is a fourth sub-label corresponding to the second type of label and the difference in the number of the fourth sub-labels from the preset number is zero, use the fourth sub-label as the first label.
[0232] 7A. The method according to any one of 1A to 6A, after detecting whether the target book has a preset label, the method further includes:
[0233] If it is detected that the target book does not have the preset label, detect the target book based on the label detection model to obtain a second label corresponding to the target book; wherein, the second label is a label under the to-be-used label system;
[0234] Add the second label to the target book.
[0235] 8A. The method according to 7A, the label detection model includes a plurality of sub-label detection models, and each sub-label detection model corresponds to a label type;
[0236] Wherein, detecting the target book based on the label detection model to obtain a second label corresponding to the target book includes:
[0237] Input the book information of the target book into each sub-label detection model respectively to obtain a sixth sub-label output by each sub-label detection model;
[0238] Use the sixth sub-labels output by each sub-label detection model as the second label.
[0239] 9A. The method according to any one of 1A to 8A, wherein the method further comprises:
[0240] Adding a source identifier to the tags under each of the to-be-used tag systems of the target book.
[0241] 10B. An electronic device, comprising a processor and a memory, the memory being configured to store executable instructions, the executable instructions causing the processor to perform the following operations:
[0242] Detecting whether a target book has a preset tag;
[0243] If it is detected that the target book has the preset tag, detecting whether the preset tag is a tag under a to-be-replaced tag system;
[0244] If it is detected that the preset tag is a tag under the to-be-replaced tag system, replacing the preset tag with a first tag; wherein the first tag is a tag under a to-be-used tag system, and the first tag is obtained by mapping the preset tag based on a preset tag mapping rule and detecting the target book based on a pre-trained tag detection model.
[0245] 11B. The electronic device according to 9B, wherein the preset tag includes a first type of tag, and the first type of tag corresponds to a first tag conversion type;
[0246] Wherein, before the processor performs the replacing the preset tag with the first tag, the executable instructions further cause the processor to perform:
[0247] Performing a mapping process on the first type of tag based on the tag mapping rule to obtain a first mapping result;
[0248] If the first mapping result is that there is a first sub-tag corresponding to the first type of tag, using the first sub-tag as the first tag; wherein the first sub-tag is a tag under a to-be-used tag system.
[0249] 12B. The electronic device according to 11B, wherein the first tag conversion type corresponds to at least one first tag type, and the tag detection model includes a first tag sub-detection model corresponding to each of the first tag types;
[0250] Wherein, after the processor performs the mapping process on the first type of tag based on the tag mapping rule, the executable instructions further cause the processor to perform:
[0251] If the first mapping processing result indicates the non-existence of the first sub-tag corresponding to the first type of tag, input the book information of the target book into each of the first tag sub-detection models to obtain the second sub-tags output by each of the first tag sub-detection models; wherein, the second sub-tags are tags under the tag system to be used.
[0252] Use the second sub-tags output by each of the first tag sub-detection models as the first tag.
[0253] 13B. The electronic device according to any one of 10B to 12B, wherein the preset tag includes a second type of tag, the second type of tag corresponds to a second tag conversion type, the second tag conversion type corresponds to at least one second tag type, and the tag detection model includes a second tag sub-detection model corresponding to each of the second tag types.
[0254] Wherein, before the processor executes replacing the preset tag with the first tag, the executable instruction further causes the processor to execute:
[0255] Based on the tag mapping rule, perform mapping processing on the second type of tag to obtain a second mapping processing result.
[0256] Input the book information of the target book into each of the second tag sub-detection models to obtain the third sub-tags output by each of the second tag sub-detection models; wherein, the third sub-tags are tags under the tag system to be used.
[0257] Determine the first tag according to the second mapping processing result and the third sub-tags.
[0258] 14B. The electronic device according to 13B, wherein when the processor executes determining the first tag according to the second mapping processing result and the third sub-tags, the executable instruction specifically causes the processor to execute:
[0259] If the second mapping processing result indicates the existence of a fourth sub-tag corresponding to the second type of tag and the difference in the number between the fourth sub-tag and the preset number is not zero, select the number of fifth sub-tags equal to the difference in the number from the third sub-tags.
[0260] Use the fourth sub-tag and the fifth sub-tags as the first tag.
[0261] 15B. The electronic device according to 14B, wherein when the processor executes determining the first tag according to the second mapping processing result and the third sub-tags, the executable instruction specifically causes the processor to execute:
[0262] If the second mapping processing result is that there is a fourth sub-label corresponding to the second type of label and the difference between the number of the fourth sub-labels and the preset number is zero, use the fourth sub-label as the first label.
[0263] 16B. The electronic device according to any one of 10B to 15B, after the processor executes the detection of whether the target book has a preset label, the executable instruction further causes the processor to execute:
[0264] If it is detected that the target book does not have the preset label, detect the target book based on the label detection model to obtain a second label corresponding to the target book; wherein, the second label is a label under the to-be-used label system;
[0265] Add the second label to the target book.
[0266] 17B. The electronic device according to 16B, the label detection model includes a plurality of sub-label detection models, and each sub-label detection model corresponds to a label type;
[0267] Wherein, when the processor executes the detection of the target book based on the label detection model to obtain a second label corresponding to the target book, the executable instruction specifically causes the processor to execute:
[0268] Input the book information of the target book into each sub-label detection model respectively to obtain a sixth sub-label output by each sub-label detection model;
[0269] Use the sixth sub-labels output by the respective sub-label detection models as the second label.
[0270] 18B. The electronic device according to any one of 10B to 17B, wherein the executable instruction further causes the processor to execute:
[0271] Add a source identifier to each label of the target book under the to-be-used label system.
[0272] 19C. A computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to implement the book label adding method according to any one of 1A-9A above.
[0273] Each component embodiment of the present disclosure can be implemented in whole or in part by hardware, or by software modules running on one or more processors, or by a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components in the electronic device according to the embodiments of the present disclosure. The present disclosure can also be implemented as a device or apparatus program (such as a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present disclosure can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0274] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the (but not limited to) technical features having similar functions disclosed in the present disclosure.
[0275] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment can also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0276] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims.
Claims
1. A method for adding book labels, characterized in that, The method includes: Detecting whether the target book has a preset label; If it is detected that the target book has the preset label, detecting whether the preset label is a label under the to-be-replaced label system; If it is detected that the preset label is a label under the to-be-replaced label system, replacing the preset label with a first label; wherein, the first label is a label under the to-be-used label system, and the first label is obtained by mapping the preset label based on a preset label mapping rule and detecting the target book based on a pre-trained label detection model; The preset label includes a second type of label, the second type of label corresponds to a second label conversion type, the second label conversion type corresponds to at least one second label type, and the label detection model includes a second label sub-detection model corresponding to each second label type; Wherein, before replacing the preset label with the first label, the method further includes: Performing a mapping process on the second type of label based on the label mapping rule to obtain a second mapping result; Inputting the book information of the target book into each second label sub-detection model to obtain a third sub-label output by each second label sub-detection model; wherein, the third sub-label is a label under the to-be-used label system; Determining the first label according to the second mapping result and the third sub-label.
2. The method according to claim 1, wherein The preset label includes a first type of label, and the first type of label corresponds to a first label conversion type; Wherein, before replacing the preset label with the first label, the method further includes: Performing a mapping process on the first type of label based on the label mapping rule to obtain a first mapping result; If the first mapping result is that there is a first sub-label corresponding to the first type of label, using the first sub-label as the first label; wherein, the first sub-label is a label under the to-be-used label system.
3. The method according to claim 2, wherein The first label conversion type corresponds to at least one first label type, and the label detection model includes a first label sub-detection model corresponding to each first label type; Wherein, after performing the mapping process on the first type of label based on the label mapping rule, the method further includes: If the first mapping result is that there is no first sub-label corresponding to the first type of label, inputting the book information of the target book into each first label sub-detection model to obtain a second sub-label output by each first label sub-detection model; wherein, the second sub-label is a label under the to-be-used label system; Using the second sub-label output by each first label sub-detection model as the first label.
4. The method according to claim 1, characterized in that, The determining the first label according to the second mapping result and the third sub-label includes: If the second mapping result is that there is a fourth sub-label corresponding to the second type of label and the difference between the number of the fourth sub-labels and the preset number is not zero, selecting the number of fifth sub-labels equal to the difference in the third sub-labels, where the difference is the value obtained by subtracting the number of the fourth sub-labels from the preset number; Use the fourth sub - label and the fifth sub - label as the first label.
5. The method according to claim 4, wherein The determining the first label according to the second mapping processing result and the third sub - label includes: If the second mapping processing result is that there is a fourth sub - label corresponding to the second - type label and the difference between the number of the fourth sub - labels and the preset number is zero, use the fourth sub - label as the first label.
6. The method according to claim 1, after detecting whether the target book has a preset label, the method further includes: If it is detected that the target book does not have the preset label, detect the target book based on the label detection model to obtain a second label corresponding to the target book; wherein, the second label is a label under the to - be - used label system. Add the second label to the target book.
7. The method according to claim 6, the label detection model includes a plurality of sub - label detection models, and each sub - label detection model corresponds to a label type. Among them, The detecting the target book based on the label detection model to obtain a second label corresponding to the target book includes: Input the book information of the target book into each sub - label detection model respectively to obtain a sixth sub - label output by each sub - label detection model. Use the sixth sub - labels output by each sub - label detection model as the second label.
8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: Add a source identifier to each label of the target book under the to - be - used label system.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory is used to store executable instructions, and the executable instructions cause the processor to perform the following operations: Detect whether the target book has a preset label. If it is detected that the target book has the preset label, detect whether the preset label is a label under the to - be - replaced label system. If it is detected that the preset label is a label under the to - be - replaced label system, replace the preset label with a first label; wherein, the first label is a label under the to - be - used label system, and the first label is obtained by mapping the preset label based on a preset label mapping rule and detecting the target book based on a pre - trained label detection model. The preset label includes a second - type label, the second - type label corresponds to a second label conversion type, the second label conversion type corresponds to at least one second label type, and the label detection model includes a second - label sub - detection model corresponding to each second label type. Wherein, before the processor executes the replacing the preset label with the first label, the executable instructions further cause the processor to execute: Based on the label mapping rule, perform mapping processing on the second - type label to obtain a second mapping processing result. Input the book information of the target book into each second - label sub - detection model to obtain a third sub - label output by each second - label sub - detection model; wherein, the third sub - label is a label under the to - be - used label system. Determine the first label according to the second mapping processing result and the third sub - label.
10. The electronic device according to claim 9, characterized in that, The preset tag includes a first type of tag, and the first type of tag corresponds to a first tag conversion type; Wherein, before the processor executes replacing the preset tag with the first tag, the executable instruction further causes the processor to execute: Based on the tag mapping rule, perform mapping processing on the first type of tag to obtain a first mapping processing result; If the first mapping processing result is that there is a first sub-tag corresponding to the first type of tag, use the first sub-tag as the first tag; wherein, the first sub-tag is a tag in the to-be-used tag system.
11. The electronic device according to claim 10, wherein The first tag conversion type corresponds to at least one first tag type, and the tag detection model includes a first tag sub-detection model corresponding to each first tag type; Wherein, after the processor executes performing mapping processing on the first type of tag based on the tag mapping rule, the executable instruction further causes the processor to execute: If the first mapping processing result is that there is no first sub-tag corresponding to the first type of tag, input the book information of the target book into each first tag sub-detection model to obtain a second sub-tag output by each first tag sub-detection model; wherein, the second sub-tag is a tag in the to-be-used tag system; Use the second sub-tag output by each first tag sub-detection model as the first tag.
12. The electronic device according to claim 9, wherein When the processor executes determining the first tag according to the second mapping processing result and the third sub-tag, the executable instruction specifically causes the processor to execute: If the second mapping processing result is that there is a fourth sub-tag corresponding to the second type of tag and the difference between the number of the fourth sub-tags and the preset number is not zero, select the number of fifth sub-tags equal to the difference in the third sub-tags, where the difference is the difference obtained by subtracting the number of the fourth sub-tags from the preset number; Use the fourth sub-tag and the fifth sub-tag as the first tag.
13. The electronic device according to claim 12, characterized in that, When the processor executes determining the first tag according to the second mapping processing result and the third sub-tag, the executable instruction specifically causes the processor to execute: If the second mapping processing result is that there is a fourth sub-tag corresponding to the second type of tag and the difference between the number of the fourth sub-tags and the preset number is zero, use the fourth sub-tag as the first tag.
14. The electronic device according to claim 9, after the processor executes detecting whether the target book has a preset tag, the executable instruction further causes the processor to execute: If it is detected that the target book does not have the preset label, the target book is detected based on the label detection model to obtain a second label corresponding to the target book; wherein, The second tag is a tag in the to-be-used tag system; Add the second tag to the target book.
15. The electronic device according to claim 14, the tag detection model includes a plurality of sub-tag detection models, and each sub-tag detection model corresponds to a tag type; Among them, When the processor executes detecting the target book based on the tag detection model to obtain the second tag corresponding to the target book, the executable instruction specifically causes the processor to execute: Input the book information of the target book into each of the sub-tag detection models respectively, and obtain the sixth sub-tag output by each of the sub-tag detection models; Use the sixth sub-tags output by each of the sub-tag detection models as the second tags.
16. The electronic device according to any one of claims 9 to 15, characterized in that, The executable instructions further cause the processor to execute: Add source identifiers to the tags under each of the tag systems to be used for the target book.
17. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, causes the processor to implement the book tag addition method according to any one of claims 1-8 above.
Citation Information
Patent Citations
Song list generation method and device, electronic equipment and storage medium
CN112836082A