CN112163142A - Commodity searching method and device, computer equipment and storage medium - Google Patents
Commodity searching method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN112163142A CN112163142A CN202011120497.2A CN202011120497A CN112163142A CN 112163142 A CN112163142 A CN 112163142A CN 202011120497 A CN202011120497 A CN 202011120497A CN 112163142 A CN112163142 A CN 112163142A
- Authority
- CN
- China
- Prior art keywords
- search
- commodity
- category
- searching
- terms
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000003860 storage Methods 0.000 title claims abstract description 14
- 238000012163 sequencing technique Methods 0.000 claims abstract description 57
- 238000007635 classification algorithm Methods 0.000 claims abstract description 54
- 238000004590 computer program Methods 0.000 claims description 24
- 230000014509 gene expression Effects 0.000 claims description 10
- 238000012545 processing Methods 0.000 claims description 10
- 238000012216 screening Methods 0.000 claims description 10
- 230000008447 perception Effects 0.000 abstract description 3
- 238000012549 training Methods 0.000 description 11
- 238000004422 calculation algorithm Methods 0.000 description 7
- 239000011159 matrix material Substances 0.000 description 6
- 230000011218 segmentation Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 238000000605 extraction Methods 0.000 description 4
- 238000003491 array Methods 0.000 description 3
- 238000004378 air conditioning Methods 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000001737 promoting effect Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9538—Presentation of query results
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2415—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
- G06F18/24155—Bayesian classification
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Artificial Intelligence (AREA)
- Probability & Statistics with Applications (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a commodity searching method, a commodity searching device, computer equipment and a storage medium, wherein the method comprises the steps of obtaining search terms; classifying the search terms by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the search terms; and searching the search terms, and sequencing and displaying the search results according to the search commodity category. The search terms are classified by adopting a Bayesian classification algorithm, so that the commodity search results can be displayed in a sorted manner according to categories, the search results are displayed more accurately, and the user perception is improved.
Description
Technical Field
The present invention relates to the field of search technologies, and in particular, to a method and an apparatus for searching for a commodity, a computer device, and a storage medium.
Background
With the development of e-commerce technology and the rise of new retailer models, more and more stores are beginning to conduct online sales. Therefore, more and more merchants are provided with the e-commerce platforms of themselves, how to enable consumers to search for desired goods in thousands of goods and enable the merchants to configure search results is a good problem to be solved by the e-commerce platforms.
At present, a large e-commerce platform has own search engines, but the search engines are not open source, so that the medium and small e-commerce platform search engines generally adopt open source elastic search or solr search engines. These search engines themselves can solve the problem of full-text searches, with the default ordering being to score the results according to the DF/IDF scoring algorithm, with higher scoring documents ranked further up. However, the default sorting result cannot meet the sorting requirements of other single dimensions or multiple dimensions of the user, and the user cannot configure the sorting result.
Disclosure of Invention
In view of the above, it is necessary to provide a method, an apparatus, a computer device and a storage medium for searching for a commodity in order to solve the above technical problems.
A method of merchandise search, comprising:
acquiring a search word;
classifying the search terms by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the search terms;
and searching the search terms, and sequencing and displaying the search results according to the search commodity category.
In one embodiment, before the step of searching for the search term and performing ranking display on the search result according to the search commodity category, the method further includes:
acquiring a search grade corresponding to each search commodity category;
the steps of searching the search terms and displaying the search results according to the search commodity category in a sequencing manner comprise:
and searching the search words by adopting an Elasticissearch search engine, and sequencing and displaying the search results according to the category of the search commodities and the search grade.
In one embodiment, the step of classifying the search term by using a bayesian classification algorithm to obtain a search commodity category corresponding to the search term includes:
classifying the effective keywords by adopting a Bayesian classification algorithm to obtain at least one search commodity category corresponding to the search word and a probability value corresponding to each search commodity category;
the steps of searching the search terms and displaying the search results according to the search commodity category in a sequencing manner comprise:
and searching the search words by using an Elasticissearch search engine, and sequencing and displaying the search results according to the search commodity category and the probability value corresponding to each search commodity category.
In one embodiment, after the step of classifying the effective keywords by using a bayesian classification algorithm to obtain at least one search product category corresponding to the search term and a probability value corresponding to each search product category, the method further includes:
extracting screening commodity categories with the probability value larger than a preset threshold value from each searching commodity category;
the steps of searching the search terms by adopting an Elasticissearch search engine and carrying out sequencing display on the search results according to the search commodity categories and the probability values corresponding to the search commodity categories comprise:
and searching the search words by adopting an Elasticissearch search engine, and sequencing and displaying the search results according to the screened commodity category and the probability value corresponding to the screened commodity category.
In one embodiment, the step of classifying the search term by using a bayesian classification algorithm to obtain the search commodity category corresponding to the search term further includes:
extracting keywords from the search terms to obtain effective keywords;
the step of classifying the search terms by adopting a Bayesian classification algorithm to obtain the search commodity category corresponding to the search terms comprises the following steps:
and classifying the effective keywords by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the effective keywords.
In one embodiment, the step of extracting keywords from the search terms to obtain valid keywords includes:
and carrying out regular expression processing on the search word to obtain the effective keyword.
In one embodiment, the searching the search terms and displaying the search results according to the search commodity category in an ordered manner includes:
searching the search terms by adopting an Elasticissearch search engine;
detecting whether category sorting is set;
when detecting that category sorting is set, sorting and displaying the search result according to the category of the search commodity;
and when the set category sorting is not detected, sorting and displaying the search results according to the default sorting.
An article search device comprising:
the search word acquisition module is used for acquiring search words;
the commodity category acquisition module is used for classifying the search terms by adopting a Bayesian classification algorithm to acquire search commodity categories corresponding to the search terms;
and the sequencing display module is used for searching the search terms and sequencing and displaying the search results according to the search commodity category.
A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of:
acquiring a search word;
classifying the search terms by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the search terms;
and searching the search terms, and sequencing and displaying the search results according to the search commodity category.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a search word;
classifying the search terms by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the search terms;
and searching the search terms, and sequencing and displaying the search results according to the search commodity category.
According to the commodity searching method, the commodity searching device, the computer equipment and the storage medium, the search words are classified by adopting the Bayesian classification algorithm, so that the commodity searching results can be displayed in a sorted manner according to categories, the displaying of the searching results is more accurate, and the user perception is improved.
Drawings
Fig. 1 is a schematic view of an application scenario of a commodity search method in one embodiment;
FIG. 2 is a flowchart illustrating a method for searching for merchandise according to an embodiment;
FIG. 3 is a block diagram showing the structure of an article search apparatus according to an embodiment;
FIG. 4 is a diagram illustrating an internal structure of a computer device according to an embodiment;
FIG. 5 is a flowchart illustrating a method for searching for merchandise according to another embodiment;
fig. 6 is a schematic diagram illustrating an implementation process of the commodity search method in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Example one
The commodity searching method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 may be, but not limited to, various personal computers, servers, laptops, smartphones, tablets and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers. The terminal 102 inputs a search word, sends the search word to the server 104, sends a search request to the server, and the server 104 acquires the search word; classifying the search terms by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the search terms; and searching the search terms, and sequencing and displaying the search results according to the search commodity category.
Example two
In this embodiment, as shown in fig. 2, a method for searching for a commodity is provided, which includes:
In this step, the user inputs the search term through the front-end page, and the server obtains the search term input by the user.
And step 220, classifying the search terms by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the search terms.
Specifically, a Bayesian classification algorithm is used for carrying out commodity category classification on each participle of the search word, and the commodity category to which the user search word belongs is determined. Specifically, the establishment of the bayesian classification algorithm model requires the acquisition of all commodity categories in the whole commodity database, including primary classification, secondary classification or tertiary classification, and the training of all commodity data to obtain a probability matrix, then the probability arrays of the search terms in all commodity categories can be obtained according to the probability matrix, and finally the commodity category of the search terms is selected according to a set threshold, for example, the category with the probability greater than 0.1.
It should be understood that all of the commodity categories for the e-commerce platform are pre-stored in the database. In one embodiment, before step 220, the method further includes: marking the training keywords and the commodity categories to enable the training keywords and the commodity categories to establish a corresponding relation, inputting the marked training keywords and the commodity categories into a Bayesian classification algorithm for training, and obtaining a Bayesian classification algorithm model. Thus, a Bayesian classification algorithm which can classify according to the search terms and obtain the corresponding search commodity category can be obtained. By inputting the search terms, one commodity category corresponding to the search terms, namely the search commodity category, can be obtained from all commodity categories through a Bayesian classification algorithm.
In this step, the search terms are classified and calculated through a Bayesian classification algorithm model, so that the commodity category corresponding to the search terms, namely the search commodity category, is obtained. It should be understood that, in this step, there may be one or more product categories obtained by classification. Through the classification of the Bayesian classification algorithm model, the search commodity category corresponding to the search word can accurately correspond to the target searched by the user, and the search precision is improved.
And step 230, searching the search terms, and sequencing and displaying the search results according to the categories of the search commodities.
In this embodiment, an Elasticsearch engine is used to search the search terms, and the search results are displayed in an ordered manner according to the category of the search goods.
In particular, the Elasticsearch is a distributed, highly-extended, highly-real-time search and data analysis engine. It can conveniently make a large amount of data have the capability of searching, analyzing and exploring. The horizontal flexibility of the elastic search is fully utilized, so that the data becomes more valuable in a production environment. The implementation principle of the Elasticissearch is mainly divided into the following steps, firstly, a user submits data to an Elasticissearch database, then a word controller divides words of corresponding sentences, the weights and word division results are stored into the data, when the user searches data, the results are ranked and scored according to the weights, and then returned results are presented to the user.
In this embodiment, an elastic search engine is adopted and the categories of the commodities classified in the previous step are combined to perform searching, so that the search results can be displayed in a sorted manner according to the categories of the searched commodities.
Specifically, if the search is performed in a conventional manner, the display of the obtained search results may be displayed according to the relevance ranking with respect to the search term or based on the time ranking, so that different commodities are mixed and ranked, for example, the first is a certain brand of air-conditioning product, the second is a certain brand of refrigerator product, the third is another brand of air-conditioning product, and thus different categories of commodities are mixed and ranked and are not easy for the user to view.
In the embodiment, the search commodity categories are obtained after classification, so that the search results can be ordered according to the search commodity categories, for example, an elastic search engine is used for searching the search terms, the search results are ordered and displayed according to the search commodity categories, commodities of the same search commodity category are ordered and displayed, and commodities of another search commodity category are ordered and displayed after the commodities of the same search commodity category, so that the commodities of multiple categories can be ordered and displayed separately, cross ordering of the commodities of different categories is avoided, the commodities can be closer to the target of user search, the display of the search results is more accurate, and the user perception is improved.
In one embodiment, the step of searching the search terms and displaying the search results according to the search commodity category further includes:
acquiring a search grade corresponding to each search commodity category; the steps of searching the search terms and displaying the search results according to the search commodity category in a sequencing manner comprise: and searching the search words by adopting an Elasticissearch search engine, and sequencing and displaying the search results according to the category of the search commodities and the search grade.
In this embodiment, the search level may be set by a background user, and the search level is used to perform priority ranking on the categories of the goods or the goods, for example, the higher the search level is, the earlier the categories of the goods or the goods are ranked, and the lower the search level is, the later the categories of the goods or the goods are ranked. The manager of the e-commerce platform may set a search level of a commodity in a self-defined manner, for example, set a search level searchLevel of a certain commodity to be 1, searchLevel to be 2, searchLevel to be 3 … …, and the higher the search level is, the higher the rank matched by the similar commodity is. In this way, in this embodiment, when the Elasticsearch engine searches for the search term, the search results are sorted in combination with the search commodity category, and are also sorted in combination with the search rank. The search results can be sorted according to the arrangement of background personnel, so that the sorting arrangement of the search results is more flexible.
In one embodiment, a search grade corresponding to each search commodity category is obtained, and a search grade factor corresponding to the search grade is obtained, wherein each commodity category corresponds to a search grade, and each search grade corresponds to a search grade factor; and searching the search words by using an Elasticissearch search engine, and sequencing and displaying the search results according to the search commodity category and the search grade factor, wherein the smaller the value of the search grade factor is, the earlier the sequencing of the corresponding search commodity category is.
In one embodiment, the step of classifying the search terms by using a bayesian classification algorithm to obtain search commodity categories corresponding to the search terms includes:
classifying the effective keywords by adopting a Bayesian classification algorithm to obtain at least one search commodity category corresponding to the search word and a probability value corresponding to each search commodity category; the steps of searching the search terms and displaying the search results according to the search commodity category in a sequencing manner comprise: and searching the search words by using an Elasticissearch search engine, and sequencing and displaying the search results according to the search commodity category and the probability value corresponding to each search commodity category.
In this embodiment, when the search term is classified, a plurality of results, that is, a plurality of search product categories may be obtained. Training all commodity data to obtain a probability matrix by using a Bayesian classification algorithm model, then obtaining probability arrays of search words in all commodity categories according to the probability matrix, and finally selecting the commodity category of the search words according to a set threshold, for example, the commodity category with the probability greater than 0.1. The probability value is the probability of the commodity category corresponding to the search word or the probability of the commodity which reflects the target required to be searched by the user.
Specifically, when there are a plurality of commodity categories with probabilities greater than 0.1, an elastic search engine is used to search the search terms, and search results are displayed in a sorted manner according to the search commodity categories and probability values corresponding to the search commodity categories, specifically, the search results are displayed in a sorted manner according to the sequence of probability values from large to small.
In this embodiment, the bayesian classification algorithm training model needs to be established on the mass commodity data. The method comprises a commodity category list of the shopping mall, commodity names of the shopping mall, commodity prices, commodity advertisement information and the like. Bayesian Classification (NBC) is a method based on bayesian theorem and assuming mutual independence between feature conditions, where a given training set is first used to learn a joint probability distribution from input to output on the premise of independence between feature words, and an input X is used to find an output Y that maximizes the posterior probability based on the learned model. The sample data set D is { D1, D2, …, D3}, the corresponding sample data feature attribute set is X { X1, X2 …, xd }, the class variable is Y { Y1, Y2, …, ym }, namely D can be classified into ym type. Where X1, X2, …, and xd are independent and random, then the prior probability P1 ═ P (Y) of Y, and the posterior probability P2 ═ P (Y | X) of Y are obtained by naive bayes algorithm, and the posterior probability can be calculated from the prior probability P1 ═ P (Y), the evidence P (X), and the class conditional probability P (X | Y): p (Y | X) ═ P (Y) P (X | Y)/P (Y), i.e., the probability of Y appearing under X.
In one embodiment, after the step of classifying the effective keywords by using a bayesian classification algorithm to obtain at least one search product category corresponding to the search term and a probability value corresponding to each search product category, the method further includes:
extracting screening commodity categories with the probability value larger than a preset threshold value from each searching commodity category; the steps of searching the search terms by adopting an Elasticissearch search engine and carrying out sequencing display on the search results according to the search commodity categories and the probability values corresponding to the search commodity categories comprise: and searching the search words by adopting an Elasticissearch search engine, and sequencing and displaying the search results according to the screened commodity category and the probability value corresponding to the screened commodity category.
In this embodiment, after classifying the search terms, when obtaining a plurality of results, that is, when obtaining a plurality of search commodity categories, the bayesian classification algorithm model classifies the search terms to obtain a plurality of commodity categories corresponding to the search terms and probability values of the commodity categories, and extracts commodity categories having probability values greater than a preset threshold value from the probability values to serve as screening commodity categories. For example, if the preset threshold is 0.1, the search commodity category corresponding to the probability value greater than 0.1 is extracted from the probability values and used as the screening commodity category. When the Elasticsearch engine searches the search words, the search results are displayed in a sorting mode according to the screened commodity category and the probability value corresponding to the screened commodity category, and specifically, the search results are displayed in a sorting mode according to the sequence of the probability values from large to small. Specifically, the screened goods with the higher probability value are ranked in the front, and then the screened goods with the second probability value are ranked … …, so that the goods with the higher probability value are ranked in the front of the search result, and the goods with the lower probability value are ranked in the back of the search result, so that the search result is closer to the target required by the user, and the search accuracy is improved.
In one embodiment, the step of classifying the search terms by using a bayesian classification algorithm to obtain the search commodity category corresponding to the search terms further includes:
extracting keywords from the search terms to obtain effective keywords; the step of classifying the search terms by adopting a Bayesian classification algorithm to obtain the search commodity category corresponding to the search terms comprises the following steps: and classifying the effective keywords by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the effective keywords.
It should be understood that the search term input by the user may have invalid tone words, auxiliary words, etc., and the invalid term can be effectively deleted by extracting the keyword processing, so as to extract an effective keyword, i.e., an effective keyword, which has a higher association degree with the commodity category, the commodity model, the commodity name, and the commodity brand. Therefore, classification can be more accurate when a Bayesian classification algorithm is adopted subsequently, and searching can be carried out aiming at effective keywords when an Elasticissearch engine is adopted for searching, so that a cable result can be more accurate.
In one embodiment, the step of extracting the keywords from the search terms to obtain the effective keywords includes: and carrying out regular expression processing on the search word to obtain the effective keyword.
In this embodiment, the search term is subjected to keyword extraction processing by using a regular expression, so as to obtain an effective keyword. Specifically, in this embodiment, an IK chinese segmenter of the Elasticsearch is used to segment the search word, where a lexicon of the IK chinese segmenter is a self-defined lexicon, and the lexicon is established by manual screening and algorithm. The word segmentation can be more accurate and more conforms to the word segmentation terms of the commodities in the shopping mall. Therefore, the effective keywords can be effectively and accurately extracted from the search words.
In one embodiment, the searching the search terms and displaying the search results according to the search commodity category in an ordered manner includes:
searching the search terms by adopting an Elasticissearch search engine; detecting whether category sorting is set; when detecting that category sorting is set, sorting and displaying the search result according to the category of the search commodity; and when the set category sorting is not detected, sorting and displaying the search results according to the default sorting.
In this embodiment, the ranking of the search results includes category ranking and default ranking, in the category ranking, the search goods classification, the search level and the probability value obtained in the above steps are displayed in a ranking manner, and in the default ranking, the search results are displayed in a ranking manner according to the default ranking of the Elasticsearch engine. The background user can display the searched results according to different sorting methods by presetting or canceling the category sorting. The preset category sequencing is equivalent to a sequencing switch, when the sequencing switch is turned on, sequencing display is carried out according to the search commodity classification, the search level and the probability value obtained in the steps, and when the sequencing switch is turned off, sequencing display is carried out on the search result according to the default sequencing of an elastic search engine. It should be understood that the setting of the category sorting manner may be implemented by a control, an assignment, and the like, for example, whether a preset sorting value is 1 is detected, when the preset sorting value is 1, sorting and displaying are performed according to the search commodity classification, the search level, and the probability value obtained in the above steps, and when the preset sorting value is not 1, sorting and displaying are performed according to a default sorting of an elastic search engine.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 2 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
EXAMPLE III
In this embodiment, a commodity search method based on an Elasticsearch engine is provided, and includes:
And step 520, performing regular expression processing on the search terms to obtain effective keywords.
And 530, classifying the effective keywords by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the effective keywords and probability values corresponding to the search commodity categories.
And 540, extracting the screened commodity category with the probability value larger than a preset threshold value from each searched commodity category.
And 560, searching the effective keywords by using an elastic search engine, and sequencing and displaying the search results according to the screened commodity category, the search level and the probability value.
The search engine that this application search adopted is elastic search, on this search engine's basis, through setting up the mapping structure of commodity index ingeniously, influences the search scoring result through setting up index search grade factor to can let the commodity rank that the search grade is high lean on earlier, reach the effect that the commodity was promoted, improve the sales volume of promoting the commodity.
When a user inputs keywords for searching, the search results are sorted according to the grade of the matching degree of the commodities, wherein the search grade factor plays an important role in the grade of the matching of the commodities. In the second stage of search, if the user needs to perform single-dimensional ranking on the search results, such as sales volume, score, price, etc., the system performs bayesian classification algorithm calculation according to the search terms input by the user, calculates the commodity classification under the search terms, and then performs single and unique ranking on all commodities belonging to the category and related to the search terms of the user. Therefore, the effect of accurate sequencing of the search results is achieved. For example: on the e-commerce platform of a dungeon shop, the search term "electric cooker" is entered, and then clicks are ordered by "sales". If before optimization, a common search engine ranks the top-ranked products with the highest sales and the names of the products with "electric" or "pot", which is obviously not the search result intended by the user. After the search sequencing result is refined, for the search word of the electric cooker, the system calculates that the word of the electric cooker belongs to the category of the electric cooker through a Bayesian classification algorithm, so that when the electric cooker is sequenced according to the sales volume, the commodity name is provided with the electric cooker or the electric cooker, the sales volume is high, and commodities which do not belong to the category of the electric cooker cannot appear in the search sequencing result. Therefore, the problem of accuracy of search sequencing results is solved, the user can be further helped to find the desired commodity, the experience of the user in using a search function is improved, and the purchase rate of the user is improved.
Please refer to fig. 5 and fig. 6, the following embodiments:
0. the manager of the e-commerce platform can set the search level of the commodity in a self-defined manner, for example, set a certain commodity search level searchLevel 1 or searchLevel 2 or searchLevel 3. The higher the search level, the higher the rank the same type of goods are matched to.
1. The method comprises the steps of obtaining search terms input by a user, using a regular expression to process the received search terms, and removing characters or words (such as special symbols, stop words, tone words, expressions and the like) which are useless for searching. And then performing word segmentation on the search keyword by using an IK Chinese word segmentation device of the Elasticissearch, wherein the word bank is a self-defined word bank, and is established by manual screening and an algorithm. The word segmentation can be more accurate and is more in line with word segmentation terms of commodities in the shopping mall.
2. On the basis of 1, carrying out commodity category classification on each participle of the search keyword by using a Bayesian classification algorithm, and determining the commodity category to which the user search word belongs. Certainly, the establishment of the algorithm model requires collecting all commodity categories of the whole market data, including primary classification, secondary classification or tertiary classification, and training all commodity data to obtain a probability matrix, then obtaining the probability arrays of the search terms in all commodity categories according to the probability matrix, and finally selecting the commodity category of the search terms according to a set threshold (for example, a category with a probability greater than 0.1). The training model is required to be established on the basis of mass commodity data. The method comprises a commodity category list of the shopping mall, commodity names of the shopping mall, commodity prices, commodity advertisement information and the like. Bayesian Classification (NBC) is a method based on bayesian theorem and assuming mutual independence between feature conditions, where a given training set is first used to learn a joint probability distribution from input to output on the premise of independence between feature words, and an input X is used to find an output Y that maximizes the posterior probability based on the learned model. The sample data set D is { D1, D2, …, D3}, the corresponding sample data feature attribute set is X { X1, X2 …, xd }, the class variable is Y { Y1, Y2, …, ym }, namely D can be classified into ym type. Where X1, X2, …, and xd are independent and random, then the prior probability P1 ═ P (Y) of Y, and the posterior probability P2 ═ P (Y | X) of Y are obtained by naive bayes algorithm, and the posterior probability can be calculated from the prior probability P1 ═ P (Y), the evidence P (X), and the class conditional probability P (X | Y): p (Y | X) ═ P (Y) P (X | Y)/P (Y), i.e., the probability of Y appearing under X.
3. On the basis of 1 and 2, the search engine Elasticissearch searches the search words. If the order is the acquiescent order, the search engine carries out TF/IDF algorithm scoring on all matched commodities, the commodity score with the search level is correspondingly improved, the system adds 1.5 searchLevel on the basis of the original TF/IDF score, and the commodity with higher score is ranked more forward. If the order is not the default order (sales volume, price, score, etc.), the system takes the Bayesian classified commodity category obtained by searching the keywords as the screening condition on the premise of searching the commodity category of the words, reduces the commodity ordering range, and then performs single-dimension ordering on the commodities.
4. And displaying the search sequencing commodities. On the basis of 0, 1, 2 and 3, the system finishes the sorting of the search results of the user. Therefore, the problem that the sorting result of full-text search according to a certain dimension of the commodities is not accurate is solved, and the merchant can configure the commodity searching grade in a user-defined mode to realize the function of promoting specific commodities in the mall.
Example four
In the present embodiment, as shown in fig. 3, there is provided a product search device including:
a search term obtaining module 310, configured to obtain a search term;
a commodity category obtaining module 320, configured to perform classification processing on the search terms by using a bayesian classification algorithm, so as to obtain search commodity categories corresponding to the search terms;
and the sequencing display module 330 is configured to search the search terms, and sequence and display the search results according to the search commodity category.
In one embodiment, the apparatus further comprises:
the search grade acquisition module is used for acquiring search grades corresponding to various search commodity categories;
the sequencing display module is also used for searching the search terms by adopting an Elasticissearch search engine and sequencing and displaying the search results according to the search commodity category and the search grade.
In one embodiment, the product category acquiring module is further configured to classify the effective keywords by using a bayesian classification algorithm, and acquire at least one search product category corresponding to the search word and a probability value corresponding to each search product category;
the sequencing display module is also used for searching the search terms by adopting an Elasticissearch search engine and sequencing and displaying the search results according to the search commodity categories and the probability values corresponding to the search commodity categories.
In one embodiment, the apparatus further comprises:
a screened commodity category extraction module used for extracting screened commodity categories with the probability value larger than a preset threshold value from each searched commodity category;
the sorting display module is further used for searching the search terms by adopting an Elasticissearch search engine and sorting and displaying the search results according to the screened commodity category and the probability value corresponding to the screened commodity category.
In one embodiment, the apparatus further comprises:
the effective keyword extraction module is used for extracting keywords from the search words to obtain effective keywords;
the commodity category obtaining module is further used for classifying the effective keywords by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the effective keywords.
In an embodiment, the effective keyword extraction module is further configured to perform regular expression processing on the search term to obtain the effective keyword.
In one embodiment, the ranking presentation module comprises:
the search unit is used for searching the search terms by adopting an Elasticissearch search engine;
a category sort setting detection unit for detecting whether or not category sort is set;
the category sorting unit is used for sorting and displaying the search results according to the categories of the search commodities when the category sorting is detected to be set;
and the default sorting unit is used for sorting and displaying the search results according to the default sorting when the set category sorting is not detected.
For the specific limitation of the product searching device, reference may be made to the above limitation of the product searching method, and details are not repeated here. The respective units in the above-described article search device may be wholly or partially implemented by software, hardware, and a combination thereof. The units can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the units.
EXAMPLE five
In this embodiment, a computer device is provided. The internal structure thereof may be as shown in fig. 4. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program, and is deployed with a database for storing commodity data, commodity categories, and search ratings. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with other computer devices, such as a user terminal, and the like, which are deployed. The computer program is executed by a processor to implement a commodity search method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program:
acquiring a search word;
classifying the search terms by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the search terms;
and searching the search terms, and sequencing and displaying the search results according to the search commodity category.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring a search grade corresponding to each search commodity category;
and searching the search words by adopting an Elasticissearch search engine, and sequencing and displaying the search results according to the category of the search commodities and the search grade.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
classifying the effective keywords by adopting a Bayesian classification algorithm to obtain at least one search commodity category corresponding to the search word and a probability value corresponding to each search commodity category;
and searching the search words by using an Elasticissearch search engine, and sequencing and displaying the search results according to the search commodity category and the probability value corresponding to each search commodity category.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
extracting screening commodity categories with the probability value larger than a preset threshold value from each searching commodity category;
and searching the search words by adopting an Elasticissearch search engine, and sequencing and displaying the search results according to the screened commodity category and the probability value corresponding to the screened commodity category.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
extracting keywords from the search terms to obtain effective keywords;
and classifying the effective keywords by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the effective keywords.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and carrying out regular expression processing on the search word to obtain the effective keyword.
EXAMPLE six
In this embodiment, a computer-readable storage medium is provided, on which a computer program is stored, the computer program realizing the following steps when executed by a processor:
acquiring a search word;
classifying the search terms by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the search terms;
and searching the search terms, and sequencing and displaying the search results according to the search commodity category.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a search grade corresponding to each search commodity category;
and searching the search words by adopting an Elasticissearch search engine, and sequencing and displaying the search results according to the category of the search commodities and the search grade.
In one embodiment, the computer program when executed by the processor further performs the steps of:
classifying the effective keywords by adopting a Bayesian classification algorithm to obtain at least one search commodity category corresponding to the search word and a probability value corresponding to each search commodity category;
and searching the search words by using an Elasticissearch search engine, and sequencing and displaying the search results according to the search commodity category and the probability value corresponding to each search commodity category.
In one embodiment, the computer program when executed by the processor further performs the steps of:
extracting screening commodity categories with the probability value larger than a preset threshold value from each searching commodity category;
and searching the search words by adopting an Elasticissearch search engine, and sequencing and displaying the search results according to the screened commodity category and the probability value corresponding to the screened commodity category.
In one embodiment, the computer program when executed by the processor further performs the steps of:
extracting keywords from the search terms to obtain effective keywords;
and classifying the effective keywords by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the effective keywords.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and carrying out regular expression processing on the search word to obtain the effective keyword.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. A method for searching for a commodity, comprising:
acquiring a search word;
classifying the search terms by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the search terms;
and searching the search terms, and sequencing and displaying the search results according to the search commodity category.
2. The method according to claim 1, wherein the step of searching the search terms and displaying the search results in an ordered manner according to the search commodity category further comprises:
acquiring a search grade corresponding to each search commodity category;
the steps of searching the search terms and displaying the search results according to the search commodity category in a sequencing manner comprise:
and searching the search words by adopting an Elasticissearch search engine, and sequencing and displaying the search results according to the category of the search commodities and the search grade.
3. The method according to claim 1, wherein the step of classifying the search term by using a bayesian classification algorithm to obtain the search commodity category corresponding to the search term comprises:
classifying the effective keywords by adopting a Bayesian classification algorithm to obtain at least one search commodity category corresponding to the search word and a probability value corresponding to each search commodity category;
the steps of searching the search terms and displaying the search results according to the search commodity category in a sequencing manner comprise:
and searching the search words by using an Elasticissearch search engine, and sequencing and displaying the search results according to the search commodity category and the probability value corresponding to each search commodity category.
4. The method according to claim 3, wherein the step of classifying the valid keywords by using a Bayesian classification algorithm to obtain at least one search commodity category corresponding to the search term and probability values corresponding to the search commodity categories further comprises:
extracting screening commodity categories with the probability value larger than a preset threshold value from each searching commodity category;
the steps of searching the search terms by adopting an Elasticissearch search engine and carrying out sequencing display on the search results according to the search commodity categories and the probability values corresponding to the search commodity categories comprise:
and searching the search words by adopting an Elasticissearch search engine, and sequencing and displaying the search results according to the screened commodity category and the probability value corresponding to the screened commodity category.
5. The method according to claim 1, wherein the step of classifying the search term by using a bayesian classification algorithm to obtain the search commodity category corresponding to the search term further comprises:
extracting keywords from the search terms to obtain effective keywords;
the step of classifying the search terms by adopting a Bayesian classification algorithm to obtain the search commodity category corresponding to the search terms comprises the following steps:
and classifying the effective keywords by adopting a Bayesian classification algorithm to obtain search commodity categories corresponding to the effective keywords.
6. The method of claim 5, wherein the step of extracting the keywords from the search term to obtain the valid keywords comprises:
and carrying out regular expression processing on the search word to obtain the effective keyword.
7. The method according to any one of claims 1-6, wherein the step of searching the search terms and presenting the search results in a sorted manner according to the search commodity category comprises:
searching the search terms by adopting an Elasticissearch search engine;
detecting whether category sorting is set;
when detecting that category sorting is set, sorting and displaying the search result according to the category of the search commodity;
and when the set category sorting is not detected, sorting and displaying the search results according to the default sorting.
8. An article search device, comprising:
the search word acquisition module is used for acquiring search words;
the commodity category acquisition module is used for classifying the search terms by adopting a Bayesian classification algorithm to acquire search commodity categories corresponding to the search terms;
and the sequencing display module is used for searching the search terms and sequencing and displaying the search results according to the search commodity category.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011120497.2A CN112163142A (en) | 2020-10-19 | 2020-10-19 | Commodity searching method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011120497.2A CN112163142A (en) | 2020-10-19 | 2020-10-19 | Commodity searching method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112163142A true CN112163142A (en) | 2021-01-01 |
Family
ID=73867395
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011120497.2A Pending CN112163142A (en) | 2020-10-19 | 2020-10-19 | Commodity searching method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112163142A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101859424A (en) * | 2010-05-18 | 2010-10-13 | 上海购龙信息科技有限公司 | Method for realizing display of commodity purchasing comparison state information on mobile phone by Internet |
CN102841946A (en) * | 2012-08-24 | 2012-12-26 | 北京国政通科技有限公司 | Commodity data retrieval sequencing and commodity recommendation method and system |
CN104077286A (en) * | 2013-03-26 | 2014-10-01 | 北京京东尚科信息技术有限公司 | Commodity information search method and system |
CN109408710A (en) * | 2018-09-26 | 2019-03-01 | 斑马网络技术有限公司 | Search result optimization method, device, system and storage medium |
-
2020
- 2020-10-19 CN CN202011120497.2A patent/CN112163142A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101859424A (en) * | 2010-05-18 | 2010-10-13 | 上海购龙信息科技有限公司 | Method for realizing display of commodity purchasing comparison state information on mobile phone by Internet |
CN102841946A (en) * | 2012-08-24 | 2012-12-26 | 北京国政通科技有限公司 | Commodity data retrieval sequencing and commodity recommendation method and system |
CN104077286A (en) * | 2013-03-26 | 2014-10-01 | 北京京东尚科信息技术有限公司 | Commodity information search method and system |
CN109408710A (en) * | 2018-09-26 | 2019-03-01 | 斑马网络技术有限公司 | Search result optimization method, device, system and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111199428B (en) | Commodity recommendation method and device, storage medium and computer equipment | |
JP5075291B2 (en) | Information processing apparatus, information processing method, and recording medium recording information processing program | |
CN108959644B (en) | Search ranking method and device, computer equipment and storage medium | |
CN112632359B (en) | Information recommendation method, device, electronic equipment and storage medium | |
Peng et al. | A fuzzy PROMETHEE approach for mining customer reviews in Chinese | |
CN109063108B (en) | Search ranking method and device, computer equipment and storage medium | |
KR102147649B1 (en) | Method and apparatus for providing product information | |
CN111080398A (en) | Commodity recommendation method and device, computer equipment and storage medium | |
CN103246681B (en) | A kind of searching method and device | |
CN111178949B (en) | Service resource matching reference data determining method, device, equipment and storage medium | |
US11182540B2 (en) | Passively suggesting text in an electronic document | |
CN108205572A (en) | A kind of searching method, device and equipment | |
CN112100512A (en) | Collaborative filtering recommendation method based on user clustering and project association analysis | |
WO2020123689A1 (en) | Suggesting text in an electronic document | |
CN113343101B (en) | Object ordering method and system | |
CN111967914A (en) | User portrait based recommendation method and device, computer equipment and storage medium | |
CN112182145A (en) | Text similarity determination method, device, equipment and storage medium | |
CN111737548A (en) | Click verification code identification method and device, computer equipment and storage medium | |
CN114820123A (en) | Group purchase commodity recommendation method, device, equipment and storage medium | |
CN111831913A (en) | Potential competitor information recommendation method, device, equipment and storage medium | |
CN111815413A (en) | Big data commodity prediction system and method based on hot event | |
CN114253990A (en) | Database query method and device, computer equipment and storage medium | |
CN113706253A (en) | Real-time product recommendation method and device, electronic equipment and readable storage medium | |
JP5559750B2 (en) | Advertisement processing apparatus, information processing system, and advertisement processing method | |
CN112667571A (en) | Biomedical literature search and sorting method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |