Vertical field corpus extraction method and device, electronic equipment and storage medium
By employing a multi-level filtering mechanism and a vertical domain corpus extraction method that combines keywords and semantic relevance, the problems of low extraction efficiency and high cost in existing technologies are solved. This achieves efficient and accurate acquisition of vertical domain corpora, improving the performance and reliability of large models.
Patent Information
- Application Number
- CN202511210645.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-27
- Publication Date
- 2025-12-30
AI Technical Summary
Existing methods for extracting corpora from vertical domains face challenges such as difficulty in designing relevance evaluation criteria, high cost of using models for filtering, and large scale of general corpora, resulting in insufficient performance and reliability of large models in vertical domains.
By acquiring general corpora and domain keywords and sample corpora from the target vertical field, a multi-level filtering mechanism is used. First, a coarse screening is performed based on domain keywords, and then a fine screening is performed based on the semantic relevance between candidate corpora and sample corpora. This includes keyword-level filtering and semantic relevance scoring, and a scoring proxy model is used for efficient screening.
It enables accurate and efficient extraction of relevant vertical domain corpora from general large-scale corpora, reducing computational pressure and cost, and improving the performance and reliability of large models in vertical domains.
Smart Images

Figure CN121234929A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, electronic device, and storage medium for extracting corpora from vertical domains. Background Technology
[0002] With the rapid development of large language models (hereinafter referred to as large models), their performance in general domains has been outstanding, demonstrating powerful capabilities in areas such as knowledge-based question answering, logical reasoning, and text analysis. However, current large models still have many shortcomings in vertical domains, such as healthcare, law, finance, and telecommunications. This is because vertical domains are often highly specialized and unique, with significant differences in language style, terminology, logical structure, and knowledge depth compared to general domains. Although large models are exposed to a large amount of general text during training, the low-frequency and scarce vertical domain data is easily overwhelmed by the massive general corpus, making it difficult for large models to learn the deep knowledge and professional details of these vertical domains. This can lead to comprehension biases, insufficient knowledge, and susceptibility to illusions when handling vertical domain tasks.
[0003] To address this shortcoming, incremental pre-training of the original large-scale model on vertical domain corpora is necessary. Through incremental pre-training, the large model can better learn the professional knowledge, terminology, and logic of the vertical domain corpus, thereby improving its performance and reliability in that domain. Extracting relevant vertical domain corpora from general large-scale corpora has become an important technical means to enhance vertical domain corpus resources. General corpora cover a wide range of topics and linguistic styles, are vast in scale, and come from diverse sources, providing rich potential material for expanding vertical domain corpora.
[0004] However, existing vertical corpus extraction methods still face challenges such as difficulty in designing relevance evaluation criteria, high cost of using model filtering, and large scale of general corpora.
[0005] Therefore, how to accurately and efficiently extract relevant vertical domain data from general large-scale corpora and improve the performance and reliability of large models in vertical domains has become a technical problem that the industry urgently needs to solve. Summary of the Invention
[0006] This application provides a method, apparatus, electronic device, and storage medium for extracting vertical domain corpora, which addresses the technical problem of how to accurately and efficiently extract relevant vertical domain corpora from general large-scale corpora, thereby improving the performance and reliability of large models in vertical domains.
[0007] This application provides a method for extracting corpora from vertical domains, including: Acquire several general corpora, as well as domain keywords and sample corpora for the target vertical field; Based on the domain keywords, the several general corpora are filtered to obtain several candidate corpora; The candidate corpora are filtered based on the semantic relevance between the candidate corpora and the sample corpora to obtain the corpora for the target vertical domain.
[0008] In some embodiments, the filtering of the general corpora based on the domain keywords to obtain a plurality of candidate corpora includes: Based on the frequency of occurrence of the domain keywords in any general corpus, the keyword frequency features of the general corpus are determined; Based on the ratio of the character length of the domain keywords to the total character length of any general corpus, the keyword character proportion feature of any general corpus is determined; Based on the keyword frequency features and / or the keyword character proportion features of any general corpus, determine the keyword-level similarity of any general corpus; If the keyword-level similarity is greater than a preset keyword-level similarity threshold, any of the general corpora will be identified as candidate corpora.
[0009] In some embodiments, determining the keyword frequency features of any general corpus based on the frequency of occurrence of the domain keywords in any general corpus includes: When there are multiple domain keywords, the sum of the occurrence counts of each domain keyword in any general corpus is determined as the keyword frequency feature of the general corpus.
[0010] In some embodiments, determining the keyword character proportion feature of any general corpus based on the ratio of the character length of the domain keywords to the total character length of any general corpus includes: When there are multiple domain keywords, the total character length of each domain keyword in any general corpus is determined based on the number of times each domain keyword appears in any general corpus and the character length of each domain keyword. The ratio of the sum of the total character lengths of keywords in each domain to the total character length of any general corpus is determined as the keyword character proportion feature of any general corpus.
[0011] In some embodiments, the domain keywords of the target vertical domain are determined based on the following steps: Obtain a systematic corpus set for the target vertical domain; The systematized corpus was segmented to obtain several initial keywords; Based on the first major model, the initial keywords are used to determine the domain, and the initial keywords are filtered to obtain several candidate keywords; Based on the second major model, the candidate keywords are validated for their domain characteristics, and the candidate keywords are filtered to obtain the domain keywords.
[0012] In some embodiments, the method further includes: Based on the third model, knowledge is generated from the domain keywords to obtain the knowledge description corpus corresponding to the domain keywords; The knowledge description corpus is added to the systematic corpus set of the target vertical domain.
[0013] In some embodiments, filtering the candidate corpora based on the semantic relevance between the candidate corpora and the sample corpora to obtain the corpora for the target vertical domain includes: The candidate corpus is scored semantically based on a scoring agent model, and the candidate corpus is filtered based on the scoring results to obtain the corpus of the target vertical domain. The scoring agent model is trained based on sample corpora from the target vertical domain.
[0014] In some embodiments, the sample corpus of the target vertical domain is determined based on the following steps: Obtain some general corpora; The semantic relevance of each general corpus in the target vertical domain is scored based on the fourth major model; The sample corpus is obtained by filtering the general corpus based on the scoring results of each general corpus.
[0015] In some embodiments, the scoring proxy model is determined based on the following steps: The sample corpus was used as training samples; The semantic relevance score of the sample corpus in the target vertical domain by the fourth major model is used as the sample label; The initial model is trained based on the training samples and the sample labels to obtain the scoring proxy model.
[0016] In some embodiments, the scoring of the semantic relevance of each general corpus in the target vertical domain based on the fourth model includes: Identify several prompts for different scoring approaches; The prompt words with different scoring approaches are input into the fourth model, which guides the fourth model to score the semantic relevance of each general corpus based on different scoring approaches, and obtains several scoring results. The average of the aforementioned scoring results is taken as the scoring result of the general corpus.
[0017] In some embodiments, the initial model includes a semantic extraction module and a scoring output module; the semantic extraction module is constructed based on a preset language model.
[0018] In some embodiments, training the initial model based on the training samples and the sample labels to obtain the scoring proxy model includes: During the training of the initial model, the model parameters of the semantic extraction module are fixed, and the model parameters of the scoring output module are updated.
[0019] This application provides a vertical domain corpus extraction device, including: The acquisition module is used to acquire several general corpora, as well as domain keywords and sample corpora from the target vertical field; A keyword-level filtering module is used to filter the several general corpora based on the domain keywords to obtain several candidate corpora; A semantic-level filtering module is used to filter the candidate corpora based on the semantic relevance between the candidate corpora and the sample corpora to obtain the corpora of the target vertical domain.
[0020] This application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the vertical domain corpus extraction method described above.
[0021] This application provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the vertical domain corpus extraction method described above.
[0022] The vertical domain corpus extraction method, apparatus, electronic device, and storage medium provided in this application acquire several general corpora, as well as domain keywords and sample corpora of the target vertical domain. Based on the domain keywords, the general corpora are filtered to obtain several candidate corpora. Based on the semantic relevance between the candidate corpora and the sample corpora, the candidate corpora are further filtered to obtain the corpora of the target vertical domain. Due to the multi-level filtering mechanism, filtering by keywords leverages its computational simplicity and speed to efficiently filter massive amounts of general corpora, greatly reducing the computational pressure and cost of subsequent processing. Building upon the previous filtering stage, semantic relevance filtering ensures that the final selected corpora are not only relevant at the lexical level but also highly consistent with the target vertical domain at the semantic level. This method effectively balances the relationship between the accuracy, recall, and computational cost of corpus extraction, achieving accurate and efficient extraction of relevant vertical domain corpora from large-scale general corpora, thus improving the performance and reliability of large models in vertical domains. Attached Figure Description
[0023] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0024] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is one of the flowcharts illustrating the vertical domain corpus extraction method provided in this application.
[0026] Figure 2 This is a flowchart illustrating the domain keyword extraction method provided in this application.
[0027] Figure 3 This is a schematic diagram illustrating the training and application process of the scoring proxy model provided in this application.
[0028] Figure 4 This is the second flowchart of the vertical domain corpus extraction method provided in this application.
[0029] Figure 5 This is a schematic diagram of the vertical domain corpus extraction device provided in this application.
[0030] Figure 6 This is a schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation
[0031] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0032] It should be noted that the terms "first," "second," etc., used in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps, units, or modules is not necessarily limited to those explicitly listed, but may include other steps, units, or modules not explicitly listed or inherent to such processes, methods, products, or devices.
[0033] In order to address the shortcomings of related technologies, Figure 1 This is one of the flowcharts illustrating the vertical domain corpus extraction method provided in this application, such as... Figure 1 As shown, the method includes steps 110, 120 and 130.
[0034] Step 110: Obtain several general corpora, as well as domain keywords and sample corpora for the target vertical field.
[0035] Specifically, the execution entity of the vertical domain corpus extraction method provided in this application embodiment is a vertical domain corpus extraction device. This device can be implemented in software, such as a vertical domain corpus extraction program running on a computer; or it can be implemented in hardware, such as a computer, server, or cloud platform that executes the vertical domain corpus extraction method.
[0036] Corpus is short for language material, referring to any collection of real-world language samples used for purposes such as language research, natural language processing, and language teaching. In short, a corpus is a large collection of text or speech data that is systematically collected, organized, and labeled to analyze language patterns, train models, or validate theories.
[0037] A general corpus refers to a large-scale text dataset that has not undergone domain-specific filtering, and encompasses a wide range of content and themes. While general corpora are diverse in origin and extremely large in scale, content related to specific vertical domains constitutes a relatively low proportion and is often mixed within them. In this application's embodiments, any dataset containing natural language text can be considered a general corpus.
[0038] A target vertical domain refers to a specialized field from which relevant corpus is expected to be extracted. This domain typically possesses specific industry knowledge, terminology, and expression habits. For example, a target vertical domain could be the medical field, the legal field, the financial field, the automotive engineering field, the chemical materials field, or the integrated circuit design field, etc.
[0039] Domain keywords refer to a set of words or phrases that can highly summarize and represent the core concepts of a target vertical domain. These keywords serve as the basis for initial filtering. Domain keywords can be obtained in various ways; for example, they can be compiled and provided by domain experts based on their professional knowledge, or they can be extracted from relevant literature in the target vertical domain.
[0040] Sample corpora refer to corpora that can serve as standard examples in a specific vertical domain. These corpora are recognized documents that are highly relevant to the domain's theme and possess excellent content quality. The primary function of sample corpora is to serve as a reference point in the subsequent semantic filtering stage to determine the relevance of other corpora. For example, sample corpora in the legal field could include classic legal provisions, sample judgments from high courts, etc.
[0041] Step 120: Filter several general corpora based on domain keywords to obtain several candidate corpora.
[0042] Specifically, by using domain keyword matching and other methods in the general corpus, a large number of obviously irrelevant parts can be quickly removed from the massive general corpus, thereby reducing the data scale for subsequent processing and lowering the overall computational cost.
[0043] In this application embodiment, the specific implementation methods for filtering based on domain keywords may include the following, but are not limited to: (1) Existence judgment: Determine whether each general corpus contains at least one or a preset number (e.g., N, N≥1) domain keywords. If it contains them, the corpus is retained as a candidate corpus; otherwise, it is discarded.
[0044] (2) Frequency or density judgment: Calculate the frequency or density of domain keywords in each general corpus. For example, a word frequency threshold (e.g., the cumulative number of times a keyword appears is no less than 5 times) or a density threshold (e.g., the total number of words of the keyword accounts for no less than 0.5% of the total number of words in the corpus). Only corpora whose indicators (frequency or density) exceed the threshold are judged as candidate corpora. This method can effectively avoid misjudgment caused by the accidental appearance of individual keywords.
[0045] (3) Comprehensive indicator judgment: Multiple statistical indicators can be combined for comprehensive judgment. For example, the types of keywords, the total number of occurrences, and the distribution in the text can all meet certain conditions.
[0046] This step filters a massive amount of general-purpose predictions, forming a smaller set of candidate corpora with higher relevance probabilities. These candidate corpora are the intermediate corpora that have passed keyword filtering and await further semantic-level refinement.
[0047] Step 130: Filter several candidate corpora based on the semantic relevance between the candidate corpora and the sample corpora to obtain the corpora of the target vertical domain.
[0048] Specifically, while filtering by domain keywords is efficient and low-cost, it may not accurately identify the true meaning of the context. For example, a social news report mentioning "a company is engaged in a legal battle with its rival" contains the keyword "law," but it is not a professional legal text. Therefore, this step aims to use deep semantic understanding to more accurately filter candidate data.
[0049] Semantic relevance refers to the degree of similarity between two corpora at the semantic and thematic levels. In this application, it specifically refers to the degree of semantic similarity between a candidate corpus and a sample corpus representing the domain standard.
[0050] First, the candidate and sample corpora need to be converted into a mathematical form that machines can understand and compare, typically high-dimensional vectors, i.e., text embedding. This step can be achieved using various techniques, such as the traditional bag-of-words model or the Term Frequency-Inverse Document Frequency (TF-IDF) algorithm. Alternatively, a pre-trained language model can be used to encode the entire candidate corpus or its key parts into a vector that captures deep semantic information. Another approach is to encode all the text in the sample corpus and then calculate an average or representative vector.
[0051] Secondly, after obtaining the vector representations of the candidate corpus and the sample corpus, the similarity score between them is calculated. Commonly used calculation methods include cosine similarity and Euclidean distance.
[0052] Next, a semantic relevance threshold is set (e.g., cosine similarity greater than 0.8). For each candidate corpus, its semantic relevance score with the sample corpus is calculated. If the score is higher than the threshold, the candidate corpus is considered to be highly semantically relevant to the target vertical domain and is retained as the final corpus for the target vertical domain; if the score is lower than the threshold, it is discarded.
[0053] The final corpus for the target vertical domain is a high-quality dataset that has passed two stages: keyword coarse screening and semantic fine screening.
[0054] The vertical domain corpus extraction method provided in this application obtains several general corpora, as well as domain keywords and sample corpora of the target vertical domain; filters the general corpora based on the domain keywords to obtain several candidate corpora; filters the candidate corpora based on the semantic relevance between the candidate corpora and the sample corpora to obtain the corpora of the target vertical domain; due to the adoption of a multi-level filtering mechanism, filtering by keywords, taking advantage of its simple and fast characteristics, efficiently filters massive general corpora, greatly reducing the computational pressure and cost of subsequent processing; based on the previous level of filtering, filtering by semantic relevance ensures that the finally selected corpora are not only relevant at the lexical level, but also highly consistent with the target vertical domain at the semantic level; this method effectively balances the relationship between the accuracy, recall and computational cost of corpus extraction, realizes accurate and efficient extraction of relevant vertical domain corpora from general large-scale corpora, and improves the performance and reliability of large models in vertical domains.
[0055] It should be noted that each implementation method of this application can be freely combined, rearranged, or executed individually, and does not need to rely on or depend on a fixed execution order.
[0056] In some embodiments, several general corpora are filtered based on domain keywords to obtain several candidate corpora, including: Based on the frequency of occurrence of domain keywords in any general corpus, the keyword frequency characteristics of any general corpus are determined; The keyword character proportion feature of any general corpus is determined by the ratio of the character length of domain keywords to the total character length of any general corpus. Based on the keyword frequency features and / or the keyword character proportion features of any general corpus, determine the keyword-level similarity of any general corpus; If the keyword-level similarity is greater than the preset keyword-level similarity threshold, any general corpus will be selected as a candidate corpus.
[0057] Specifically, in order to filter domain keywords more accurately and avoid introducing a large amount of irrelevant data due to the accidental appearance of a single domain keyword, this application proposes a filtering scheme based on multi-dimensional statistical features.
[0058] Keyword frequency features specifically refer to the total number of times words from a predefined list of domain keywords appear in a single piece of general corpus (such as a document or a paragraph). This feature aims to quantify the strength of the association between the corpus and the target vertical domain. Generally, the more frequently the domain keywords appear, the more focused and in-depth the discussion of the corpus content is on the topic of that vertical domain.
[0059] Keyword character proportion feature refers to the ratio between the sum of the character lengths of all hit domain keywords in a single general corpus and the total character length of the corpus. This feature is introduced to eliminate interference from document length itself. For example, a general novel of a million words may contain a few domain keywords by chance; relying solely on word frequency might lead to incorrect selection. The keyword character proportion feature, however, effectively measures the proportion or weight of domain keywords within the entire corpus; a higher proportion indicates a closer connection between the core content of the corpus and the domain keywords.
[0060] Keyword-level similarity is a comprehensive metric used to determine whether a general corpus passes the initial screening. It can be determined based on one or two of the features mentioned above. Here, "and / or" means that either keyword frequency or keyword character proportion can be used alone as keyword-level similarity; or both of the above features can be selected simultaneously as keyword-level similarity.
[0061] The preset keyword-level similarity threshold is a single value or a set of values pre-set based on experience or experiments. Let's assume the preset keyword-level similarity threshold is a dual threshold: a keyword frequency feature threshold set to 2, and a keyword character proportion feature threshold set to 5%. Both features are selected as the keyword-level similarity.
[0062] For any general corpus, the keyword frequency feature must be greater than 2 and the keyword character proportion feature must be greater than 5% to determine the general corpus as a candidate corpus. Conversely, if either condition is not met, the corpus will be filtered out.
[0063] The vertical domain corpus extraction method provided in this application significantly improves the accuracy of the initial screening stage by introducing and combining keyword frequency features and keyword character proportion features for keyword-level filtering. It not only focuses on the frequency of domain keywords in the corpus but also on the actual weight of these keywords in the text. This effectively eliminates excessively long, general corpora that only occasionally mention domain terms sporadically, as well as corpora with high keyword proportions but overly brief discussion content lacking substantial information. The resulting candidate corpora are of higher quality and more relevant, providing better input for the subsequent fine screening stage, thereby improving the final effect and efficiency of the entire vertical domain corpus extraction process.
[0064] In some embodiments, the keyword frequency characteristics of any general corpus are determined based on the frequency of occurrence of domain keywords in any general corpus, including: When there are multiple domain keywords, the sum of the occurrences of each domain keyword in any general corpus is determined as the keyword frequency feature of any general corpus.
[0065] Specifically, in practical applications, to comprehensively represent a target vertical domain, the constructed domain keyword list is usually a collection of hundreds or thousands of words, rather than a single keyword. Therefore, this application's embodiments illustrate how to calculate keyword frequency features that accurately reflect the relevance of the corpus when there are multiple domain keywords.
[0066] Iterate through the list of domain keywords and check if any domain keyword appears in any general corpus. If any domain keyword appears in any general corpus, increment its frequency by 1. This process can be expressed by the formula: .
[0067] in, For the first Keywords for each field For the first A general corpus, The total number of keywords. For the first A general corpus Keyword frequency features Indicates condition If the condition is met, the value is 1.
[0068] The vertical domain corpus extraction method provided in this application, through the summation calculation method, makes the judgment basis for keyword-level filtering more sufficient and robust, and can more finely distinguish texts with different degrees of relevance, thereby improving the screening resolution and accuracy of the coarse screening stage, and laying a solid foundation for finally obtaining high-purity domain corpus.
[0069] In some embodiments, the keyword character proportion feature of any general corpus is determined based on the ratio of the character length of domain keywords to the total character length of any general corpus, including: When there are multiple domain keywords, the total character length of each domain keyword in any general corpus is determined based on the number of times each domain keyword appears in any general corpus and the character length of each domain keyword. The ratio of the sum of the total character lengths of keywords in various fields to the total character length of any general corpus is determined as the keyword character proportion feature of any general corpus.
[0070] Specifically, we can count the number of... Keywords in each field In the A general corpus Number of times in Multiplied by the first Keywords in each field character length The first one can be calculated. Keywords in each field In the A general corpus The total length of characters in the text.
[0071] Sum the total character length of keywords in each domain, and then sum the results with the sum of the characters in the first domain. A general corpus Total character length Divide them to determine the ratio as the first value. A general corpus Keyword character ratio characteristics It can be expressed by the formula: .
[0072] In conjunction with the previous embodiment, after completing the keyword feature calculation, thresholds are set for the keyword frequency feature and the keyword character proportion feature, respectively. Only when both indicators are higher than the threshold can subsequent steps be carried out; otherwise, they are discarded.
[0073] The vertical domain corpus extraction method provided in this application uses keyword character proportion features to more accurately reflect the actual content proportion of core domain concepts in the text. Compared to simply calculating the types of different keywords or simple word frequencies, this method can better distinguish between two situations: one where the corpus broadly but superficially mentions multiple terms, and the other where the corpus is focused and deeply elaborates on a few core terms. This weighted calculation method makes the feature value more sensitive to the focus of the text content, thus providing a more robust and discriminative metric for keyword-level filtering, significantly improving the reliability of the screening decision, and ensuring that the candidate corpus entering the next stage is truly text dominated by domain-related content.
[0074] In some embodiments, the domain keywords of the target vertical are determined based on the following steps: Obtain a systematic corpus set for the target vertical domain; The systematized corpus was segmented to obtain several initial keywords; Based on the first major model, the initial keywords are used to determine the domain, and several initial keywords are filtered to obtain several candidate keywords; Based on the second major model, domain validation is performed on the candidate keywords, and several candidate keywords are filtered to obtain domain keywords.
[0075] Specifically, Figure 2 This is a flowchart illustrating the domain keyword extraction method provided in this application, such as... Figure 2 As shown, this method includes a highly automated, systematic, and iteratively optimizable implementation scheme. High-quality domain keywords are the fundamental guarantee for the accuracy of subsequent keyword-level filtering.
[0076] A systematic corpus collection refers to a collection of high-quality, high signal-to-noise ratio authoritative texts that are collected in a systematic manner and can represent the knowledge framework and core concepts of a vertical domain.
[0077] First, collect relevant corpora in a systematic way. These can be obtained from the following types of data: (1) Professional courses: covering the basic theories and practical knowledge of the field; (2) Exam questions: exam questions related to the field, which may be a question bank for professional or vocational exams; (3) Standard documents: industry standards, agreements or normative documents; (4) Equipment documents: technical documents, operation manuals or maintenance guidelines for equipment related to the field; (5) Professional exam materials: such as certification exam materials for relevant vertical fields.
[0078] These input data ensure the comprehensiveness and authority of keyword extraction, covering multiple dimensions such as theory, practice, industry standards, and professional examinations.
[0079] Subsequently, all these text data are concatenated to form a complete and systematic corpus, and then segmented. The word list obtained after this segmentation stage is a large candidate set containing the initial keywords, but it has not been refined and still contains a large number of redundant or irrelevant words. Therefore, further keyword filtering is required.
[0080] In this embodiment, the semantic understanding capability of the first large model can be used to perform domain discrimination on the initial keywords, and filter several initial keywords to obtain several candidate keywords. The first large model can be a pre-trained large language model with strong general knowledge and logical reasoning capabilities, and can be selected from large models publicly available in related technologies. The specific implementation of domain discrimination is usually to guide the first large model to complete the task through carefully designed prompts. For example, the prompt could be "You are a senior expert in [target vertical field, such as: artificial intelligence]. Please identify and select all professional terms belonging to this field from the following list of words. Please note that you need to exclude general words that are not specific to this field. Please output the results in list form."
[0081] The first major model uses its internal knowledge and understanding of the prompt words to judge the initial input keywords one by one or in batches, and selects words that it believes are related to the target vertical field, which are a number of candidate keywords.
[0082] For the initially filtered candidate keywords, a second round of manual verification is conducted. Experts verify each keyword individually to ensure a strong relevance to the vertical domain. Alternatively, a second model can be used to perform domain-specific verification on the candidate keywords, providing a final and more rigorous review to obtain the final domain-specific keywords, ensuring the accuracy of the final keyword library.
[0083] The second model can be the same as the first model, or it can be a different model. The emphasis here is on its role in performing the second-stage validation function. Domain validation is typically implemented by guiding the second model through carefully designed prompts. For example, the prompt might be: "You are a top expert in [target vertical domain], and your task is to conduct the final quality audit. For each of the following candidate words, determine whether it is an indispensable core term in this domain. If not, remove it. Return only the final list of core terms that have undergone your rigorous validation."
[0084] After the final verification step, the domain keywords obtained are high-quality, high-coverage, and high-accuracy keywords that can be used in subsequent corpus extraction processes.
[0085] The vertical domain corpus extraction method provided in this application, by leveraging the powerful semantic understanding and inductive capabilities of large language models, highly automates the previously tedious and laborious keyword compilation work that required significant manual input, greatly improving efficiency. Simultaneously, through domain discrimination and validation, it ensures that the final generated domain keywords are both comprehensive and accurate, providing a solid and reliable data foundation for the effectiveness of the entire vertical domain corpus extraction method and fundamentally improving the quality of the extraction results.
[0086] In some embodiments, the method further includes: Based on the third model, knowledge is generated from domain keywords to obtain knowledge description corpus corresponding to the domain keywords; Add the knowledge description corpus to the systematic corpus set of the target vertical domain.
[0087] Specifically, the quality and coverage of domain keywords heavily depend on the quality of systematic corpus collection. To avoid the problem of reduced vocabulary quality caused by incomplete coverage of systematic corpus collection, after domain validation, a large model can be used to generate relevant knowledge descriptions as new corpus.
[0088] First, leveraging the content generation capabilities of large language models, detailed knowledge description corpora rich in contextual information are generated based on extracted domain keywords.
[0089] The third major model can be the same model entity as the first or second major model mentioned in the above embodiments, or it can be another large language model specifically optimized for knowledge question answering or content generation tasks. Its key capability lies in its ability to generate a well-structured, accurate, and information-rich explanatory text based on a given term.
[0090] The specific implementation of knowledge description corpus generation usually involves guiding the third major model to complete the task through carefully designed prompts. For example, the prompts could be: "You are a communications, network, and computer expert, and I am a PhD student in communications. Please teach me the relevant knowledge of [keywords in a certain field] using textbook-level professional language. Minimize mathematical operations and symbols; including but not limited to the full name, definition, concept, characteristics, advantages and disadvantages, relationship with other knowledge, and application scenarios of the knowledge points."
[0091] The newly generated knowledge description corpus is added to the systematic corpus set of the target vertical domain.
[0092] The vertical domain corpus extraction method provided in this application transforms the keyword extraction process from a linear, one-off task into a dynamic, self-improving, and evolving intelligent process. This effectively solves the core pain point of limited initial corpus coverage, enabling keywords to expand and improve automatically and in a snowballing manner, greatly enhancing the comprehensiveness and completeness of the final domain keywords.
[0093] In some embodiments, several candidate corpora are filtered based on the semantic relevance between the candidate corpora and the sample corpora to obtain corpora for the target vertical domain, including: The candidate corpus is scored semantically based on a scoring agent model, and the candidate corpus is filtered based on the scoring results to obtain the corpus of the target vertical domain. The scoring agent model is trained based on sample corpora from the target vertical domain.
[0094] Specifically, the number of candidate corpora obtained after keyword coarse screening can still be enormous (e.g., millions or even billions of entries). If a method is adopted that directly calculates the semantic similarity between each candidate corpus and the sample corpus in real time (e.g., using a general pre-trained large model to obtain the embedding vectors separately and then calculating the cosine similarity), the computational overhead and time cost will be enormous, even unacceptable in industrial applications. Therefore, this application proposes an innovative solution: constructing and using a dedicated scoring proxy model to complete this semantic fine screening task.
[0095] A scoring proxy model refers to a relatively small, lightweight model with an optimized structure. It may not possess the comprehensive knowledge of a general-purpose large model, but through specialized training, it is molded into an expert model for a specific task. Its sole function is to receive a corpus as input and efficiently score the semantic relevance of the input corpus to the target vertical domain.
[0096] The scoring proxy model can be trained using sample corpora from the target vertical domain, or its parameters can be fine-tuned on an already trained model. This allows the scoring proxy model to learn and internalize the deep semantic features, topic distribution, writing style, and even knowledge structure contained in the sample corpora. Through training, the scoring proxy model can then score the semantic relevance of candidate corpora.
[0097] The candidate corpora are filtered based on the scoring results to obtain the corpora for the target vertical domain. For example, a preset semantic scoring threshold (e.g., 0.85) can be set. The scoring result of each candidate corpus is compared with this threshold. Only candidate corpora with scores greater than the threshold are ultimately retained and become the corpora for the target vertical domain. Candidate corpora with scores lower than the threshold are discarded.
[0098] The vertical domain corpus extraction method provided in this application cleverly avoids the high computational cost and time latency associated with directly using large-scale language models for full semantic evaluation by introducing and training a dedicated, lightweight scoring proxy model for semantic filtering. This method transforms the complex and dynamic task of semantic similarity calculation into a pattern of one-time training and multiple efficient inferences. This makes deep semantic screening of massive candidate corpora possible, greatly improving the engineering practicality and scalability of the entire corpus extraction process. Ultimately, while ensuring screening accuracy, it achieves efficient, low-cost, and accurate semantic relevance evaluation of the corpus.
[0099] In some embodiments, the sample corpus of the target vertical domain is determined based on the following steps: Obtain some general corpora; The fourth model is used to score the semantic relevance of various general corpora in the target vertical domain; Based on the scoring results of various general corpora, several general corpora are filtered to obtain sample corpora.
[0100] Specifically, the final performance of the scoring proxy model directly depends on the quality and scale of its training data. Manually constructing a large-scale, high-quality, and precisely labeled sample corpus is an extremely time-consuming and labor-intensive task. To address this, this application proposes an innovative method for automatically generating high-quality sample corpora using large language models.
[0101] First, a general corpus is obtained. This general corpus can be from the same source as the general corpus obtained in the above embodiments, or it can be another independent dataset with extensive content.
[0102] Secondly, the fourth model is used to score the semantic relevance of each general corpus in the target vertical domain, and the general corpus is filtered according to the scoring results to obtain the sample corpus.
[0103] The fourth type of model refers to a large-scale pre-trained language model with top-tier semantic understanding, logical reasoning, and instruction-following capabilities. Typically, it is a flagship model with a massive number of parameters. Such a powerful model is chosen to maximize the accuracy and authority of its scoring results, ensuring that its scoring behavior simulates or even surpasses that of human domain experts.
[0104] Semantic relevance scoring can be accomplished by sending carefully crafted prompts to the fourth model. The execution unit takes each general corpus as input, along with the prompt. For example, the prompt might be: "You are a senior expert in [target vertical domain]. Please carefully read the following text and evaluate its professional relevance to the domain on an integer scale of 1 to 5. The scoring criteria are as follows: 1 - completely irrelevant; 2 - only occasionally mentions the term; 3 - slightly relevant, but not core content; 4 - highly relevant, professional content; 5 - extremely relevant, a typical core document in the domain. Please only output the final score." In this way, the fourth model scores each general corpus entry, outputting a quantified relevance score.
[0105] The filtering process involves setting a scoring threshold for selection. For example, it might be possible to select only general corpora with a score of 4 or 5. This is a process of refining and improving, aiming to ensure that every piece of corpus selected is a high-quality, positive example that is highly relevant to the target vertical domain.
[0106] The vertical domain corpus extraction method provided in this application transforms the original process, which relied on expensive and limited human expert annotation, into a scalable and highly efficient automated process, greatly reducing the cost of obtaining sample corpora.
[0107] In some embodiments, the scoring agent model is determined based on the following steps: Use the sample corpus as training samples; The fourth model's score of the semantic relevance of the sample corpus in the target vertical domain is used as the sample label; The initial model is trained based on the training samples and sample labels to obtain the scoring proxy model.
[0108] Specifically, by using the sample corpus as training samples and the semantic relevance scores of the sample corpus in the target vertical domain by the fourth model as sample labels, high-quality training data can be generated. The format can be represented as {training corpus}. semantic relevance score }, This is the sample number.
[0109] By training the initial model using training samples and sample labels, the final scoring proxy model can be obtained.
[0110] The vertical domain corpus extraction method provided in this application uses a top-level fourth-largest model for scoring, ensuring the accuracy and consistency of the labeled scores (i.e., training labels). This provides a crucial, high-quality data foundation for training a high-performance scoring proxy model, enabling the entire corpus extraction method to achieve both low cost and high accuracy.
[0111] In some embodiments, the semantic relevance of each general corpus in the target vertical domain is scored based on the fourth model, including: Identify several prompts for different scoring approaches; Inputting prompts with different scoring approaches into the fourth model guides the fourth model to score the semantic relevance of various general corpora based on different scoring approaches, resulting in several scoring results. The average of several scoring results is used as the scoring result of the general corpus.
[0112] Specifically, the output of a large language model may be sensitive to the prompts in its input; even slight differences in wording can cause fluctuations in the scoring results. To overcome this problem and improve the stability and accuracy of the scoring results, this application proposes a multi-path scoring fusion strategy.
[0113] Figure 3 This is a schematic diagram illustrating the training and application process of the scoring proxy model provided in this application, such as... Figure 3 As shown, corresponding prompt words can be designed based on multiple different scoring approaches. These prompt words from different scoring approaches are input into the fourth model, which then scores the semantic relevance of various general corpora based on these different approaches, yielding several scoring results. Finally, the average of these scoring results representing different scoring approaches is taken as the overall score for the general corpus.
[0114] The scoring approach can include, but is not limited to, the following two: (1) Direct scoring approach: This approach aims to obtain a quick and intuitive judgment based on the model’s overall knowledge.
[0115] For example, the corresponding prompt can be "You are an expert in the field of communication network and computer, and now you need to select fragments that are strongly related to communication network and computer from a large amount of Internet corpus. Here is a document fragment, please judge its relationship with the field of communication network and computer. The output is a number in [5, 4, 3, 2, 1], which represents the strength of the relevance. The following are some rules for relevance scoring: (1) Output "5" means there is a strong relationship, output "4" means there is a strong relationship, output "3" means there is a relationship, output "2" means there is a weak relationship, and output "1" means there is no relationship; (2) The field of communication includes but is not limited to: 5G, 6G, wireless communication, optical fiber communication, communication principles, digital signal processing, operators, computer rooms, network failures, computer failures, monitoring, network operation and maintenance, satellites, quantum communication, electromagnetic waves, digital / analog circuits. The input document fragment is {general corpus}, please directly output the relevance score".
[0116] (2) Chain-of-Thought (CoT) scoring approach: This approach requires the model to perform step-by-step analysis and reasoning before giving a final score, and to explicitly express the reasoning process. This can encourage the model to think more deeply and systematically, thereby arriving at a well-considered judgment.
[0117] For example, the corresponding prompt can be "You are an expert in the field of communication network and computer, and now you need to select fragments that are strongly related to communication network and computer from a large amount of Internet corpus. Here is a document fragment, please judge its relationship with the field of communication network and computer. The output is a number in [5, 4, 3, 2, 1], which represents the strength of the relevance. The following are some rules for relevance scoring: (1) Output "5" means there is a strong relationship, output "4" means there is a strong relationship, output "3" means there is a relationship, output "2" means there is a weak relationship, and output "1" means there is no relationship; (2) The field of communication includes but is not limited to: 5G, 6G, wireless communication, optical fiber communication, communication principles, digital signal processing, operators, computer rooms, network failures, computer failures, monitoring, network operation and maintenance, satellites, quantum communication, electromagnetic waves, digital / analog circuits. Please use your logical analysis ability to analyze how to score very briefly, and then output the value of the relevance score (first output "relevance score:", then output the score value). The input document fragment is {general corpus}, please output the logic analysis of relevance scoring and the relevance score.
[0118] After multi-path scoring, a single general corpus will correspond to multiple scores. First, the specific scores in the scoring output text are extracted using methods such as regular expressions; then, the multi-path scores are merged using methods such as averaging to obtain the final score.
[0119] The vertical domain corpus extraction method provided in this application can effectively smooth out and offset the randomness or systematic bias that may be caused by a single prompt word by combining prompt words with multiple different scoring approaches, making the final scoring results more robust and fair.
[0120] In some embodiments, the initial model includes a semantic extraction module and a scoring output module; the semantic extraction module is constructed based on a preset language model.
[0121] Specifically, in order to achieve functional decoupling and high training efficiency, the embodiments of this application divide the structure of the initial model into two core functional modules.
[0122] The semantic extraction module's core responsibility is to act as the model's front end, receiving the input text corpus and transforming it into high-dimensional mathematical vectors rich in deep semantic information that can be understood and processed by the machine. This module is fundamental to the model's understanding capabilities.
[0123] The semantic extraction module can select a pre-defined language model from existing technologies. A pre-defined language model refers to a mature language model that has been pre-trained on massive amounts of general text data. These models have internalized rich linguistic knowledge, grammatical structures, and world knowledge by learning from a large corpus. In the embodiments of this application, the pre-defined language model is an efficient text embedding model, such as, but not limited to, the BGE (BAAI General Embedding) series of models.
[0124] The core responsibility of the scoring output module is to act as the backend of the model. It receives high-dimensional semantic vectors from the semantic extraction module and maps or regresses them to a single numerical score representing semantic relevance. This module is the execution terminal for the model to complete a specific task (i.e., scoring).
[0125] Structurally, the rating output module can be one or more fully connected layers. It is a lightweight network structure with a relatively small number of parameters. Its input is a high-dimensional semantic vector, and its output is a single neuron whose value is the final rating. To normalize the rating result to the [0, 1] interval, activation functions such as Sigmoid can be used in the output layer.
[0126] The vertical domain corpus extraction method provided in this application decouples general semantic understanding capabilities (provided by a fixed semantic extraction module) from specific task adaptation capabilities (provided by a trainable scoring output module), achieving extremely high training efficiency and resource utilization. This architecture fully leverages the powerful capabilities of existing pre-defined language models, and through efficient parameter fine-tuning, enables the model to quickly adapt to the scoring task of the target vertical domain at extremely low cost. Ultimately, it constructs a scoring proxy model that possesses both high-precision semantic discrimination capabilities and low-latency inference performance, perfectly meeting the cost and efficiency requirements of this application in industrial applications.
[0127] In some embodiments, an initial model is trained based on training samples and sample labels to obtain a scoring proxy model, including: During the initial model training process, the model parameters of the semantic extraction module are fixed, while the model parameters of the scoring output module are updated.
[0128] Specifically, fixing model parameters means that during the training phase of backpropagation and gradient updates, all parameters (including weights and biases) of the module are manually set not to participate in the updates. That is, regardless of the calculated loss and gradient, the values of these parameters will remain in their initial state when the preset language model was loaded, and will not change at all.
[0129] By fixing the model parameters of the semantic extraction module, its general semantic understanding capabilities can be preserved. This module is built upon a powerful pre-defined language model, whose parameters already contain rich and generalized linguistic knowledge learned from massive amounts of data. Fixing these parameters fully preserves this powerful general semantic understanding capability, preventing it from being compromised by overfitting when trained on small datasets specific to a particular vertical domain. Furthermore, the semantic extraction module (i.e., the pre-defined language model base) typically has the largest number of parameters in the entire model. Freezing it significantly reduces the number of gradients that need to be computed and stored during training, thereby significantly reducing the demands on computing hardware and shortening the training time.
[0130] Unlike the semantic extraction module, the model parameters of the scoring output module are updatable during training. The advantage of this training method is that, through training, its parameters learn how to accurately map the general semantic vectors provided by the semantic extraction module to the relevance scores required by the target vertical domain. Furthermore, since the scoring output module typically consists of only a few fully connected layers, its number of parameters is negligible compared to the large semantic extraction module. Training only this small subset of parameters makes the entire training process very lightweight, allowing for rapid model convergence with limited resources.
[0131] For example, using the BGE-M3 model as the semantic extraction module, The initial model is obtained by concatenating fully connected layers into a scoring output module. During training, the original parameters of the BGE-M3 model are frozen and not updated to fully utilize its semantic modeling capabilities. The objective function for training the initial model is... for: .
[0132] in, This represents the total number of training samples (sample corpus). The first output of the initial model Semantic relevance score of each training sample; The fourth model scores the semantic relevance of training samples in the target vertical domain. These are the weighting coefficients; For the first The weight parameters of a fully connected layer. This is a regularization term used to avoid overfitting.
[0133] The vertical domain corpus extraction method provided in this application fully retains the powerful general semantic representation capabilities of the preset language model, while greatly reducing the complexity, hardware requirements, and time cost of model training by minimizing the number of parameters that need to be trained. This makes the process of fine-tuning a powerful model for a specific task economical and feasible. It not only ensures the high performance of the final scoring proxy model, but also gives the entire technical solution excellent engineering practicality and scalability, enabling the rapid and low-cost customization of exclusive corpus screening models for different vertical domains.
[0134] Figure 4 This is the second flowchart illustrating the vertical domain corpus extraction method provided in this application, as shown below. Figure 4 As shown, this method employs a multi-level filtering mechanism. First, it filters a large-scale general corpus based on keyword-level relevance. In this step, a large amount of irrelevant data can be filtered out at low cost. Then, the filtered corpus undergoes semantic-level relevance evaluation. The corpus that passes the semantic-level relevance evaluation is used as the extracted vertical domain corpus.
[0135] The method includes: Step 1: Keyword-level filtering.
[0136] Keyword-level relevance assessment includes three parts: (1) collection of domain keywords; (2) calculation of word frequency features of vertical domain keywords; and (3) calculation of character features of vertical domain keywords.
[0137] First, a keyword list for the vertical domain needs to be collected. After obtaining the list, the frequency of vertical domain keywords in the general corpus is statistically analyzed to calculate how many vertical domain keywords are contained in the corpus.
[0138] Then, the proportion of keyword characters in this corpus is statistically analyzed. After obtaining these two features of a corpus, a threshold judgment is performed, and those that reach the threshold are saved and enter the semantic relevance discrimination process.
[0139] Step 2: Semantic level filtering.
[0140] The semantic level relevance assessment includes two parts: (1) training of the scoring agent model; and (2) semantic relevance scoring of the corpus and vertical domain.
[0141] First, based on a large model, a large amount of initial corpus is scored to obtain semantic relevance scores for vertical domains that are close to human preferences.
[0142] Then, a small-scale scoring proxy model is trained based on this data. This small-scale scoring proxy model is used to score the semantic relevance of the keyword-filtered corpus, and a threshold is used to determine whether to retain it as vertical domain corpus.
[0143] The vertical domain corpus extraction method provided in this application evaluates the relevance of a corpus to a vertical domain from three dimensions: domain keyword frequency, keyword character proportion, and corpus semantics. This allows for the extraction of vertical domain corpus from general corpora for pre-training in vertical domain enhancement. This application avoids the drawbacks of focusing solely on keyword or semantic relevance during corpus extraction by evaluating relevance from multiple dimensions. In the keyword feature evaluation stage, a systematic domain keyword extraction algorithm is proposed, accumulating systematic knowledge of the vertical domain to obtain a vocabulary list with higher domain word density. Then, the final domain keyword list is obtained based on domain keyword discrimination using a large model and / or expert review. This keyword filtering scheme has a high level of automation and avoids insufficient keyword comprehensiveness due to initial knowledge deficiencies through large model self-iteration. In the semantic evaluation stage, a specially trained scoring proxy model is used for semantic relevance evaluation, reducing the dependence of other methods on the comprehensiveness of the initial domain corpus. Simultaneously, the scoring cost of the proxy model is controllable due to its small model size. In the main process, a multi-level filtering mechanism is designed. Initial filtering based on low computational complexity at the word level filters out a large amount of irrelevant general corpus. Then, semantic rating based on the surrogate model is performed, which effectively balances the overall computational complexity.
[0144] The apparatus provided in the embodiments of this application is described below. The apparatus described below can be referred to in correspondence with the method described above.
[0145] Figure 5 This is a schematic diagram of the vertical domain corpus extraction device provided in this application, as shown below. Figure 5 As shown, the device includes: The acquisition module 510 is used to acquire several general corpora, as well as domain keywords and sample corpora of the target vertical field; The keyword-level filtering module 520 is used to filter several general corpora based on domain keywords to obtain several candidate corpora; The semantic-level filtering module 530 is used to filter several candidate corpora based on the semantic relevance between the candidate corpora and the sample corpora to obtain the corpora of the target vertical domain.
[0146] The vertical domain corpus extraction device provided in this application employs a multi-level filtering mechanism. It filters by keywords, leveraging the simplicity and speed of computation to efficiently filter massive amounts of general corpus, significantly reducing the computational pressure and cost of subsequent processing. Building upon the previous filtering stage, it further filters by semantic relevance, ensuring that the final selected corpus is not only relevant at the lexical level but also highly consistent with the target vertical domain at the semantic level. This method effectively balances the relationship between accuracy, recall, and computational cost in corpus extraction, achieving accurate and efficient extraction of relevant vertical domain corpus from general large-scale corpus, thus improving the performance and reliability of large models in vertical domains.
[0147] Figure 6 This is a schematic diagram of the structure of the electronic device provided in this application, such as... Figure 6 As shown, the electronic device may include: a processor 610, a communications interface 620, a memory 630, and a communications bus 640, wherein the processor, communications interface, and memory communicate with each other via the communications bus. The processor can invoke logical commands stored in the memory to execute the methods described in the above embodiments, for example: Acquire several general corpora, as well as domain keywords and sample corpora for the target vertical field; Several general corpora were filtered based on domain keywords to obtain several candidate corpora; Based on the semantic relevance between candidate corpora and sample corpora, several candidate corpora are filtered to obtain corpora for the target vertical domain.
[0148] Furthermore, the logical commands in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several commands to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0149] The processor in the electronic device provided in this application embodiment can call logical instructions in the memory to implement the above method. Its specific implementation method is the same as the aforementioned method implementation method and can achieve the same beneficial effect, which will not be repeated here.
[0150] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the methods provided in the above embodiments.
[0151] The specific implementation method is the same as the aforementioned method implementation method and can achieve the same beneficial effects, so it will not be repeated here.
[0152] This application provides a computer program product, including a computer program that, when executed by a processor, implements the method described above.
[0153] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0154] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A vertical domain corpus extraction method, characterized in that, The method comprises the following steps: acquiring a plurality of general corpora, and domain keywords and sample corpora of a target vertical domain; filtering the plurality of general corpora based on the domain keywords to obtain a plurality of candidate corpora; filtering the plurality of candidate corpora based on semantic relevance between the candidate corpora and the sample corpora to obtain the corpus of the target vertical domain.
2. The vertical domain corpus extraction method of claim 1, wherein, The filtering of the plurality of general corpora based on the domain keywords to obtain a plurality of candidate corpora comprises: determining a keyword frequency feature of any general corpus based on the number of occurrences of the domain keywords in the general corpus; determining a keyword character proportion feature of the general corpus based on a ratio of the character length of the domain keywords to the total character length of the general corpus; determining a keyword-level similarity of the general corpus based on the keyword frequency feature of the general corpus and / or the keyword character proportion feature of the general corpus; in a case where the keyword-level similarity is greater than a preset keyword-level similarity threshold, determining the general corpus as a candidate corpus.
3. The vertical domain corpus extraction method of claim 2, wherein, The determination of the keyword frequency feature of any general corpus based on the number of occurrences of the domain keywords in the general corpus comprises: in a case where the number of domain keywords is a plurality, determining a sum of the number of occurrences of each domain keyword in the general corpus as the keyword frequency feature of the general corpus.
4. The vertical domain corpus extraction method of claim 2, wherein, The determination of the keyword character proportion feature of any general corpus based on a ratio of the character length of the domain keywords to the total character length of the general corpus comprises: in a case where the number of domain keywords is a plurality, determining a total character length of each domain keyword in the general corpus based on the number of occurrences of each domain keyword in the general corpus and the character length of each domain keyword; determining a ratio of the sum of the total character lengths of each domain keyword to the total character length of the general corpus as the keyword character proportion feature of the general corpus.
5. The vertical domain corpus extraction method of claim 1, wherein, The domain keywords of the target vertical domain are determined based on the following steps: acquiring a systematized corpus set of the target vertical domain; performing word segmentation on the systematized corpus set to obtain a plurality of initial keywords; performing domain discrimination on the initial keywords based on a first large model, filtering the plurality of initial keywords to obtain a plurality of candidate keywords; performing domain verification on the candidate keywords based on a second large model, filtering the plurality of candidate keywords to obtain the domain keywords.
6. The vertical domain corpus extraction method of claim 5, wherein, The method further comprises: performing knowledge generation on the domain keywords based on a third large model to obtain a knowledge description corpus corresponding to the domain keywords; adding the knowledge description corpus to the systematized corpus set of the target vertical domain.
7. The vertical domain corpus extraction method of claim 1, wherein, The filtering of the plurality of candidate corpora based on semantic relevance between the candidate corpora and the sample corpora to obtain the corpus of the target vertical domain comprises: The candidate corpus is scored in semantic relevance based on a scoring agent model, and the candidate corpus is filtered based on the scoring result to obtain the corpus of the target vertical field; The scoring agent model is trained based on sample corpus of the target vertical field.
8. The vertical domain corpus extraction method of claim 7, wherein, The sample corpus of the target vertical field is determined based on the following steps: Obtain a plurality of general corpora; Score the semantic relevance of each general corpus in the target vertical field based on a fourth large model; Filter the plurality of general corpora based on the scoring results of each general corpus to obtain the sample corpus.
9. The vertical domain corpus extraction method of claim 8, wherein, The scoring agent model is determined based on the following steps: Use the sample corpus as a training sample; Use the semantic relevance score of the sample corpus in the target vertical field by the fourth large model as a sample label; Train an initial model based on the training sample and the sample label to obtain the scoring agent model.
10. The vertical domain corpus extraction method of claim 8, wherein, The scoring of the semantic relevance of each general corpus in the target vertical field based on the fourth large model includes: Determine a plurality of prompt words of different scoring ideas; Input the plurality of prompt words of different scoring ideas into the fourth large model to guide the fourth large model to score the semantic relevance of each general corpus based on different scoring ideas to obtain a plurality of scoring results; Use the average of the plurality of scoring results as the scoring result of the general corpus.
11. The vertical domain corpus extraction method of claim 9, wherein, The initial model includes a semantic extraction module and a scoring output module; the semantic extraction module is constructed based on a preset language model.
12. The vertical domain corpus extraction method of claim 11, wherein, Training the initial model based on the training sample and the sample label to obtain the scoring agent model includes: During the training process of the initial model, fix the model parameters of the semantic extraction module and update the model parameters of the scoring output module.
13. A vertical domain corpus extraction apparatus characterized by comprising: It includes: An acquisition module for acquiring a plurality of general corpora, and a domain keyword and a sample corpus of a target vertical field; A keyword-level filtering module for filtering the plurality of general corpora based on the domain keyword to obtain a plurality of candidate corpora; A semantic-level filtering module for filtering the plurality of candidate corpora based on the semantic relevance between the candidate corpora and the sample corpus to obtain the corpus of the target vertical field.
14. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the vertical field corpus extraction method of any one of claims 1 to 12.
15. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the vertical field corpus extraction method of any one of claims 1 to 12.
Citation Information
Cited By
Large model optimization method, device and equipment for target vertical field
CN122287707A