A method, apparatus, medium and electronic device for classifying a house type

CN115358230BActive Publication Date: 2026-09-08BEIJING FENBEIJINFU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211022469.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-25
Publication Date
2026-09-08
Estimated Expiration
2042-08-25

AI Technical Summary

Technical Problem

聚合关系不能积累沉淀,酒店聚合算法采用预制的正则表达式方案,聚合率低,而且不具备数据迭代,历史的正向的聚合结果,并不会改善后续的聚合结论

Benefits of technology

[0020] Some embodiments of this application also divide room types into main room types and attached room types, improving the room type data displayed to users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115358230B_ABST
    Figure CN115358230B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a method, device, medium and electronic equipment for classifying room types, the method comprising: obtaining room type data in at least one supplier; performing word segmentation on the room type data to obtain a word segmentation result, and constructing a feature vector according to the word segmentation result to obtain a feature vector set; inputting the feature vector set into a random forest classifier to obtain an initial classification result; constructing an undirected graph according to the initial classification result, performing connectivity analysis on the undirected graph using a depth-first search algorithm to obtain at least one connected subgraph, and confirming one or more room types corresponding to each connected subgraph in the at least one connected subgraph as belonging to a type of room. The scheme proposed in some embodiments of the present application can well improve the room type aggregation effect and reduce the number of room types available for selection by users in hotel booking and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, and more specifically, embodiments of this application relate to a method, apparatus, medium, and electronic device for classifying room types. Background Technology

[0002] The hotel details page in the hotel module displays a large number of room types. All room types obtained from suppliers are aggregated and displayed after a simple aggregation process. Currently, the number of room types displayed on the hotel details page is less than the industry average of 14 for OTAs, resulting in a poor user selection experience.

[0003] The room type aggregation relationship is determined in real time when the user enters the hotel details (D) based on a simple logic of room type name / window / bed. Aggregation relationships cannot be accumulated or retained. The hotel aggregation algorithm uses a pre-defined regular expression scheme, resulting in a low aggregation rate and lacking data iteration capabilities. Historical positive aggregation results do not improve subsequent aggregation conclusions.

[0004] Existing aggregation methods that use regular expressions to make simple judgments based on three dimensions: room type name, window type, and bed type, have relatively high requirements for the quality of the data itself. When there are slight differences in the way room type name, window type, and bed type are expressed, aggregation will fail. As the business continues to develop and more suppliers are connected, the differences in the data will become more widespread, and the aggregation effect will become worse and worse.

[0005] Therefore, how to improve the aggregation results of room types on hotel detail pages and other display pages has become an urgent technical problem to be solved. Summary of the Invention

[0006] The purpose of this application is to provide a method, apparatus, medium, and electronic device for classifying room types. Some embodiments of this application propose solutions that can effectively improve the room type aggregation effect, reduce the number of room types that users can choose in situations such as hotel booking, improve the user's purchasing experience, and improve the hotel price anchoring rate (number of anchor price plans / total number of hotel details plans) after room type aggregation optimization.

[0007] In a first aspect, embodiments of this application provide a method for classifying room types, the method comprising: acquiring room type data from at least one supplier; performing word segmentation on the room type data to obtain word segmentation results, and constructing feature vectors based on the word segmentation results to obtain a feature vector set; inputting the feature vector set into a random forest classifier to obtain an initial classification result; constructing an undirected graph based on the initial classification result, and performing connectivity analysis on the undirected graph using a depth-first traversal algorithm to obtain at least one connected subgraph, and confirming one or more room types corresponding to each connected subgraph in the at least one connected subgraph as belonging to the same room type category.

[0008] Some embodiments of this application obtain initial classification results for room types through a random forest classifier, and then determine each room type belonging to the same type based on the constructed undirected graph, thereby achieving automatic classification of room types.

[0009] In some embodiments, obtaining room type data from at least one supplier includes: obtaining basic room type data and obtaining a list of supplier room types through an interface provided by the supplier to obtain the room type data.

[0010] The room type data to be analyzed in some embodiments of this application includes basic room type data and supplier room type lists.

