WO2023065640A1 - Model parameter adjustment method and apparatus, electronic device and storage medium - Google Patents

Model parameter adjustment method and apparatus, electronic device and storage medium Download PDF

Info

Publication number
WO2023065640A1
WO2023065640A1 PCT/CN2022/090461 CN2022090461W WO2023065640A1 WO 2023065640 A1 WO2023065640 A1 WO 2023065640A1 CN 2022090461 W CN2022090461 W CN 2022090461W WO 2023065640 A1 WO2023065640 A1 WO 2023065640A1
Authority
WO
WIPO (PCT)
Prior art keywords
social information
social
information
identifier
heterogeneous
Prior art date
Application number
PCT/CN2022/090461
Other languages
French (fr)
Chinese (zh)
Inventor
李雷来
王健宗
瞿晓阳
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2023065640A1 publication Critical patent/WO2023065640A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9536Search customisation based on social or collaborative filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates

Definitions

  • the present application relates to the field of artificial intelligence, and in particular to a model parameter adjustment method, device, electronic equipment and storage medium.
  • Embodiments of the present application provide a model parameter adjustment method, device, electronic device, and storage medium, which improve the generalization capability of the recommendation model.
  • the first aspect of the present application provides a method for adjusting model parameters, including:
  • first social information Acquiring first social information, second social information and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories;
  • the second aspect of the present application provides a model parameter adjustment device, the device includes an acquisition module, an encoding module, a first determination module, a second determination module, a third determination module and a training module,
  • the acquisition module is configured to acquire first social information, second social information and third social information, the first social information and the second social information belong to the same category, the first social information and the second social information 3. Social information belongs to different categories;
  • the encoding module is configured to encode the first social information, the second social information and the third social information respectively to obtain a first feature vector, a second feature vector and a third feature vector;
  • the first determination module is configured to determine a distance between the first feature vector and the second feature vector to obtain a first distance
  • the second determination module is configured to determine a distance between the first feature vector and the third feature vector to obtain a second distance
  • the third determination module is configured to determine a loss function according to the difference between the first distance and the second distance;
  • the training module is configured to adjust model parameters of the recommendation model according to the loss function, so as to train the recommendation model.
  • the third aspect of the present application provides an electronic device for model parameter adjustment, which includes a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory, and are generated to be executed by the processor to perform the following steps:
  • first social information Acquiring first social information, second social information and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories;
  • a fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the stored computer program is executed by the processor to implement the following steps:
  • first social information Acquiring first social information, second social information and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories;
  • the loss function is determined according to the first distance between the feature vectors corresponding to the social information belonging to the same category and the second distance between the feature vectors corresponding to the social information belonging to different categories, so when using this loss function to adjust the recommendation model
  • the model parameters can make the representation of similar data more abundant, which in turn enhances the feature extraction ability of the recommendation model and improves the generalization ability of the recommendation model.
  • Fig. 1 is a schematic flow chart of a model parameter adjustment method provided by the embodiment of the present application
  • FIG. 2 is a schematic diagram of a heterogeneous social graph provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a homogeneous social graph obtained based on the heterogeneous social graph shown in FIG. 2;
  • Fig. 4 is a schematic flowchart of another model parameter adjustment method provided by the embodiment of the present application.
  • FIG. 5 is a schematic diagram of a model parameter adjustment device provided in an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an electronic device in a hardware operating environment involved in an embodiment of the present application.
  • the execution subject may be an electronic device or a cloud server, which is not limited here.
  • electronic devices may include various handheld devices with wireless communication functions, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to wireless modems, as well as various forms of user equipment (User Equipment, UE), mobile Taiwan (Mobile Station, MS), terminal equipment (terminal device) and so on.
  • UE User Equipment
  • UE mobile Taiwan
  • MS Mobile Station
  • terminal device terminal device
  • FIG. 1 is a schematic flowchart of a method for adjusting model parameters provided by an embodiment of the present application. As shown in Figure 1, the method includes:
  • the first social information includes the first word text, the first tag information, the first named entity, the first user identifier, the first time information and the identifier of the first social information.
  • the first word text can include one or more word texts, and one or more word texts are words other than common words and rare words. Common words can be modal particles, stop words, etc., and rare words can be included in open source The words in the data set or presets are not limited here.
  • the first tag information is used to identify a topic or category to which the first social information belongs.
  • the first user identifier is an identifier of a user who publishes the first social information.
  • the first time information is the time when the first social information is published.
  • the second social information includes the second word text, the second label information, the second named entity, the second user identifier, the second time information and the identifier of the second social information.
  • the second word text may include two or more word texts.
  • the second tag information is used to identify a topic or category to which the second social information belongs.
  • the second user identifier is the identifier of the user who publishes the second social information.
  • the second time information is the time when the second social information is published.
  • the third social information includes third word text, third tag information, third named entity, third user identifier, third time information, and third social information identifier.
  • the third word text may include three or more word texts.
  • the third tag information is used to identify a topic or category to which the third social information belongs.
  • the third user identifier is the identifier of the user who publishes the third social information.
  • the third time information is the time when the third social information is published.
  • social information may be, for example, text information such as tweets and comments and/or image information, which is not limited here.
  • the first word text is obtained by natural language processing according to the first social information
  • the second word text is obtained by natural language processing according to the second social information
  • the third word text is obtained by natural language processing according to the third social information. Do limit.
  • the method further includes: acquiring a heterogeneous social graph, where the heterogeneous social graph includes a plurality of heterogeneous nodes and at least two heterogeneous nodes among the plurality of heterogeneous nodes
  • a heterogeneous node in the heterogeneous social graph includes the following items: word text, label information, user identification, time information and identification of social information, and the label information is used to identify the category to which the social information belongs ;
  • Generate an isomorphic social graph according to the heterogeneous social graph the isomorphic social graph includes a plurality of isomorphic nodes and connection edges between at least two of the plurality of isomorphic nodes, the An isomorphic node in the isomorphic social graph is an identifier of social information, and the plurality of isomorphic nodes include the identifier of the first social information, the identifier of the second social information, and the identifier of the third social information ;
  • the isomorphic social graph includes a pluralit
  • connection edge between at least two heterogeneous nodes may be a connection edge between at least two heterogeneous nodes of the same type, and/or a connection edge between at least two heterogeneous nodes of different types.
  • FIG. 2 is a schematic diagram of a heterogeneous social graph provided by an embodiment of the present application.
  • a heterogeneous node identification of social information
  • can have connection edges with other nodes for example, a heterogeneous node (identification of social information) can be connected with word text, label information, user identification, time
  • connection edges between nodes such as information
  • a heterogeneous node may have connection edges with nodes such as word text, label information, user identification, and time information, that is, connection edges between at least two heterogeneous nodes of different types ; There may also be a connection edge between a heterogeneous node (identification of social information) and another identification of social information, that is, a connection edge between at least two heterogeneous nodes of the same type.
  • connection edge between at least two isomorphic nodes may be a connection edge between at least two isomorphic nodes of the same type.
  • FIG. 3 is a schematic diagram of a homogeneous social graph obtained based on the heterogeneous social graph shown in FIG. 2 .
  • FIG. 3 there is a connecting edge between every two social information identifiers (every two isomorphic nodes) among the three social information identifiers (three isomorphic nodes), that is, at least two homogeneous nodes of the same type connect edges between nodes.
  • the first threshold may be the same as or different from the second threshold, which is not limited here.
  • the first threshold is higher than the second threshold.
  • generating a homogeneous social graph according to the heterogeneous social graph includes: mapping the heterogeneous social graph into a homogeneous social graph based on a heterogeneous information network (heterogeneous information networks, HIN) mapping rule.
  • a heterogeneous information network heterogeneous information networks, HIN
  • the HIN mapping rule includes one or more of the following: if the word text connected with the identifier of the social information D in the heterogeneous social graph is connected with the word text connected with the identifier of the social information E in the heterogeneous social graph If the similarity is greater than or equal to the third threshold, connect the identification of social information D and the identification of social information E in the homogeneous social graph; if the tag information connected to the identification of social information D in the heterogeneous social graph is connected to If the tag information connected to the logo of social information E in the heterogeneous social graph is the same, then the logo of social information D is connected to the logo of social information E in the homogeneous social graph; if the social information D in the heterogeneous social graph The user ID connected with the ID of is the same as the user ID connected with the ID of social information E in the heterogeneous social graph, then the ID of social information D is connected with the ID of social information E in the homogeneous social graph; if The time information connected with the logo
  • the third threshold is different from the fourth threshold, for example, the third threshold is greater than the fourth threshold, or the third threshold is smaller than the fourth threshold.
  • the isomorphic social graph is obtained based on the heterogeneous social graph, so that the obtained isomorphic social graph is more in line with the actual situation.
  • the first weight and the second weight according to the isomorphic social graph by determining the first weight and the second weight according to the isomorphic social graph, whether different social information belongs to the same category can be determined according to the two weights, thereby improving the accuracy of category determination.
  • the method before the acquisition of the heterogeneous social graph, the method further includes: acquiring multiple pieces of social information within a preset time; extracting word text and tags contained in each piece of social information among the multiple pieces of social information identification of information, user identification, time information and social information; generating the heterogeneous social graph according to the word text, tag information, user identification, time information and identification of social information contained in each piece of social information.
  • the preset time can be set by an administrator, or configured in a configuration file, which is not limited here.
  • multiple pieces of social information can be included in the same social information block, the number of the social information block is within the preset number range, the preset coding range can be 0 to t+w, and t is greater than or equal to 0 and less than w Integer, w is the length of the time window for maintaining the recommendation model, which can be set by the administrator or configured in the configuration file, and there is no limit here. It should be understood that in this application, the social information contained in the social information block within the preset encoding range is not outdated.
  • different social information blocks correspond to different numbers, and the size of the numbers is used to indicate the time sequence in which the social information blocks occur.
  • the occurrence times of different social information in the same social information block may be different or the same, that is, the time information contained in different social information in the same social information block may be different or the same.
  • the determining the first weight and the second weight according to the isomorphic social graph includes: if the connection edge between at least two homogeneous nodes in the isomorphic social graph is based on the heterogeneous social
  • the word text associated with the identification of different social information in the figure is determined, and the word text associated with the identification of the first social information is determined according to the similarity between the word text associated with the identification of the second social information.
  • the first weight; the second weight is determined according to the similarity between the word text associated with the identifier of the first social information and the word text associated with the identifier of the third social information.
  • determining the first weight according to the similarity between the word text associated with the identifier of the first social information and the word text associated with the identifier of the second social information may include: according to the first The first weight is determined by a cosine similarity between the word text associated with the identifier of the social information and the word text associated with the identifier of the second social information.
  • determining the second weight according to the similarity between the word text associated with the identifier of the first social information and the word text associated with the identifier of the third social information includes: according to the first social information The second weight is determined by a cosine similarity between the word text associated with the identifier of the information and the word text associated with the identifier of the third social information.
  • the weight is determined by the similarity between words and texts associated with different social information identifiers, so that it can be more accurately determined whether they belong to the same category according to the weight.
  • the determining the first weight and the second weight according to the isomorphic social graph includes: if the connection edge between at least two homogeneous nodes in the isomorphic social graph is based on the heterogeneous social
  • the label information associated with the identification of different social information in the figure is determined, and the label information associated with the identification of the first social information is determined according to the similarity between the label information associated with the identification of the second social information.
  • the first weight; the second weight is determined according to the similarity between the tag information associated with the identifier of the first social information and the tag information associated with the identifier of the third social information.
  • determining the second weight according to the similarity between the tag information associated with the identifier of the first social information and the tag information associated with the identifier of the third social information includes: according to the first social information The second weight is determined by a cosine similarity between tag information associated with the identifier of the information and tag information associated with the identifier of the third social information.
  • the weight is determined by the similarity between the tag information associated with different social information identifiers, so that it can be more accurately determined whether they belong to the same category according to the weight.
  • the determining the first weight and the second weight according to the isomorphic social graph includes: if the connection edge between at least two homogeneous nodes in the isomorphic social graph is based on the heterogeneous social The time information associated with the identification of different social information in the figure is determined, then according to the difference between the time information associated with the identification of the first social information and the time information associated with the identification of the second social information, determine The first weight: determining the second weight according to the difference between the time information associated with the identifier of the first social information and the time information associated with the identifier of the third social information.
  • the weight is determined by the similarity between the time information associated with different social information identifiers, so that it can be more accurately determined whether they belong to the same category according to the weight.
  • the loss function is determined according to the first distance between the feature vectors corresponding to the social information belonging to the same category and the second distance between the feature vectors corresponding to the social information belonging to different categories, so when using this loss function to adjust the recommendation model
  • the model parameters can make the representation of similar data more abundant, which in turn enhances the feature extraction ability of the recommendation model and improves the generalization ability of the recommendation model.
  • the model parameters of layer l when the input of the recommended model is m i
  • the model parameters of the first l- 1 layer when the input of the recommendation model is m j related; wherein, l is an integer greater than or equal to 2; m i is the first social information, m j is the second social information; or, m i is the first social information, m j is the third social information.
  • the model parameters of the l-th layer since the input of the recommended model is m i , the model parameters of the l-th layer The model parameters of the first l-1 layer when the input of the recommendation model is m j Therefore, the model parameters of different layers in the recommendation model can be associated with each other, and the information contained in the model parameters can be enriched, thereby improving the generalization ability of the recommendation model.
  • heads means that the model parameters of the first l-1 layer are connected in series towards the head direction, N(m j ) is the adjacency matrix of m j , It is used to extract the model parameters of the first l-1 layer when the input of the recommendation model is m j , It is used to aggregate the model parameters of the first l-1 layers extracted when the input of the recommendation model is m j .
  • the loss function ⁇ t satisfies the following formula:
  • m i is the first social information
  • m i+ is the second social information
  • m i- is the third social information
  • is the first distance is the second distance
  • a is the regularization parameter
  • T is the set formed by the combination of every three pieces of social information.
  • social information A and social information B belong to the same type, and in the combination, social information A and social information C is of different types.
  • FIG. 4 is a schematic flowchart of another method for adjusting model parameters provided by the embodiment of the present application. As shown in Figure 4, the method includes:
  • first social information Acquire first social information, second social information, and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories. category.
  • step 401 is the same as step 101 in FIG. 1 , and will not be repeated here.
  • step 402 reference may be made to the relevant description of step 102 in FIG. 1 , and details are not repeated here.
  • step 403 reference may be made to the relevant description of step 102 in FIG. 1 , and details are not repeated here.
  • step 404 reference may be made to the related description of step 102 in FIG. 1 , and details are not repeated here.
  • step 405 reference may be made to the relevant description of step 102 in FIG. 1 , and details are not repeated here.
  • step 406 reference may be made to the relevant description of step 102 in FIG. 1 , and details are not repeated here.
  • step 407 is the same as step 102 in FIG. 1 , and will not be repeated here.
  • step 408 is the same as step 103 in FIG. 1 , and will not be repeated here.
  • step 409 is the same as step 104 in FIG. 1 , and will not be repeated here.
  • step 410 is the same as step 105 in FIG. 1 , and will not be repeated here.
  • step 411 is the same as step 106 in FIG. 1 , and will not be repeated here.
  • the loss function is determined according to the first distance between the feature vectors corresponding to the social information belonging to the same category and the second distance between the feature vectors corresponding to the social information belonging to different categories, so when using this loss function to adjust the recommendation model
  • the model parameters can make the representation of similar data more abundant, which in turn enhances the feature extraction ability of the recommendation model and improves the generalization ability of the recommendation model.
  • the obtained isomorphic social graph is more in line with the actual situation.
  • the first weight and the second weight according to the isomorphic social graph whether different social information belongs to the same category can be determined according to the two weights, thereby improving the accuracy of category determination.
  • FIG. 5 is a schematic diagram of a model parameter adjustment device provided in an embodiment of the present application.
  • a model parameter adjustment device 500 provided in the embodiment of the present application includes an acquisition module 501, an encoding module 502, a first determination module 503, a second determination module 504, a third determination module 505 and a training module 506,
  • the obtaining module 501 is configured to obtain first social information, second social information and third social information, the first social information and the second social information belong to the same category, the first social information and the The third social information belongs to different categories;
  • the encoding module 502 is configured to encode the first social information, the second social information and the third social information respectively to obtain the first feature vector, the second feature vector and the third eigenvector;
  • the first determining module 503 is used to determine the distance between the first eigenvector and the second eigenvector to obtain the first distance;
  • the second determining module 504 uses To determine the distance between the first eigenvector and the third eigenvector to obtain a second distance;
  • the third determination module 505 is configured to obtain a second distance according to the distance between the first distance and the second distance The difference is to determine a loss function;
  • the training module 506 is configured to adjust model parameters of the recommendation model according to the loss function, so as to train the recommendation model.
  • the model parameter adjustment apparatus 500 further includes a generation module 507 and an acquisition module 501, further configured to acquire a heterogeneous social graph, where the heterogeneous social graph includes multiple heterogeneous nodes and at least A connection edge between two heterogeneous nodes, a heterogeneous node in the heterogeneous social graph includes the following items: word text, label information, user identification, time information and social information identification, and the label information is used To identify the category to which the social information belongs; the generating module 507 is configured to generate an isomorphic social graph according to the heterogeneous social graph, the isomorphic social graph includes a plurality of isomorphic nodes and at least one of the plurality of isomorphic nodes A connection edge between two isomorphic nodes, one isomorphic node in the isomorphic social graph is an identifier of social information, and the plurality of isomorphic nodes include the identifier of the first social information, the second The identification of social information and the identification of the third social
  • the model parameter adjustment device 500 also includes an extraction module 508, the acquisition module 501 is also used to acquire multiple pieces of social information within a preset time; the extraction module 508 is also used to extract each of the multiple pieces of social information Identification of word text, tag information, user ID, time information and social information contained in social information; generating module 507 is also used to generate word text, tag information, user ID, time information and social Information identification, generating the heterogeneous social graph.
  • the first determining module 503 is configured to: if the connection edge between at least two isomorphic nodes in the isomorphic social graph Determined according to the word text associated with different social information identifiers in the heterogeneous social graph, then according to the difference between the word text associated with the first social information identifier and the word text associated with the second social information identifier The first weight is determined according to the similarity between them; the second weight is determined according to the similarity between the word text associated with the identifier of the first social information and the word text associated with the identifier of the third social information .
  • the model parameters of layer l when the input of the recommended model is m i
  • the model parameters of the first l-1 layer when the input of the recommendation model is m j Relevant; wherein, l is an integer greater than or equal to 2; m i is the first social information, m j is the second social information; or, m i is the first social information, m j is the third social information.
  • heads means that the model parameters of the first l-1 layer are connected in series towards the head direction, N(m j ) is the adjacency matrix of m j , It is used to extract the model parameters of the first l-1 layer when the input of the recommendation model is m j , It is used to aggregate the model parameters of the first l-1 layers extracted when the input of the recommendation model is m j .
  • the loss function ⁇ t satisfies the following formula:
  • m i is the first social information
  • m i+ is the second social information
  • m i- is the third social information
  • is the first distance is the second distance
  • a is the regularization parameter
  • T is the set formed by the combination of every three pieces of social information.
  • social information A and social information B belong to the same type, and in the combination, social information A and social information C is of different types.
  • FIG. 6 is a schematic structural diagram of an electronic device of a hardware operating environment involved in an embodiment of the present application.
  • An embodiment of the present application provides an electronic device for model parameter adjustment, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured Executed by the processor to execute instructions comprising the steps in any one of the model parameter adjustment methods.
  • the electronic equipment of the hardware operating environment involved in the embodiment of the present application may include:
  • Processor 601 such as a CPU.
  • the storage 602 optionally, the storage may be a high-speed RAM storage, or a stable storage, such as a disk storage.
  • the communication interface 603 is configured to realize connection and communication between the processor 601 and the memory 602 .
  • FIG. 6 the structure of the electronic device shown in FIG. 6 is not limited thereto, and may include more or less components than shown in the figure, or combine some components, or arrange different components.
  • the memory 602 may include an operating system, a network communication module, and one or more programs.
  • An operating system is a program that manages and controls the hardware and software resources of a server and supports the operation of one or more programs.
  • the network communication module is used to realize the communication between various components inside the memory 602, and communicate with other hardware and software inside the electronic device.
  • the processor 601 is used to execute one or more programs in the memory 602 to implement the following steps:
  • first social information Acquiring first social information, second social information and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories;
  • the present application also provides a computer-readable storage medium, the computer-readable storage medium is used to store a computer program, and the stored computer program is executed by the processor to implement the following steps:
  • first social information Acquiring first social information, second social information and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories;
  • the computer-readable storage medium may be non-volatile or volatile.

