Label determination method and device, electronic equipment and computer readable storage medium
By dynamically determining the threshold and comparing the characteristic values, the problem of low accuracy in the traditional label determination method is solved, and more accurate label determination and information object value evaluation are achieved.
Patent Information
- Application Number
- CN202311075761.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-24
- Publication Date
- 2025-02-25
AI Technical Summary
In traditional methods, the accuracy of the tag is low, resulting in the inability to effectively identify high-value and low-value information objects.
By obtaining the eigenvalues of the plurality of objects to be determined and dynamically determine the first threshold and the second threshold based on the eigenvalues and object types, the eigenvalues and thresholds are compared to the thresholds to determine the label.
Improve the accuracy of label determination and enable more efficient identification of high-value and low-value information objects.
Smart Images

Figure CN119513644A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a tag determination method, device, electronic device, and computer-readable storage medium. Background Art
[0002] With the development of computer technology, information collection technology has emerged. Information collection technology refers to obtaining, collecting and summarizing information related to specific topics, fields or issues from different information sources or data sources. Information collection technology is widely used in research, data analysis, market research and content generation.
[0003] In traditional methods, labels of images and texts related to specific subjects, fields, or issues are determined to be high value, resulting in low label accuracy. Summary of the invention
[0004] The embodiments of the present application provide a tag determination method, device, electronic device, and computer-readable storage medium, which can improve the accuracy of tag determination.
[0005] In a first aspect, the present application provides a tag determination method. The method comprises:
[0006] Acquire multiple objects to be determined; the multiple objects to be determined correspond to the same type;
[0007] Determine a first threshold and a second threshold corresponding to the object to be determined based on the object to be determined and the type corresponding to the object to be determined;
[0008] For each of the objects to be determined, comparing the first characteristic value of the object to be determined with the first threshold to obtain a first comparison result, and comparing the second characteristic value of the object to be determined with the second threshold to obtain a second comparison result;
[0009] Based on the first comparison result and the second comparison result, a label corresponding to the object to be determined is determined; the label includes a first label and a second label, and the value represented by the first label is lower than the value represented by the second label.
[0010] In a second aspect, the present application also provides a label determination device. The device comprises:
[0011] An acquisition module, used for acquiring a plurality of objects to be determined; the plurality of objects to be determined correspond to the same type;
[0012] A threshold determination module, configured to determine a first threshold and a second threshold corresponding to the object to be determined based on the object to be determined and the type corresponding to the object to be determined;
[0013] a comparison module, configured to compare, for each of the objects to be determined, a first feature value of the object to be determined with the first threshold value to obtain a first comparison result, and to compare a second feature value of the object to be determined with the second threshold value to obtain a second comparison result;
[0014] The label determination module determines the label corresponding to the object to be determined based on the first comparison result and the second comparison result; the label includes a first label and a second label, and the value represented by the first label is lower than the value represented by the second label.
[0015] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0016] Acquire multiple objects to be determined; the multiple objects to be determined correspond to the same type;
[0017] Determine a first threshold and a second threshold corresponding to the object to be determined based on the object to be determined and the type corresponding to the object to be determined;
[0018] For each of the objects to be determined, comparing the first characteristic value of the object to be determined with the first threshold to obtain a first comparison result, and comparing the second characteristic value of the object to be determined with the second threshold to obtain a second comparison result;
[0019] Based on the first comparison result and the second comparison result, a label corresponding to the object to be determined is determined; the label includes a first label and a second label, and the value represented by the first label is lower than the value represented by the second label.
[0020] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0021] Acquire multiple objects to be determined; the multiple objects to be determined correspond to the same type;
[0022] Determine a first threshold and a second threshold corresponding to the object to be determined based on the object to be determined and the type corresponding to the object to be determined;
[0023] For each of the objects to be determined, comparing the first characteristic value of the object to be determined with the first threshold to obtain a first comparison result, and comparing the second characteristic value of the object to be determined with the second threshold to obtain a second comparison result;
[0024] Based on the first comparison result and the second comparison result, a label corresponding to the object to be determined is determined; the label includes a first label and a second label, and the value represented by the first label is lower than the value represented by the second label.
[0025] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0026] Acquire multiple objects to be determined; the multiple objects to be determined correspond to the same type;
[0027] Determine a first threshold and a second threshold corresponding to the object to be determined based on the object to be determined and the type corresponding to the object to be determined;
[0028] For each of the objects to be determined, comparing the first characteristic value of the object to be determined with the first threshold to obtain a first comparison result, and comparing the second characteristic value of the object to be determined with the second threshold to obtain a second comparison result;
[0029] Based on the first comparison result and the second comparison result, a label corresponding to the object to be determined is determined; the label includes a first label and a second label, and the value represented by the first label is lower than the value represented by the second label.
[0030] In the above-mentioned label determination method, for multiple objects to be determined of the same type, a first threshold and a second threshold are determined according to the objects to be determined and the types corresponding to the objects to be determined, a first feature value of the object to be determined is compared with the first threshold to obtain a first comparison result, a second feature value of the object to be determined is compared with the second threshold to obtain a second comparison result, and a label of the object to be determined is determined according to the first comparison result and the second comparison result. The first threshold and the second threshold are determined by the multiple objects to be determined and the types corresponding to the objects to be determined, that is, the first threshold and the second threshold are dynamically determined according to the multiple objects to be determined and the types corresponding to the objects to be determined. The first threshold and the second threshold reflect the characteristics of the multiple objects to be determined. Compared with using a set fixed first threshold and a fixed second threshold, the accuracy of the first comparison result and the second comparison result is improved. The label of the object to be determined is determined according to the first comparison result and the second comparison result, thereby improving the accuracy of label determination. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 A diagram of an application environment of a tag determination method in an embodiment;
[0033] Figure 2 A flowchart of a label determination method in one embodiment;
[0034] Figure 3 A flowchart of the steps of determining the first threshold and the second threshold in one embodiment;
[0035] Figure 4 A flowchart of a step of determining a picture label in one embodiment;
[0036] Figure 5 A flowchart of a step of determining a first threshold and a second threshold corresponding to a character in one embodiment;
[0037] Figure 6 A flowchart of steps for determining a first threshold and a second threshold corresponding to a character in another embodiment;
[0038] Figure 7 A flowchart of a method for determining a picture label in one embodiment;
[0039] Figure 8 A flowchart of a method for determining a character tag in one embodiment;
[0040] Fig. 9 is a structural block diagram of a label determination device in one embodiment;
[0041] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] The label determination method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. For example, the terminal 102 sends the information collection instruction to the server 104, and the server 104 receives the information collection instruction, obtains multiple objects to be determined, and the multiple objects to be determined correspond to the same type. Based on the objects to be determined and the types corresponding to the objects to be determined, the first threshold and the second threshold corresponding to the objects to be determined are determined. For each object to be determined, the first feature value of the object to be determined is compared with the first threshold to obtain a first comparison result, and the second feature value of the object to be determined is compared with the second threshold to obtain a second comparison result. Based on the first comparison result and the second comparison result, the label corresponding to the object to be determined is determined, and the label includes a first label and a second label. The value represented by the first label is lower than the value represented by the second label. The server 104 sends the object to be determined with the first label to the terminal 102. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, smart cars, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0044] In one embodiment, Figure 2 As shown, a label determination method is provided, which is applied to Figure 2 Taking the computer device in the example as an example, the method includes the following steps 202 to 208, wherein:
[0045] Step 202, obtaining a plurality of objects to be determined; the plurality of objects to be determined correspond to the same type.
[0046] The object to be determined refers to an object whose label needs to be determined, and the object to be determined may be a character to be determined or a picture to be determined, etc. The type refers to the form of the object to be determined, and the type includes but is not limited to characters, pictures, audio and video, etc.
[0047] Exemplarily, a computer device receives an information collection instruction, the information collection instruction includes a collection information feature, and obtains multiple to-be-determined objects corresponding to the collection information feature, where the multiple to-be-determined objects have the same type. The collection information feature refers to a feature of the collection information, for example, the collection information feature is a picture containing a mountain.
[0048] In one embodiment, a computer device receives a set of objects to be determined, where the set of objects to be determined includes multiple objects to be determined, and the multiple objects to be determined correspond to the same type.
[0049] Step 204: Determine a first threshold and a second threshold corresponding to the object to be determined based on the object to be determined and the type corresponding to the object to be determined.
[0050] Among them, the first threshold refers to the threshold corresponding to the first characteristic value of the object to be determined, which can be understood as the threshold compared with the first characteristic value of the object to be determined. For example, the first characteristic value of the object to be determined is the image height, and the first threshold is the height threshold. The first threshold is determined by multiple objects to be determined and the types corresponding to the objects to be determined. The second threshold refers to the threshold corresponding to the second characteristic value of the object to be determined, which can be understood as the threshold compared with the second characteristic value of the object to be determined. For example, the second characteristic value of the object to be determined is the image width, and the second threshold is the width threshold. The second threshold is determined by multiple objects to be determined and the types corresponding to the objects to be determined.
[0051] Exemplarily, the computer device determines the type of the object to be determined based on the object to be determined, obtains a first ratio and a second ratio corresponding to the type, determines a first threshold corresponding to the object to be determined based on multiple objects to be determined and the first ratio, and determines a second threshold corresponding to the object to be determined based on multiple objects to be determined and the second ratio.
[0052] Step 206 , for each object to be determined, compare the first characteristic value of the object to be determined with the first threshold to obtain a first comparison result, and compare the second characteristic value of the object to be determined with the second threshold to obtain a second comparison result.
[0053] Among them, the first characteristic value refers to the parameter value of the preset first characteristic parameter of the type corresponding to the object to be determined, and the second characteristic value refers to the parameter value of the preset second characteristic parameter of the type corresponding to the object to be determined. There is a corresponding relationship between the preset first characteristic parameter and the preset second characteristic parameter and the type, that is, according to the type, the preset first characteristic parameter and the preset second characteristic parameter can be determined. For example, if the type is a picture, the preset first characteristic parameter is the height, and the preset second parameter is the width, then the first characteristic value is the picture height of the picture, and the second characteristic value is the picture width of the picture. If the type is a character, the preset first characteristic parameter is the number of pixels occupied, and the preset second characteristic parameter is transparency, then the first characteristic value is the number of pixels occupied by the character, and the second characteristic value is the transparency of the character. The first comparison result refers to the result of comparing the first characteristic value with the first threshold value, and the first comparison result can be greater than, equal to, or less than. The second comparison result refers to the result of comparing the second characteristic value with the second threshold value, and the second comparison result can be greater than, equal to, or less than.
[0054] Exemplarily, for each object to be determined, the computer device obtains a first eigenvalue and a second eigenvalue corresponding to the object to be determined, compares the first eigenvalue with a first threshold to obtain a first comparison result, and compares the second eigenvalue with a second threshold to obtain a second comparison result.
[0055] In one embodiment, the computer device determines the preset first characteristic parameter and the preset second characteristic parameter corresponding to the type of the object to be determined, and for each object to be determined, obtains the first characteristic parameter value corresponding to the preset first characteristic parameter of the object to be determined to obtain the first characteristic value, and obtains the second characteristic parameter value corresponding to the preset second characteristic parameter of the object to be determined to obtain the second characteristic value.
[0056] Step 208, based on the first comparison result and the second comparison result, determine the label corresponding to the object to be determined; the label includes a first label and a second label, and the value represented by the first label is lower than the value represented by the second label.
[0057] Among them, a label refers to an identifier or mark for classifying, identifying or describing an object to be determined. It can be understood that if the object to be determined is divided into high-value and low-value, a label is added to the object to be determined. If the added label is a first label, it indicates that the object to be determined is of high value. If the added label is a second label, it indicates that the object to be determined is of low value. The label can be a first label or a second label. The first label refers to a label that indicates high value, and the second label refers to a label that indicates low value. Value refers to the importance of the object to be determined.
[0058] Exemplarily, a computer device obtains a target preset mapping relationship table corresponding to the type, the target preset mapping relationship table including the correspondence between the first comparison result and the second comparison result and the label, and determines the labels corresponding to the first comparison result and the second comparison result based on the target preset mapping relationship table, and determines the labels corresponding to the first comparison result and the second comparison result as labels corresponding to the object to be determined, the label is the first label or the second label, and the value represented by the first label is lower than the value represented by the second label.
[0059] In one embodiment, after determining the tag corresponding to the object to be determined, the computer device sends the object to be determined with the second tag to the target object, which may be a target terminal or a target server. That is, a high-value object to be determined is screened out from multiple objects to be determined, and the high-value object to be determined is sent to the target object, thereby improving the sending efficiency of the objects to be determined.
[0060] In one embodiment, after determining the tag corresponding to the object to be determined, the computer device presents the object to be determined with the second tag in the current page, that is, the high-value object to be determined is screened out from the multiple objects to be determined, and the high-value object to be determined is presented in the current page, thereby reducing redundant information in the current page.
[0061] In one embodiment, after determining the tag corresponding to the object to be determined, the computer device filters based on the tag corresponding to the object to be determined, and saves the object to be determined with the second tag. That is, the object to be determined with the first tag is filtered out, and the object to be determined with the second tag is saved, and the high-value object to be determined is selected from multiple objects to be determined and saved, thereby reducing the storage space for saving the objects to be determined and improving resource utilization.
[0062] In the above-mentioned label determination method, for multiple objects to be determined of the same type, a first threshold and a second threshold are determined according to the objects to be determined and the types corresponding to the objects to be determined, a first feature value of the object to be determined is compared with the first threshold to obtain a first comparison result, a second feature value of the object to be determined is compared with the second threshold to obtain a second comparison result, and a label of the object to be determined is determined according to the first comparison result and the second comparison result. The first threshold and the second threshold are determined by the multiple objects to be determined and the types corresponding to the objects to be determined, that is, the first threshold and the second threshold are dynamically determined according to the multiple objects to be determined and the types corresponding to the objects to be determined. Compared with using a set fixed first threshold and a fixed second threshold, the first threshold and the second threshold improve the accuracy of the first comparison result and the second comparison result, and the label of the object to be determined is determined according to the first comparison result and the second comparison result, thereby improving the accuracy of label determination.
[0063] In one embodiment, Figure 3 As shown, the type corresponding to the object to be determined is a picture; based on the object to be determined and the type corresponding to the object to be determined, determining a first threshold and a second threshold corresponding to the object to be determined includes:
[0064] Step 302: Obtain the screen height and screen width of the display screen corresponding to the object to be determined.
[0065] The display screen refers to the screen used to present the object to be determined, which can be understood as the screen that plays or displays the object to be determined, such as a mobile phone screen or a computer screen. The screen height refers to the height of the screen that presents the object to be determined, and the screen width refers to the width of the screen that presents the object to be determined. The units of the screen height and screen width can be centimeters, decimeters, or meters, etc.
[0066] Exemplarily, when the type corresponding to the object to be determined is a picture, the computer device determines a display screen for presenting the object to be determined, and obtains a screen height and a screen width of the display screen.
[0067] Step 304: Obtain a preset first ratio and a preset second ratio corresponding to the image.
[0068] The preset first ratio refers to a ratio preset for determining a first threshold. The preset second ratio refers to a ratio preset for determining a second threshold. The preset first ratio and the preset second ratio may be the same or different, and the preset first ratio and the preset second ratio corresponding to different types may be the same or different, and are set according to actual needs.
[0069] Exemplarily, the computer device obtains a preset ratio correspondence relationship, which includes a correspondence relationship between the type and the first ratio and the second ratio, and obtains the preset first ratio and the preset second ratio corresponding to the image from the preset ratio correspondence relationship.
[0070] Step 306: Merge the screen height with the preset first ratio to obtain a first threshold.
[0071] Exemplarily, the computer device multiplies the screen height by a preset first ratio to obtain the first threshold.
[0072] Step 308: Merge the screen width and the preset second ratio to obtain a second threshold.
[0073] Exemplarily, the computer device multiplies the screen width by a preset second ratio to obtain the second threshold.
[0074] In this embodiment, when the type corresponding to the object to be determined is a picture, the first threshold and the second threshold corresponding to the object to be determined are determined according to the screen height and the screen width of the display screen presenting the object to be determined, and the preset first ratio and the preset second ratio corresponding to the picture. That is, based on multiple objects to be determined, the first threshold and the second threshold corresponding to the object to be determined are dynamically determined, and the first threshold and the second threshold reflect the characteristics of multiple objects to be determined.
[0075] In one embodiment, the first feature value is the image height, and the second feature value is the image width; for each object to be determined, the first feature value of the object to be determined is compared with a first threshold to obtain a first comparison result, and the second feature value of the object to be determined is compared with a second threshold to obtain a second comparison result, including:
[0076] For each object to be determined, the image height and image width of the object to be determined are obtained; the image height of the object to be determined is compared with a first threshold to obtain a first comparison result corresponding to the object to be determined; the image width of the object to be determined is compared with a second threshold to obtain a second comparison result corresponding to the object to be determined.
[0077] Exemplarily, for each object to be determined, the computer device obtains the image height and image width of the object to be determined, compares the image height of the object to be determined with a first threshold, obtains a first comparison result corresponding to the object to be determined, and compares the image width of the object to be determined with a second threshold, obtains a second comparison result corresponding to the object to be determined.
[0078] In this embodiment, the image height of the object to be determined is compared with the first threshold to obtain a first comparison result corresponding to the object to be determined, and the image width of the object to be determined is compared with the second threshold to obtain a second comparison result corresponding to the object to be determined, thereby providing accurate basic data for determining the label of the object to be determined.
[0079] In one embodiment, Figure 4 As shown, based on the first comparison result and the second comparison result, determining a label corresponding to the object to be determined includes:
[0080] Step 402: When at least one of the first comparison result and the second comparison result is less than or equal to, determine that the label corresponding to the object to be determined is the first label.
[0081] Exemplarily, if the first comparison result is less than or equal to, or the second comparison result is less than or equal to, the computer device determines that the tag corresponding to the object to be determined is the first tag.
[0082] Step 404: when the first comparison result and the second comparison result are both greater than , obtain the pixel value corresponding to each pixel point in the object to be determined.
[0083] Among them, pixel refers to the smallest unit that makes up the image. It can be understood that the image is composed of multiple points, and each point is a pixel. The pixel value refers to the numerical value that represents the color of the pixel. Different pixel values represent different colors. For example, in a grayscale image, the pixel value of a pixel is in the range of 0 to 255, where 0 represents black and 255 represents white.
[0084] Exemplarily, if the first comparison result and the second comparison result are both greater than, the computer device obtains the pixel value corresponding to each pixel point in the object to be determined.
[0085] Step 406: When all pixel values are the same, determine that the label corresponding to the object to be determined is the first label.
[0086] Exemplarily, the computer device compares the pixel values of each pixel point, and if the pixel values are the same, it is determined that the label corresponding to the object to be determined is the first label.
[0087] Step 408: When the pixel values are different, determine that the label corresponding to the object to be determined is the second label.
[0088] Exemplarily, the computer device compares the pixel values of each pixel point, and if the pixel values are different, determines that the label corresponding to the object to be determined is the second label.
[0089] In this embodiment, if the image height of the object to be determined is less than or equal to the first threshold, or the image width is less than or equal to the second threshold, the object to be determined is determined as a low-value image; if the image height of the object to be determined is greater than the first threshold and the image width is greater than the second threshold, the object to be determined is further judged; if the object to be determined is a solid color image, the object to be determined is determined as a low-value image; if the object to be determined is a non-solid color image, the object to be determined is determined as a high-value image; by making three judgments on the object to be determined, namely, the judgment of the image height, the judgment of the image width and the judgment of the pixel value, the label of the object to be determined is determined, thereby improving the accuracy of label determination.
[0090] In one embodiment, Figure 5 As shown, the type corresponding to the object to be determined is a character; based on the object to be determined and the type corresponding to the object to be determined, determining a first threshold and a second threshold corresponding to the object to be determined includes:
[0091] Step 502: Obtain the number of pixels and transparency corresponding to each object to be determined.
[0092] Among them, character refers to the basic unit that makes up the text. Characters can be, but are not limited to, letters, words, and numbers. The number of pixels refers to the number of pixels occupied by a character on the screen, which can be understood as the number of pixels used to present the character. The more pixels there are, the larger the character. Transparency refers to a value that characterizes the degree of transparency of the character. The greater the transparency, the more transparent the character. For example, transparency is a value between 0 and 100%, 0 means that the character is completely opaque, and 100% means that the character is completely transparent. Complete transparency means that it is invisible.
[0093] Exemplarily, when the type corresponding to the object to be determined is a character, the computer device obtains the number of pixels and the transparency corresponding to each object to be determined.
[0094] Step 504: Obtain a preset first ratio and a preset second ratio corresponding to the character.
[0095] Exemplarily, the computer device obtains a preset ratio correspondence relationship, which includes a correspondence relationship between the type and the first ratio and the second ratio, and obtains the preset first ratio and the preset second ratio corresponding to the character from the preset ratio correspondence relationship.
[0096] Step 506: Determine a first threshold based on the number of pixels corresponding to each object to be determined and a preset first ratio.
[0097] Exemplarily, the computer device determines the target number of pixels based on the number of pixels corresponding to each object to be determined, and determines the first threshold based on the target number of pixels and a preset first ratio.
[0098] Step 508: Determine a second threshold based on the transparency corresponding to each object to be determined and a preset second ratio.
[0099] Exemplarily, the computer device determines the target transparency based on the transparency corresponding to each object to be determined, and determines the second threshold based on the target transparency and a preset second ratio.
[0100] In this embodiment, when the type corresponding to the object to be determined is a character, the first threshold and the second threshold corresponding to the object to be determined are determined according to the number of pixels and the transparency of each object to be determined, and the preset first ratio and the preset second ratio corresponding to the character. That is, based on multiple objects to be determined, the first threshold and the second threshold corresponding to the object to be determined are dynamically determined, and the first threshold and the second threshold reflect the characteristics of multiple objects to be determined.
[0101] In one embodiment, Figure 6 As shown, based on the number of pixels corresponding to each object to be determined and a preset first ratio, a first threshold is determined, and based on the transparency corresponding to each object to be determined and a preset second ratio, a second threshold is determined, including:
[0102] Step 602: Classify and count the number of pixel points corresponding to the multiple objects to be determined, and obtain a first statistical number corresponding to each number of pixel points.
[0103] The classification statistics refers to counting the number of objects to be determined having the same characteristics, for example, counting the number of objects to be determined having the same number of pixels. The first statistical number refers to the number of objects to be determined having the same number of pixels.
[0104] Exemplarily, the computer device performs classified statistics on the number of pixel points corresponding to the multiple objects to be determined, and obtains a first statistical number corresponding to each number of pixel points.
[0105] Step 604: Determine the target pixel number by taking the pixel number corresponding to the largest first statistical number.
[0106] The target pixel number refers to the pixel number corresponding to the largest first statistical number.
[0107] Exemplarily, the computer device compares first statistical quantities corresponding to multiple pixel point quantities to obtain a maximum first statistical quantity, and determines the target pixel point quantity by the pixel point quantity corresponding to the maximum first statistical quantity.
[0108] Step 606: Merge the target pixel number and the preset first ratio to obtain a first threshold.
[0109] Exemplarily, the computer device multiplies the number of target pixels by a preset first ratio to obtain a first threshold.
[0110] Step 608: Classify and count the transparencies corresponding to the multiple objects to be determined to obtain a second statistical quantity corresponding to each transparency.
[0111] The second statistical quantity refers to the quantity of objects to be determined that have the same transparency.
[0112] Exemplarily, the computer device performs classified statistics on the transparencies corresponding to the multiple objects to be determined, and obtains a second statistical quantity corresponding to each transparency.
[0113] Step 610: determine the transparency corresponding to the largest second statistical quantity as the target transparency.
[0114] Exemplarily, the computer device compares the second statistical quantities corresponding to the multiple transparencies to obtain the largest second statistical quantity, and determines the transparency corresponding to the largest second statistical quantity as the target transparency.
[0115] Step 612: Merge the target transparency with the preset second ratio to obtain a second threshold.
[0116] Exemplarily, the computer device multiplies the target transparency by a preset second ratio to obtain a second threshold.
[0117] In this embodiment, when the type corresponding to the object to be determined is a character, the first threshold corresponding to the object to be determined is determined based on the number of pixels of each object to be determined and the preset first ratio corresponding to the character, and the second threshold corresponding to the object to be determined is determined based on the transparency of each object to be determined and the preset second ratio corresponding to the character, thereby providing basic data for accuracy for the subsequent determination of the first comparison result and the second comparison result.
[0118] In one embodiment, determining a label corresponding to the object to be determined based on the first comparison result and the second comparison result includes:
[0119] When the first comparison result is less than or equal to, or the second comparison result is greater than or equal to, the label corresponding to the object to be determined is determined to be the first label; when the first comparison result is greater than and the second comparison result is less than, the label corresponding to the object to be determined is determined to be the second label.
[0120] Exemplarily, when the type corresponding to the object to be determined is character, if the first comparison result corresponding to the object to be determined is less than or equal to, or the second comparison result is greater than or equal to, then the label corresponding to the object to be determined is determined to be the first label; if the first comparison result corresponding to the object to be determined is greater than, and the second comparison result is less than, then the label corresponding to the object to be determined is determined to be the second label.
[0121] In this embodiment, when the type corresponding to the object to be determined is a character, the label of the object to be determined is determined by making two judgments on the object to be determined, namely, the judgment of the number of pixels and the judgment of transparency, thereby improving the accuracy of label determination.
[0122] In an exemplary embodiment, the image tag determination process is as follows: Figure 7 As shown, including:
[0123] The computer device collects a picture collection, which includes multiple pictures to be determined, obtains the screen height and screen width of the display screen corresponding to the picture to be determined from the screen manager, obtains the preset first ratio and preset second ratio corresponding to the picture, multiplies the screen height by the preset first ratio to obtain a first threshold, and multiplies the screen width by the preset second ratio to obtain a second threshold.
[0124] For each picture to be determined, obtain the picture height and picture width of the picture to be determined, compare the picture height of the picture to be determined with the first threshold, and obtain a first comparison result corresponding to the picture to be determined; compare the picture width of the picture to be determined with the second threshold, and obtain a second comparison result corresponding to the picture to be determined.
[0125] If the first comparison result is less than or equal to, or the second comparison result is less than or equal to, then the label corresponding to the image to be determined is determined to be of low value; if the first comparison result and the second comparison result are both greater than, then the pixel value corresponding to each pixel point in the image to be determined is obtained, and the pixel values of each pixel point are compared. If the pixel values are the same, then the label corresponding to the image to be determined is determined to be of low value; if the pixel values are different, then the label corresponding to the image to be determined is determined to be of high value.
[0126] The character label determination process is as follows Figure 8 As shown, including:
[0127] A computer device collects a character set, which includes multiple characters to be determined, obtains the number of pixels and the transparency corresponding to each character to be determined, classifies and counts the number of pixels corresponding to the multiple characters to be determined, obtains a first statistical number corresponding to each pixel number, compares the first statistical numbers corresponding to the multiple pixel numbers to obtain a maximum first statistical number, determines the target pixel number based on the number of pixels corresponding to the maximum first statistical number, multiplies the target pixel number by a preset first ratio corresponding to the character to obtain a first threshold; classifies and counts the transparency corresponding to the multiple characters to be determined, obtains a second statistical number corresponding to each transparency, compares the second statistical numbers corresponding to the multiple transparencies to obtain a maximum second statistical number, determines the transparency corresponding to the maximum second statistical number as the target transparency, multiplies the target transparency by a preset second ratio corresponding to the character to obtain a second threshold.
[0128] For each character to be determined, the number of pixels of the character to be determined is compared with a first threshold to obtain a first comparison result corresponding to the character to be determined. If the first comparison result corresponding to the character to be determined is less than or equal to, the label of the character to be determined is determined to be low value; if the first comparison result corresponding to the character to be determined is greater than, the transparency of the character to be determined is compared with a second threshold to obtain a second comparison result corresponding to the character to be determined. If the second comparison result is greater than or equal to, the label of the character to be determined is determined to be low value; if the second comparison result is less than, the label of the character to be determined is determined to be high value.
[0129] In the above-mentioned label determination method, for multiple objects to be determined of the same type, a first threshold and a second threshold are determined according to the objects to be determined and the types corresponding to the objects to be determined, a first feature value of the object to be determined is compared with the first threshold to obtain a first comparison result, a second feature value of the object to be determined is compared with the second threshold to obtain a second comparison result, and a label of the object to be determined is determined according to the first comparison result and the second comparison result. The first threshold and the second threshold are determined by the multiple objects to be determined and the types corresponding to the objects to be determined, that is, the first threshold and the second threshold are dynamically determined according to the multiple objects to be determined and the types corresponding to the objects to be determined. Compared with using a set fixed first threshold and a fixed second threshold, the first threshold and the second threshold improve the accuracy of the first comparison result and the second comparison result, and the label of the object to be determined is determined according to the first comparison result and the second comparison result, thereby improving the accuracy of label determination.
[0130] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0131] Based on the same inventive concept, the embodiment of the present application also provides a label determination device for implementing the label determination method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the label determination device provided below can refer to the limitations of the label determination method above, and will not be repeated here.
[0132] In one embodiment, Fig. 9 As shown, a label determination device is provided, including: an acquisition module 902, a threshold determination module 904, a comparison module 906 and a label determination module 908, wherein:
[0133] An acquisition module 902 is used to acquire multiple objects to be determined; the multiple objects to be determined correspond to the same type;
[0134] A threshold determination module 904, configured to determine a first threshold and a second threshold corresponding to the object to be determined based on the object to be determined and the type corresponding to the object to be determined;
[0135] A comparison module 906 is used to compare, for each object to be determined, a first feature value of the object to be determined with a first threshold value to obtain a first comparison result, and to compare a second feature value of the object to be determined with a second threshold value to obtain a second comparison result;
[0136] The label determination module 908 determines a label corresponding to the object to be determined based on the first comparison result and the second comparison result; the label includes a first label and a second label, and the value represented by the first label is lower than the value represented by the second label.
[0137] In one embodiment, the threshold determination module 904 is also used to: obtain the screen height and screen width of the display screen corresponding to the object to be determined; obtain the preset first ratio and preset second ratio corresponding to the picture; merge the screen height with the preset first ratio to obtain the first threshold; merge the screen width with the preset second ratio to obtain the second threshold.
[0138] In one embodiment, the comparison module 906 is also used to: for each object to be determined, obtain the image height and image width of the object to be determined; compare the image height of the object to be determined with a first threshold to obtain a first comparison result corresponding to the object to be determined; compare the image width of the object to be determined with a second threshold to obtain a second comparison result corresponding to the object to be determined.
[0139] In one embodiment, the label determination module 908 is also used to: when at least one of the first comparison result and the second comparison result is less than or equal to, determine that the label corresponding to the object to be determined is the first label; when the first comparison result and the second comparison result are both greater than, obtain the pixel value corresponding to each pixel point in the object to be determined; when the pixel values are the same, determine that the label corresponding to the object to be determined is the first label; when the pixel values are different, determine that the label corresponding to the object to be determined is the second label.
[0140] In one embodiment, the threshold determination module 904 is also used to: obtain the number of pixels and transparency corresponding to each object to be determined; obtain the preset first ratio and the preset second ratio corresponding to the character; determine the first threshold based on the number of pixels corresponding to each object to be determined and the preset first ratio; determine the second threshold based on the transparency corresponding to each object to be determined and the preset second ratio.
[0141] In one embodiment, the threshold determination module 904 is also used to: classify and count the number of pixel points corresponding to multiple objects to be determined to obtain a first statistical number corresponding to each pixel number; determine the target pixel number based on the number of pixel points corresponding to the largest first statistical number; merge the target pixel number with a preset first ratio to obtain a first threshold; determine the second threshold based on the transparency corresponding to each object to be determined and a preset second ratio, including: classify and count the transparencies corresponding to multiple objects to be determined to obtain a second statistical number corresponding to each transparency; determine the transparency corresponding to the largest second statistical number as the target transparency; merge the target transparency with the preset second ratio to obtain the second threshold.
[0142] In one embodiment, the label determination module 908 is also used to: when the first comparison result is less than or equal to, or the second comparison result is greater than or equal to, determine that the label corresponding to the object to be determined is the first label; when the first comparison result is greater than and the second comparison result is less than, determine that the label corresponding to the object to be determined is the second label.
[0143] Each module in the above-mentioned tag determination device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0144] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store objects to be determined whose labels are first labels. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a label determination method is implemented.
[0145] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0146] The embodiment of the present application further provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, enable the processors to perform the steps of the tag determination method.
[0147] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the tag determination method.
[0148] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0149] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0150] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0151] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A label determination method, characterized in that: include: Get multiple objects to be determined; The multiple objects to be determined correspond to the same type; Determine a first threshold and a second threshold corresponding to the object to be determined based on the object to be determined and the type corresponding to the object to be determined; For each of the objects to be determined, comparing the first characteristic value of the object to be determined with the first threshold to obtain a first comparison result, and comparing the second characteristic value of the object to be determined with the second threshold to obtain a second comparison result; Based on the first comparison result and the second comparison result, a label corresponding to the object to be determined is determined; the label includes a first label and a second label, and the value represented by the first label is lower than the value represented by the second label.
2. The method according to claim 1, characterized in that: The type corresponding to the object to be determined is a picture; and determining the first threshold and the second threshold corresponding to the object to be determined based on the object to be determined and the type corresponding to the object to be determined includes: Obtaining a screen length and a screen width of a display screen corresponding to the object to be determined; Get the preset first ratio and the preset second ratio corresponding to the image; Merging the screen length with the preset first ratio to obtain a first threshold; The screen width is combined with the preset second ratio to obtain a second threshold.
3. The method according to claim 2, characterized in that The first feature value is the picture height, and the second feature value is the picture width; for each of the objects to be determined, comparing the first feature value of the object to be determined with the first threshold to obtain a first comparison result, and comparing the second feature value of the object to be determined with the second threshold to obtain a second comparison result, including: For each of the objects to be determined, obtaining a picture height and a picture width of the object to be determined; Compare the image height of the object to be determined with the first threshold to obtain a first comparison result corresponding to the object to be determined; The image width of the object to be determined is compared with the second threshold to obtain a second comparison result corresponding to the object to be determined.
4. The method according to claim 3, characterized in that The determining, based on the first comparison result and the second comparison result, a label corresponding to the object to be determined includes: When at least one of the first comparison result and the second comparison result is less than or equal to, determining that the label corresponding to the object to be determined is the first label; When the first comparison result and the second comparison result are both greater than, obtaining pixel values corresponding to each pixel point in the object to be determined; When all the pixel values are the same, determining that the label corresponding to the object to be determined is the first label; When the pixel values are different, the label corresponding to the object to be determined is determined to be the second label.
5. The method according to claim 1, characterized in that The type corresponding to the object to be determined is a character; and determining the first threshold and the second threshold corresponding to the object to be determined based on the object to be determined and the type corresponding to the object to be determined includes: Obtaining the number and transparency of pixels corresponding to each of the objects to be determined; Obtain a preset first ratio and a preset second ratio corresponding to the character; Determining a first threshold based on the number of pixels corresponding to each of the objects to be determined and the preset first ratio; A second threshold is determined based on the transparency corresponding to each of the objects to be determined and the preset second ratio.
6. The method according to claim 5, characterized in that The determining of the first threshold based on the number of pixels corresponding to each of the objects to be determined and the preset first ratio includes: Classify and count the number of pixel points corresponding to the plurality of objects to be determined, and obtain a first statistical number corresponding to each number of pixel points; The number of pixel points corresponding to the largest first statistical number is used to determine the number of target pixel points; The target pixel number is combined with the preset first ratio to obtain a first threshold value; The determining the second threshold based on the transparency corresponding to each of the objects to be determined and the preset second ratio includes: Classify and count the transparencies corresponding to the plurality of objects to be determined, and obtain a second statistical quantity corresponding to each of the transparencies; The transparency corresponding to the largest second statistical quantity is determined as the target transparency; The target transparency is combined with the preset second ratio to obtain a second threshold.
7. The method according to claim 5, characterized in that The determining, based on the first comparison result and the second comparison result, a label corresponding to the object to be determined includes: When the first comparison result is less than or equal to, or the second comparison result is greater than or equal to, determining that the label corresponding to the object to be determined is the first label; When the first comparison result is greater than and the second comparison result is less than, it is determined that the label corresponding to the object to be determined is the second label.
8. A label determination device, characterized in that: include: An acquisition module, used for acquiring multiple objects to be determined; The multiple objects to be determined correspond to the same type; A threshold determination module, configured to determine a first threshold and a second threshold corresponding to the object to be determined based on the object to be determined and the type corresponding to the object to be determined; a comparison module, configured to compare, for each of the objects to be determined, a first feature value of the object to be determined with the first threshold value to obtain a first comparison result, and to compare a second feature value of the object to be determined with the second threshold value to obtain a second comparison result; The label determination module determines the label corresponding to the object to be determined based on the first comparison result and the second comparison result; the label includes a first label and a second label, and the value represented by the first label is lower than the value represented by the second label.
9. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the label determination method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the tag determination method according to any one of claims 1 to 7 are implemented.