[0011] In some embodiments, the step of segmenting the room type data into words to obtain segmentation results and constructing feature vectors based on the segmentation results includes: segmenting the room type data into words based on multiple segmentation categories to obtain segmentation results, wherein the segmentation categories include at least: hotel room type name, floor, bed type, area, services, facilities and invoices; and constructing the feature vectors based on the segmentation results and a cosine similarity algorithm to obtain a feature vector set.

[0012] Some embodiments of this application perform word segmentation processing on room type data based on hotel room type data, floor, bed type, area, services, facilities and invoices, so that the obtained feature vectors can better reflect the characteristics of the analyzed room type and better achieve room type classification.

[0013] In some embodiments, inputting the feature vector set into a random forest classifier to obtain an initial classification result includes: inputting the feature vector set into the classifier to obtain a score for each pair of room types belonging to the same room type.

[0014] Some embodiments of this application use a random forest classifier to obtain scores for determining whether two room types belong to the same room type.

[0015] In some embodiments, before inputting the feature vector set into a random forest classifier, the method further includes: randomly selecting N samples with replacement from a sample set T, and training a decision tree using the randomly selected N samples; when each sample has M attributes, when each node of the decision tree needs to split, randomly selecting m attributes from the M attributes, and selecting one attribute from the m attributes as the splitting attribute for that node, where m < 0. <M。

[0016] Some embodiments of this application use multiple decision trees. In the construction of the decision trees, the random dimension includes the number of samples and the number of features participating in the training.

[0017] In some embodiments, the step of constructing an undirected graph based on the initial classification structure and performing connectivity analysis on the undirected graph using a depth-first traversal algorithm to obtain at least one connected subgraph includes: obtaining the undirected graph based on the initial classification result; grouping the undirected graph according to connectivity relationships, with each subgraph belonging to a room type.

[0018] Some embodiments of this application use an undirected graph constructed based on the initial classification results to obtain multiple room type categories of the data to be analyzed.

[0019] In some embodiments, after grouping the undirected graph by connectivity, the method further includes: selecting the main room type and attached room type for each node of each subgraph based on the priority of supplier type.

[0020] Some embodiments of this application also divide room types into main room types and attached room types, improving the room type data displayed to users.

[0021] In some embodiments, grouping the undirected graph by connectivity includes: extracting a room type node array from the initial classification result; sorting the node array by supplier priority; traversing the node array and extracting one layer of adjacency relationships; and traversing the node array in combination with the adjacency relationships, using a stack for depth-first traversal to group the room types.

[0022] Some embodiments of this application provide a specific room type grouping algorithm to improve the accuracy and speed of obtaining room type classification results.

[0023] Secondly, some embodiments of this application provide an apparatus for classifying room types. The apparatus includes: a room type data acquisition module configured to acquire room type data from at least one supplier; a word segmentation and feature vector construction module configured to segment the room type data to obtain segmentation results, and construct feature vectors based on the segmentation results to obtain a feature vector set; an initial classification result acquisition template configured to input the feature vector set into a random forest classifier to obtain an initial classification result; and a room type classification module configured to construct an undirected graph based on the initial classification result, perform connectivity analysis on the undirected graph using a depth-first traversal algorithm to obtain at least one connected subgraph, and identify one or more room types corresponding to each connected subgraph in the at least one connected subgraph as belonging to the same room type category.

[0024] Thirdly, some embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the method described in any embodiment of the first aspect.

[0025] Fourthly, some embodiments of this application provide an information processing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, can implement the method as described in any embodiment of the first aspect. Attached Figure Description

[0026] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 A system architecture diagram for providing room type clustering is provided for embodiments of this application; Figure 2 One of the flowcharts for a method of classifying room types provided in the embodiments of this application; Figure 3 A second flowchart illustrating a method for classifying room types as provided in an embodiment of this application; Figure 4 A block diagram illustrating the components of a device for classifying room types, as provided in an embodiment of this application. Figure 5 This is a schematic diagram of the electronic device provided in the embodiments of this application. Detailed Implementation