Abstract

The present application relates to intelligent decision making, and discloses a model parameter adjustment method and apparatus, an electronic device and a storage medium. The method comprises: acquiring first social information, second social information, and third social information, the first social information and the second social information belonging to the same category, and the first social information and the third social information belonging to different categories; separately encoding the first social information, the second social information, and the third social information, to obtain a first feature vector, a second feature vector, and a third feature vector; determining a distance between the first feature vector and the second feature vector, to obtain a first distance; determining a distance between the first feature vector and the third feature vector, to obtain a second distance; determining a loss function on the basis of a difference between the first distance and the second distance; and adjusting a model parameter of a recommendation model according to the loss function, so as to train the recommendation model. By means of implementing embodiments of the present application, generalization ability of a recommendation model is improved.

Description

一种模型参数调整方法、装置、电子设备和存储介质A model parameter adjustment method, device, electronic equipment and storage medium
优先权申明priority statement
本申请要求于2021年10月22日提交中国专利局、申请号为202111231066.8,发明名称为“一种模型参数调整方法、装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202111231066.8 submitted to the China Patent Office on October 22, 2021, and the title of the invention is "A Model Parameter Adjustment Method, Device, Electronic Equipment, and Storage Medium", the entire content of which Incorporated in this application by reference.
技术领域technical field
本申请涉及人工智能领域,尤其涉及一种模型参数调整方法、装置、电子设备和存储介质。The present application relates to the field of artificial intelligence, and in particular to a model parameter adjustment method, device, electronic equipment and storage medium.
背景技术Background technique
当今社会,社交行为已经几乎完全围绕互联网进行,例如博文、社交状态、热点评论等社交信息流往往从大量社交事件中产生。一般来说,这种社交信息流具有时序性、数量大、更新快、复杂度高等特点。然而,当前阶段,在进行推荐模型的训练上往往采用社交信息进行训练,并利用训练好的推荐模型为用户推荐社交信息。因为在训练时仅机械化的将社交信息输入到推荐模型,所以在利用训练好的推荐模型为用户推荐社交信息时可能存在社交信息推荐不够精准的问题。换句话来说,该推荐模型的泛化能力差。因此,发明人意识到,如何提高推荐模型的泛化能力成为当前阶段亟待解决的技术问题。In today's society, social behavior has almost completely revolved around the Internet, such as blog posts, social status, hot comments and other social information flows are often generated from a large number of social events. Generally speaking, this social information flow has the characteristics of timing, large quantity, fast update, and high complexity. However, at the current stage, social information is often used for training the recommendation model, and the trained recommendation model is used to recommend social information for users. Because only the social information is mechanically input into the recommendation model during training, there may be a problem that the social information recommendation is not accurate enough when using the trained recommendation model to recommend social information for users. In other words, the generalization ability of this recommendation model is poor. Therefore, the inventor realizes that how to improve the generalization ability of the recommendation model has become an urgent technical problem to be solved at the current stage.
发明内容Contents of the invention
本申请实施例提供了一种模型参数调整方法、装置、电子设备和存储介质,提高了推荐模型的泛化能力。Embodiments of the present application provide a model parameter adjustment method, device, electronic device, and storage medium, which improve the generalization capability of the recommendation model.
本申请第一方面提供了一种模型参数调整方法,包括:The first aspect of the present application provides a method for adjusting model parameters, including:
获取第一社交信息、第二社交信息和第三社交信息,所述第一社交信息与所述第二社交信息属于同一类别,所述第一社交信息与所述第三社交信息属于不同类别;Acquiring first social information, second social information and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories;
对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量;Encoding the first social information, the second social information and the third social information respectively to obtain a first feature vector, a second feature vector and a third feature vector;
确定所述第一特征向量与所述第二特征向量之间的距离,得到第一距离;determining a distance between the first eigenvector and the second eigenvector to obtain a first distance;
确定所述第一特征向量与所述第三特征向量之间的距离,得到第二距离;determining a distance between the first eigenvector and the third eigenvector to obtain a second distance;
根据所述第一距离和所述第二距离之间的差值,确定损失函数;determining a loss function based on the difference between the first distance and the second distance;
根据所述损失函数调整所述推荐模型的模型参数,以对所述推荐模型进行训练。Adjusting model parameters of the recommendation model according to the loss function to train the recommendation model.
本申请第二方面提供了一种模型参数调整装置,所述装置包括获取模块、编码模块、第一确定模块、第二确定模块、第三确定模块和训练模块,The second aspect of the present application provides a model parameter adjustment device, the device includes an acquisition module, an encoding module, a first determination module, a second determination module, a third determination module and a training module,
所述获取模块,用于获取第一社交信息、第二社交信息和第三社交信息,所述第一社交信息与所述第二社交信息属于同一类别,所述第一社交信息与所述第三社交信息属于不同类别;The acquisition module is configured to acquire first social information, second social information and third social information, the first social information and the second social information belong to the same category, the first social information and the second social information 3. Social information belongs to different categories;
所述编码模块,用于对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量;The encoding module is configured to encode the first social information, the second social information and the third social information respectively to obtain a first feature vector, a second feature vector and a third feature vector;
所述第一确定模块,用于确定所述第一特征向量与所述第二特征向量之间的距离,得到第一距离;The first determination module is configured to determine a distance between the first feature vector and the second feature vector to obtain a first distance;
所述第二确定模块,用于确定所述第一特征向量与所述第三特征向量之间的距离,得到第二距离;The second determination module is configured to determine a distance between the first feature vector and the third feature vector to obtain a second distance;
所述第三确定模块,用于根据所述第一距离和所述第二距离之间的差值,确定损失函数;The third determination module is configured to determine a loss function according to the difference between the first distance and the second distance;
所述训练模块,用于根据所述损失函数调整所述推荐模型的模型参数,以对所述推荐模 型进行训练。The training module is configured to adjust model parameters of the recommendation model according to the loss function, so as to train the recommendation model.
本申请第三方面提供了一种模型参数调整的电子设备,其中,包括处理器、存储器、通信接口以及一个或多个程序,其中,所述一个或多个程序被存储在所述存储器中,并且被生成由所述处理器执行,以执行如下步骤的指令:The third aspect of the present application provides an electronic device for model parameter adjustment, which includes a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory, and are generated to be executed by the processor to perform the following steps:
获取第一社交信息、第二社交信息和第三社交信息,所述第一社交信息与所述第二社交信息属于同一类别,所述第一社交信息与所述第三社交信息属于不同类别;Acquiring first social information, second social information and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories;
对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量;Encoding the first social information, the second social information and the third social information respectively to obtain a first feature vector, a second feature vector and a third feature vector;
确定所述第一特征向量与所述第二特征向量之间的距离,得到第一距离;determining a distance between the first eigenvector and the second eigenvector to obtain a first distance;
确定所述第一特征向量与所述第三特征向量之间的距离,得到第二距离;determining a distance between the first eigenvector and the third eigenvector to obtain a second distance;
根据所述第一距离和所述第二距离之间的差值,确定损失函数;determining a loss function based on the difference between the first distance and the second distance;
根据所述损失函数调整所述推荐模型的模型参数,以对所述推荐模型进行训练。Adjusting model parameters of the recommendation model according to the loss function to train the recommendation model.
本申请第四方面提供了一种计算机可读存储介质,其中,所述计算机可读存储介质用于存储计算机程序,所述存储计算机程序被所述处理器执行,以实现如下步骤:A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the stored computer program is executed by the processor to implement the following steps:
获取第一社交信息、第二社交信息和第三社交信息,所述第一社交信息与所述第二社交信息属于同一类别,所述第一社交信息与所述第三社交信息属于不同类别;Acquiring first social information, second social information and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories;
对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量;Encoding the first social information, the second social information and the third social information respectively to obtain a first feature vector, a second feature vector and a third feature vector;
确定所述第一特征向量与所述第二特征向量之间的距离,得到第一距离;determining a distance between the first eigenvector and the second eigenvector to obtain a first distance;
确定所述第一特征向量与所述第三特征向量之间的距离,得到第二距离;determining a distance between the first eigenvector and the third eigenvector to obtain a second distance;
根据所述第一距离和所述第二距离之间的差值,确定损失函数;determining a loss function based on the difference between the first distance and the second distance;
根据所述损失函数调整所述推荐模型的模型参数,以对所述推荐模型进行训练。Adjusting model parameters of the recommendation model according to the loss function to train the recommendation model.
可以看出,上述技术方案中,通过确定属于同一类别的社交信息对应的特征向量之间的第一距离,以及确定属于不同类别的社交信息对应的特征向量之间的第二距离,进而可以根据第一距离和第二距离之间的差值,确定损失函数。因为该损失函数是根据属于同一类别的社交信息对应的特征向量之间的第一距离和属于不同类别的社交信息对应的特征向量之间的第二距离确定,所以在利用该损失函数调整推荐模型的模型参数时可以使得同类数据的表现形式更加丰富,进而使得推荐模型的特征提取能力得到增强,提高了推荐模型的泛化能力。It can be seen that in the above technical solution, by determining the first distance between the feature vectors corresponding to the social information belonging to the same category, and determining the second distance between the feature vectors corresponding to the social information belonging to different categories, and then can be based on The difference between the first distance and the second distance determines the loss function. Because the loss function is determined according to the first distance between the feature vectors corresponding to the social information belonging to the same category and the second distance between the feature vectors corresponding to the social information belonging to different categories, so when using this loss function to adjust the recommendation model The model parameters can make the representation of similar data more abundant, which in turn enhances the feature extraction ability of the recommendation model and improves the generalization ability of the recommendation model.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present application. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
其中:in:
图1是本申请实施例提供的一种模型参数调整方法的流程示意图;Fig. 1 is a schematic flow chart of a model parameter adjustment method provided by the embodiment of the present application;
图2为本申请实施例提供的一种异构社交图的示意图;FIG. 2 is a schematic diagram of a heterogeneous social graph provided by an embodiment of the present application;
图3为基于图2所示的异构社交图得到的一种同构社交图的示意图;FIG. 3 is a schematic diagram of a homogeneous social graph obtained based on the heterogeneous social graph shown in FIG. 2;
图4是本申请实施例提供的又一种模型参数调整方法的流程示意图;Fig. 4 is a schematic flowchart of another model parameter adjustment method provided by the embodiment of the present application;
图5为本申请实施例提供的一种模型参数调整装置的示意图;FIG. 5 is a schematic diagram of a model parameter adjustment device provided in an embodiment of the present application;
图6为本申请的实施例涉及的硬件运行环境的电子设备结构示意图。FIG. 6 is a schematic structural diagram of an electronic device in a hardware operating environment involved in an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例, 都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the application with reference to the drawings in the embodiments of the application. Apparently, the described embodiments are only some of the embodiments of the application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the scope of protection of this application.
以下分别进行详细说明。Each will be described in detail below.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first" and "second" in the specification and claims of the present application and the above drawings are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "include" and "have", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally further includes For other steps or units inherent in these processes, methods, products or apparatuses.
以下结合附图说明本申请实施例,可以理解的,在本申请中,执行主体可以为电子设备或云服务器,在此不做限制。其中,电子设备可以包括各种具有无线通信功能的手持设备、车载设备、可穿戴设备、计算设备或连接到无线调制解调器的其他处理设备,以及各种形式的用户设备(User Equipment,UE),移动台(Mobile Station,MS),终端设备(terminal device)等等。The following describes the embodiments of the present application with reference to the accompanying drawings. It can be understood that in the present application, the execution subject may be an electronic device or a cloud server, which is not limited here. Among them, electronic devices may include various handheld devices with wireless communication functions, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to wireless modems, as well as various forms of user equipment (User Equipment, UE), mobile Taiwan (Mobile Station, MS), terminal equipment (terminal device) and so on.
参见图1,图1是本申请实施例提供的一种模型参数调整方法的流程示意图。如图1所示,所述方法包括:Referring to FIG. 1 , FIG. 1 is a schematic flowchart of a method for adjusting model parameters provided by an embodiment of the present application. As shown in Figure 1, the method includes:
101、获取第一社交信息、第二社交信息和第三社交信息,所述第一社交信息与所述第二社交信息属于同一类别,所述第一社交信息与所述第三社交信息属于不同类别。101. Acquire first social information, second social information, and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different category.
其中,第一社交信息包括第一词文本、第一标签信息、第一命名实体、第一用户标识、第一时间信息和第一社交信息的标识。第一词文本可以包括一个或多个词文本,一个或多个词文本为除常见词和罕见词之外的词,常见词例如可以为语气助词、停用词等,罕见词可以包含在开源的数据集中或预设的词,在此不做限制。第一标签信息用于标识第一社交信息所属的话题或类别。第一用户标识为发布第一社交信息的用户的标识。第一时间信息为发布第一社交信息的时间。Wherein, the first social information includes the first word text, the first tag information, the first named entity, the first user identifier, the first time information and the identifier of the first social information. The first word text can include one or more word texts, and one or more word texts are words other than common words and rare words. Common words can be modal particles, stop words, etc., and rare words can be included in open source The words in the data set or presets are not limited here. The first tag information is used to identify a topic or category to which the first social information belongs. The first user identifier is an identifier of a user who publishes the first social information. The first time information is the time when the first social information is published.
其中,第二社交信息包括第二词文本、第二标签信息、第二命名实体、第二用户标识、第二时间信息和第二社交信息的标识。第二词文本可以包括二个或多个词文本。第二标签信息用于标识第二社交信息所属的话题或类别。第二用户标识为发布第二社交信息的用户的标识。第二时间信息为发布第二社交信息的时间。Wherein, the second social information includes the second word text, the second label information, the second named entity, the second user identifier, the second time information and the identifier of the second social information. The second word text may include two or more word texts. The second tag information is used to identify a topic or category to which the second social information belongs. The second user identifier is the identifier of the user who publishes the second social information. The second time information is the time when the second social information is published.
其中,第三社交信息包括第三词文本、第三标签信息、第三命名实体、第三用户标识、第三时间信息和第三社交信息的标识。第三词文本可以包括三个或多个词文本。第三标签信息用于标识第三社交信息所属的话题或类别。第三用户标识为发布第三社交信息的用户的标识。第三时间信息为发布第三社交信息的时间。Wherein, the third social information includes third word text, third tag information, third named entity, third user identifier, third time information, and third social information identifier. The third word text may include three or more word texts. The third tag information is used to identify a topic or category to which the third social information belongs. The third user identifier is the identifier of the user who publishes the third social information. The third time information is the time when the third social information is published.
需要说明的,在本申请中,社交信息例如可以为推文、评论等文字类信息和/或图片类信息,在此不做限制。It should be noted that in this application, social information may be, for example, text information such as tweets and comments and/or image information, which is not limited here.
另外,第一词文本根据第一社交信息进行自然语言处理得到,第二词文本根据第二社交信息进行自然语言处理得到,第三词文本根据第三社交信息进行自然语言处理得到,在此不做限制。In addition, the first word text is obtained by natural language processing according to the first social information, the second word text is obtained by natural language processing according to the second social information, and the third word text is obtained by natural language processing according to the third social information. Do limit.
102、对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量。102. Encode the first social information, the second social information, and the third social information respectively to obtain a first feature vector, a second feature vector, and a third feature vector.
可选的,在步骤102之前,所述方法还包括:获取异构社交图,所述异构社交图包括多个异构节点以及所述多个异构节点中至少两个异构节点之间的连接边,所述异构社交图中的一个异构节点包括以下一项:词文本、标签信息、用户标识、时间信息和社交信息的标识,所述标签信息用于标识社交信息所属的类别;根据所述异构社交图,生成同构社交图,所述同构社交图包括多个同构节点以及所述多个同构节点中至少两个同构节点之间的连接边,所述同构社交图中的一个同构节点为社交信息的标识,所述多个同构节点包括所述第一社交信息的标识、所述第二社交信息的标识和所述第三社交信息的标识;根据所述同构社交图,确定第一权重和第二权重,所述第一权重根据所述第一社交信息的标识与所述第二社交信息的标识之间的连接边确定,所述第二权重根据所述第一社交信息的标识与所述第三社交信息的 标识之间的连接边确定;若所述第一权重高于第一阈值,则确定所述第一社交信息与所述第二社交信息属于同一类别;若所述第二权重低于第二阈值,则确定所述第一社交信息与所述第三社交信息属于不同类别。Optionally, before step 102, the method further includes: acquiring a heterogeneous social graph, where the heterogeneous social graph includes a plurality of heterogeneous nodes and at least two heterogeneous nodes among the plurality of heterogeneous nodes A heterogeneous node in the heterogeneous social graph includes the following items: word text, label information, user identification, time information and identification of social information, and the label information is used to identify the category to which the social information belongs ; Generate an isomorphic social graph according to the heterogeneous social graph, the isomorphic social graph includes a plurality of isomorphic nodes and connection edges between at least two of the plurality of isomorphic nodes, the An isomorphic node in the isomorphic social graph is an identifier of social information, and the plurality of isomorphic nodes include the identifier of the first social information, the identifier of the second social information, and the identifier of the third social information ; According to the isomorphic social graph, determine the first weight and the second weight, the first weight is determined according to the connection edge between the identification of the first social information and the identification of the second social information, the The second weight is determined according to the connection edge between the identifier of the first social information and the identifier of the third social information; if the first weight is higher than the first threshold, determine the first social information and the third social information The second social information belongs to the same category; if the second weight is lower than a second threshold, it is determined that the first social information and the third social information belong to different categories.
其中,至少两个异构节点之间的连接边可以为同类型的至少两个异构节点之间的连接边,和/或,不同类型的至少两个异构节点之间的连接边。Wherein, the connection edge between at least two heterogeneous nodes may be a connection edge between at least two heterogeneous nodes of the same type, and/or a connection edge between at least two heterogeneous nodes of different types.
示例性的,参见图2,图2为本申请实施例提供的一种异构社交图的示意图。如图2所示,一个异构节点(社交信息的标识)可以与其他节点之间存在连接边,如,一个异构节点(社交信息的标识)可以与词文本、标签信息、用户标识、时间信息等节点之间存在连接边,一个异构节点(社交信息的标识)还可以与另一社交信息的标识之间存在连接边。可以理解的,一个异构节点(社交信息的标识)可以与词文本、标签信息、用户标识、时间信息等节点之间存在连接边,即不同类型的至少两个异构节点之间的连接边;一个异构节点(社交信息的标识)还可以与另一社交信息的标识之间存在连接边,即同类型的至少两个异构节点之间的连接边。For example, refer to FIG. 2 , which is a schematic diagram of a heterogeneous social graph provided by an embodiment of the present application. As shown in Figure 2, a heterogeneous node (identification of social information) can have connection edges with other nodes, for example, a heterogeneous node (identification of social information) can be connected with word text, label information, user identification, time There are connection edges between nodes such as information, and there may be a connection edge between a heterogeneous node (identification of social information) and an identification of another social information. It can be understood that a heterogeneous node (identification of social information) may have connection edges with nodes such as word text, label information, user identification, and time information, that is, connection edges between at least two heterogeneous nodes of different types ; There may also be a connection edge between a heterogeneous node (identification of social information) and another identification of social information, that is, a connection edge between at least two heterogeneous nodes of the same type.
其中,至少两个同构节点之间的连接边可以为同类型的至少两个同构节点之间的连接边。Wherein, the connection edge between at least two isomorphic nodes may be a connection edge between at least two isomorphic nodes of the same type.
示例性的,参见图3,图3为基于图2所示的异构社交图得到的一种同构社交图的示意图。如图3所示,三个社交信息的标识(三个同构节点)中每两个社交信息的标识(每两个同构节点)之间存在连接边,即,同类型的至少两个同构节点之间的连接边。For example, refer to FIG. 3 , which is a schematic diagram of a homogeneous social graph obtained based on the heterogeneous social graph shown in FIG. 2 . As shown in Figure 3, there is a connecting edge between every two social information identifiers (every two isomorphic nodes) among the three social information identifiers (three isomorphic nodes), that is, at least two homogeneous nodes of the same type connect edges between nodes.
其中,第一阈值可以与第二阈值相同或不同,在此不做限制。如第一阈值高于第二阈值。Wherein, the first threshold may be the same as or different from the second threshold, which is not limited here. For example, the first threshold is higher than the second threshold.
可选的,根据所述异构社交图,生成同构社交图,包括:基于异构信息网络(heterogeneous information networks,HIN)映射规则将所述异构社交图映射为同构社交图。Optionally, generating a homogeneous social graph according to the heterogeneous social graph includes: mapping the heterogeneous social graph into a homogeneous social graph based on a heterogeneous information network (heterogeneous information networks, HIN) mapping rule.
其中,HIN映射规则包括以下一项或多项:若所述异构社交图中社交信息D的标识所连接的词文本与所述异构社交图中社交信息E的标识所连接的词文本的相似度大于或等于第三阈值,则在同构社交图中将社交信息D的标识和社交信息E的标识相连;若所述异构社交图中社交信息D的标识所连接的标签信息与所述异构社交图中社交信息E的标识所连接的标签信息相同,则在同构社交图中将社交信息D的标识和社交信息E的标识相连;若所述异构社交图中社交信息D的标识所连接的用户标识与所述异构社交图中社交信息E的标识所连接的用户标识相同,则在同构社交图中将社交信息D的标识和社交信息E的标识相连;若所述异构社交图中社交信息D的标识所连接的时间信息与所述异构社交图中社交信息E的标识所连接的时间信息相同,则在同构社交图中将社交信息D的标识和社交信息E的标识相连;若所述异构社交图中社交信息D的标识所连接的时间信息与所述异构社交图中社交信息E的标识所连接的时间信息的差值小于或等于第四阈值,则在同构社交图中将社交信息D的标识和社交信息E的标识相连。Wherein, the HIN mapping rule includes one or more of the following: if the word text connected with the identifier of the social information D in the heterogeneous social graph is connected with the word text connected with the identifier of the social information E in the heterogeneous social graph If the similarity is greater than or equal to the third threshold, connect the identification of social information D and the identification of social information E in the homogeneous social graph; if the tag information connected to the identification of social information D in the heterogeneous social graph is connected to If the tag information connected to the logo of social information E in the heterogeneous social graph is the same, then the logo of social information D is connected to the logo of social information E in the homogeneous social graph; if the social information D in the heterogeneous social graph The user ID connected with the ID of is the same as the user ID connected with the ID of social information E in the heterogeneous social graph, then the ID of social information D is connected with the ID of social information E in the homogeneous social graph; if The time information connected with the logo of social information D in the heterogeneous social graph is the same as the time information connected with the logo of social information E in the heterogeneous social graph, then the logo of social information D and The identification of social information E is connected; if the difference between the time information connected with the identification of social information D in the heterogeneous social graph and the time information connected with the identification of social information E in the heterogeneous social graph is less than or equal to the first Four thresholds, connect the identification of social information D and the identification of social information E in the isomorphic social graph.
其中,第三阈值与第四阈值不同,如第三阈值大于第四阈值,或,第三阈值小于第四阈值。Wherein, the third threshold is different from the fourth threshold, for example, the third threshold is greater than the fourth threshold, or the third threshold is smaller than the fourth threshold.
可以看出,上述技术方案中,通过基于异构社交图得到同构社交图,使得获得的同构社交图更加符合实际情况。同时,通过根据同构社交图确定第一权重和第二权重,从而可以根据两个权重确定出不同社交信息是否属于同一类别,提高了类别确定的准确性。It can be seen that in the above technical solution, the isomorphic social graph is obtained based on the heterogeneous social graph, so that the obtained isomorphic social graph is more in line with the actual situation. At the same time, by determining the first weight and the second weight according to the isomorphic social graph, whether different social information belongs to the same category can be determined according to the two weights, thereby improving the accuracy of category determination.
可选的,在所述获取异构社交图之前,所述方法还包括:获取预设时间内的多条社交信息;提取所述多条社交信息中每条社交信息中包含的词文本、标签信息、用户标识、时间信息和社交信息的标识;根据每条社交信息中包含的词文本、标签信息、用户标识、时间信息和社交信息的标识,生成所述异构社交图。Optionally, before the acquisition of the heterogeneous social graph, the method further includes: acquiring multiple pieces of social information within a preset time; extracting word text and tags contained in each piece of social information among the multiple pieces of social information identification of information, user identification, time information and social information; generating the heterogeneous social graph according to the word text, tag information, user identification, time information and identification of social information contained in each piece of social information.
其中,预设时间可以由管理员设置,或配置在配置文件中,在此不做限制。Wherein, the preset time can be set by an administrator, or configured in a configuration file, which is not limited here.
其中,多条社交信息可以包含在同一社交信息块中,该社交信息块的编号在预设编号范围内,预设编码范围可以为0至t+w,t为大于或等于0且小于w的整数,w为维护推荐模型的时间窗口长度,该时间窗口长度可以由管理员设置或配置在配置文件中,在此不做限制。应理解的,在本申请中,在预设编码范围内的社交信息块其包含的社交信息未过时。Wherein, multiple pieces of social information can be included in the same social information block, the number of the social information block is within the preset number range, the preset coding range can be 0 to t+w, and t is greater than or equal to 0 and less than w Integer, w is the length of the time window for maintaining the recommendation model, which can be set by the administrator or configured in the configuration file, and there is no limit here. It should be understood that in this application, the social information contained in the social information block within the preset encoding range is not outdated.
可以理解的,在本申请中,不同社交信息块对应不同的编号,编号的大小用于表示社交信息块发生的时间先后顺序。另外,同一社交信息块中不同社交信息发生的时间可以不同或相同,即同一社交信息块中不同社交信息包含的时间信息可以不同或相同。It can be understood that in this application, different social information blocks correspond to different numbers, and the size of the numbers is used to indicate the time sequence in which the social information blocks occur. In addition, the occurrence times of different social information in the same social information block may be different or the same, that is, the time information contained in different social information in the same social information block may be different or the same.
可以看出,上述技术方案中,实现了异构社交图的生成。It can be seen that in the above technical solution, the generation of heterogeneous social graph is realized.
可选的,所述根据所述同构社交图,确定第一权重和第二权重,包括:若所述同构社交图中至少两个同构节点之间的连接边根据所述异构社交图中不同社交信息的标识所关联的词文本确定,则根据所述第一社交信息的标识所关联的词文本与所述第二社交信息的标识所关联的词文本之间的相似度确定所述第一权重;根据所述第一社交信息的标识所关联的词文本与所述第三社交信息的标识所关联的词文本之间的相似度确定所述第二权重。Optionally, the determining the first weight and the second weight according to the isomorphic social graph includes: if the connection edge between at least two homogeneous nodes in the isomorphic social graph is based on the heterogeneous social The word text associated with the identification of different social information in the figure is determined, and the word text associated with the identification of the first social information is determined according to the similarity between the word text associated with the identification of the second social information. The first weight; the second weight is determined according to the similarity between the word text associated with the identifier of the first social information and the word text associated with the identifier of the third social information.
其中,根据所述第一社交信息的标识所关联的词文本与所述第二社交信息的标识所关联的词文本之间的相似度确定所述第一权重,可以包括:根据所述第一社交信息的标识所关联的词文本与所述第二社交信息的标识所关联的词文本之间的余弦相似度确定所述第一权重。Wherein, determining the first weight according to the similarity between the word text associated with the identifier of the first social information and the word text associated with the identifier of the second social information may include: according to the first The first weight is determined by a cosine similarity between the word text associated with the identifier of the social information and the word text associated with the identifier of the second social information.
其中,根据所述第一社交信息的标识所关联的词文本与所述第三社交信息的标识所关联的词文本之间的相似度确定所述第二权重,包括:根据所述第一社交信息的标识所关联的词文本与所述第三社交信息的标识所关联的词文本之间的余弦相似度确定所述第二权重。Wherein, determining the second weight according to the similarity between the word text associated with the identifier of the first social information and the word text associated with the identifier of the third social information includes: according to the first social information The second weight is determined by a cosine similarity between the word text associated with the identifier of the information and the word text associated with the identifier of the third social information.
可以看出,上述技术方案中,通过不同社交信息的标识所关联的词文本之间的相似度确定权重,使得在根据权重确定是否属于同一类别时可以更加精准。It can be seen that in the above technical solution, the weight is determined by the similarity between words and texts associated with different social information identifiers, so that it can be more accurately determined whether they belong to the same category according to the weight.
可选的,所述根据所述同构社交图,确定第一权重和第二权重,包括:若所述同构社交图中至少两个同构节点之间的连接边根据所述异构社交图中不同社交信息的标识所关联的标签信息确定,则根据所述第一社交信息的标识所关联的标签信息与所述第二社交信息的标识所关联的标签信息之间的相似度确定所述第一权重;根据所述第一社交信息的标识所关联的标签信息与所述第三社交信息的标识所关联的标签信息之间的相似度确定所述第二权重。Optionally, the determining the first weight and the second weight according to the isomorphic social graph includes: if the connection edge between at least two homogeneous nodes in the isomorphic social graph is based on the heterogeneous social The label information associated with the identification of different social information in the figure is determined, and the label information associated with the identification of the first social information is determined according to the similarity between the label information associated with the identification of the second social information. The first weight; the second weight is determined according to the similarity between the tag information associated with the identifier of the first social information and the tag information associated with the identifier of the third social information.
其中,根据所述第一社交信息的标识所关联的标签信息与所述第三社交信息的标识所关联的标签信息之间的相似度确定所述第二权重,包括:根据所述第一社交信息的标识所关联的标签信息与所述第三社交信息的标识所关联的标签信息之间的余弦相似度确定所述第二权重。Wherein, determining the second weight according to the similarity between the tag information associated with the identifier of the first social information and the tag information associated with the identifier of the third social information includes: according to the first social information The second weight is determined by a cosine similarity between tag information associated with the identifier of the information and tag information associated with the identifier of the third social information.
可以看出,上述技术方案中,通过不同社交信息的标识所关联的标签信息之间的相似度确定权重,使得在根据权重确定是否属于同一类别时可以更加精准。It can be seen that in the above technical solution, the weight is determined by the similarity between the tag information associated with different social information identifiers, so that it can be more accurately determined whether they belong to the same category according to the weight.
可选的,所述根据所述同构社交图,确定第一权重和第二权重,包括:若所述同构社交图中至少两个同构节点之间的连接边根据所述异构社交图中不同社交信息的标识所关联的时间信息确定,则根据所述第一社交信息的标识所关联的时间信息与所述第二社交信息的标识所关联的时间信息之间的差值,确定所述第一权重;根据所述第一社交信息的标识所关联的时间信息与所述第三社交信息的标识所关联的时间信息之间的差值确定所述第二权重。Optionally, the determining the first weight and the second weight according to the isomorphic social graph includes: if the connection edge between at least two homogeneous nodes in the isomorphic social graph is based on the heterogeneous social The time information associated with the identification of different social information in the figure is determined, then according to the difference between the time information associated with the identification of the first social information and the time information associated with the identification of the second social information, determine The first weight: determining the second weight according to the difference between the time information associated with the identifier of the first social information and the time information associated with the identifier of the third social information.
可以看出,上述技术方案中,通过不同社交信息的标识所关联的时间信息之间的相似度确定权重,使得在根据权重确定是否属于同一类别时可以更加精准。It can be seen that in the above technical solution, the weight is determined by the similarity between the time information associated with different social information identifiers, so that it can be more accurately determined whether they belong to the same category according to the weight.
103、确定所述第一特征向量与所述第二特征向量之间的距离,得到第一距离。103. Determine a distance between the first feature vector and the second feature vector to obtain a first distance.
104、确定所述第一特征向量与所述第三特征向量之间的距离,得到第二距离。104. Determine a distance between the first eigenvector and the third eigenvector to obtain a second distance.
105、根据所述第一距离和所述第二距离之间的差值,确定损失函数。105. Determine a loss function according to the difference between the first distance and the second distance.
106、根据所述损失函数调整所述推荐模型的模型参数,以对所述推荐模型进行训练。106. Adjust model parameters of the recommendation model according to the loss function, so as to train the recommendation model.
可以看出,上述技术方案中,通过确定属于同一类别的社交信息对应的特征向量之间的第一距离,以及确定属于不同类别的社交信息对应的特征向量之间的第二距离,进而可以根据第一距离和第二距离之间的差值,确定损失函数。因为该损失函数是根据属于同一类别的社交信息对应的特征向量之间的第一距离和属于不同类别的社交信息对应的特征向量之间的第二距离确定,所以在利用该损失函数调整推荐模型的模型参数时可以使得同类数据的表现形式更加丰富,进而使得推荐模型的特征提取能力得到增强,提高了推荐模型的泛化能力。It can be seen that in the above technical solution, by determining the first distance between the feature vectors corresponding to the social information belonging to the same category, and determining the second distance between the feature vectors corresponding to the social information belonging to different categories, and then can be based on The difference between the first distance and the second distance determines the loss function. Because the loss function is determined according to the first distance between the feature vectors corresponding to the social information belonging to the same category and the second distance between the feature vectors corresponding to the social information belonging to different categories, so when using this loss function to adjust the recommendation model The model parameters can make the representation of similar data more abundant, which in turn enhances the feature extraction ability of the recommendation model and improves the generalization ability of the recommendation model.
可选的,推荐模型的输入为m i时第l层的模型参数
Figure PCTCN2022090461-appb-000001
与所述推荐模型的输入为m j时前l- 1层的模型参数
Figure PCTCN2022090461-appb-000002
有关;其中,l为大于或等于2的整数;m i为第一社交信息,m j为第二社交信息;或,m i为第一社交信息,m j为第三社交信息。
Optionally, the model parameters of layer l when the input of the recommended model is m i
Figure PCTCN2022090461-appb-000001
The model parameters of the first l- 1 layer when the input of the recommendation model is m j
Figure PCTCN2022090461-appb-000002
related; wherein, l is an integer greater than or equal to 2; m i is the first social information, m j is the second social information; or, m i is the first social information, m j is the third social information.
可以看出,上述技术方案中,因为推荐模型的输入为m i时第l层的模型参数
Figure PCTCN2022090461-appb-000003
与所述推荐模型的输入为m j时前l-1层的模型参数
Figure PCTCN2022090461-appb-000004
有关,所以可以使得推荐模型中不同层的模型参数之间有关联关系,进而可以使得模型参数包含的信息更加丰富,进而提高了推荐模型的泛化能力。
It can be seen that in the above technical solution, since the input of the recommended model is m i , the model parameters of the l-th layer
Figure PCTCN2022090461-appb-000003
The model parameters of the first l-1 layer when the input of the recommendation model is m j
Figure PCTCN2022090461-appb-000004
Therefore, the model parameters of different layers in the recommendation model can be associated with each other, and the information contained in the model parameters can be enriched, thereby improving the generalization ability of the recommendation model.
可选的,
Figure PCTCN2022090461-appb-000005
满足以下公式:
optional,
Figure PCTCN2022090461-appb-000005
satisfy the following formula:
Figure PCTCN2022090461-appb-000006
Figure PCTCN2022090461-appb-000006
其中,heads表示前l-1层的模型参数往头部方向串联,N(m j)为m j的邻接矩阵,
Figure PCTCN2022090461-appb-000007
用于在所述推荐模型的输入为m j时提取前l-1层的模型参数,
Figure PCTCN2022090461-appb-000008
用于聚合在所述推荐模型的输入为m j时所提取前l-1层的模型参数。
Among them, heads means that the model parameters of the first l-1 layer are connected in series towards the head direction, N(m j ) is the adjacency matrix of m j ,
Figure PCTCN2022090461-appb-000007
It is used to extract the model parameters of the first l-1 layer when the input of the recommendation model is m j ,
Figure PCTCN2022090461-appb-000008
It is used to aggregate the model parameters of the first l-1 layers extracted when the input of the recommendation model is m j .
可选的,损失函数ζ t满足以下公式: Optionally, the loss function ζ t satisfies the following formula:
Figure PCTCN2022090461-appb-000009
Figure PCTCN2022090461-appb-000009
其中,m i为第一社交信息,m i+为第二社交信息,m i-为第三社交信息,
Figure PCTCN2022090461-appb-000010
为第一距离,
Figure PCTCN2022090461-appb-000011
为第二距离,a为正则化参数,T为每三条社交信息构成的组合所形成的集合,所述组合中社交信息A与社交信息B属于同一类型,所述组合中社交信息A与社交信息C属于不同类型。
Among them, m i is the first social information, m i+ is the second social information, m i- is the third social information,
Figure PCTCN2022090461-appb-000010
is the first distance,
Figure PCTCN2022090461-appb-000011
is the second distance, a is the regularization parameter, and T is the set formed by the combination of every three pieces of social information. In the combination, social information A and social information B belong to the same type, and in the combination, social information A and social information C is of different types.
参见图4,图4是本申请实施例提供的又一种模型参数调整方法的流程示意图。如图4所示,所述方法包括:Referring to FIG. 4 , FIG. 4 is a schematic flowchart of another method for adjusting model parameters provided by the embodiment of the present application. As shown in Figure 4, the method includes:
401、获取第一社交信息、第二社交信息和第三社交信息,所述第一社交信息与所述第二社交信息属于同一类别,所述第一社交信息与所述第三社交信息属于不同类别。401. Acquire first social information, second social information, and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories. category.
其中,步骤401与图1中步骤101相同,在此不加赘述。Wherein, step 401 is the same as step 101 in FIG. 1 , and will not be repeated here.
402、获取异构社交图。402. Obtain a heterogeneous social graph.
其中,步骤402可以参考图1中步骤102相关描述,在此不加赘述。Wherein, for step 402, reference may be made to the relevant description of step 102 in FIG. 1 , and details are not repeated here.
403、根据所述异构社交图,生成同构社交图。403. Generate a homogeneous social graph according to the heterogeneous social graph.
其中,步骤403可以参考图1中步骤102相关描述,在此不加赘述。Wherein, for step 403, reference may be made to the relevant description of step 102 in FIG. 1 , and details are not repeated here.
404、根据所述同构社交图,确定第一权重和第二权重。404. Determine a first weight and a second weight according to the isomorphic social graph.
其中,步骤404可以参考图1中步骤102相关描述,在此不加赘述。Wherein, for step 404, reference may be made to the related description of step 102 in FIG. 1 , and details are not repeated here.
405、若所述第一权重高于第一阈值,则确定所述第一社交信息与所述第二社交信息属于同一类别。405. If the first weight is higher than a first threshold, determine that the first social information and the second social information belong to the same category.
其中,步骤405可以参考图1中步骤102相关描述,在此不加赘述。Wherein, for step 405, reference may be made to the relevant description of step 102 in FIG. 1 , and details are not repeated here.
406、若所述第二权重低于第二阈值,则确定所述第一社交信息与所述第三社交信息属于不同类别。406. If the second weight is lower than a second threshold, determine that the first social information and the third social information belong to different categories.
其中,步骤406可以参考图1中步骤102相关描述,在此不加赘述。Wherein, for step 406, reference may be made to the relevant description of step 102 in FIG. 1 , and details are not repeated here.
407、对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量。407. Encode the first social information, the second social information, and the third social information respectively to obtain a first feature vector, a second feature vector, and a third feature vector.
其中,步骤407与图1中步骤102相同,在此不加赘述。Wherein, step 407 is the same as step 102 in FIG. 1 , and will not be repeated here.
408、确定所述第一特征向量与所述第二特征向量之间的距离,得到第一距离。408. Determine a distance between the first feature vector and the second feature vector to obtain a first distance.
其中,步骤408与图1中步骤103相同,在此不加赘述。Wherein, step 408 is the same as step 103 in FIG. 1 , and will not be repeated here.
409、确定所述第一特征向量与所述第三特征向量之间的距离,得到第二距离。409. Determine a distance between the first feature vector and the third feature vector to obtain a second distance.
其中,步骤409与图1中步骤104相同,在此不加赘述。Wherein, step 409 is the same as step 104 in FIG. 1 , and will not be repeated here.
410、根据所述第一距离和所述第二距离之间的差值,确定损失函数。410. Determine a loss function according to the difference between the first distance and the second distance.
其中,步骤410与图1中步骤105相同,在此不加赘述。Wherein, step 410 is the same as step 105 in FIG. 1 , and will not be repeated here.
411、根据所述损失函数调整所述推荐模型的模型参数,以对所述推荐模型进行训练。411. Adjust model parameters of the recommendation model according to the loss function, so as to train the recommendation model.
其中,步骤411与图1中步骤106相同,在此不加赘述。Wherein, step 411 is the same as step 106 in FIG. 1 , and will not be repeated here.
可以看出,上述技术方案中,通过确定属于同一类别的社交信息对应的特征向量之间的第一距离,以及确定属于不同类别的社交信息对应的特征向量之间的第二距离,进而可以根据第一距离和第二距离之间的差值,确定损失函数。因为该损失函数是根据属于同一类别的社交信息对应的特征向量之间的第一距离和属于不同类别的社交信息对应的特征向量之间的第二距离确定,所以在利用该损失函数调整推荐模型的模型参数时可以使得同类数据的表现形式更加丰富,进而使得推荐模型的特征提取能力得到增强,提高了推荐模型的泛化能力。同时,通过基于异构社交图得到同构社交图,使得获得的同构社交图更加符合实际情况。同时,通过根据同构社交图确定第一权重和第二权重,从而可以根据两个权重确定出不同社交信息是否属于同一类别,提高了类别确定的准确性。It can be seen that in the above technical solution, by determining the first distance between the feature vectors corresponding to the social information belonging to the same category, and determining the second distance between the feature vectors corresponding to the social information belonging to different categories, and then can be based on The difference between the first distance and the second distance determines the loss function. Because the loss function is determined according to the first distance between the feature vectors corresponding to the social information belonging to the same category and the second distance between the feature vectors corresponding to the social information belonging to different categories, so when using this loss function to adjust the recommendation model The model parameters can make the representation of similar data more abundant, which in turn enhances the feature extraction ability of the recommendation model and improves the generalization ability of the recommendation model. At the same time, by obtaining the isomorphic social graph based on the heterogeneous social graph, the obtained isomorphic social graph is more in line with the actual situation. At the same time, by determining the first weight and the second weight according to the isomorphic social graph, whether different social information belongs to the same category can be determined according to the two weights, thereby improving the accuracy of category determination.
参见图5,图5为本申请实施例提供的一种模型参数调整装置的示意图。其中,如图5所示,本申请实施例提供的一种模型参数调整装置500包括获取模块501、编码模块502、第一确定模块503、第二确定模块504、第三确定模块505和训练模块506,Referring to FIG. 5 , FIG. 5 is a schematic diagram of a model parameter adjustment device provided in an embodiment of the present application. Wherein, as shown in FIG. 5 , a model parameter adjustment device 500 provided in the embodiment of the present application includes an acquisition module 501, an encoding module 502, a first determination module 503, a second determination module 504, a third determination module 505 and a training module 506,
所述获取模块501,用于获取第一社交信息、第二社交信息和第三社交信息,所述第一社交信息与所述第二社交信息属于同一类别,所述第一社交信息与所述第三社交信息属于不同类别;所述编码模块502,用于对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量;所述第一确定模块503,用于确定所述第一特征向量与所述第二特征向量之间的距离,得到第一距离;所述第二确定模块504,用于确定所述第一特征向量与所述第三特征向量之间的距离,得到第二距离;所述第三确定模块505,用于根据所述第一距离和所述第二距离之间的差值,确定损失函数;所述训练模块506,用于根据所述损失函数调整所述推荐模型的模型参数,以对所述推荐模型进行训练。The obtaining module 501 is configured to obtain first social information, second social information and third social information, the first social information and the second social information belong to the same category, the first social information and the The third social information belongs to different categories; the encoding module 502 is configured to encode the first social information, the second social information and the third social information respectively to obtain the first feature vector, the second feature vector and the third eigenvector; the first determining module 503 is used to determine the distance between the first eigenvector and the second eigenvector to obtain the first distance; the second determining module 504 uses To determine the distance between the first eigenvector and the third eigenvector to obtain a second distance; the third determination module 505 is configured to obtain a second distance according to the distance between the first distance and the second distance The difference is to determine a loss function; the training module 506 is configured to adjust model parameters of the recommendation model according to the loss function, so as to train the recommendation model.
可选的,模型参数调整装置500还包括生成模块507,获取模块501,还用于获取异构社交图,所述异构社交图包括多个异构节点以及所述多个异构节点中至少两个异构节点之间的连接边,所述异构社交图中的一个异构节点包括以下一项:词文本、标签信息、用户标识、时间信息和社交信息的标识,所述标签信息用于标识社交信息所属的类别;生成模块507,用于根据所述异构社交图,生成同构社交图,所述同构社交图包括多个同构节点以及所述多个同构节点中至少两个同构节点之间的连接边,所述同构社交图中的一个同构节点为社交信息的标识,所述多个同构节点包括所述第一社交信息的标识、所述第二社交信息的标识和所述第三社交信息的标识;第一确定模块503,还用于根据所述同构社交图,确定第一权重和第二权重,所述第一权重根据所述第一社交信息的标识与所述第二社交信息的标识之间的连接边确定,所述第二权重根据所述第一社交信息的标识与所述第三社交信息的标识之间的连接边确定;第一确定模块503,还用于若所述第一权重高于第一阈值,则确定所述第一社交信息与所述第二社交信息属于同一类别;第一确定模块503,还用于若所述第二权重低于第二阈值,则确定所述第一社交信息与所述第三社交信息属于不同类别。Optionally, the model parameter adjustment apparatus 500 further includes a generation module 507 and an acquisition module 501, further configured to acquire a heterogeneous social graph, where the heterogeneous social graph includes multiple heterogeneous nodes and at least A connection edge between two heterogeneous nodes, a heterogeneous node in the heterogeneous social graph includes the following items: word text, label information, user identification, time information and social information identification, and the label information is used To identify the category to which the social information belongs; the generating module 507 is configured to generate an isomorphic social graph according to the heterogeneous social graph, the isomorphic social graph includes a plurality of isomorphic nodes and at least one of the plurality of isomorphic nodes A connection edge between two isomorphic nodes, one isomorphic node in the isomorphic social graph is an identifier of social information, and the plurality of isomorphic nodes include the identifier of the first social information, the second The identification of social information and the identification of the third social information; the first determination module 503 is further configured to determine a first weight and a second weight according to the isomorphic social graph, and the first weight is based on the first A connection edge between the identifier of the social information and the identifier of the second social information is determined, and the second weight is determined according to a connection edge between the identifier of the first social information and the identifier of the third social information; The first determining module 503 is further configured to determine that the first social information and the second social information belong to the same category if the first weight is higher than the first threshold; the first determining module 503 is further configured to determine if If the second weight is lower than a second threshold, it is determined that the first social information and the third social information belong to different categories.
可选的,模型参数调整装置500还包括提取模块508,获取模块501,还用于获取预设时间内的多条社交信息;提取模块508,还用于提取所述多条社交信息中每条社交信息中包含的词文本、标签信息、用户标识、时间信息和社交信息的标识;生成模块507,还用于根据每条社交信息中包含的词文本、标签信息、用户标识、时间信息和社交信息的标识,生成所述异构社交图。Optionally, the model parameter adjustment device 500 also includes an extraction module 508, the acquisition module 501 is also used to acquire multiple pieces of social information within a preset time; the extraction module 508 is also used to extract each of the multiple pieces of social information Identification of word text, tag information, user ID, time information and social information contained in social information; generating module 507 is also used to generate word text, tag information, user ID, time information and social Information identification, generating the heterogeneous social graph.
可选的,在根据所述同构社交图,确定第一权重和第二权重时,第一确定模块503,用于若所述同构社交图中至少两个同构节点之间的连接边根据所述异构社交图中不同社交信息的标识所关联的词文本确定,则根据所述第一社交信息的标识所关联的词文本与所述第二社交信息的标识所关联的词文本之间的相似度确定所述第一权重;根据所述第一社交信息的标 识所关联的词文本与所述第三社交信息的标识所关联的词文本之间的相似度确定所述第二权重。Optionally, when determining the first weight and the second weight according to the isomorphic social graph, the first determining module 503 is configured to: if the connection edge between at least two isomorphic nodes in the isomorphic social graph Determined according to the word text associated with different social information identifiers in the heterogeneous social graph, then according to the difference between the word text associated with the first social information identifier and the word text associated with the second social information identifier The first weight is determined according to the similarity between them; the second weight is determined according to the similarity between the word text associated with the identifier of the first social information and the word text associated with the identifier of the third social information .
可选的,推荐模型的输入为m i时第l层的模型参数
Figure PCTCN2022090461-appb-000012
与所述推荐模型的输入为m j时前l-1层的模型参数
Figure PCTCN2022090461-appb-000013
有关;其中,l为大于或等于2的整数;m i为第一社交信息,m j为第二社交信息;或,m i为第一社交信息,m j为第三社交信息。
Optionally, the model parameters of layer l when the input of the recommended model is m i
Figure PCTCN2022090461-appb-000012
The model parameters of the first l-1 layer when the input of the recommendation model is m j
Figure PCTCN2022090461-appb-000013
Relevant; wherein, l is an integer greater than or equal to 2; m i is the first social information, m j is the second social information; or, m i is the first social information, m j is the third social information.
可选的,
Figure PCTCN2022090461-appb-000014
满足以下公式:
optional,
Figure PCTCN2022090461-appb-000014
satisfy the following formula:
Figure PCTCN2022090461-appb-000015
Figure PCTCN2022090461-appb-000015
其中,heads表示前l-1层的模型参数往头部方向串联,N(m j)为m j的邻接矩阵,
Figure PCTCN2022090461-appb-000016
用于在所述推荐模型的输入为m j时提取前l-1层的模型参数,
Figure PCTCN2022090461-appb-000017
用于聚合在所述推荐模型的输入为m j时所提取前l-1层的模型参数。
Among them, heads means that the model parameters of the first l-1 layer are connected in series towards the head direction, N(m j ) is the adjacency matrix of m j ,
Figure PCTCN2022090461-appb-000016
It is used to extract the model parameters of the first l-1 layer when the input of the recommendation model is m j ,
Figure PCTCN2022090461-appb-000017
It is used to aggregate the model parameters of the first l-1 layers extracted when the input of the recommendation model is m j .
可选的,损失函数ζ t满足以下公式: Optionally, the loss function ζ t satisfies the following formula:
Figure PCTCN2022090461-appb-000018
Figure PCTCN2022090461-appb-000018
其中,m i为第一社交信息,m i+为第二社交信息,m i-为第三社交信息,
Figure PCTCN2022090461-appb-000019
为第一距离,
Figure PCTCN2022090461-appb-000020
为第二距离,a为正则化参数,T为每三条社交信息构成的组合所形成的集合,所述组合中社交信息A与社交信息B属于同一类型,所述组合中社交信息A与社交信息C属于不同类型。
Among them, m i is the first social information, m i+ is the second social information, m i- is the third social information,
Figure PCTCN2022090461-appb-000019
is the first distance,
Figure PCTCN2022090461-appb-000020
is the second distance, a is the regularization parameter, and T is the set formed by the combination of every three pieces of social information. In the combination, social information A and social information B belong to the same type, and in the combination, social information A and social information C is of different types.
参见图6,图6为本申请的实施例涉及的硬件运行环境的电子设备结构示意图。Referring to FIG. 6 , FIG. 6 is a schematic structural diagram of an electronic device of a hardware operating environment involved in an embodiment of the present application.
本申请实施例提供了一种模型参数调整的电子设备,包括处理器、存储器、通信接口以及一个或多个程序,其中,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,以执行包括任一项模型参数调整方法中的步骤的指令。其中,如图6所示,本申请的实施例涉及的硬件运行环境的电子设备可以包括:An embodiment of the present application provides an electronic device for model parameter adjustment, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured Executed by the processor to execute instructions comprising the steps in any one of the model parameter adjustment methods. Wherein, as shown in FIG. 6, the electronic equipment of the hardware operating environment involved in the embodiment of the present application may include:
处理器601,例如CPU。 Processor 601, such as a CPU.
存储器602,可选的,存储器可以为高速RAM存储器,也可以是稳定的存储器,例如磁盘存储器。The storage 602, optionally, the storage may be a high-speed RAM storage, or a stable storage, such as a disk storage.
通信接口603,用于实现处理器601和存储器602之间的连接通信。The communication interface 603 is configured to realize connection and communication between the processor 601 and the memory 602 .
本领域技术人员可以理解,图6中示出的电子设备的结构并不构成对其的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the structure of the electronic device shown in FIG. 6 is not limited thereto, and may include more or less components than shown in the figure, or combine some components, or arrange different components.
如图6所示,存储器602中可以包括操作系统、网络通信模块以及一个或多个程序。操作系统是管理和控制服务器硬件和软件资源的程序,支持一个或多个程序的运行。网络通信模块用于实现存储器602内部各组件之间的通信,以及与电子设备内部其他硬件和软件之间通信。As shown in FIG. 6 , the memory 602 may include an operating system, a network communication module, and one or more programs. An operating system is a program that manages and controls the hardware and software resources of a server and supports the operation of one or more programs. The network communication module is used to realize the communication between various components inside the memory 602, and communicate with other hardware and software inside the electronic device.
在图6所示的电子设备中,处理器601用于执行存储器602中一个或多个程序,实现以下步骤:In the electronic device shown in FIG. 6 , the processor 601 is used to execute one or more programs in the memory 602 to implement the following steps:
获取第一社交信息、第二社交信息和第三社交信息,所述第一社交信息与所述第二社交信息属于同一类别,所述第一社交信息与所述第三社交信息属于不同类别;Acquiring first social information, second social information and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories;
对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量;Encoding the first social information, the second social information and the third social information respectively to obtain a first feature vector, a second feature vector and a third feature vector;
确定所述第一特征向量与所述第二特征向量之间的距离,得到第一距离;determining a distance between the first eigenvector and the second eigenvector to obtain a first distance;
确定所述第一特征向量与所述第三特征向量之间的距离,得到第二距离;determining a distance between the first eigenvector and the third eigenvector to obtain a second distance;
根据所述第一距离和所述第二距离之间的差值,确定损失函数;determining a loss function based on the difference between the first distance and the second distance;
根据所述损失函数调整所述推荐模型的模型参数,以对所述推荐模型进行训练。Adjusting model parameters of the recommendation model according to the loss function to train the recommendation model.
本申请涉及的电子设备的具体实施可参见上述模型参数调整方法的各实施例,在此不做赘述。For the specific implementation of the electronic device involved in the present application, reference may be made to the various embodiments of the above-mentioned model parameter adjustment method, which will not be repeated here.
本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质用于存储计算机程序,所述存储计算机程序被所述处理器执行,以实现以下步骤:The present application also provides a computer-readable storage medium, the computer-readable storage medium is used to store a computer program, and the stored computer program is executed by the processor to implement the following steps:
获取第一社交信息、第二社交信息和第三社交信息,所述第一社交信息与所述第二社交信息属于同一类别,所述第一社交信息与所述第三社交信息属于不同类别;Acquiring first social information, second social information and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories;
对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量;Encoding the first social information, the second social information and the third social information respectively to obtain a first feature vector, a second feature vector and a third feature vector;
确定所述第一特征向量与所述第二特征向量之间的距离,得到第一距离;determining a distance between the first eigenvector and the second eigenvector to obtain a first distance;
确定所述第一特征向量与所述第三特征向量之间的距离,得到第二距离;determining a distance between the first eigenvector and the third eigenvector to obtain a second distance;
根据所述第一距离和所述第二距离之间的差值,确定损失函数;determining a loss function based on the difference between the first distance and the second distance;
根据所述损失函数调整所述推荐模型的模型参数,以对所述推荐模型进行训练。Adjusting model parameters of the recommendation model according to the loss function to train the recommendation model.
本申请涉及的计算机可读存储介质的具体实施可参见上述模型参数调整方法的各实施例,在此不做赘述。所述计算机可读存储介质可以是非易失性,也可以是易失性。For the specific implementation of the computer-readable storage medium involved in the present application, reference may be made to the various embodiments of the above-mentioned model parameter adjustment method, and details are not repeated here. The computer-readable storage medium may be non-volatile or volatile.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应所述知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应所述知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. limitations, as certain steps may be performed in other orders or simultaneously depending on the application. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions and modules involved are not necessarily required by this application.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still understand the foregoing The technical solutions described in each embodiment are modified, or some of the technical features are replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the various embodiments of the application.

