A data recommendation method and device, and an electronic device
By acquiring users' historical reading data, identifying adjacent users and constructing feature vectors, and using the TF-IDF algorithm to calculate tag weights, the problem of users having difficulty obtaining the data they need in a big data environment is solved, achieving efficient data recommendation and improved user experience.
Patent Information
- Application Number
- CN202211568638.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-08
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2042-12-08
AI Technical Summary
In the information age, the increase in terminal devices has led to a surge in data volume, making it difficult for users to efficiently obtain the data they need.
By acquiring historical reading data from multiple users, adjacent users are identified and assigned label groups. The label weights are calculated based on the TF-IDF algorithm, feature vectors are constructed, and data recommendations are made when the similarity meets the conditions.
It improved the efficiency of data acquisition, enhanced the user experience, and enabled more accurate data recommendations.
Smart Images

Figure CN116070017B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a data recommendation method and device and electronic equipment. BACKGROUND
[0002] With the development of society, society gradually enters the information age. In the information age, data has become an indispensable part of people's daily life.
[0003] However, with the increase of terminal devices, the amount of data also gradually increases, so that the current user is difficult to obtain the required data in the complex data amount. How to improve the efficiency of users to obtain data is a problem to be solved in the current related technology. SUMMARY
[0004] Therefore, the embodiments of the present disclosure provide a data recommendation method, device and electronic equipment, which can improve the efficiency of obtaining data and improve the user experience.
[0005] In a first aspect, the embodiments of the present disclosure provide a data recommendation method, comprising:
[0006] obtaining historical reading data of each user in a plurality of users;
[0007] In a case where the same data in the historical reading data of the first user and the historical reading data of the second user exceeds a preset threshold, determining the first user and the second user as adjacent users, and the plurality of users includes the first user and the second user;
[0008] assigning the first user to a first label group and the second user to a second label group based on the historical reading data corresponding to the first user and the second user respectively, wherein the first label group and the second label group each include a plurality of labels, and each label corresponds to a weight;
[0009] determining a first feature vector corresponding to the first user based on the first label group, and determining a second feature vector corresponding to the second user based on the second label group;
[0010] In a case where the cosine similarity of the first feature vector and the second feature vector meets a preset condition, recommending the historical reading data of the first user to the second user.
[0011] According to a specific implementation manner of the embodiments of the present disclosure, assigning the first user to a first label group and the second user to a second label group based on the historical reading data corresponding to the first user and the second user respectively, wherein the first label group and the second label group each include a plurality of labels, and each label corresponds to a weight, comprising:
[0012] determining a plurality of first labels corresponding to the first user based on the historical reading data of the first user;
[0013] determine a plurality of second labels corresponding to the second user based on historical reading data of the second user;
[0014] determine a first label group and a weight corresponding to each label in the first label group based on a TF-IDF algorithm and the plurality of first labels;
[0015] determine a second label group and a weight corresponding to each label in the second label group based on a TF-IDF algorithm and the plurality of second labels.
[0016] According to a specific implementation manner of an embodiment of the present disclosure, determining a first label group and a weight corresponding to each label in the first label group based on a TF-IDF algorithm and the plurality of first labels comprises:
[0017] determining a TF-IDF value corresponding to each first label in the plurality of first labels based on TF-IDF;
[0018] sorting the plurality of first labels based on the TF-IDF value corresponding to each first label to obtain a first sequence;
[0019] obtaining a preset number of first labels based on the first sequence;
[0020] determining the preset number of first labels as the first label group;
[0021] determining a weight corresponding to each first label in the first label group based on the TF-IDF value corresponding to each first label and a total TF-IDF value corresponding to the plurality of first labels.
[0022] According to a specific implementation manner of an embodiment of the present disclosure, determining a second label group and a weight corresponding to each label in the second label group based on a TF-IDF algorithm and the plurality of second labels comprises:
[0023] determining a TF-IDF value corresponding to each second label in the plurality of second labels based on TF-IDF;
[0024] sorting the plurality of second labels based on the TF-IDF value corresponding to each second label to obtain a second sequence;
[0025] obtaining a preset number of second labels based on the second sequence;
[0026] determining the preset number of second labels as the second label group;
[0027] determining a weight corresponding to each second label in the second label group based on the TF-IDF value corresponding to each second label and a total TF-IDF value corresponding to the plurality of second labels.
[0028] According to a specific implementation manner of the embodiment of the present disclosure, the first feature vector corresponding to the first user is determined based on the first label group, and the second feature vector corresponding to the second user is determined based on the second label group, including:
[0029] Obtaining different labels in the first label group and the second label group;
[0030] Replacing the different label with the minimum weight in the first label group with the different label with the maximum weight in the second label group to obtain a redetermined first label group;
[0031] Replacing the different label with the minimum weight in the second label group with the different label with the maximum weight in the first label group to obtain a redetermined second label group;
[0032] Constructing a standard label group based on all labels in the first label group and the second label group;
[0033] Determining the first feature vector and the second feature vector based on the corresponding relationship among the redetermined first label group, the redetermined second label group and the standard label group.
[0034] In a second aspect, the embodiment of the present disclosure provides a data recommendation device, including:
[0035] An obtaining module, configured to obtain historical reading data of each user in a plurality of users;
[0036] A first determining module, configured to determine a first user and a second user as adjacent users in a case where the same data in the historical reading data of the first user and the historical reading data of the second user exceeds a preset threshold, the plurality of users including the first user and the second user;
[0037] An assigning module, configured to assign the first user to a first label group and the second user to a second label group based on the historical reading data corresponding to the first user and the second user respectively, the first label group and the second label group each including a plurality of labels, and each label corresponding to a weight;
[0038] A second determining module, configured to determine a first feature vector corresponding to the first user based on the first label group, and determine a second feature vector corresponding to the second user based on the second label group;
[0039] A recommendation module, configured to recommend the historical reading data of the first user to the second user in a case where the cosine similarity of the first feature vector and the second feature vector satisfies a preset condition.
[0040] According to a specific implementation manner of the embodiment of the present disclosure, the assigning module includes:
[0041] A first determining unit, configured to determine a plurality of first labels corresponding to the first user based on the historical reading data of the first user;
[0042] The second determining unit is configured to determine a plurality of second tags corresponding to the second user based on historical reading data of the second user.
[0043] The third determining unit is configured to determine a first tag group and a weight corresponding to each tag in the first tag based on a TF-IDF algorithm and the plurality of first tags.
[0044] The fourth determining unit is configured to determine a second tag group and a weight corresponding to each tag in the second tag based on a TF-IDF algorithm and the plurality of second tags.
[0045] According to a specific implementation manner of the embodiment of the present disclosure, the third determining unit comprises:
[0046] The first determining sub-unit is configured to determine a TF-IDF value corresponding to each first tag in the plurality of first tags based on TF-IDF.
[0047] The first sorting sub-unit is configured to sort the plurality of first tags based on the TF-IDF value corresponding to each first tag to obtain a first sequence.
[0048] The first obtaining sub-unit is configured to obtain a preset number of first tags based on the first sequence.
[0049] The second determining sub-unit is configured to determine the preset number of first tags as the first tag group.
[0050] The third determining sub-unit is configured to determine a weight corresponding to each first tag in the first tag group based on the TF-IDF value corresponding to each first tag and a total TF-IDF value corresponding to the plurality of first tags.
[0051] According to a specific implementation manner of the embodiment of the present disclosure, the preset condition is satisfied when the number of training times meets a preset number and / or a loss function value corresponding to the data classification model meets a preset threshold value.
[0052] According to a specific implementation manner of the embodiment of the present disclosure, the fourth determining unit further comprises:
[0053] The fourth determining sub-unit is configured to determine a TF-IDF value corresponding to each second tag in the plurality of second tags based on TF-IDF.
[0054] The second sorting sub-unit is configured to sort the plurality of second tags based on the TF-IDF value corresponding to each second tag to obtain a second sequence.
[0055] The second obtaining sub-unit is configured to obtain a preset number of second tags based on the second sequence.
[0056] The fifth determining sub-unit is configured to determine a preset number of second labels as a second label group.
[0057] The sixth determining sub-unit is configured to determine a weight corresponding to each second label in the second label group based on the TF-IDF value corresponding to each second label and the total TF-IDF value corresponding to the plurality of second labels.
[0058] According to a specific implementation manner of the embodiment of the present disclosure, the second determining module comprises:
[0059] The first obtaining unit is configured to obtain different labels in the first label group and the second label group.
[0060] The first replacing unit is configured to replace the different label with the smallest weight in the first label group with the different label with the largest weight in the second label group to obtain a re-determined first label group.
[0061] The second replacing unit is configured to replace the different label with the smallest weight in the second label group with the different label with the largest weight in the first label group to obtain a re-determined second label group.
[0062] The constructing unit is configured to construct a standard label group based on all labels in the first label group and the second label group.
[0063] The fifth determining unit is configured to determine the first feature vector and the second feature vector based on the corresponding relationship among the re-determined first label group, the second label group and the standard label group.
[0064] In a third aspect, an electronic device is provided, which comprises a housing, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is arranged inside a space enclosed by the housing, the processor and the memory are arranged on the circuit board; the power supply circuit is configured to supply power to each circuit or device of the electronic device; the memory is configured to store executable program codes; the processor is configured to run a program corresponding to the executable program codes by reading the executable program codes stored in the memory, and execute the method of any of the preceding implementation manners.
[0065] In a fourth aspect, an application program is provided, which is executed to implement the method of any of the embodiments of the present disclosure.
[0066] The data recommendation method, device and electronic equipment provided by the embodiments of the present disclosure can obtain historical reading data of each user in a plurality of users, determine a first user and a second user as adjacent users in a case where the same data in the historical reading data of the first user and the second user in the plurality of users exceeds a preset threshold, assign the first user to a first label group and the second user to a second label group based on the historical reading data corresponding to the first user and the second user respectively, each label in each label group corresponding to a weight, determine a first feature vector corresponding to the first user based on the first label group, determine a second feature vector corresponding to the second user based on the second label group, and recommend the historical reading data of the first user to the second user in a case where the cosine similarity of the first feature vector and the second feature vector meets a preset condition. BRIEF DESCRIPTION OF DRAWINGS
[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0068] Figure 1 A flowchart of the data recommendation method of the first embodiment of the present disclosure;
[0069] Figure 2 A flowchart of the data recommendation method of the first embodiment of the present disclosure;
[0070] Figure 3 A flowchart of the data recommendation method of the third embodiment of the present disclosure;
[0071] Figure 4 A flowchart of the data recommendation device of the fourth embodiment of the present disclosure;
[0072] Figure 5 A flowchart of the data recommendation method of the fifth embodiment of the present disclosure;
[0073] Figure 6 A structural schematic diagram of one embodiment of the electronic equipment of the present disclosure. DETAILED DESCRIPTION
[0074] The embodiments of the present disclosure will be described in detail below with reference to the drawings. It should be clear that the described embodiments are only some of the embodiments of the present disclosure, not all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present disclosure.
[0075] It should be understood that each of the steps recited in the method embodiments of the present disclosure can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit performing the steps shown. The scope of the present disclosure is not limited in this regard.
[0076] It should be noted that the concepts of "first", "first", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0077] It should be noted that the modification of "one", "multiple" mentioned in the present disclosure is illustrative and not limiting, and those skilled in the art should understand that unless otherwise explicitly indicated in the context, it should be understood as "one or more".
[0078] The economy of the world today is developing towards economic integration and knowledge economy, and network, virtualization, digitization and knowledge are becoming important characteristics of modern economic development, which makes the business environment faced by enterprises increasingly complex and changeable.
[0079] In the case of increasingly fierce market competition, knowledge has become the primary resource for business operations, and the competitive advantage of enterprises is increasingly reflected in whether the enterprise has strong knowledge capital and unique operating ability. Therefore, knowledge management is becoming the most core management content of enterprises.
[0080] However, in the related art, the level of knowledge management is low, and it is difficult to meet the needs of users.
[0081] To solve the above technical problems, the embodiments of the present disclosure provide a data recommendation method.
[0082] Figure 1 A flowchart of a data recommendation method provided by the present disclosure embodiment one is shown in Figure 1 As shown, the method can include:
[0083] S110, obtaining historical reading data of each user in a plurality of users.
[0084] In some embodiments, the user historical reading data can include data in various forms such as documents, books, manuals, etc. read by the user.
[0085] In some embodiments, the user can read data through the terminal device of the user.
[0086] In some embodiments, the historical reading data of the user can be stored in the server.
[0087] Optionally, the application clients installed in different terminal devices are the same, or are clients of the same type of application based on different operating systems. Based on the difference of terminal platforms, the specific forms of the application clients can also be different, for example, the application clients can be mobile phone clients, PC clients, etc.
[0088] The server can be a server providing various services, for example, a background management server providing support for the user to operate the device by using the terminal device. The background management server can analyze and process the received request and other data, and feed back the processing result to the terminal device.
[0089] Optionally, the server can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application.
[0090] Those skilled in the art can know that the number of the above-mentioned terminal devices, networks and servers is only illustrative, and any number of terminal devices, networks and servers can be provided according to actual needs. The present disclosure does not limit this.
[0091] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to Local Area Networks (LANs), Metropolitan Area Networks (MANs), Wide Area Networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Networks (VPNs), and Internet Protocol Security (IPsec) can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.
[0092] S120, if the number of identical data in the historical reading data of the first user and the historical reading data of the second user exceeds a preset threshold, the first user and the second user are identified as adjacent users, and the multiple users include the first user and the second user.
[0093] In one embodiment, the historical reading data of any two users among multiple users can be compared.
[0094] In one embodiment, the preset threshold may include a user-defined threshold, which is not specifically limited in this embodiment.
[0095] In one embodiment, user relationships can be determined in the form of a knowledge graph. For example, each user is considered as a node in the knowledge graph, and two users connected by an edge are considered as adjacent users.
[0096] S130, based on the historical reading data corresponding to the first user and the second user respectively, the first user is assigned to the first tag group, and the second user is assigned to the second tag group. Both the first tag group and the second tag group contain multiple tags, and each tag has a corresponding weight.
[0097] In an embodiment, a keyword in the historical reading data of the user can be obtained, and the keyword is determined as a label corresponding to the user. The label group is determined based on the label.
[0098] In an embodiment, the weight corresponding to the label can be determined based on the frequency of occurrence of the label.
[0099] S140, a first feature vector corresponding to the first user is determined based on the first label group, and a second feature vector corresponding to the second user is determined based on the second label group.
[0100] In an embodiment, different labels can be encoded according to a preset rule, and then the feature vectors corresponding to the first user and the second user are determined based on the encoding.
[0101] S150, in a case where the cosine similarity of the first feature vector and the second feature vector meets a preset condition, the historical reading data of the first user is recommended to the second user.
[0102] In some embodiments, the historical reading data of the second user can also be recommended to the first user.
[0103] In some embodiments, the preset condition can include that the determined cosine similarity value meets a preset threshold.
[0104] The data recommendation method provided by the embodiment of the present disclosure includes: obtaining historical reading data of each user in a plurality of users; in a case where the same data in the historical reading data of a first user and a second user in the plurality of users exceeds a preset threshold, determining the first user and the second user as adjacent users; then assigning the first user to a first label group and the second user to a second label group based on the historical reading data corresponding to the first user and the second user respectively, each label in each label group corresponding to a weight; then determining a first feature vector corresponding to the first user based on the first label group, and determining a second feature vector corresponding to the second user based on the second label group; and in a case where the cosine similarity of the first feature vector and the second feature vector meets a preset condition, recommending the historical reading data of the first user to the second user.
[0105] Figure 2 A data recommendation method flowchart provided by the second embodiment of the present disclosure is shown in FIG. 2, and the method can include: Figure 2
[0106] S210, a plurality of first labels corresponding to the first user are determined based on the historical reading data of the first user.
[0107] S220, a plurality of second labels corresponding to the second user are determined based on the historical reading data of the second user.
[0108] S230, determine a first label group based on the TF-IDF algorithm and the plurality of first labels, and a weight corresponding to each label in the first labels.
[0109] S240, determine a second label group based on the TF-IDF algorithm and the plurality of second labels, and a weight corresponding to each label in the second labels.
[0110] In some embodiments, the TF-IDF value corresponding to each keyword in the historical data corresponding to each user can be determined based on the TF-IDF algorithm, and then the weight corresponding to each keyword can be determined according to the ratio of the TF-IDF value corresponding to each keyword to the total value of the TF-IDF values corresponding to all keywords, wherein the keyword can be determined as a label in the label group.
[0111] Figure 3 A data recommendation method flowchart provided by Embodiment Three of the present disclosure is shown in FIG. 3. Figure 3 As shown in FIG. 3, the method can include:
[0112] S310, determine a TF-IDF value corresponding to each first label in the plurality of first labels based on the TF-IDF;
[0113] S320, sort the plurality of first labels based on the TF-IDF value corresponding to each first label to obtain a first sequence;
[0114] S330, obtain a preset number of first labels based on the first sequence;
[0115] S340, determine the preset number of first labels as a first label group;
[0116] In one embodiment, the TF-IDF value corresponding to each keyword can be obtained, and then the TF-IDF values are sorted, and then a preset number of keywords with higher TF-IDF values are determined as labels in the label group.
[0117] S350, determine a weight corresponding to each first label in the first label group based on the TF-IDF value corresponding to each first label and the total value of the TF-IDF values corresponding to the plurality of first labels.
[0118] In some embodiments, the method of determining the labels in the second label group and the weight value corresponding to each label is the same as the above-mentioned embodiments, which will not be described here.
[0119] Figure 4 A data recommendation method flowchart provided by Embodiment Four of the present disclosure is shown in FIG. 4. Figure 4 As shown in FIG. 4, the method can include:
[0120] S410, obtain different labels in the first label group and the second label group.
[0121] In some embodiments, the labels in the first label group are "5G, hospital, big data, intelligent, governance" respectively, and the corresponding weights are "0.8, 0.75, 0.65, 0.6, 0.58" respectively, the labels in the second label group are "5G, public health, big data, intelligent, PaaS" respectively, and the corresponding weights are "0.85, 0.8, 0.75, 0.7, 0.59" respectively, and the different labels are hospital, governance, public health, and PaaS.
[0122] S420, replacing the different label with the minimum weight in the first label group with the different label with the maximum weight in the second label group to obtain a first label group determined again.
[0123] In some embodiments, the different label with the minimum weight in the first label group is governance, and the different label with the maximum weight in the second label group is public health, and the first label group determined again is "5G, hospital, big data, intelligent, public health".
[0124] S430, replacing the different label with the minimum weight in the second label group with the different label with the maximum weight in the first label group to obtain a second label group determined again.
[0125] In some embodiments, the method for determining the second label group is the same as the method for determining the first label group, which will not be described here.
[0126] S440, constructing a standard label group based on all labels in the first label group and the second label group.
[0127] In some embodiments, in some embodiments, the labels in the first label group are "5G, hospital, big data, intelligent, governance" respectively, and the corresponding weights are "0.8, 0.75, 0.65, 0.6, 0.58" respectively, the labels in the second label group are "5G, public health, big data, intelligent, PaaS" respectively, and the corresponding weights are "0.85, 0.8, 0.75, 0.7, 0.59" respectively, and the standard label group is "5G, hospital, big data, intelligent, governance, public health, PaaS".
[0128] S450, determining a first feature vector and a second feature vector based on the correspondence relationship among the first label group determined again, the second label group, and the standard label group.
[0129] In some embodiments, determining the first feature vector corresponding to the first label group and the second feature vector corresponding to the second label group based on the standard label group and the first label group and the second label group can include:
[0130] For the first label group, in a case where the first label group and the standard label group contain the same label, the weight of the label in the first label group is determined as an element of the first feature vector, and in a case where the first label group does not contain the label in the standard label group, 0 is assigned to the position corresponding to the first feature vector.
[0131] For example, the labels in the first label group are "5G, hospital, big data, intelligent, and governance" respectively, and the corresponding weights are "0.8, 0.75, 0.65, 0.6, and 0.58" respectively, and the labels in the second label group are "5G, public health, big data, intelligent, and PaaS" respectively, and the corresponding weights are "0.85, 0.8, 0.75, 0.7, and 0.59" respectively, and the standard label group is "5G, hospital, big data, intelligent, governance, public health, and PaaS".
[0132] The first feature vector is [0.8, 0.75, 0.65, 0.6, 0.58, 0, 0], and the second feature vector is [0.85, 0, 0.75, 0.7, 0, 0.8, 0.59].
[0133] Based on the same inventive concept, the disclosure also provides a data recommendation device.
[0134] Figure 5 A data recommendation device structure diagram provided by the fifth embodiment of the disclosure is shown in FIG. 5. Figure 5 As shown in FIG. 5, the device can include:
[0135] The acquisition module 510 is configured to acquire historical reading data of each user in a plurality of users.
[0136] The first determination module 520 is configured to determine a first user and a second user as adjacent users in a case where the same data in the historical reading data of the first user and the historical reading data of the second user exceeds a preset threshold, and the plurality of users includes the first user and the second user.
[0137] The assignment module 530 is configured to assign the first user to a first label group and the second user to a second label group based on the historical reading data corresponding to the first user and the second user respectively, the first label group and the second label group each contain a plurality of labels, and each label corresponds to a weight.
[0138] The second determination module 540 is configured to determine a first feature vector corresponding to the first user based on the first label group, and determine a second feature vector corresponding to the second user based on the second label group.
[0139] The recommendation module 550 is configured to recommend the historical reading data of the first user to the second user in a case where the cosine similarity of the first feature vector and the second feature vector meets a preset condition.
[0140] The data recommendation apparatus provided by the embodiments of the present disclosure comprises: obtaining historical reading data of each user in a plurality of users; determining a first user and a second user as adjacent users in a case where the same data in the historical reading data of the first user and the second user in the plurality of users exceeds a preset threshold; assigning the first user to a first label group and the second user to a second label group based on the historical reading data corresponding to the first user and the second user respectively, each label in each label group corresponding to a weight; determining a first feature vector corresponding to the first user based on the first label group, and determining a second feature vector corresponding to the second user based on the second label group; and recommending the historical reading data of the first user to the second user in a case where the cosine similarity of the first feature vector and the second feature vector satisfies a preset condition.
[0141] According to a specific implementation manner of the embodiments of the present disclosure, the assigning module comprises:
[0142] a first determining unit configured to determine a plurality of first labels corresponding to the first user based on the historical reading data of the first user;
[0143] a second determining unit configured to determine a plurality of second labels corresponding to the second user based on the historical reading data of the second user;
[0144] a third determining unit configured to determine the first label group and the weight corresponding to each label in the first label group based on a TF-IDF algorithm and the plurality of first labels;
[0145] a fourth determining unit configured to determine the second label group and the weight corresponding to each label in the second label group based on a TF-IDF algorithm and the plurality of second labels.
[0146] According to a specific implementation manner of the embodiments of the present disclosure, the third determining unit comprises:
[0147] a first determining subunit configured to determine the TF-IDF value corresponding to each first label in the plurality of first labels based on TF-IDF;
[0148] a first sorting subunit configured to sort the plurality of first labels based on the TF-IDF value corresponding to each first label to obtain a first sequence;
[0149] a first obtaining subunit configured to obtain a preset number of first labels based on the first sequence;
[0150] a second determining subunit configured to determine the preset number of first labels as the first label group;
[0151] The third determining sub-unit is configured to determine a weight corresponding to each first label in the first label group based on the TF-IDF value corresponding to each first label and the total TF-IDF value corresponding to the plurality of first labels.
[0152] According to a specific implementation manner of the embodiment of the present disclosure, the preset condition is met, including that the number of training times meets the preset number and / or the loss function value corresponding to the data classification model meets the preset threshold.
[0153] According to a specific implementation manner of the embodiment of the present disclosure, the fourth determining unit further includes:
[0154] The fourth determining sub-unit is configured to determine a TF-IDF value corresponding to each second label in the plurality of second labels based on the TF-IDF.
[0155] The second sorting sub-unit is configured to sort the plurality of second labels based on the TF-IDF value corresponding to each second label to obtain a second sequence.
[0156] The second obtaining sub-unit is configured to obtain a preset number of second labels based on the second sequence.
[0157] The fifth determining sub-unit is configured to determine the preset number of second labels as a second label group.
[0158] The sixth determining sub-unit is configured to determine a weight corresponding to each second label in the second label group based on the TF-IDF value corresponding to each second label and the total TF-IDF value corresponding to the plurality of second labels.
[0159] According to a specific implementation manner of the embodiment of the present disclosure, the second determining module includes:
[0160] The first obtaining unit is configured to obtain different labels in the first label group and the second label group.
[0161] The first replacing unit is configured to replace the different label with the smallest weight in the first label group with the different label with the largest weight in the second label group to obtain a re-determined first label group.
[0162] The second replacing unit is configured to replace the different label with the smallest weight in the second label group with the different label with the largest weight in the first label group to obtain a re-determined second label group.
[0163] The constructing unit is configured to construct a standard label group based on all labels in the first label group and the second label group.
[0164] The fifth determining unit is configured to determine the first feature vector and the second feature vector based on a corresponding relationship among the re-determined first label group, the re-determined second label group and the standard label group.
[0165] Figure 6 As shown in the structural schematic diagram of an embodiment of the electronic device of the present disclosure, the method of the present disclosure can be implemented Figures 1-5 As shown in the flowchart of the embodiment, the method of the present disclosure can be implemented Figure 6 As shown in the structural schematic diagram of an embodiment of the electronic device of the present disclosure, the method of the present disclosure can be implemented
[0166] The specific execution process of the above steps by the processor 42 and the steps further executed by the processor 42 by running the executable program code can be referred to the description of the embodiment of the present disclosure Figures 1-5 As shown in the structural schematic diagram of an embodiment of the electronic device of the present disclosure, the method of the present disclosure can be implemented
[0167] The electronic device exists in various forms, including but not limited to:
[0168] (1) Mobile communication device: This type of device is characterized by having mobile communication function and providing voice and data communication as the main target. This type of terminal includes smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
[0169] (2) Ultra-mobile personal computer device: This type of device belongs to the category of personal computers and has computing and processing functions, and generally also has the feature of mobile Internet. This type of terminal includes PDA, MID and UMPC devices, such as iPad.
[0170] (3) Portable entertainment device: This type of device can display and play multimedia data. This type of device includes audio and video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
[0171] (4) Server: A device that provides computing services. The components of a server include a processor, a hard disk, a memory, a system bus, etc. The server is similar in architecture to a general-purpose computer, but requires higher processing power, stability, reliability, security, scalability, and manageability due to the need to provide high-reliability services.
[0172] (5) Other electronic devices with data interaction function.
[0173] In a fifth aspect, the embodiments of the present disclosure also provide an application program, which is executed to implement the method provided by any of the embodiments of the present disclosure.
[0174] It is to be noted that, in the present document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0175] Each of the above-described embodiments can be implemented in a variety of ways, and the same or similar parts among the embodiments can be mutually referred to, and each of the embodiments focuses on the difference from other embodiments.
[0176] In particular, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiments.
[0177] For the convenience of description, the above device is described in various units / modules respectively according to functions. Of course, in the implementation of the present disclosure, the functions of each unit / module can be implemented in the same or multiple software and / or hardware.
[0178] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The program can be stored in a computer readable storage medium, and when the program is executed, it can include the processes of the above-mentioned embodiment methods. The storage medium can be a magnetic disc, an optical disc, a read-only memory (ROM) or a random access memory (RAM) and the like.
[0179] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or replacements within the technical scope disclosed by the present disclosure can be easily thought of by those skilled in the art, and should be covered by the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.
Claims
1. A data recommendation method characterized by, The method comprises: obtaining historical reading data of each user in a plurality of users; in a case where identical data in historical reading data of a first user and historical reading data of a second user exceeds a preset threshold, determining the first user and the second user as adjacent users, the plurality of users comprising the first user and the second user; assigning the first user to a first label group and the second user to a second label group based on historical reading data corresponding to the first user and the second user respectively, the first label group and the second label group each comprising a plurality of labels, and each label corresponding to a weight; determining a first feature vector corresponding to the first user based on the first label group and determining a second feature vector corresponding to the second user based on the second label group; in a case where a cosine similarity of the first feature vector and the second feature vector satisfies a preset condition, recommending the historical reading data of the first user to the second user; the determining of the first feature vector corresponding to the first user based on the first label group and the determining of the second feature vector corresponding to the second user based on the second label group comprises: obtaining different labels in the first label group and the second label group; replacing a different label with the smallest weight in the first label group with a different label with the largest weight in the second label group to obtain a first label group determined again; replacing a different label with the smallest weight in the second label group with a different label with the largest weight in the first label group to obtain a second label group determined again; constructing a standard label group based on all labels in the first label group and the second label group; determining the first feature vector and the second feature vector based on a correspondence relationship between the first label group determined again, the second label group determined again and the standard label group.
2. The data recommendation method of claim 1, wherein, the assigning of the first user to the first label group and the second user to the second label group based on historical reading data corresponding to the first user and the second user respectively, the first label group and the second label group each comprising a plurality of labels, and each label corresponding to a weight, comprises: determining a plurality of first labels corresponding to the first user based on historical reading data of the first user; determining a plurality of second labels corresponding to the second user based on historical reading data of the second user; determining the first label group and a weight corresponding to each first label in the first label group based on a TF-IDF algorithm and the plurality of first labels; determining the second label group and a weight corresponding to each second label in the second label group based on a TF-IDF algorithm and the plurality of second labels.
3. The data recommendation method of claim 2, wherein, the determining of the first label group and the weight corresponding to each first label in the first label group based on the TF-IDF algorithm and the plurality of first labels comprises: determining a TF-IDF value corresponding to each first label in the plurality of first labels based on TF-IDF; sorting the plurality of first labels based on the TF-IDF value corresponding to each first label to obtain a first sequence; obtaining a preset number of first labels based on the first sequence; determining the preset number of first labels as the first label group; Determine the weight corresponding to each first label in the first label group based on the TF-IDF value corresponding to each first label and the total TF-IDF value corresponding to the plurality of first labels.
4. The data recommendation method of claim 2, wherein, The second label group and the weight corresponding to each label in the second label group are determined based on the TF-IDF algorithm and the plurality of second labels, including: Determine the TF-IDF value corresponding to each second label in the plurality of second labels based on TF-IDF; Sort the plurality of second labels based on the TF-IDF value corresponding to each second label to obtain a second sequence; Obtain a preset number of second labels based on the second sequence; Determine the preset number of second labels as the second label group; Determine the weight corresponding to each second label in the second label group based on the TF-IDF value corresponding to each second label and the total TF-IDF value corresponding to the plurality of second labels.
5. A data recommendation device, characterized by, The device comprises: An acquisition module for acquiring historical reading data of each user in a plurality of users; A first determination module for determining a first user and a second user as adjacent users in a case where the same data in the historical reading data of the first user and the historical reading data of the second user exceeds a preset threshold, the plurality of users including the first user and the second user; An assignment module for assigning the first user to a first label group and the second user to a second label group based on the historical reading data corresponding to the first user and the second user respectively, the first label group and the second label group each containing a plurality of labels, and each label corresponding to a weight; A second determination module for determining a first feature vector corresponding to the first user based on the first label group and determining a second feature vector corresponding to the second user based on the second label group; A recommendation module for recommending the historical reading data of the first user to the second user in a case where the cosine similarity of the first feature vector and the second feature vector meets a preset condition; The first feature vector corresponding to the first user is determined based on the first label group, and the second feature vector corresponding to the second user is determined based on the second label group, including: Obtain different labels in the first label group and the second label group; Replace the different label with the smallest weight in the first label group with the different label with the largest weight in the second label group to obtain a re-determined first label group; Replace the different label with the smallest weight in the second label group with the different label with the largest weight in the first label group to obtain a re-determined second label group; Construct a standard label group based on all labels in the first label group and the second label group; Determine the first feature vector and the second feature vector based on the correspondence between the re-determined first label group, the second label group and the standard label group.
6. The apparatus of claim 5, wherein, The assignment module comprises: A first determination unit for determining a plurality of first labels corresponding to the first user based on the historical reading data of the first user; A second determination unit for determining a plurality of second labels corresponding to the second user based on the historical reading data of the second user; The third determining unit is configured to determine the first label group and a weight corresponding to each label in the first label group based on a TF-IDF algorithm and the first labels. The fourth determining unit is configured to determine the second label group and a weight corresponding to each label in the second label group based on a TF-IDF algorithm and the second labels.
7. The data recommendation device according to claim 6, wherein The third determining unit comprises: The first determining sub-unit is configured to determine a TF-IDF value corresponding to each first label in the first labels based on a TF-IDF algorithm. The first sorting sub-unit is configured to sort the first labels based on the TF-IDF value corresponding to each first label to obtain a first sequence. The first acquiring sub-unit is configured to acquire a preset number of first labels based on the first sequence. The second determining sub-unit is configured to determine the preset number of first labels as the first label group. The third determining sub-unit is configured to determine a weight corresponding to each first label in the first label group based on the TF-IDF value corresponding to each first label and a total TF-IDF value corresponding to the first labels.
8. An electronic device, comprising: The electronic device comprises a housing, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is arranged inside a space enclosed by the housing, the processor and the memory are arranged on the circuit board; the power supply circuit is configured to supply power to each circuit or device of the electronic device; the memory is configured to store executable program codes; the processor is configured to run programs corresponding to the executable program codes by reading the executable program codes stored in the memory, and execute the method of any one of the preceding claims 1 to 4.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores one or more programs, which can be executed by one or more processors to implement the method of any one of the preceding claims 1 to 4.
Citation Information
Patent Citations
Reading recommendation method and device, and readable storage medium
CN108763519A
KR20220034701A