[0028] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0029] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0030] The automatic aggregation method for hotel logical room types supporting multiple suppliers proposed in some embodiments of this application has the following advantages. First, the new aggregation algorithm has broad applicability to a wide range of suppliers, from a few initially to dozens later, the algorithm can maintain its effectiveness. Second, the scheme adopted in some embodiments of this application has undergone very comprehensive feature engineering. By segmenting and statistically analyzing existing data, and then supplementing it with manual review and annotation, the synonymy between high-frequency words is handled very thoroughly. Finally, in determining whether two room types are the same, some embodiments of this application use random forest as a classifier, with multiple decision trees for final voting, thereby making the entire algorithm more stable.

[0031] The solutions proposed in some embodiments of this application can effectively improve the room type aggregation effect, reduce the number of room types available to users, improve the user's purchasing experience, and increase the hotel price anchoring rate (number of anchor price plans / total number of hotel price plans) after room type aggregation optimization.

[0032] Please refer to Figure 1 , Figure 1 This diagram illustrates the system architecture of some embodiments of this application, which allows categorized room type data to be provided to requesting terminals. For example, it provides clients who have clicked on a hotel details page with the results of room type categorization and aggregation using some embodiments of this application.

[0033] Figure 1 The system includes client devices 200, a room type clustering server 100, and interface servers from multiple vendors (i.e., Figure 2 The first interface server 301, the second interface server 302, and the third interface server 303.

[0034] For example, users through Figure 1 Client 200 sends a request to room type clustering server 100 to open the hotel details page. Room type clustering server 100 responds to the page open request from client device 200 by generating a corresponding target page, which also includes the clustered room type data.

[0035] It should be noted that some embodiments of this application utilize... Figure 1 The room type clustering server generates room type classification results, and then provides the room type classification results to the demand side, which generates the display page.

[0036] The following is combined with Figure 2 Exemplary illustration by Figure 1 The room type clustering server 100 executes a method for classifying room types.

[0037] like Figure 2As shown in the embodiment of this application, a method for classifying room types is provided, the method comprising: S101, Obtain room type data from at least one supplier.

[0038] For example, in some embodiments of this application, obtaining room type data from at least one supplier includes: obtaining basic room type data and obtaining a supplier room type list through an interface provided by the supplier, thereby obtaining the room type data. In some embodiments of this application, the room type data to be analyzed includes basic room type data and a supplier room type list.

[0039] S102, the room type data is segmented into words to obtain segmentation results, and feature vectors are constructed based on the segmentation results to obtain a feature vector set.

[0040] For example, in some embodiments of this application, the step of segmenting the room type data into words to obtain segmentation results and constructing feature vectors based on the segmentation results includes: segmenting the room type data into words based on multiple segmentation categories to obtain segmentation results, wherein the segmentation categories include at least: hotel room type name, floor, bed type, area, services, facilities and invoices; constructing the feature vectors based on the segmentation results and the cosine similarity algorithm to obtain a feature vector set.

[0041] In other words, some embodiments of this application perform word segmentation processing on room type data based on hotel room type data, floor, bed type, area, services, facilities and invoices, so that the obtained feature vector can better reflect the characteristics of the room type being analyzed and better achieve room type classification.

[0042] S103, input the set of feature vectors into the random forest classifier to obtain the initial classification result.

[0043] For example, in some embodiments of this application, before inputting the feature vector set into a random forest classifier, the method further includes: randomly selecting N samples with replacement from a sample set T, and training a decision tree using the randomly selected N samples; when each sample has M attributes, when each node of the decision tree needs to split, randomly selecting m attributes from the M attributes, and selecting one attribute from the m attributes as the splitting attribute for that node, where m < 0. <M。

[0044] Some embodiments of this application use multiple decision trees. In the construction of the decision trees, the random dimension includes the number of samples and the number of features participating in the training.

[0045] For example, in some embodiments of this application, the step of inputting the feature vector set into a random forest classifier to obtain an initial classification result includes: inputting the feature vector set into the classifier to obtain a score indicating that each pair of room types belongs to the same room type.

[0046] Some embodiments of this application use a random forest classifier to obtain scores for determining whether two room types belong to the same room type.

[0047] S104. Construct an undirected graph based on the initial classification results. Use a depth-first traversal algorithm to perform connectivity analysis on the undirected graph to obtain at least one connected subgraph. Confirm one or more room types corresponding to each connected subgraph in the at least one connected subgraph as belonging to the same room type category.

[0048] For example, in some embodiments of this application, the step of constructing an undirected graph based on the initial classification structure and performing connectivity analysis on the undirected graph using a depth-first traversal algorithm to obtain at least one connected subgraph includes: obtaining the undirected graph based on the initial classification result; grouping the undirected graph according to connectivity relationships, with each subgraph belonging to a room type.

[0049] Some embodiments of this application use an undirected graph constructed based on the initial classification results to obtain multiple room type categories of the data to be analyzed.

[0050] For example, in some embodiments of this application, after grouping the undirected graph by connectivity, the method further includes: selecting the main room type and attached room type for each node of each subgraph based on the priority of supplier type.

[0051] Some embodiments of this application also divide room types into main room types and attached room types, improving the room type data displayed to users.

[0052] For example, in some embodiments of this application, grouping the undirected graph by connectivity includes: extracting a room type node array from the initial classification result; sorting the node array by supplier priority; traversing the node array and extracting one layer of adjacency relationships; traversing the node array and combining the adjacency relationships, and using a stack for depth-first traversal to group the room types.

[0053] Some embodiments of this application provide a specific room type grouping algorithm to improve the accuracy and speed of obtaining room type classification results. Some embodiments of this application obtain initial classification results for room types using a random forest classifier, and then determine room types belonging to the same type based on the constructed undirected graph, thus achieving automatic room type classification.

[0054] The following is based on Figure 3The present application provides an example of a method for classifying hotel room types using some embodiments, with the example based on data from Fenbeitong Company.

[0055] For example, a manufacturer's hotel room type aggregation process, after adopting the room type classification method of this application, includes, for example: Figure 3 The steps shown are as follows: Step 1, Obtain the hotels to be aggregated Obtain the corresponding manufacturer's basic hotel [room type 1, 2, ..., N], and use the manufacturer's hotel room type data to be aggregated as the parent data to obtain basic room type data as the benchmark to participate in the aggregation process with the supplier's room types.

[0056] Step 2, obtain the supplier's room type list The supplier's room type list is obtained through the interface. The room type template obtained in step 1 above is combined with the supplier's room type list obtained through the interface to perform subsequent word segmentation and feature construction.

[0057] Step 3, Word segmentation / feature construction Using the basic room type information from the relevant manufacturers input in steps 1 and 2 above, and the room type data from the suppliers obtained from the interface, word segments are constructed based on categories such as bed type, window type, breakfast, floor, and area. These word segments are then combined with a cosine similarity algorithm to digitize the comparison results and construct different feature vectors, preparing for machine learning.

[0058] Figure 4 The classification types include: bed type, number of beds, bed type, number of people, bedroom, room type, equipment, view, room type level, gender of occupants, and whether an invoice is available. Some embodiments of this application perform word segmentation processing on the hotels to be aggregated according to these word segmentation types to obtain feature vectors.

[0059] The word segmentation process is illustrated below.

[0060] As shown in Table 1 below, the room type aggregation word segmentation construction model is used for word segmentation. The previous solution obtained similarity by comparing "overall name and address", which was too coarse-grained.

[0061] Table 1. Word segmentation types

[0062] Word segmentation refers to cutting the text of hotel room names and other similar items into structured data. This aims to solve the problem of coarse granularity in comparing room names and to prepare for the subsequent construction of feature vectors.

[0063] Before discussing specific room type name word segmentation, let's first confirm the construction of the word segmentation dictionary. Existing word segmentation technologies are generally based on dictionaries, and the richness and accuracy of the dictionary often determine the quality of the segmentation results.

[0064] When segmenting hotel room type names, some embodiments of this application require the use of a hotel room type-related dictionary. Maintaining this dictionary manually would be extremely labor-intensive and inefficient, making it difficult to create a comprehensive dictionary. Here, we employ a statistical approach, combining machine and manual methods to quickly maintain the segmentation dictionary. 1. Randomly select 100,000+ hotel room types and obtain their name data; 2. Segment the name sequentially from back to front and from front to back, level by level; 3. Each cut obtains a segmented word, and the frequency of the segmented word increases by 1; 4. Frequently occurring words are often key terms related to hotel room types.

[0065] The following example illustrates feature construction. The preceding word segmentation, simulating human thought, is essentially preparation for constructing feature vectors. The feature construction process itself is also a simulation of human thought, aiming to perform pairwise comparisons of the structured word segmentation data, digitizing the comparison results to construct feature vectors, thus preparing for machine learning. For different suppliers, some embodiments of this application determine that the data obtainable mainly includes dimensions such as hotel room name, floor, bed type, area, services, facilities, and invoices. Table 2 Model for Constructing Room Type Feature Values

[0066] Step 4, Machine Model The feature vectors from step 3 above are input into the training model of the random forest to obtain the score of whether each pair of room types is the same room type.

[0067] The feature vectors are input into a classifier built using the random forest algorithm. Multiple classification results belonging to the same room type are obtained through a voting process, resulting in the initial classification result. For example, Figure 3 The initial classification results include: A1 and B1 belong to the same room type, D2 and A2 belong to the same room type, C1 and B1 belong to the same room type, D1 and B1 belong to the same room type, D2 and C2 belong to the same room type, and B2 and C2 belong to the same room type. In some embodiments of this application, a score is obtained for belonging to the same room type.

[0068] Step 5, Depth-First Search (DFS) Within the same hotel dimension, the scores of each pair of room type combinations are obtained through step 4. A score of 75 is used as the threshold to determine that they are the same room type, thus obtaining an undirected graph. Then, the graph is grouped by connectivity using the depth-first traversal algorithm (DFS), and each subgraph is a room type.

[0069] Please refer to Figure 4 , Figure 4 This application illustrates an embodiment of a device for classifying room types. It should be understood that this device is similar to the one described above. Figure 2 Corresponding to the method embodiments, it can execute the various steps involved in the above method embodiments. The specific functions of the device can be found in the description above. To avoid repetition, detailed descriptions are appropriately omitted here. The device includes at least one software function module that can be stored in the memory or embedded in the device's operating system in the form of software or firmware. The device for classifying room types includes: a room type data acquisition module 101, a word segmentation and feature vector construction module 102, an initial classification result acquisition template 103, and a room type classification module 104.

[0070] The room type data acquisition module is configured to acquire room type data from at least one supplier.

[0071] The word segmentation and feature vector construction module is configured to segment the room type data to obtain the segmentation results, and construct feature vectors based on the segmentation results to obtain a feature vector set.

[0072] The initial classification result acquisition template is configured to input the feature vector set into a random forest classifier to obtain the initial classification result.

[0073] The room type classification module is configured to construct an undirected graph based on the initial classification results, perform connectivity analysis on the undirected graph using a depth-first traversal algorithm to obtain at least one connected subgraph, and identify one or more room types corresponding to each connected subgraph in the at least one connected subgraph as belonging to the same room type category.

[0074] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the aforementioned method, and will not be elaborated further here.

[0075] Some embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the method described in any of the embodiments of the method for classifying room types described above.

[0076] like Figure 5As shown, this application embodiment also provides an electronic device 500, which includes a memory 510, a processor 520, and a computer program stored in the memory 510 and executable on the processor 520. When the processor 520 executes the program (and reads the program from the memory 510 via the bus 530 and executes it), it can achieve... Figure 2 and Figure 3 The method shown can also be used to implement the method described in the above embodiments.

[0077] Processor 520 can process digital signals and can include various computing architectures. For example, it can be a complex instruction set computer architecture, a reduced instruction set computer architecture, or an architecture that implements multiple instruction set combinations. In some examples, processor 520 can be a microprocessor.

[0078] The memory 510 can be used to store instructions executed by the processor 520 or data related to the execution of instructions. These instructions and / or data may include code used to implement some or all of the functions of one or more modules described in the embodiments of this application. The processor 520 of the embodiments of this disclosure can be used to execute the instructions in the memory 510 to implement… Figure 2 The method shown. Memory 510 includes dynamic random access memory, static random access memory, flash memory, optical memory, or other memory well known to those skilled in the art.

[0079] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0080] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0081] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0082] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0083] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0084] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A method for classifying room types, characterized in that, The method includes: Obtain room type data from at least one supplier; The room type data is segmented into words to obtain segmentation results, and feature vectors are constructed based on the segmentation results to obtain a feature vector set; The set of feature vectors is input into a random forest classifier to obtain the initial classification result; An undirected graph is constructed based on the initial classification results. A depth-first traversal algorithm is used to perform connectivity analysis on the undirected graph to obtain at least one connected subgraph. One or more room types corresponding to each connected subgraph in the at least one connected subgraph are identified as belonging to the same room type category.

2. The method as described in claim 1, characterized in that, The acquisition of room type data from at least one supplier includes: Obtain basic room type data, and obtain the supplier's room type list through the interface provided by the supplier to obtain the room type data.

3. The method as described in claim 1, characterized in that, The step of segmenting the room type data into words to obtain segmentation results, and constructing feature vectors based on the segmentation results, includes: The room type data is segmented based on multiple segmentation categories to obtain segmentation results. The segmentation categories include at least: hotel room name, floor, bed type, area, services, facilities, and invoice. The feature vectors are constructed based on the word segmentation results and the cosine similarity algorithm to obtain a set of feature vectors.

4. The method as described in claim 3, characterized in that, The step of inputting the feature vector set into a random forest classifier to obtain the initial classification result includes: The feature vector set is input into the classifier to obtain a score indicating that each pair of room types belongs to the same room type.

5. The method as described in claim 4, characterized in that, Before inputting the set of feature vectors into the random forest classifier, the method further includes: From a sample set T, N samples are randomly selected with replacement, and a decision tree is trained using these N randomly selected samples. When each sample has M attributes, when each node of the decision tree needs to split, m attributes are randomly selected from the M attributes, and one attribute is selected from the m attributes as the split attribute for that node, where m < 0. <M。 6. The method as described in claim 5, characterized in that, The step of constructing an undirected graph based on the initial classification results and performing connectivity analysis on the undirected graph using a depth-first traversal algorithm to obtain at least one connected subgraph includes: The undirected graph is obtained based on the initial classification results; The undirected graph is grouped according to connectivity, and each subgraph is associated with a room type.