Claims (20)

  1. 一种模型参数调整方法,其中,包括:A method for adjusting model parameters, including:
    获取第一社交信息、第二社交信息和第三社交信息,所述第一社交信息与所述第二社交信息属于同一类别,所述第一社交信息与所述第三社交信息属于不同类别;Acquiring first social information, second social information and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories;
    对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量;Encoding the first social information, the second social information and the third social information respectively to obtain a first feature vector, a second feature vector and a third feature vector;
    确定所述第一特征向量与所述第二特征向量之间的距离,得到第一距离;determining a distance between the first eigenvector and the second eigenvector to obtain a first distance;
    确定所述第一特征向量与所述第三特征向量之间的距离,得到第二距离;determining a distance between the first eigenvector and the third eigenvector to obtain a second distance;
    根据所述第一距离和所述第二距离之间的差值,确定损失函数;determining a loss function based on the difference between the first distance and the second distance;
    根据所述损失函数调整所述推荐模型的模型参数,以对所述推荐模型进行训练。Adjusting model parameters of the recommendation model according to the loss function to train the recommendation model.
  2. 根据权利要求1所述的方法,其中,在所述对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量之前,所述方法还包括:The method according to claim 1, wherein, in the encoding of the first social information, the second social information and the third social information respectively, the first feature vector, the second feature vector and the Before the third eigenvector, the method also includes:
    获取异构社交图,所述异构社交图包括多个异构节点以及所述多个异构节点中至少两个异构节点之间的连接边,所述异构社交图中的一个异构节点包括以下一项:词文本、标签信息、用户标识、时间信息和社交信息的标识,所述标签信息用于标识社交信息所属的类别;Obtain a heterogeneous social graph, the heterogeneous social graph includes a plurality of heterogeneous nodes and connection edges between at least two heterogeneous nodes in the plurality of heterogeneous nodes, one heterogeneous social graph in the heterogeneous social graph The node includes the following items: word text, label information, user identification, time information and identification of social information, and the label information is used to identify the category to which the social information belongs;
    根据所述异构社交图,生成同构社交图,所述同构社交图包括多个同构节点以及所述多个同构节点中至少两个同构节点之间的连接边,所述同构社交图中的一个同构节点为社交信息的标识,所述多个同构节点包括所述第一社交信息的标识、所述第二社交信息的标识和所述第三社交信息的标识;Generate an isomorphic social graph according to the heterogeneous social graph, the isomorphic social graph includes a plurality of isomorphic nodes and connection edges between at least two isomorphic nodes among the plurality of isomorphic nodes, the homogeneous social graph includes An isomorphic node in the structural social graph is an identifier of social information, and the plurality of isomorphic nodes include an identifier of the first social information, an identifier of the second social information, and an identifier of the third social information;
    根据所述同构社交图,确定第一权重和第二权重,所述第一权重根据所述第一社交信息的标识与所述第二社交信息的标识之间的连接边确定,所述第二权重根据所述第一社交信息的标识与所述第三社交信息的标识之间的连接边确定;According to the isomorphic social graph, determine a first weight and a second weight, the first weight is determined according to a connection edge between the identifier of the first social information and the identifier of the second social information, and the first weight is determined according to the connection edge between the identifier of the first social information and the identifier of the second social information The second weight is determined according to the connecting edge between the identifier of the first social information and the identifier of the third social information;
    若所述第一权重高于第一阈值,则确定所述第一社交信息与所述第二社交信息属于同一类别;If the first weight is higher than a first threshold, then determining that the first social information and the second social information belong to the same category;
    若所述第二权重低于第二阈值,则确定所述第一社交信息与所述第三社交信息属于不同类别。If the second weight is lower than a second threshold, it is determined that the first social information and the third social information belong to different categories.
  3. 根据权利要求2所述的方法,其中,在所述获取异构社交图之前,所述方法还包括:The method according to claim 2, wherein, before said acquiring the heterogeneous social graph, said method further comprises:
    获取预设时间内的多条社交信息;Obtain multiple pieces of social information within a preset time;
    提取所述多条社交信息中每条社交信息中包含的词文本、标签信息、用户标识、时间信息和社交信息的标识;Extracting the word text, label information, user identification, time information and social information identification contained in each social information in the plurality of social information;
    根据每条社交信息中包含的词文本、标签信息、用户标识、时间信息和社交信息的标识,生成所述异构社交图。The heterogeneous social graph is generated according to the word text, label information, user identification, time information and identification of social information contained in each piece of social information.
  4. 根据权利要求2所述的方法,其中,所述根据所述同构社交图,确定第一权重和第二权重,包括:The method according to claim 2, wherein said determining the first weight and the second weight according to the isomorphic social graph comprises:
    若所述同构社交图中至少两个同构节点之间的连接边根据所述异构社交图中不同社交信息的标识所关联的词文本确定,则根据所述第一社交信息的标识所关联的词文本与所述第二社交信息的标识所关联的词文本之间的相似度确定所述第一权重;If the connection edge between at least two isomorphic nodes in the homogeneous social graph is determined according to the word text associated with the identifiers of different social information in the heterogeneous social graph, then according to the identifier of the first social information The similarity between the associated word text and the word text associated with the identifier of the second social information determines the first weight;
    根据所述第一社交信息的标识所关联的词文本与所述第三社交信息的标识所关联的词文本之间的相似度确定所述第二权重。The second weight is determined according to the similarity between the word text associated with the identifier of the first social information and the word text associated with the identifier of the third social information.
  5. 根据权利要求4所述的方法,其中,推荐模型的输入为m i时第l层的模型参数
    Figure PCTCN2022090461-appb-100001
    与所述推荐模型的输入为m j时前l-1层的模型参数
    Figure PCTCN2022090461-appb-100002
    有关;其中,l为大于或等于2的整数;m i为第一社交信息,m j为第二社交信息;或,m i为第一社交信息,m j为第三社交信息。
    The method according to claim 4, wherein the input of the recommended model is the model parameters of the l-th layer when mi
    Figure PCTCN2022090461-appb-100001
    The model parameters of the first l-1 layer when the input of the recommendation model is m j
    Figure PCTCN2022090461-appb-100002
    Relevant; wherein, l is an integer greater than or equal to 2; m i is the first social information, m j is the second social information; or, m i is the first social information, m j is the third social information.
  6. 根据权利要求5所述的方法,其中,
    Figure PCTCN2022090461-appb-100003
    满足以下公式:
    The method according to claim 5, wherein,
    Figure PCTCN2022090461-appb-100003
    satisfy the following formula:
    Figure PCTCN2022090461-appb-100004
    Figure PCTCN2022090461-appb-100004
    其中,heads表示前l-1层的模型参数往头部方向串联,N(m j)为m j的邻接矩阵,
    Figure PCTCN2022090461-appb-100005
    用于在所述推荐模型的输入为m j时提取前l-1层的模型参数,
    Figure PCTCN2022090461-appb-100006
    用于聚合在所述推荐模型的输入为m j时所提取前l-1层的模型参数。
    Among them, heads means that the model parameters of the first l-1 layer are connected in series towards the head direction, N(m j ) is the adjacency matrix of m j ,
    Figure PCTCN2022090461-appb-100005
    It is used to extract the model parameters of the first l-1 layer when the input of the recommendation model is m j ,
    Figure PCTCN2022090461-appb-100006
    It is used to aggregate the model parameters of the first l-1 layers extracted when the input of the recommendation model is m j .
  7. 根据权利要求4所述的方法,其中,损失函数ζ t满足以下公式: The method according to claim 4, wherein the loss function ζ t satisfies the following formula:
    Figure PCTCN2022090461-appb-100007
    Figure PCTCN2022090461-appb-100007
    其中,m i为第一社交信息,m i+为第二社交信息,m i-为第三社交信息,
    Figure PCTCN2022090461-appb-100008
    为第一距离,
    Figure PCTCN2022090461-appb-100009
    为第二距离,a为正则化参数,T为每三条社交信息构成的组合所形成的集合,所述组合中社交信息A与社交信息B属于同一类型,所述组合中社交信息A与社交信息C属于不同类型。
    Among them, m i is the first social information, m i+ is the second social information, m i- is the third social information,
    Figure PCTCN2022090461-appb-100008
    is the first distance,
    Figure PCTCN2022090461-appb-100009
    is the second distance, a is the regularization parameter, and T is the set formed by the combination of every three pieces of social information. In the combination, social information A and social information B belong to the same type, and in the combination, social information A and social information C is of different types.
  8. 一种模型参数调整装置,其中,所述装置包括获取模块、编码模块、第一确定模块、第二确定模块、第三确定模块和训练模块,A model parameter adjustment device, wherein the device includes an acquisition module, an encoding module, a first determination module, a second determination module, a third determination module and a training module,
    所述获取模块,用于获取第一社交信息、第二社交信息和第三社交信息,所述第一社交信息与所述第二社交信息属于同一类别,所述第一社交信息与所述第三社交信息属于不同类别;The acquisition module is configured to acquire first social information, second social information and third social information, the first social information and the second social information belong to the same category, the first social information and the second social information 3. Social information belongs to different categories;
    所述编码模块,用于对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量;The encoding module is configured to encode the first social information, the second social information and the third social information respectively to obtain a first feature vector, a second feature vector and a third feature vector;
    所述第一确定模块,用于确定所述第一特征向量与所述第二特征向量之间的距离,得到第一距离;The first determination module is configured to determine a distance between the first feature vector and the second feature vector to obtain a first distance;
    所述第二确定模块,用于确定所述第一特征向量与所述第三特征向量之间的距离,得到第二距离;The second determination module is configured to determine a distance between the first feature vector and the third feature vector to obtain a second distance;
    所述第三确定模块,用于根据所述第一距离和所述第二距离之间的差值,确定损失函数;The third determination module is configured to determine a loss function according to the difference between the first distance and the second distance;
    所述训练模块,用于根据所述损失函数调整所述推荐模型的模型参数,以对所述推荐模型进行训练。The training module is configured to adjust model parameters of the recommendation model according to the loss function, so as to train the recommendation model.
  9. 一种模型参数调整的电子设备,其中,包括处理器、存储器、通信接口以及一个或多个程序,其中,所述一个或多个程序被存储在所述存储器中,并且被生成由所述处理器执行,以执行如下步骤的指令:An electronic device for model parameter adjustment, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and generated by the processing The controller executes to execute the instructions of the following steps:
    获取第一社交信息、第二社交信息和第三社交信息,所述第一社交信息与所述第二社交信息属于同一类别,所述第一社交信息与所述第三社交信息属于不同类别;Acquiring first social information, second social information and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories;
    对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量;Encoding the first social information, the second social information and the third social information respectively to obtain a first feature vector, a second feature vector and a third feature vector;
    确定所述第一特征向量与所述第二特征向量之间的距离,得到第一距离;determining a distance between the first eigenvector and the second eigenvector to obtain a first distance;
    确定所述第一特征向量与所述第三特征向量之间的距离,得到第二距离;determining a distance between the first eigenvector and the third eigenvector to obtain a second distance;
    根据所述第一距离和所述第二距离之间的差值,确定损失函数;determining a loss function based on the difference between the first distance and the second distance;
    根据所述损失函数调整所述推荐模型的模型参数,以对所述推荐模型进行训练。Adjusting model parameters of the recommendation model according to the loss function to train the recommendation model.
  10. 根据权利要求9所述的电子设备,其中,在所述对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量之前,所述步骤还包括:The electronic device according to claim 9, wherein, in the encoding of the first social information, the second social information and the third social information respectively, a first feature vector and a second feature vector are obtained and before the third eigenvector, the steps also include:
    获取异构社交图,所述异构社交图包括多个异构节点以及所述多个异构节点中至少两个异构节点之间的连接边,所述异构社交图中的一个异构节点包括以下一项:词文本、标签信息、用户标识、时间信息和社交信息的标识,所述标签信息用于标识社交信息所属的类别;Obtain a heterogeneous social graph, the heterogeneous social graph includes a plurality of heterogeneous nodes and connection edges between at least two heterogeneous nodes in the plurality of heterogeneous nodes, one heterogeneous social graph in the heterogeneous social graph The node includes the following items: word text, label information, user identification, time information and identification of social information, and the label information is used to identify the category to which the social information belongs;
    根据所述异构社交图,生成同构社交图,所述同构社交图包括多个同构节点以及所述多个同构节点中至少两个同构节点之间的连接边,所述同构社交图中的一个同构节点为社交信息的标识,所述多个同构节点包括所述第一社交信息的标识、所述第二社交信息的标识和所述第三社交信息的标识;Generate an isomorphic social graph according to the heterogeneous social graph, the isomorphic social graph includes a plurality of isomorphic nodes and connection edges between at least two isomorphic nodes among the plurality of isomorphic nodes, the homogeneous social graph includes An isomorphic node in the structural social graph is an identifier of social information, and the plurality of isomorphic nodes include an identifier of the first social information, an identifier of the second social information, and an identifier of the third social information;
    根据所述同构社交图,确定第一权重和第二权重,所述第一权重根据所述第一社交信息的标识与所述第二社交信息的标识之间的连接边确定,所述第二权重根据所述第一社交信息的标识与所述第三社交信息的标识之间的连接边确定;According to the isomorphic social graph, determine a first weight and a second weight, the first weight is determined according to a connection edge between the identifier of the first social information and the identifier of the second social information, and the first weight is determined according to the connection edge between the identifier of the first social information and the identifier of the second social information The second weight is determined according to the connecting edge between the identifier of the first social information and the identifier of the third social information;
    若所述第一权重高于第一阈值,则确定所述第一社交信息与所述第二社交信息属于同一类别;If the first weight is higher than a first threshold, then determining that the first social information and the second social information belong to the same category;
    若所述第二权重低于第二阈值,则确定所述第一社交信息与所述第三社交信息属于不同类别。If the second weight is lower than a second threshold, it is determined that the first social information and the third social information belong to different categories.
  11. 根据权利要求10所述的电子设备,其中,在所述获取异构社交图之前,所述步骤还包括:The electronic device according to claim 10, wherein, before said acquiring the heterogeneous social graph, said step further comprises:
    获取预设时间内的多条社交信息;Obtain multiple pieces of social information within a preset time;
    提取所述多条社交信息中每条社交信息中包含的词文本、标签信息、用户标识、时间信息和社交信息的标识;Extracting the word text, label information, user identification, time information and social information identification contained in each social information in the plurality of social information;
    根据每条社交信息中包含的词文本、标签信息、用户标识、时间信息和社交信息的标识,生成所述异构社交图。The heterogeneous social graph is generated according to the word text, label information, user identification, time information and identification of social information contained in each piece of social information.
  12. 根据权利要求10所述的电子设备,其中,所述根据所述同构社交图,确定第一权重和第二权重,包括:The electronic device according to claim 10, wherein said determining the first weight and the second weight according to the isomorphic social graph comprises:
    若所述同构社交图中至少两个同构节点之间的连接边根据所述异构社交图中不同社交信息的标识所关联的词文本确定,则根据所述第一社交信息的标识所关联的词文本与所述第二社交信息的标识所关联的词文本之间的相似度确定所述第一权重;If the connection edge between at least two isomorphic nodes in the homogeneous social graph is determined according to the word text associated with the identifiers of different social information in the heterogeneous social graph, then according to the identifier of the first social information The similarity between the associated word text and the word text associated with the identifier of the second social information determines the first weight;
    根据所述第一社交信息的标识所关联的词文本与所述第三社交信息的标识所关联的词文本之间的相似度确定所述第二权重。The second weight is determined according to the similarity between the word text associated with the identifier of the first social information and the word text associated with the identifier of the third social information.
  13. 根据权利要求12所述的电子设备,其中,推荐模型的输入为m i时第l层的模型参数
    Figure PCTCN2022090461-appb-100010
    与所述推荐模型的输入为m j时前l-1层的模型参数
    Figure PCTCN2022090461-appb-100011
    有关;其中,l为大于或等于2的整数;m i为第一社交信息,m j为第二社交信息;或,m i为第一社交信息,m j为第三社交信息。
    The electronic device according to claim 12, wherein the input of the recommended model is the model parameter of the l-th layer when mi
    Figure PCTCN2022090461-appb-100010
    The model parameters of the first l-1 layer when the input of the recommendation model is m j
    Figure PCTCN2022090461-appb-100011
    Relevant; wherein, l is an integer greater than or equal to 2; m i is the first social information, m j is the second social information; or, m i is the first social information, m j is the third social information.
  14. 根据权利要求13所述的电子设备,其中,
    Figure PCTCN2022090461-appb-100012
    满足以下公式:
    The electronic device according to claim 13, wherein,
    Figure PCTCN2022090461-appb-100012
    satisfy the following formula:
    Figure PCTCN2022090461-appb-100013
    Figure PCTCN2022090461-appb-100013
    其中,heads表示前l-1层的模型参数往头部方向串联,N(m j)为m j的邻接矩阵,
    Figure PCTCN2022090461-appb-100014
    用于在所述推荐模型的输入为m j时提取前l-1层的模型参数,
    Figure PCTCN2022090461-appb-100015
    用于聚合在所述推荐模型的输入为m j时所提取前l-1层的模型参数。
    Among them, heads means that the model parameters of the first l-1 layer are connected in series towards the head direction, N(m j ) is the adjacency matrix of m j ,
    Figure PCTCN2022090461-appb-100014
    It is used to extract the model parameters of the first l-1 layer when the input of the recommendation model is m j ,
    Figure PCTCN2022090461-appb-100015
    It is used to aggregate the model parameters of the first l-1 layers extracted when the input of the recommendation model is m j .
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质用于存储计算机程序,所述存储计算机程序被所述处理器执行,以实现如下步骤:A computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the stored computer program is executed by the processor to implement the following steps:
    获取第一社交信息、第二社交信息和第三社交信息,所述第一社交信息与所述第二社交信息属于同一类别,所述第一社交信息与所述第三社交信息属于不同类别;Acquiring first social information, second social information and third social information, where the first social information and the second social information belong to the same category, and the first social information and the third social information belong to different categories;
    对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量;Encoding the first social information, the second social information and the third social information respectively to obtain a first feature vector, a second feature vector and a third feature vector;
    确定所述第一特征向量与所述第二特征向量之间的距离,得到第一距离;determining a distance between the first eigenvector and the second eigenvector to obtain a first distance;
    确定所述第一特征向量与所述第三特征向量之间的距离,得到第二距离;determining a distance between the first eigenvector and the third eigenvector to obtain a second distance;
    根据所述第一距离和所述第二距离之间的差值,确定损失函数;determining a loss function based on the difference between the first distance and the second distance;
    根据所述损失函数调整所述推荐模型的模型参数,以对所述推荐模型进行训练。Adjusting model parameters of the recommendation model according to the loss function to train the recommendation model.
  16. 根据权利要求15所述的计算机可读存储介质,其中,在所述对所述第一社交信息、所述第二社交信息和所述第三社交信息分别进行编码,得到第一特征向量、第二特征向量和第三特征向量之前,所述步骤还包括:The computer-readable storage medium according to claim 15, wherein, after encoding the first social information, the second social information and the third social information respectively, the first feature vector, the second Before the second eigenvector and the third eigenvector, the steps also include:
    获取异构社交图,所述异构社交图包括多个异构节点以及所述多个异构节点中至少两个 异构节点之间的连接边,所述异构社交图中的一个异构节点包括以下一项:词文本、标签信息、用户标识、时间信息和社交信息的标识,所述标签信息用于标识社交信息所属的类别;Obtain a heterogeneous social graph, the heterogeneous social graph includes a plurality of heterogeneous nodes and connection edges between at least two heterogeneous nodes in the plurality of heterogeneous nodes, one heterogeneous social graph in the heterogeneous social graph The node includes the following items: word text, label information, user identification, time information and identification of social information, and the label information is used to identify the category to which the social information belongs;
    根据所述异构社交图,生成同构社交图,所述同构社交图包括多个同构节点以及所述多个同构节点中至少两个同构节点之间的连接边,所述同构社交图中的一个同构节点为社交信息的标识,所述多个同构节点包括所述第一社交信息的标识、所述第二社交信息的标识和所述第三社交信息的标识;Generate an isomorphic social graph according to the heterogeneous social graph, the isomorphic social graph includes a plurality of isomorphic nodes and connection edges between at least two isomorphic nodes among the plurality of isomorphic nodes, the homogeneous social graph includes An isomorphic node in the structural social graph is an identifier of social information, and the plurality of isomorphic nodes include an identifier of the first social information, an identifier of the second social information, and an identifier of the third social information;
    根据所述同构社交图,确定第一权重和第二权重,所述第一权重根据所述第一社交信息的标识与所述第二社交信息的标识之间的连接边确定,所述第二权重根据所述第一社交信息的标识与所述第三社交信息的标识之间的连接边确定;According to the isomorphic social graph, determine a first weight and a second weight, the first weight is determined according to a connection edge between the identifier of the first social information and the identifier of the second social information, and the first weight is determined according to the connection edge between the identifier of the first social information and the identifier of the second social information The second weight is determined according to the connecting edge between the identifier of the first social information and the identifier of the third social information;
    若所述第一权重高于第一阈值,则确定所述第一社交信息与所述第二社交信息属于同一类别;If the first weight is higher than a first threshold, then determining that the first social information and the second social information belong to the same category;
    若所述第二权重低于第二阈值,则确定所述第一社交信息与所述第三社交信息属于不同类别。If the second weight is lower than a second threshold, it is determined that the first social information and the third social information belong to different categories.
  17. 根据权利要求16所述的计算机可读存储介质,其中,在所述获取异构社交图之前,所述步骤还包括:The computer-readable storage medium according to claim 16, wherein, before said obtaining a heterogeneous social graph, said steps further comprise:
    获取预设时间内的多条社交信息;Obtain multiple pieces of social information within a preset time;
    提取所述多条社交信息中每条社交信息中包含的词文本、标签信息、用户标识、时间信息和社交信息的标识;Extracting the word text, label information, user identification, time information and social information identification contained in each social information in the plurality of social information;
    根据每条社交信息中包含的词文本、标签信息、用户标识、时间信息和社交信息的标识,生成所述异构社交图。The heterogeneous social graph is generated according to the word text, label information, user identification, time information and identification of social information contained in each piece of social information.
  18. 根据权利要求16所述的计算机可读存储介质,其中,所述根据所述同构社交图,确定第一权重和第二权重,包括:The computer-readable storage medium according to claim 16, wherein said determining the first weight and the second weight according to the isomorphic social graph comprises:
    若所述同构社交图中至少两个同构节点之间的连接边根据所述异构社交图中不同社交信息的标识所关联的词文本确定,则根据所述第一社交信息的标识所关联的词文本与所述第二社交信息的标识所关联的词文本之间的相似度确定所述第一权重;If the connection edge between at least two isomorphic nodes in the homogeneous social graph is determined according to the word text associated with the identifiers of different social information in the heterogeneous social graph, then according to the identifier of the first social information The similarity between the associated word text and the word text associated with the identifier of the second social information determines the first weight;
    根据所述第一社交信息的标识所关联的词文本与所述第三社交信息的标识所关联的词文本之间的相似度确定所述第二权重。The second weight is determined according to the similarity between the word text associated with the identifier of the first social information and the word text associated with the identifier of the third social information.
  19. 根据权利要求18所述的计算机可读存储介质,其中,推荐模型的输入为m i时第l层的模型参数
    Figure PCTCN2022090461-appb-100016
    与所述推荐模型的输入为m j时前l-1层的模型参数
    Figure PCTCN2022090461-appb-100017
    有关;其中,l为大于或等于2的整数;m i为第一社交信息,m j为第二社交信息;或,m i为第一社交信息,m j为第三社交信息。
    The computer-readable storage medium according to claim 18, wherein the input of the recommended model is the model parameter of the lth layer when mi
    Figure PCTCN2022090461-appb-100016
    The model parameters of the first l-1 layer when the input of the recommendation model is m j
    Figure PCTCN2022090461-appb-100017
    Relevant; wherein, l is an integer greater than or equal to 2; m i is the first social information, m j is the second social information; or, m i is the first social information, m j is the third social information.
  20. 根据权利要求19所述的计算机可读存储介质,其中,
    Figure PCTCN2022090461-appb-100018
    满足以下公式:
    The computer readable storage medium of claim 19, wherein:
    Figure PCTCN2022090461-appb-100018
    satisfy the following formula:
    Figure PCTCN2022090461-appb-100019
    Figure PCTCN2022090461-appb-100019
    其中,heads表示前l-1层的模型参数往头部方向串联,N(m j)为m j的邻接矩阵,
    Figure PCTCN2022090461-appb-100020
    用于在所述推荐模型的输入为m j时提取前l-1层的模型参数,
    Figure PCTCN2022090461-appb-100021
    用于聚合在所述推荐模型的输入为m j时所提取前l-1层的模型参数。
    Among them, heads means that the model parameters of the first l-1 layer are connected in series towards the head direction, N(m j ) is the adjacency matrix of m j ,
    Figure PCTCN2022090461-appb-100020
    It is used to extract the model parameters of the first l-1 layer when the input of the recommendation model is m j ,
    Figure PCTCN2022090461-appb-100021
    It is used to aggregate the model parameters of the first l-1 layers extracted when the input of the recommendation model is m j .
