Gated recurrent neural network-based restaurant delivery merchant category intelligent identification method and system
Patent Information
- Application Number
- CN202611115101.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-27
- Publication Date
- 2026-10-30
AI Technical Summary
针对现有技术依赖人工标注、平台标签不统一、餐品明细/图像数据获取困难等问题,本发明旨在提供一种仅使用餐饮配送商户名称文本即可实现品类自动识别的方法与系统
1. 输入极简:仅需商户名称文本一项字段,数据获取成本极低;
Smart Images

Figure CN123012809A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of natural language processing and deep learning technology, and in particular to a method and system for automatic identification of food delivery merchant categories based on recurrent neural networks and transfer learning. Background Technology
[0002] The rapid development of the online food delivery industry has led to a dramatic expansion of the data volume in the catering industry. Food categories are a key attribute dimension for depicting the spatial pattern of urban catering, conducting surveys on residents' dietary structures, and analyzing business layouts.
[0003] Existing technologies mainly include three types of solutions: (1) Manual labeling scheme: Personnel review merchant information one by one to summarize product categories. The labeling quality is high, but the labor cost increases linearly with the number of merchants, making it difficult to adapt to a scale of millions. (2) Platform native tagging solution: directly use the category tags provided by the delivery platform, but the tagging systems of different platforms are not consistent, and there are often problems of cross-platform tag conflicts for the same merchant; (3) Machine learning solutions based on detailed menu text or menu images: This requires collecting complete menu details or menu images, which has a high data collection threshold, poses a significant privacy risk, and cannot work when merchant information is incomplete.
[0004] None of the above solutions have addressed the technical requirement of achieving automated category identification using only the most basic, easily accessible, and publicly available information: the merchant's name. Summary of the Invention
[0005] (I) The technical problem to be solved by the present invention To address the problems of existing technologies such as reliance on manual labeling, inconsistent platform tags, and difficulty in obtaining detailed / image data of food items, this invention aims to provide a method and system for automatic category identification using only the text of the food delivery merchant's name.
[0006] (II) Technical means adopted in this invention This invention constructs a deep learning model that includes a character-level vector mapping layer, a multi-layer gated recurrent neural network layer, and a fully connected discriminant layer. It adopts a multi-stage transfer learning training strategy of "pre-training of general language representation → semi-supervised tuning of target domain character level → supervised tuning of category discriminator" to enable the model to capture semantic patterns in the character sequence of merchant names under limited labeled data conditions, thereby achieving end-to-end mapping from merchant names to categories.
[0007] (III) Technical Effects of the Invention 1. Extremely simple input: Only one field, the merchant's name text, is required, resulting in extremely low data retrieval costs; 2. Reliable recognition accuracy: In the validation test of tagged samples, the overall recognition accuracy and recall rate both reached approximately 72%. 3. Cross-language transferability: By replacing the pre-trained model in the first stage with the corpus in the second and third stages, it can be extended to any language scenario; 4. Strong visualization capabilities: It can generate large-scale regional category density distribution maps by combining geographic information; 5. Low deployment cost: The model is small in size and has a fast inference speed, and can be deployed in the cloud or on edge devices. Attached Figure Description
[0008] Figure 1 This is a diagram showing the overall system architecture of the present invention; Figure 2 This is a flowchart illustrating the multi-stage transfer learning process of this invention. Figure 3 This is a schematic diagram of the gated recurrent neural network structure of the present invention; Figure 4 This is a flowchart illustrating the training data preprocessing and annotation process of this invention. Figure 5 This is an application example of the present invention in Jiangxi Province—a multi-subgraph matrix diagram of the spatial distribution density of ten types of food items (illustrated diagram); Figure 6 This is a schematic diagram illustrating the performance of the ten categories of food items in this invention. Detailed Implementation
[0009] The present invention will now be described in further detail with reference to the accompanying drawings.
[0010] I. System Overall Architecture (corresponding to) Figure 1 ) like Figure 1 As shown, the system of this invention consists of a data acquisition module, a data preprocessing module, a category recognition model module (including a training submodule and an inference submodule), and a result output and visualization module. After data is collected from a food delivery platform, it undergoes preprocessing and annotation, and is then input into a multi-stage transfer learning deep model for training, ultimately outputting N categories of food category recognition results.
[0011] II. Data Acquisition and Standardization Processing (corresponding to) Figure 4 ) The data acquisition module retrieves merchant information in batches from mainstream food delivery service platforms via web crawlers or platform open interfaces. Example code implemented in Python is as follows:
[0012] [Python Code] import requests, json, time def fetch_merchant_names(platform_api, area_code, page_size=100): """Batch retrieve merchant names from the delivery platform interface""" merchant_list = [] page = 1 while True: resp = requests.get( platform_api, params={"area": area_code, "page": page, "size": page_size}, headers={"User-Agent": "PatentBot / 1.0"}, timeout=10 ) data = json.loads(resp.text) If not data.get("merchants"): break for m in data["merchants"]: merchant_list.append({ "merchant_id": m["id"], "merchant_name": m["name"], "raw_label": m.get("category", ""), "lat": m.get("latitude"), "lng": m.get("longitude") }) page += 1 time.sleep(0.5) return merchant_list The preprocessing steps are performed as described in claim 6:
[0013] [Python Code] import unicodedata, re def normalize_text(name: str, max_len: int = 40) -> str: """Merchant Name Standardization Processing (corresponding to claim 6)"" # (a) Unicode NFKD Normalization name = unicodedata.normalize("NFKD", name) name = "".join(c for c in name if not unicodedata.combining(c)) # (b) Convert all to lowercase name = name.lower() # (c) Remove leading and trailing whitespace and merge redundant whitespace in the middle. name = re.sub(r"\s+", " ", name).strip() if len(name) > max_len: name = name[:max_len] return name def char_tokenize(name, char2id, max_len=40, pad_id=0): Character-level tokenization (corresponding to claim 6(d)) ids = [char2id.get(c, char2id[" <unk>) for c in name] if len(ids) < max_len: ids = ids + [pad_id] * (max_len - len(ids)) return ids[:max_len]
[0014] III. Training Data Construction and Text Matching Priority Correction Mechanism (corresponding to Figure 4 ) The configurable token dictionary of the text matching priority correction mechanism (corresponding to claim 5(b)), each category is represented by the alphabetic code A to J, and the specific category semantics are configured as required in actual implementation:
[0015]
Python Code
[0016] [Python Code] import random from collections import defaultdict def balance_dataset(samples, target_size_per_class=4000, tau=100): """Make the difference in sample size for each category |n_i - n_j| <= tau""" class_buckets = defaultdict(list) for s in samples: class_buckets[s["label"]].append(s) balanced = [] for category, bucket in class_buckets.items(): if len(bucket) >= target_size_per_class: balanced.extend(random.sample(bucket, target_size_per_class)) else: balanced.extend(random.choices(bucket, k=target_size_per_class)) random.shuffle(balanced) return balanced
[0017] IV. Model Structure and Hyperparameter Configuration (corresponding) Figure 3 ) A complete model structure implementation example in PyTorch, strictly corresponding to the discriminant head structure (random deactivation + fully connected + normalized exponential function) in claim 1(5):
[0018] [Python Code] import torch import torch.nn as nn class MerchantCategoryClassifier(nn.Module): Category discriminator based on multi-stage transfer learning and gated recurrent neural networks The structure strictly corresponds to claims 1, 3, and 4: Character vector layer → Random vector deactivation → Gated recurrent network (L-layer, unidirectional or bidirectional) → Final-state random inactivation → Fully connected → Normalized exponential function """ def __init__(self, vocab_size, embed_dim=400, hidden_dim=1152, num_layers=3, num_classes=10, embed_dropout=0.1, inter_recurrent_dropout=0.2, hidden_dropout=0.4, bidirectional=False): super().__init__() # (a) Character-level vector mapping layer self.embedding = nn.Embedding(vocab_size, embed_dim, padding_idx=0) self.embed_dropout = nn.Dropout(embed_dropout) # (b) Gated cyclic encoder (unidirectional / bidirectional selectable) self.recurrent = nn.LSTM( input_size=embed_dim, hidden_size=hidden_dim, num_layers=num_layers, batch_first=True, dropout=inter_recurrent_dropout if num_layers > 1 else0.0, bidirectional = bidirectional ) out_dim = hidden_dim * (2 if bidirectional else 1) # (c) Discriminator: Random deactivation + Fully connected + Normalized exponential function self.hidden_dropout = nn.Dropout(hidden_dropout) self.fc = nn.Linear(out_dim, num_classes) def forward(self, x, seq_lengths=None): emb = self.embed_dropout(self.embedding(x)) seq_out, _ = self.recurrent(emb) # Weight 1(4): Take the hidden state of the last valid timing position. if seq_lengths is not None: idx = (seq_lengths - 1).view(-1, 1, 1).expand(-1, 1, seq_out.size(-1)) h_T = seq_out.gather(1, idx).squeeze(1) else: h_T = seq_out[:, -1, :] h_T = self.hidden_dropout(h_T) logits = self.fc(h_T) return logits def predict_proba(self, x, seq_lengths=None): return torch.softmax(self.forward(x, seq_lengths), dim=-1)
[0019] Hyperparameter configuration in this embodiment: Character vector dimension d_e=400 (within the range [50,512] of weight term 4(a)); Hidden layer dimension d_h=1152 (within the range [128,2048] of weight term 4(b)); Number of loop layers L=3 (within the range [1,6] of weight term 4(c)); Input length T_max=40 (within the range [20,128] of weight term 4(e)); Random vector deactivation=0.1; Random deactivation between loop layers=0.2; Random deactivation in the final state=0.4 (both within the range [0.1,0.7] of weight term 4(d)); Batch size=64; The optimizer uses an adaptive moment estimation method with weight decay (β1=0.9, β2=0.99); Differential rate decay factor γ=2.6 (within the range [2,3] of weight term 2).
[0020] V. Multi-stage transfer learning training algorithm (corresponding) Figure 2 ) Phase 1: Pre-training of general language representations, learning rate 1e-3, gradient L2 norm cutoff clip_norm=0.25: Loss function:
[0021] [Python Code] def stage1_pretrain_LM(corpus_loader, vocab_size, epochs=10, (lr=1e-3, clip_norm=0.25): """First stage: Learning rate η_1 ∈ [1e-4, 5e-3], gradient L2 norm truncation""" model = LanguageModel(vocab_size=vocab_size, embed_dim=400, hidden_dim=1152, num_layers=3) optimizer = torch.optim.AdamW(model.parameters(), lr=lr, weight_decay=1e-6) criterion = nn.CrossEntropyLoss(ignore_index=0) for epoch in range(epochs): for batch in corpus_loader: x, y = batch["input_ids"], batch["target_ids"] logits = model(x) loss = criterion(logits.reshape(-1, vocab_size),y.reshape(-1)) optimizer.zero_grad() loss.backward() torch.nn.utils.clip_grad_norm_(model.parameters(), clip_norm) optimizer.step() return model Second stage: Target domain character-level semi-supervised tuning, learning rate 1e-4 (i.e., 1 / 10 of η_1): Loss function:
[0022] [Python Code] def stage2_domain_finetune(pretrained_LM, merchant_loader, epochs=15, (lr=1e-4, clip_norm=0.25): """Second stage: η_2 <= η_1 (In this example, 1e-4 <= 1e-3)""" model = pretrained_LM optimizer = torch.optim.AdamW(model.parameters(), lr=lr) criterion = nn.CrossEntropyLoss(ignore_index=0) for epoch in range(epochs): for batch in merchant_loader: char_ids = batch["char_ids"] x, y = char_ids[:, :-1], char_ids[:, 1:] logits = model(x) loss = criterion(logits.reshape(-1, model.vocab_size), y.reshape(-1)) optimizer.zero_grad() loss.backward() torch.nn.utils.clip_grad_norm_(model.parameters(), clip_norm) optimizer.step() return model Phase 3: Supervised tuning of the discriminator, employing a layer-by-layer unfreezing and differential rate strategy: Loss function:
[0023] Differential rate:
[0024] [Python Code] def stage3_classifier_finetune(domain_LM, labeled_loader, num_classes=10, epochs=8, top_lr=1e-3, gamma=2.6, clip_norm=1.0): """Third stage: Layer-by-layer thawing + differential rate, γ ∈ [2, 3]""" classifier = MerchantCategoryClassifier.from_LM( domain_LM, num_classes=num_classes) # In the first round, all parameters are frozen, and only the discriminator head is trained. for name, param in classifier.named_parameters(): param.requires_grad = ("fc" in name) # Differential rate parameter set (top layer → bottom layer, each layer reduced by a factor of γ) param_groups = [ {"params": classifier.embedding.parameters(), "lr": top_lr / (gamma**3)}, {"params": classifier.recurrent.parameters(), "lr": top_lr / (gamma**2)}, {"params": classifier.fc.parameters(), "lr": top_lr}, ] optimizer = torch.optim.AdamW(param_groups, weight_decay=1e-2) scheduler = torch.optim.lr_scheduler.OneCycleLR( optimizer, max_lr=[g["lr"] for g in param_groups], total_steps=epochs * len(labeled_loader)) criterion = nn.CrossEntropyLoss() # Layer-by-layer thawing plan: Thaw one layer at a time in each round unfreeze_schedule = ["fc", "recurrent", "embedding"] for epoch in range(epochs): if epoch < len(unfreeze_schedule): layer_kw = unfreeze_schedule[epoch] for name, param in classifier.named_parameters(): if layer_kw in name: param.requires_grad = True for batch in labeled_loader: x, y = batch["char_ids"], batch["label_id"] logits = classifier(x) loss = criterion(logits, y) optimizer.zero_grad() loss.backward() torch.nn.utils.clip_grad_norm_(classifier.parameters(),clip_norm) optimizer.step() scheduler.step() return classifier
[0025] VI. Core Structure of Gated Recurrent Neural Networks (corresponding to) Figure 3 ) The core of the product category recognition model of this invention is a gated recurrent neural network. This network solves the gradient vanishing problem through gating mechanisms such as forgetting, input, and output, and can effectively capture long-distance dependencies in the character sequence of merchant names. The calculation process of a single recurrent unit is shown in formulas (1) to (6):
[0026] Finally, the probability distribution of N categories is output through a fully connected layer and a normalized exponential function, as shown in formula (7):
[0027] Where P(y_k|x) represents the probability that a given input name x belongs to the k-th category; w_k is the weight vector of the k-th category; h_T is the hidden state vector at the last valid temporal position of the recurrent network; b_k is the bias term of the k-th category; and N is the total number of categories.
[0028] VII. Algorithm for the Recognition Stage Single Merchant Identification Interface:
[0029] [Python Code] def identify_category(model, merchant_name, char2id, id2category,max_len=40): Single Merchant Identification Interface Input: The trained model (model), the merchant name (merchant_name) Output: {category: predicted category, confidence: confidence probability, top3: probability of the top 3 categories} """ model.eval() # Step 1-2: Preprocessing (corresponding to weight 6) normalized = normalize_text(merchant_name, max_len=max_len) # Step 3: Character-level tokenization (corresponding to weight 1(3)) char_ids = char_tokenize(normalized, char2id, max_len=max_len) seq_len = torch.tensor([sum(1 for i in char_ids if i != 0)]) x = torch.tensor([char_ids], dtype=torch.long) with torch.no_grad(): # Steps 4-5: Time series modeling + normalized exponential function (corresponding to weights 1(4)(5)) probs = model.predict_proba(x, seq_len)[0] pred_id = probs.argmax().item() top3_ids = probs.topk(3).indices.tolist() return { "category": id2category[pred_id], "confidence": float(probs[pred_id]), "top3": [(id2category[i], float(probs[i])) for i in top3_ids] }
[0030] VIII. Specific Implementation of Cross-Language Transfer to Chinese Scenarios For merchant category identification in Chinese scenarios, the present invention can be extended to Chinese scenarios through the cross-language transfer strategy described in claim 7(i): (1) Replace the general language model in the first stage with a pre-trained language model of the target language; (2) Replace the unlabeled corpus from the second stage with merchant name corpus in the target language; (3) Replace the labeled dataset in the third stage with merchant category samples in the target language.
[0031] [Python Code] from transformers import BertModel, BertTokenizer # Loading Chinese pre-trained models chinese_LM = BertModel.from_pretrained("hfl / chinese-roberta-wwm-ext") chinese_tokenizer = BertTokenizer.from_pretrained("hfl / chinese-roberta-wwm-ext") def build_chinese_vocab(merchant_names, min_freq=3): """Constructing a character set based on Chinese merchant names""" from collections import Counter counter = Counter() for name in merchant_names: counter.update(list(name)) vocab = [" <pad> ", " <unk>"] + [c for c, freq in counter.items() if freq >= min_freq] return {c: i for i, c in enumerate(vocab)}
[0032] IX. Spatial Visualization Aggregation Algorithm (corresponding to) Figure 5 ) Density calculation formula:
[0033] [Python Code] import geopandas as gpd import pandas as pd def aggregate_by_region(predictions, admin_gdf): Aggregate the identification results by administrative division unit and calculate the density ρ_ij = n_ij / A_i. df_pred = pd.DataFrame(predictions) gdf_pred = gpd.GeoDataFrame( df_pred, geometry=gpd.points_from_xy(df_pred.lng, df_pred.lat), crs="EPSG:4326" ) gdf_joined = gpd.sjoin(gdf_pred, admin_gdf, how="left", predicate="within") count = gdf_joined.groupby(["region_name", "category"]).size().unstack(fill_value=0) area = admin_gdf.set_index("region_name")["area_km2"] density = count.div(area, axis=0) return density def draw_multi_subplot_map(density, admin_gdf, output_path): "Drawing a visualization of a multi-subgraph matrix" import matplotlib.pyplot as plt categories = density.columns.tolist() fig, axes = plt.subplots(2, 5, figsize=(20, 8)) for ax, category in zip(axes.flatten(), categories): gdf_plot = admin_gdf.merge( density[category].rename("density"), left_on="region_name", right_index=True) gdf_plot.plot(column="density", ax=ax, legend=True, cmap="YlOrRd", edgecolor="black", linewidth=0.5) ax.set_title(category, fontsize=12) ax.axis("off") plt.tight_layout() plt.savefig(output_path, dpi=300)
[0034] 10. Deployment and Engineering Implementation The model can be exported to TorchScript or ONNX format, and a REST API online service is provided.
[0035] [Python Code] # Export as TorchScript scripted_model = torch.jit.script(model) scripted_model.save("category_classifier.pt") # Export to ONNX torch.onnx.export(model, dummy_input, "category_classifier.onnx", input_names=["char_ids"], output_names=["logits"], dynamic_axes={"char_ids": {0: "batch"}}) # Flask REST service from flask import Flask, request, jsonify app = Flask(__name__) @app.route(" / identify", methods=["POST"]) def identify_endpoint(): name = request.json["merchant_name"] result = identify_category(model, name, char2id, id2category) return jsonify(result) if __name__ == "__main__": app.run(host="0.0.0.0", port=8080)
[0036] XI. Application Example: Category Identification of Catering Delivery Merchants in Jiangxi Province Taking Jiangxi Province, China as a specific application example, the model, trained through cross-language transfer, automatically identifies the product categories of catering delivery merchants in 11 prefecture-level cities in Jiangxi Province (Nanchang, Jiujiang, Jingdezhen, Pingxiang, Xinyu, Yingtan, Ganzhou, Ji'an, Yichun, Fuzhou, and Shangrao), and aggregates them by prefecture-level city administrative region, generating data such as... Figure 5 The multi-subgraph matrix visualization shown depicts the density distribution of a category in each subgraph. (Note: This is a schematic visualization example; the actual data distribution should be based on the specific training data. For formal applications, the geographic base map should be the standard base map authorized by the Ministry of Natural Resources.)
[0037] XII. Category Identification Performance Evaluation (corresponding to) Figure 6 ) In the validation experiment with labeled samples, the overall recognition accuracy and recall of the model of this invention were approximately 72%. Among them, categories with large differences in language features (such as Oriental-style dishes and South Asian-style dishes) performed better, while categories with more overlapping language features (such as Western-style meat dishes and general fast food) performed relatively lower. Figure 6 The graph is for illustrative purposes only; the actual values should be based on the actual training data and experimental settings.
[0038] Thirteen, the beneficial effects of the present invention (1) Minimal input: Only one text field is required for the merchant name; (2) Reliable recognition accuracy: The overall accuracy rate reached approximately 72% in the experiment with labeled samples; (3) Cross-language transferability: By replacing the pre-trained model and corpus, it can be extended to any language; (4) Strong visualization capabilities: Supports administrative region aggregation and multi-subgraph matrix visualization output; (5) Low deployment cost: The model is lightweight and inference is fast.
[0039] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.< / unk> < / pad> < / unk>
Claims
1. A method for intelligent identification of food delivery merchant categories based on gated recurrent neural networks, characterized in that... The method includes the following steps in the identification phase: (1) Acquisition Steps: Acquire the text name x of the food delivery merchant to be identified; (2) Preprocessing step: Normalize the name text x to obtain normalized text x'; (3) Vector mapping step: The normalized text x' is mapped through a character-level vector mapping layer E ∈ R. (V×de) Convert to a character vector sequence {e1, e2, ..., e T }, where V is the size of the character set, d e For vector dimensions; (4) Temporal modeling steps: Input the character vector sequence into an encoder composed of L layers of unidirectional or bidirectional gated recurrent neural networks, and take the hidden state of the last valid temporal position of the sequence as the final hidden state representation h. T ∈ R (dh) ; (5) Category output step: The final hidden layer representation h T The discriminator, consisting of at least one random deactivation layer and one fully connected layer, outputs an N-dimensional category probability distribution via a normalized exponential function. The category with the highest probability is taken as the recognition result. The gated recurrent neural network is obtained through pre-training using a multi-stage transfer learning strategy.
2. The method according to claim 1, characterized in that... The multi-stage transfer learning strategy is specifically as follows: Phase 1 (General Language Representation Pre-training): The language model is trained on a general text corpus with the objective of minimizing the negative log-likelihood L1 of the next word prediction. The initial learning rate is η1 ∈ [1×10^2]. -4 5×10 -3 ], and apply L2 norm truncation to the parameter gradient; The second stage (semi-supervised tuning at the target domain character level): tuning is performed on an unlabeled merchant name corpus with the objective of minimizing the negative log-likelihood L2 of the next character prediction, with a learning rate η2 ≤ η1; The third stage (supervised tuning of the discriminator): The top layer is replaced with an N-dimensional normalized exponential classifier head, and training is performed with the goal of minimizing the cross-entropy loss L3. A layer-by-layer unfreezing strategy and a differential rate strategy are adopted, i.e., the learning rate η of the l-th layer is... l =η (l+1) / γ, attenuation factor γ ∈ [2, 3].
3. The method according to claim 1, characterized in that... The calculation process of each recurrent unit of the gated recurrent neural network is as follows: Forgotten Gate:f t = σ(W f · [h t-1 , x t ] + b f ); Input gate: i t = σ(W i · [h t-1 , x t ] + b i ); Candidate state: C̃ t = tanh(W C · [h t-1 , x t ] + b C ); Cell state: C t = f t ⊙ C t-1 + i t ⊙ C̃ t ; Output gate: o t = σ(W o · [h t-1 , x t ] + b o ); Hidden state:h t = o t ⊙ tanh(C t ); Where σ is the logistic activation function, ⊙ is element-wise multiplication, and W * , b * The parameters to be learned are denoted as . The above equations describe the computational processes of forgetting control, input control, candidate state generation, unit state update, output control, and hidden state generation, respectively.
4. The method according to claim 1, characterized in that... The specific structural parameters of the gated recurrent neural network satisfy the following range: (a) Character vector dimension d e ∈ [50, 512]; (b) Hidden layer dimension d h ∈ [128, 2048]; (c) The number of loops L ∈ [1, 6]; (d) Random inactivation probability p drop ∈ [0.1, 0.7], the random deactivation applies at least to one of the following locations: character vector output, inter-loop layer, and final hidden layer representation; (e) Maximum length T of the input sequence max ∈ [20, 128].
5. The method according to claim 1, characterized in that... Before training the gated recurrent neural network, a training data construction step is also included: (a) Collect a corpus of merchant names with original tags from food delivery platforms; (b) Correct the original tags according to the text hit priority correction mechanism: pre-define the tags for each category c k Configure at least one set of strong indicative lexical units K k When the merchant name, after normalization, contains any k ∈ K k At that time, the merchant was marked as category c. k If multiple product category terms are matched simultaneously, they are selected according to a preset priority order; if no terms are matched, the original platform tag mapping results are used. (c) Perform balanced sampling on the samples of each category so that the number of samples of each category in the training set satisfies |n i - n j |≤ τ, where τ is a preset threshold.
6. The method according to claim 1, characterized in that... The preprocessing steps specifically include: (a) Unicode NFKD normalization: x' = NFKD(x); (b) Convert all characters to lowercase: x' = lower(x'); (c) Remove leading and trailing whitespace characters and merge redundant whitespace in the middle; (d) Use a character-level tokenizer to split x' into a character sequence, and truncate or pad the sequence to a preset length T. max .
7. The method according to claim 1, characterized in that... The method supports cross-language transfer and spatial visualization extension: (i) Cross-language transfer: Replace the general language model in the first stage with a pre-trained language model of the target language, and replace the data source in the second and third stages with food delivery merchant name data in the target language; (ii) Spatial Visualization: The recognition results are associated with the merchant's geographical location information (longitude, latitude), and density aggregation statistics are performed on each category according to preset administrative division units. The density calculation formula is ρ. ij = n ij / A i , where n ij Let A be the number of merchants in the j-th category within the i-th administrative region. i The area of the administrative region is used to generate a spatial distribution visualization map of product category density, including a heat map or a multi-subplot matrix visualization map.
8. A smart identification system for food delivery merchant categories based on a gated recurrent neural network, characterized in that... It includes the following modules connected in sequence: (1) Data Acquisition Module: Acquires merchant name text from the food delivery platform; (2) Data preprocessing module: performs the preprocessing steps described in claim 6; (3) Training module: trains a gated recurrent neural network according to the multi-stage transfer learning strategy of claim 2, and includes a training data labeling submodule to perform the steps of claims 5(b) and 5(c); (4) Category identification model module: with a built-in gated recurrent neural network that has been trained, executes steps (3) to (5) of claim 1; (5) Result output and visualization module: Perform the visualization generation step described in claim 7(ii).
9. The system according to claim 8, characterized in that... The specific network structure parameters of the category identification model module satisfy claim 4; the result output and visualization module supports aggregating the identification results by prefecture-level city units of Chinese provincial administrative regions (e.g., Jiangxi Province) and outputting results in the form of a multi-subgraph matrix visualization graph.
10. An electronic device, comprising a memory and a processor, characterized in that... The memory stores an executable program, and when the processor executes the program, it implements the method as described in any one of claims 1 to 7, or the system as described in any one of claims 8 to 9; the memory may also be a non-transitory computer-readable storage medium.