7. The method as described in claim 6, characterized in that, After grouping the undirected graph by connectivity, the method further includes: For each node in each subgraph, the main room type and attached room type are selected based on the priority of the supplier type.

8. The method as described in claim 6, characterized in that, The grouping of the undirected graph by connectivity includes: Extract the room type node array from the initial classification results; Sort the node array according to supplier priority; Traverse the node array and extract the first level of adjacency relationships; The node array is traversed and combined with the adjacency relationship, and a stack is used to perform a depth-first traversal to group the room types.

9. A device for classifying room types, characterized in that, The device includes: The room type data acquisition module is configured to acquire room type data from at least one supplier; The word segmentation and feature vector construction module is configured to segment the room type data into words to obtain segmentation results, and construct feature vectors based on the segmentation results to obtain a feature vector set. The initial classification result acquisition module is configured to input the feature vector set into a random forest classifier to obtain the initial classification result; The room type classification module is configured to construct an undirected graph based on the initial classification results, perform connectivity analysis on the undirected graph using a depth-first traversal algorithm to obtain at least one connected subgraph, and identify one or more room types corresponding to each connected subgraph in the at least one connected subgraph as belonging to the same room type category.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it can implement the method described in any one of claims 1-8.

11. An information processing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, When the processor executes the program, it can implement the method described in any one of claims 1-8.

Citation Information

Patent Citations

  • Automatic basic room type aggregation method

    CN106886565A

  • Electrical loop automatic analysis and drawing generation method and device based on graph algorithm

    CN113626909A