PCT/CN2022/090461 2021-10-22 2022-04-29 Model parameter adjustment method and apparatus, electronic device and storage medium WO2023065640A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111231066.8A CN113779423A (en) 2021-10-22 2021-10-22 Model parameter adjusting method and device, electronic equipment and storage medium
CN202111231066.8 2021-10-22

Publications (1)

Publication Number Publication Date
WO2023065640A1 true WO2023065640A1 (en) 2023-04-27

Family

ID=78873367

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/090461 WO2023065640A1 (en) 2021-10-22 2022-04-29 Model parameter adjustment method and apparatus, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN113779423A (en)
WO (1) WO2023065640A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113779423A (en) * 2021-10-22 2021-12-10 平安科技(深圳)有限公司 Model parameter adjusting method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112861967A (en) * 2021-02-07 2021-05-28 中国电子科技集团公司电子科学研究院 Social network abnormal user detection method and device based on heterogeneous graph neural network
CN112949281A (en) * 2021-01-28 2021-06-11 北京航空航天大学 Incremental social event detection method for graph neural network
CN113076422A (en) * 2021-04-15 2021-07-06 国家计算机网络与信息安全管理中心 Multi-language social event detection method based on federal graph neural network
CN113779423A (en) * 2021-10-22 2021-12-10 平安科技(深圳)有限公司 Model parameter adjusting method and device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112949281A (en) * 2021-01-28 2021-06-11 北京航空航天大学 Incremental social event detection method for graph neural network
CN112861967A (en) * 2021-02-07 2021-05-28 中国电子科技集团公司电子科学研究院 Social network abnormal user detection method and device based on heterogeneous graph neural network
CN113076422A (en) * 2021-04-15 2021-07-06 国家计算机网络与信息安全管理中心 Multi-language social event detection method based on federal graph neural network
CN113779423A (en) * 2021-10-22 2021-12-10 平安科技(深圳)有限公司 Model parameter adjusting method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CAO YUWEI: "Knowledge-Preserving Incremental Social Event Detection via Heterogeneous GNNs", PROCEEDINGS OF THE WEB CONFERENCE 2021, 19 April 2021 (2021-04-19) - 23 April 2021 (2021-04-23), New York, NY, USA, pages 3383 - 3395, XP058745423, ISBN: 978-1-4503-8313-4, DOI: 10.1145/3442381.3449834 *

Also Published As

Publication number Publication date
CN113779423A (en) 2021-12-10

Similar Documents

Publication Publication Date Title
CN105468742B (en) The recognition methods of malice order and device
JP6587330B2 (en) Random forest model training method, electronic apparatus, and storage medium
WO2015085948A1 (en) Method, device, and server for friend recommendation
WO2020253127A1 (en) Facial feature extraction model training method and apparatus, facial feature extraction method and apparatus, device, and storage medium
CN109509010B (en) Multimedia information processing method, terminal and storage medium
US10453165B1 (en) Computer vision machine learning model execution service
CN104462051B (en) Segmenting method and device
CN105630767B (en) The comparative approach and device of a kind of text similarity
US20180349796A1 (en) Classification and quarantine of data through machine learning
CN112132208B (en) Image conversion model generation method and device, electronic equipment and storage medium
US20200394448A1 (en) Methods for more effectively moderating one or more images and devices thereof
WO2021174877A1 (en) Processing method for smart decision-based target detection model, and related device
WO2023065640A1 (en) Model parameter adjustment method and apparatus, electronic device and storage medium
CN115496970A (en) Training method of image task model, image recognition method and related device
WO2020135054A1 (en) Method, device and apparatus for video recommendation and storage medium
WO2022001233A1 (en) Pre-labeling method based on hierarchical transfer learning and related device
CN113220828A (en) Intention recognition model processing method and device, computer equipment and storage medium
WO2023087667A1 (en) Sorting model training method and apparatus for intelligent recommendation, and intelligent recommendation method and apparatus
CN113824797B (en) Self-adaptive synchronization method and device for teaching resources
CN113449808B (en) Multi-source image-text information classification method and corresponding device, equipment and medium
CN112738225B (en) Edge calculation method based on artificial intelligence
CN114782077A (en) Information screening method, model training method, device, electronic equipment and medium
WO2015021908A1 (en) Method, apparatus and system for security verification
CN115168609A (en) Text matching method and device, computer equipment and storage medium
CN113886547A (en) Client real-time conversation switching method and device based on artificial intelligence and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22882265

Country of ref document: EP

Kind code of ref document: A1