Literature reference processing method based on artificial intelligence and electronic device
Patent Information
- Application Number
- CN202611233433.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-10-27
AI Technical Summary
现阶段行业内对于文献中引物相关信息的获取与整理工作,整体作业模式较为落后,普遍存在处理效率偏低的问题
[0014]本申请实施例提供的基于人工智能的文献引物处理方法及电子设备,通过对文献文件开展有效性筛选与篇幅控制,剔除无效信息并适配模型输入。首先解析多格式文献得到纯文本,依托DNA序列匹配规则筛选有效文献,缩减待处理数据量;再依据容量阈值对文本分段或完整留存,使其符合大语言模型输入要求,节约计算资源。随后借助大语言模型并结合格式约束,提取引物名称、序列、靶标基因等结构化信息,利用模型语义关联能力整合跨段落内容,提取效果优于传统规则方法。最后对原始引物记录开展标准化清洗,统一数据格式、去除数据噪声,形成规范的引物数据集,从而提高了文献引物数据提取的准确性和提取效率。
Smart Images

Figure CN122985950A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to an artificial intelligence-based method for processing literature primers and an electronic device. Background Technology
[0002] In the fields of bioinformatics and molecular diagnostics, acquiring and organizing viral primer data from professional literature is a crucial foundation for the development of viral detection technologies and the construction of primer systems. Currently, the industry's overall approach to acquiring and organizing primer-related information from literature is relatively outdated, generally suffering from low processing efficiency. Furthermore, existing data processing methods struggle to guarantee the accuracy of primer-related information extraction results; the acquired raw data is often poorly formatted, contains various invalid noises, and lacks data standardization. Due to these limitations, the primer data obtained using existing methods is of inconsistent quality and cannot adequately meet the requirements of subsequent research and application work. Summary of the Invention
[0003] The artificial intelligence-based literature primer processing method and electronic device provided in this application are used to improve the accuracy and efficiency of literature primer data extraction.
[0004] In a first aspect, embodiments of this application provide an artificial intelligence-based method for processing literature primers, including:
[0005] Obtain the set of literature files to be processed;
[0006] Based on the length and sequence presence characteristics of each document in the document set, the document set is subjected to validity screening and length control processing to obtain a simplified text content set. The sequence presence characteristics are used to identify whether the document contains the target DNA sequence.
[0007] The text content set is input into a large language model for intelligent reasoning and analysis to obtain the original primer record information corresponding to each of the document files.
[0008] The original primer record information is subjected to bioinformatics data standardization and cleaning to obtain a standardized primer dataset. The standardized primer dataset includes primer sequences with unified orientation, normalized serotype annotations, and detection probe modification information.
[0009] Secondly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0010] The memory stores computer-executed instructions;
[0011] The processor executes computer execution instructions stored in the memory, causing the processor to perform the implementation method described in the first aspect above.
[0012] Thirdly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the embodiments described in the first aspect above.
[0013] Fourthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the implementation methods described in the first aspect above.
[0014] The AI-based literature primer processing method and electronic device provided in this application removes invalid information and adapts to model input by performing validity screening and length control on literature documents. First, it parses multi-format documents to obtain plain text, and uses DNA sequence matching rules to screen valid documents, reducing the amount of data to be processed. Then, based on a capacity threshold, the text is segmented or retained entirely to meet the input requirements of a large language model, saving computational resources. Subsequently, using the large language model and combined with format constraints, structured information such as primer names, sequences, and target genes is extracted. The model's semantic association capabilities are used to integrate cross-paragraph content, resulting in extraction performance superior to traditional rule-based methods. Finally, the original primer records are standardized and cleaned to unify data formats, remove data noise, and form a standardized primer dataset, thereby improving the accuracy and efficiency of literature primer data extraction. Attached Figure Description
[0015] Figure 1 A flowchart illustrating an artificial intelligence-based literature primer processing method provided for embodiments of this application;
[0016] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0017] Figure 1 This is a flowchart illustrating an artificial intelligence-based primer processing method for embodiments of this application. Figure 1 As shown, the method may include the following steps:
[0018] S101. Obtain the set of literature files to be processed.
[0019] The literature collection is a systematic compilation of multiple studies related to primers, sourced from a wide range of sources, including academic databases, institutional repositories, and laboratory-built databases. The document formats must be compatible with mainstream electronic document types.
[0020] Obtaining this collection is the starting point of the entire processing flow. Only by ensuring the comprehensiveness and relevance of the literature documents can the subsequent screening, analysis and processing steps be carried out in an orderly manner and produce valuable results.
[0021] One possible approach is to utilize the application programming interfaces (APIs) provided by academic databases for batch searching and automated downloading. First, a search strategy is developed, identifying core keywords, such as those related to primer design, virus detection, and target gene amplification. Simultaneously, multi-dimensional filtering conditions are set, including publication time range, research field classification, author affiliation, and journal name, to precisely narrow the search scope and improve the relevance of the retrieved documents. A structured search request is then sent to the target academic database using the API interface. The database returns a list of matching document entries based on the request parameters. This list typically includes metadata such as unique identifiers, titles, authors, journals, volumes, issues, page numbers, abstracts, and keywords. Based on this metadata, highly relevant documents can be further filtered. After filtering, the full-text files of the documents are downloaded in batches via download links provided by the API interface. Once downloaded, they are stored uniformly in a designated directory on the local file system, forming an initial set of documents to be processed.
[0022] Another possible approach is to import the collection of literature files to be processed from local files, such as importing collected PDF literature into the processing flow by specifying the file system path.
[0023] S102. Based on the length characteristics and sequence presence characteristics of each document in the document set, the document set is subjected to document validity screening and length control processing to obtain a simplified text content set. The sequence presence characteristics are used to identify whether the document contains the target DNA sequence.
[0024] Length features are multidimensional features that quantify the size of a document's text. These include the number of characters (including all printable characters such as letters, numbers, symbols, spaces, line breaks, tabs, etc.), the number of words (for English documents, counted using spaces or punctuation marks as separators), the number of Chinese characters (for Chinese documents, counted the number of Chinese characters and Chinese punctuation marks), the number of pages (physical or logical pages, such as the number of pages in a PDF file), and the number of paragraphs (the number of text blocks defined by line breaks or specific punctuation marks). These features reflect the amount of information and structural complexity of the text from different perspectives.
[0025] The sequence presence feature is a binary logical feature that identifies whether a document contains a target DNA sequence that meets a predefined definition. The target sequence refers to a specific biologically significant DNA fragment related to the research topic, such as a specific region sequence of viral genes, bacterial drug resistance genes, or human genetic disease-related genes.
[0026] The validity screening and length control process aims to eliminate invalid literature, retain valid literature containing potential primer information, and adjust the text length to adapt to the input length limit of the subsequent Large Language Model (LLM), so as to obtain a set of concise text content that focuses on primer information and has an appropriate length.
[0027] One possible approach is to achieve validity screening and length control through steps such as text parsing, sequence matching, filtering, length estimation, and processing.
[0028] S1021. Perform text parsing on the document to obtain the original text content of the document.
[0029] Text parsing is the process of extracting textual information from documents of different formats and converting it into plain text using algorithms and tools. It requires stripping away non-text elements while preserving the order and logical structure of the text. The original text content is a collection of plain text without formatting tags or non-text elements, fully preserving the author's original narrative while removing all formatting interference that might affect text extraction and subsequent analysis. For example, if a PDF document contains a table about primer sequences, the text parsing stage will ignore the table's borders and formatting, extracting only the textual content, such as primer names, sequences, and target genes.
[0030] The method for parsing the text of a document can be determined based on its format. Different parsing methods can be used for different document formats to obtain the original text content. Specific methods for parsing different types of document documents can be found in existing technologies; this application does not impose any limitations on this.
[0031] S1022. Match the original text content based on preset DNA sequence matching rules to obtain the sequence existence characteristics of the document.
[0032] Preset DNA sequence matching rules are formulated based on DNA molecular biology characteristics and sequence representation conventions. For example, they may consider features such as base composition (four basic bases: A, T, G, and C), length range (primer sequences are usually 15-30 base pairs, and probe sequences are 15-40 base pairs), orientation indicators (such as the direction from the 5'-end to the 3'-end, usually represented as "5'-...-3'"), degenerate bases, and separators (spaces, hyphens, etc., used to improve readability).
[0033] The sequence presence feature is a binary variable, taking the value "present" or "absent", indicating whether the document contains the target DNA sequence that conforms to the rules.
[0034] In this step, regular expression pattern matching can be used to construct various patterns. For example, there are patterns with directional indicators and clearly defined base sequences (e.g., “5'-[ATGCRYSWKMBDHVN]{15,30}-3') where “5'-” and “-3'” are directional indicators, “[ATGCRYSWKMBDHVN]” indicates allowed base characters, and “{15,30}” specifies the length; there are also pure base sequence patterns without directional indicators but with clearly defined lengths (e.g., “[ATGCRYSWKMBDHVN]{15,40}”); there are sequence patterns with separators (e.g., “5'-([ATGCRYSWKMBDHVN]{1,10}[-]){1,4}[ATGCRYSWKMBDHVN]{1,10}-3') where spaces or hyphens are allowed after every 1-10 bases in the sequence; and there are reverse complementary sequence patterns (e.g., “3'-[ATGCRYSWKMBDHVN]{15,30}-5') to avoid omitting the reverse primer sequence.
[0035] The `re` module in the programming language is used to perform a full-text scan and match on the original text. `re.findall()` is used to find all matching sequences, and `re.search()` is used to determine if at least one matching sequence exists. If any matching string is found, the sequence is considered to exist; otherwise, it is considered not to exist.
[0036] S1023. Based on the sequence existence characteristics, invalid document files are removed from the document file set to obtain a document file set after validity screening. The sequence existence characteristics of the invalid document files indicate that the original text content of the invalid document files does not contain a DNA sequence corresponding to the preset DNA sequence matching rule.
[0037] Invalid documents refer to those with a sequence presence characteristic of "absent," containing no target DNA sequence that meets the rules. These may be review articles, theoretical research articles, or experimental articles that do not involve specific primer design, and are of no value for primer information extraction. The set after validity screening is the collection of documents containing the "present" sequence characteristic remaining after removing invalid documents. It may contain the target DNA sequence and related primer information, such as primer sequences, target genes, amplification conditions, detection performance, etc.
[0038] The document collection is traversed, and validity is determined based on the sequence existence characteristic. A loop is used to traverse the document list; documents with the sequence existence characteristic of "not present" are removed from the collection (moved to the "invalid documents" directory or deleted from memory); documents with the "present" characteristic are retained, forming a set after validity filtering.
[0039] S1024. Estimate the character capacity of the original text content of the valid document files included in the set of valid document files after the validity screening to obtain the length characteristics of the valid document files.
[0040] Character capacity estimation is the process of counting the total number of characters in the original text content of valid documents. Characters include all text characters such as letters, numbers, punctuation, spaces, newlines, and tabs. The result reflects the original data volume of the text and is a basic indicator for measuring the length of a document. In this step, length characteristics can be reflected in the number of characters. For example, Python's `len()` function can be used to calculate the length of the text string (in Python 3, this counts Unicode characters, correctly handling multi-byte characters). Ensure that the text encoding is consistent (e.g., UTF-8) to avoid encoding affecting the statistics. For string collections divided by page or paragraph, first merge them into complete strings (e.g., Python's `''.join(segments)`) before counting the total number of characters.
[0041] By estimating the character capacity, the specific number of characters for each valid document is obtained as a length feature, which is then used for subsequent length control processing.
[0042] S1025. When the length feature meets the preset context capacity threshold, the effective document file is segmented and truncated and content filtered based on the preset context capacity threshold to obtain a single text fragment that matches the model input specification.
[0043] The preset context capacity threshold is set according to the maximum input text length limit of the subsequent large language model, and is usually slightly smaller than the maximum input length of the model (e.g., if the maximum model length is 8192 characters, the threshold is set to 7500 characters), reserving space to add prompt words and model output content.
[0044] When the length of the effective document (total number of characters) is greater than or equal to the threshold, the text is too long and needs to be truncated (divided into multiple short text segments according to the threshold) and filtered (removed irrelevant parts) to obtain a single text segment whose length meets the threshold and is suitable for the model input.
[0045] For example, a threshold T can be determined, and the text can be initially analyzed to identify key paragraphs (such as primer-related parts in "Materials and Methods", "Results", and "Discussion", such as paragraphs describing primer design, synthesis, validation, and performance parameters), and the positions of the start and end characters can be recorded. A segment of length T can be extracted from the beginning of the text to avoid segmenting key paragraphs. If the key paragraphs are too long, they can be segmented at sentence boundaries or natural pauses. Non-key paragraphs can be filtered (irrelevant paragraphs can be deleted, and low-relevance sentences can be pruned) to generate a single text segment with no more than T characters and containing multiple primer-related content.
[0046] For example, a document with a total of 80,000 characters is divided into three single text segments at T=28,000, containing 28,000, 28,000, and 24,000 characters respectively. All segments are filtered to retain highly relevant text.
[0047] S1026. When the length feature does not meet the preset context capacity threshold, the complete original text content is retained as a usable text fragment.
[0048] When the effective document length feature (number of characters) is less than the threshold, the text length is moderate and can be directly input into the model. The complete original text content is retained as a usable text fragment, that is, a text fragment that can be directly used for subsequent model processing. This preserves the integrity of the document content and the coherence of the context, which helps the model understand the primer information association relationship.
[0049] The implementation method is to directly save the original text content (plain text string after parsing and post-processing) after confirming that the length feature is less than the threshold, ensuring the content is complete and without deletion or modification (except for non-text elements removed during parsing).
[0050] S1027. Based on the single text fragment and the available text fragments, generate a simplified set of text content.
[0051] The streamlined text content set consists of single text fragments processed from valid literature (segmented) and usable text fragments (unsegmented), containing potential primer-related information and with a length adapted to the model input.
[0052] Specifically, valid documents can be traversed to collect corresponding text fragments, which are then integrated into a list or dictionary (the key is the document identifier, and the value is a list of fragments). Each fragment is associated with a source document, and metadata can be embedded or the correspondence can be recorded through an index file. The fragments are then evaluated for quality, and substandard fragments are reprocessed or removed, ultimately generating a concise set of text content that serves as the data source for the model's input.
[0053] S103. Input the text content set into the large language model for intelligent reasoning analysis and processing to obtain the original primer record information corresponding to each of the document files.
[0054] Large language models are deep learning models trained on large-scale text corpora. For example, they can adopt the Transformer architecture and have the ability to understand, generate, reason, and extract information from natural language. They can understand complex instructions and generate relevant outputs based on input.
[0055] Intelligent reasoning analysis and processing utilizes models to perform semantic understanding, entity recognition, relation extraction, and logical reasoning on text fragments, and extracts structured primer information.
[0056] The original primer record information is a collection of primer-related information extracted directly from the literature without standardization. It includes attributes such as primer name, sequence, target gene, genomic location, amplicon length, detection sensitivity, detection specificity, and annealing temperature. The description, format, and completeness vary from literature to literature, and there are differences and noise. For example, different literature may describe the detection sensitivity as "10 copies / mL", "10^3 copies / reaction", or "able to detect 100 fg of template DNA", and the format is not consistent.
[0057] S1031. Send an output format constraint request to the dialogue interface of the large language model. The output format constraint request is used to limit the returned data structure to include at least one of the following: primer name field, primer sequence field, target gene field, genomic location field, amplicon length field, detection sensitivity field, and detection specificity field.
[0058] Output format constraint requests are natural language instructions that tell the model the expected primer information data structure and its included fields. The dialog interface is the interface through which the model interacts with the outside world, supporting HTTP / HTTPS protocols, and can take forms such as REST API, WebSocket, etc.
[0059] Each field stores the primer name or identifier (e.g., "primer F3", "ORF1ab-F"), base sequence (e.g., "ATGCGGCTTAAGCTCG"), target gene name (e.g., "novel coronavirus ORF1ab gene"), genomic location information (e.g., "NC_045512.2:28274-28295"), amplicon length (e.g., "150bp"), detection sensitivity index (e.g., "10 copies / mL"), and detection specificity index (e.g., "99.5%)".
[0060] Specifically, prompt text containing specific instructions can be constructed and sent to the model's dialogue interface. The prompts must be clear and unambiguous, for example: "Extract primer information and return it in the following field format: Primer Name|Primer Sequence|Target Gene|Genomic Location|Amplicon Length|Detection Sensitivity|Detection Specificity. Fields in each record are separated by '|'. 'N / A' indicates that the information is missing. Example: Primer Name|Primer Sequence|.... Please ensure that the output only contains records in the above format and do not add any additional explanatory text." When sending, adhere to the interface communication protocol and data format requirements (e.g., a JSON request body containing parameters such as "prompt", "temperature", and "max_tokens"). "Temperature" controls the randomness of the output (a lower value, such as 0.2, makes the output more deterministic), and "max_tokens" controls the maximum length of the output.
[0061] S1032. The text content set is attached to the dialogue interface of the large language model as input data for the output format constraint request. The text content set includes primer sequence descriptions, target gene descriptions, genomic location descriptions, and experimental detection performance descriptions that are scattered in different page text segments.
[0062] The input data is a concise collection of text content, which, when added to the dialog interface, is combined with the output format constraint request prompts to form the complete input for the model.
[0063] Primer sequence descriptions are textual information mentioning the primer's base sequence (e.g., "the forward primer sequence is 5'-ATGCGGCTTAAGCTCG-3'"). Target gene descriptions describe the genes targeted by the primers (e.g., "this primer specifically targets the conserved region of the M gene of the influenza virus"). Genomic location descriptions describe the primer's location in the genome (e.g., "the primer binds to nucleotides 1234-1256 of the viral genome"). Experimental detection performance descriptions describe the primer's sensitivity, specificity, and other properties (e.g., "the detection limit of this primer combination is up to 100 copies / reaction, and the specificity is 100%"). This information is scattered and unstructured in the literature.
[0064] Specifically, the size of the text set and the model input limit can be considered. When the text volume is small, text fragments are concatenated and prompt words are added at the beginning to form the input text. When the text volume is large, it is processed in batches, with text fragments grouped (the total length of each group plus prompt words should not exceed the maximum input length of the model) and sent to the interface in sequence. When processing in batches, key information fragments are processed first. The prompt words of subsequent batches can mention the previous results to maintain contextual coherence. Pay attention to text encoding (such as UTF-8) and add delimiters or markers to distinguish text fragments (such as "[Document ID:Lit_001, Frag ID:Frag_001]").
[0065] S1033, instruct the dialogue interface of the large language model to perform cross-paragraph semantic linking operation on the text content set, link the primer sequence description with the target gene description to generate the value of the target gene field, extract the position coordinate information of the primer sequence description in the same literature context from the text content set to generate the value of the genome position field, and locate the experimental performance parameter description corresponding to the primer sequence description from the text content set to generate the values of the detection sensitivity field and the detection specificity field.
[0066] Cross-paragraph semantic linking is the model's ability to understand the semantic relationships between different paragraphs and link them to form knowledge units. In this method, primer sequence descriptions are linked with other relevant descriptions. The same document context refers to text regions semantically closely related to the primer sequence description (such as the same sentence, paragraph, or section). Location coordinate information is the specific location of the primer on the genome (such as genome version number, start and stop nucleotide positions). Experimental performance parameter descriptions are textual content describing the primer's sensitivity and specificity (including numerical values, percentages, experimental methods, or results statements).
[0067] Specifically, relying on the model capabilities and prompts of a large language model, the model automatically performs semantic analysis after receiving input. It identifies primer sequence entities through entity recognition, searches for relevant target gene descriptions and semantically links them, and extracts gene names as target gene field values. It also searches for location coordinate information in the same context to generate genomic location field values, locates experimental performance parameter descriptions and extracts numerical values as detection sensitivity and specificity field values. The model uses domain knowledge (common sense of molecular biology, primer design terminology, etc.) to assist in understanding and linking.
[0068] S1034. Receive response data returned by the dialogue interface of the large language model that satisfies the output format constraint request. The response data includes the corresponding values of the primer name field, the primer sequence field, the target gene field, the genomic location field, the amplicon length field, the detection sensitivity field, and the detection specificity field.
[0069] Response data is the result returned by the model after processing the input, and it conforms to the data structure and format of the output format constraints. Receiving response data is a crucial step in obtaining the processing result.
[0070] Specifically, based on the interface communication protocol, REST APIs using HTTP / HTTPS can receive responses by sending POST requests. For example, Python can use the requests library to send requests and parse JSON response data. The response data includes model-generated text, organized according to a preset format (e.g., records with fields separated by "|"). After receiving the data, format validation is performed (checking the number of fields and the separation method), and exceptions such as network errors and timeouts are handled. A retry mechanism is implemented to ensure reliable reception.
[0071] S1035. Generate the original primer record information based on the values of the primer sequence field, the target gene field, the genomic location field, the detection sensitivity field, and the detection specificity field in the response data.
[0072] The raw primer record information is a collection of primer information that has been initially organized and structured in response data. It integrates relevant field values for each primer as a unit, and converts the unstructured or semi-structured text returned by the model into structured data that can be processed by a computer.
[0073] In this step, the response data can be parsed, field values can be extracted and split according to a preset format, converted into a dictionary or object, the existence of key fields can be ensured, and information that does not exist can be represented by None or an empty string. Metadata such as literature ID, fragment ID, and extraction time can be added, integrity checks can be performed, and erroneous or incomplete records can be marked. The data can be stored in JSON, CSV or database table format.
[0074] S104. Perform bioinformatics data standardization and cleaning on the original primer record information to obtain a standardized primer dataset. The standardized primer dataset includes primer sequences with unified orientation, normalized serotype annotations, and detection probe modification information.
[0075] Bioinformatics data standardization and cleaning is an operation that standardizes, unifies, and controls the quality of raw primer records, eliminating noise, inconsistencies, and redundancy. It includes steps such as data format unification, character cleaning, terminology standardization, and logical verification.
[0076] The unified primer sequence is one that standardizes all primer sequences to a 5' to 3' orientation and removes sequences with inconsistent orientation markers. Normalized serotype labeling involves converting multiple serotype descriptions into a unified code or identifier. Detection probe modification information is information on non-base functional groups (fluorescent groups, quenchers, etc.) extracted from the probe sequence text, including their type, location, and quantity.
[0077] A standardized primer dataset is a collection of primer data that has been processed and contains standardized information in a uniform format, and can be directly used for subsequent analysis applications.
[0078] S1041. Remove non-base characters from the primer sequence text in the original primer record information, and uniformly adjust the molecular orientation identifier of the retained base character sequence to obtain a primer sequence with unified orientation.
[0079] Non-base characters refer to characters other than standard bases (A, T, G, C) and degenerate bases (R, Y, M, etc.), such as direction symbols, separators, numbers, other letters, and special symbols. Molecular direction symbols are symbols indicating the orientation of the 5' and 3' ends of the primer, and must be consistent with the 5' to 3' orientation.
[0080] For example, the set of base characters that are allowed to be retained can be defined, and non-base characters can be removed by traversing the sequence text; the direction identifier can be identified, and the identifier can be removed from the retained base sequence containing "5'-" and "-3'", and the sequence containing "3'-" and "-5'" can be converted to the 5' to 3' direction by reverse complementation. For those without an explicit direction identifier, the 5' to 3' direction can be determined based on the context or by default and marked, resulting in a clean sequence string containing only uppercase standard base characters with a unified direction.
[0081] S1042. Based on the virus type associated with the original primer record information, call the corresponding serotype conversion rule to convert the original expression form in the serotype description text in the original primer record information into a unified serotype coding identifier, and obtain a normalized serotype label.
[0082] The virus type associated with the original primer record information is the type of pathogen virus the primer targets, which can be obtained from the target gene field or the title and abstract of the literature. Serotype conversion rules are a set of rules developed for specific virus types, mapping the original serotype description to a unified coding identifier. Different viruses have different serotype classification systems. The original description is the various descriptive texts of the serotype in the literature; the unified serotype coding identifier is a standardized and unique code.
[0083] For example, the corresponding serotype conversion rules can be retrieved from the rule base based on the virus type, the original expression of the serotype description text can be analyzed, and the serotype can be mapped to a unified encoding identifier according to the rules to obtain a normalized serotype label.
[0084] S1043. Detect and separate non-base functional group identifiers from the probe sequence text marked as probes in the original primer record information, and generate detection probe modification information based on the detected functional group identifiers.
[0085] The probe sequence text is the sequence text labeled as a probe in the original record, and may contain non-base functional group identifiers (fluorescent groups, quencher groups, etc.). Functional group identifiers are symbols or text indicating the functional groups of the probe. Detecting and separating functional group identifiers involves identifying and separating these identifiers from the base sequence. Detecting probe modification information is information formed by organizing the separated functional group identifiers.
[0086] For example, the probe sequence text can be analyzed, and functional group identifiers can be identified and separated through a preset functional group identifier library. Based on the separated identifiers, detection probe modification information containing information such as functional group type and location can be generated.
[0087] S1044. The primer sequences after direction unification, the normalized serotype labeling, and the detection probe modification information are bound and stored with the target gene information in the original primer record information to generate the standardized primer dataset.
[0088] Binding storage involves storing the aligned primer sequences, normalized serotype annotations, detection probe modification information, and target gene information together as a whole. Standardized primer datasets are datasets that integrate standardized information, facilitating querying, analysis, and application.
[0089] For example, the above information can be linked with target gene information and stored in a database table format, with each record containing this linking information, to generate a standardized primer dataset.
[0090] The method provided in this application, through validity screening and length control of document documents, can remove invalid information and adapt the text length to the model input. Specifically, firstly, documents of different formats are converted into plain text through text parsing. Then, a preset DNA sequence matching rule is used to identify valid documents containing the target DNA sequence, and irrelevant invalid documents are eliminated. This step significantly reduces the amount of data in subsequent processing and improves processing efficiency. Next, the character capacity of valid documents is estimated, and the text is truncated or retained in its entirety according to a preset context capacity threshold, ensuring that the text length meets the input requirements of the large language model and avoiding model processing failure or information loss due to excessive text length, while also avoiding unnecessary waste of computational resources. Then, the large language model is used to extract the original primer record information. By sending an output format constraint request, the model is guided to extract structured primer information from the text, including key fields such as primer name, sequence, and target gene. The cross-paragraph semantic linking capability of the large language model can associate relevant information scattered in different paragraphs to generate complete original primer record information. Compared with traditional rule-based information extraction methods, it has higher flexibility and accuracy and can handle complex and varied natural language descriptions. Finally, the original primer records underwent bioinformatics data standardization and cleaning, including removing non-base characters, standardizing primer orientation, normalizing serotype annotation, and extracting probe modification information. This transformed the original data into a standardized primer dataset with a unified format, eliminating noise and inconsistencies and providing a high-quality data foundation for subsequent primer evaluation, comparison, design optimization, or database construction. The resulting high-quality standardized primer dataset can be used to develop new virus detection kits, optimize the performance of existing primers, and construct viral primer databases, demonstrating significant research and clinical application value.
[0091] Optionally, if the document includes table content, the method may further include:
[0092] S201. Perform page-level table extraction on the document to obtain a set of table structures. The table entries in the set of table structures include the page number information, column header information, and row data.
[0093] Page-level table extraction is an operation that identifies and extracts tables for each page of a document. The table structure set is a collection of multiple table entries, with each entry corresponding to an extracted table, including the page number, column header information, and row data.
[0094] For example, table extraction tools or libraries (such as Camelot, Tabula, pdfplumber, etc.) can be used to scan documents page by page, identify table areas (by analyzing features such as lines, blank spaces, and text alignment on the page), extract page numbers, column headers (text in the first row or specified row of the table), and row data (text in other rows of the table excluding column headers), and organize them into table entries (such as a dictionary containing "page_number", "headers", and "rows" keys) to form a set of table structures.
[0095] S202. Perform context association processing on the table entries in the table structure set and the text content set. Extract the page text segment under the same page number from the text content set according to the page number information of the table in the table entry. Concatenate the page text segment under the same page number with the table column header information and table row data of the table entry to generate table context description text.
[0096] Context association processing establishes a link between table entries and text segments on the same page number. Concatenation combines page text segments with table column headers and row data to generate table context description text containing table content and the page number text segment information.
[0097] For example, based on the page number information in the table entries, the corresponding page text segment can be found in the text content set (e.g., extracted from a list of text segments organized by page number). The found page text segment is then concatenated with the column header information and row data of the table entries in a certain order (e.g., page text segment + "Table column header:" + column header text + "Table row data:" + row data text) to generate the table context description text, thus combining the table content with its context text information.
[0098] S203. Based on the preset primer information extraction template, the page text segments in the text content set are spliced together in page order, and the table context description text of all table entries below the page is inserted after the page text segments to generate a paragraph organization structure.
[0099] The preset primer information extraction template is a template that specifies the text organization method. It guides the combination of page text segments and table context description text, splices the page text segments in page order, and inserts table context description text after them to generate paragraph organization structure.
[0100] For example, following a preset primer information extraction template (such as defining the text organization order and delimiters), the page text segments in the text content set can be sequentially concatenated according to page order (e.g., page 1 text segment + page 2 text segment + ...). For each page, the table context description text of all table entries on that page is inserted after its page text segment (e.g., page 1 text segment + page 1 table 1 context description text + page 1 table 2 context description text + page 2 text segment + ...), forming a paragraph organization structure.
[0101] S204. The table column header information and table row data in the table structure set are structurally transformed according to the table dimensions to generate metadata description.
[0102] Table dimensions refer to the structure of a table, consisting of columns and rows. Structured transformation converts column headers and row data into a fixed-structure metadata format, generating a metadata description of the table's structure and content.
[0103] For example, the column header information and row data of table entries in a set of table structures can be analyzed and converted into structured forms such as key-value pairs (column headers as keys and row data as values) and JSON objects (e.g., {"table_id":"table_001", "headers":["primer name", "sequence"], "rows":[{"primer name":"F3", "sequence":"ATGC..."}, ...]}) according to the table dimensions, to generate metadata descriptions that describe the structure and content of the tables.
[0104] S205. Combine and package the paragraph organization structure and the metadata description to obtain primer information extraction request data.
[0105] The combined packaging process merges paragraph organization structures and metadata descriptions into a single data set, resulting in primer information extraction request data containing both text content and metadata.
[0106] The implementation involves combining paragraph organization and metadata description in a specific format (such as adding metadata description to the beginning or end of paragraph organization, or using specific delimiters) to form primer information extraction request data, so that the data contains both text content and metadata describing the table structure.
[0107] S206. Replace the text content set with the primer information extraction request data and use it as input data for intelligent reasoning analysis processing of the large language model.
[0108] Replacement uses requested data instead of a set of text content as model input, allowing the model to process richer information including table context and metadata, thus improving extraction accuracy.
[0109] Specifically, when inputting data into a large language model, primer information is used to extract request data instead of the text content set, and the request data is sent to the model's dialogue interface in the same way as the input text content set (such as constructing prompt words and setting parameters).
[0110] The method provided in this application extracts and processes the table content in the literature and combines it with the text content to generate primer information extraction request data containing richer information. Specifically, the process begins by accurately extracting table structures and data from the literature at the page level, avoiding any omissions of table information. Tables are crucial carriers of primer information, often containing key details such as primer names, sequences, and target genes. Next, table entries are contextually linked to text segments on the same page, generating contextual descriptions that combine table content with surrounding text. This helps the large language model better understand the background and meaning of the table data; for example, experimental conditions corresponding to primer sequences in a table might be described in a text segment on the same page. Then, a paragraph organization structure is generated based on a preset template, and the table structure is converted into metadata descriptions, further enriching the structure and information content of the input data. Finally, the paragraph organization structure and metadata descriptions are packaged together as model input. Compared to a simple collection of text content, this request data, including table context and metadata, provides the model with more comprehensive information, enabling the large language model to understand the literature content more fully and improving the completeness and accuracy of extracting original primer record information. This is particularly effective for extracting structured primer information contained within tables.
[0111] In one possible implementation, the method may further include:
[0112] S301. Load the existing result storage file, which contains the file name of the processed literature file and the corresponding standardized primer dataset.
[0113] The existing results storage file is a file containing processed literature information and corresponding standardized primer datasets that was previously processed and saved. Loading this file is to obtain the processed records and avoid duplicate processing.
[0114] Specifically, for example, the result storage file (such as a JSON file, CSV file, or database file) can be opened and read using file operation functions (such as Python's open() function), and the file name and the corresponding standardized primer dataset can be loaded into memory (e.g., stored as a dictionary, with the file name as the key and the dataset as the value).
[0115] S302. Construct a set of processed document names based on the existing result storage file.
[0116] The processed document name set is a collection containing all processed document file names, used to quickly check whether the current document has been processed.
[0117] Specifically, for example, the file names of all processed documents can be extracted from the loaded result storage file (e.g., extracted from dictionary keys), and these names can be stored in a set data structure (such as a set in Python) to improve the efficiency of checking by leveraging the fast lookup feature of sets.
[0118] S303. Before performing the validity screening and length control processing on the document, check whether the file name of the current document exists in the set of processed document names.
[0119] Checking is a step that determines whether a document has been processed before processing, avoiding duplication of work and improving efficiency.
[0120] Specifically, for example, before processing each document file, you can obtain its file name (e.g., extract it from the file path), and then use a set membership check operation (e.g., the in keyword in Python) to query whether the name is in the set of processed document names.
[0121] S304. If it exists, skip the subsequent processing steps of the current document and continue processing the next document.
[0122] If the current document name exists in the set of processed document names, it means that the document has already been processed and does not need to be processed again; skip the subsequent steps directly.
[0123] The implementation involves performing a jump operation (such as the continue statement in Python) when the current document name is detected in the set, and starting to process the next document file.
[0124] S305. After completing the bioinformatics data standardization and cleaning process on the literature file and generating a standardized primer dataset, the file name of the current literature file and the corresponding standardized primer dataset are assembled into a single result record, and the single result record is written to the result storage file in append mode.
[0125] Assemble a single result record by combining the filename of the current document with its corresponding standardized primer dataset into a single record. Append-write mode adds a new record to the end of the result storage file without overwriting existing content.
[0126] Specifically, for example, the current literature file name and standardized primer dataset can be assembled into a single result record in a certain format (such as a JSON format dictionary containing "filename" and "dataset" keys), and then the result storage file can be opened in append mode (such as the "a" mode of the Python open() function) and the record can be written to the file (such as after being converted to a JSON string).
[0127] The method provided in this application, by loading processed result files and constructing a set of processed document names, can check whether a document has already been processed before processing. Specifically, when processing a new set of document files, the previously processed result storage file is first loaded, and the names of processed documents are extracted and a set is constructed. Thus, before processing each document file, only a simple query is needed to see if its name is in the set; if it is, subsequent processing steps are skipped, avoiding repeated processing of the same document and saving significant computational resources and time. This is especially effective when the set of document files is large or requires multiple processing steps. Simultaneously, the result storage file is updated promptly after processing, assembling the current document name and the generated standardized primer dataset into a record and appending it to the file. This ensures data continuity and traceability, allowing for direct use of existing results in subsequent processing without starting from scratch, thus improving the efficiency and maintainability of the entire processing workflow.
[0128] Optionally, after obtaining the set of documents to be processed, the method may further include:
[0129] S401. Perform layout type recognition processing on the layout format of the document to obtain the layout type identifier of the document. The layout type identifier is used to distinguish between plain text document, mixed text and image document, dense table document, and appendix supplementary information document.
[0130] Formatting refers to the layout and content organization of a document's pages. Formatting type identification is the process of analyzing the formatting to determine its type. Formatting type identifiers are symbols or codes (such as "text_only", "image_text", "table_dense", "appendix") that distinguish between plain text (primarily text with almost no images or tables), mixed text and image (text and images, charts and tables), dense table (containing a large number of tables), and appendix / supplementary information (containing appendices, supplementary data, etc.) documents.
[0131] In this step, layout analysis algorithms or tools (such as deep learning-based layout analysis models, OpenCV image processing library, etc.) can be used to scan documents and analyze the distribution and proportion of text, images, tables and other elements on the page (such as calculating the proportion of image / table areas to the total page area).
[0132] Based on the analysis results, the document documents are divided into different layout types and assigned corresponding layout type labels. For example, if the text accounts for more than 90% of the page and there are no pictures or tables, it is a plain text type; if the pictures / tables account for 10%-40%, it is a mixed text and image type; if the tables account for more than 40%, it is a dense table type; if it contains titles such as "Appendix" or "Supplementary Materials" and the content is supplementary data, it is an appendix supplementary information type.
[0133] S402. When the layout type identifier indicates that the current document is a mixed text and image document, perform figure area detection processing on the current document to identify the figure area in the document and extract the figure caption text associated with the figure area.
[0134] The attached figure region detection process is an operation to identify the image region in documents with mixed text and images. The attached figure region is the area in the document that contains the image, and the caption text is the explanatory text associated with the attached figure region (usually located below or next to the image).
[0135] In this step, when the document contains both text and images, image recognition algorithms (such as edge detection, contour analysis, and deep learning-based object detection models like Faster R-CNN) can be used to scan the document pages and detect the figures (by identifying non-text areas and regularly shaped areas on the page). Then, the caption text surrounding the figures (usually below the image, identified by text location coordinates and keywords such as "Fig. X") is located and extracted.
[0136] S403. Perform primer-related entity recognition processing on the caption text, mine the primer sequence information and experimental parameter information recorded in the caption text, and obtain a set of hidden primer information.
[0137] Primer-related entity recognition processing is the operation of identifying primer-related entity information from the caption text, such as primer sequences and experimental parameters (detection limits, specificity, etc.). The hidden primer information set is a collection of primer-related information mined from the caption text that was not previously extracted from the main text.
[0138] For example, entity recognition techniques from natural language processing (such as BERT-based named entity recognition models, regular expression matching, etc.) can be used to analyze the caption text and identify primer sequence information (such as strings that conform to base sequence rules) and experimental parameter information (such as "detection limit 100 copies / mL" and "specificity 99%"). This information can then be collected to form a set of hidden primer information (such as a list, where each element is a dictionary containing primer sequences, parameters, etc.).
[0139] S404. The implicit primer information set is fused and aligned with the primer information extracted from the main text and table data to generate a supplemented text content set.
[0140] Fusion alignment is an operation that integrates, matches, and supplements the set of implicit primer information with the primer information extracted from the main text and tables, ensuring the consistency and completeness of the information. The supplemented text content set is a set of text content that integrates the implicit primer information in the figure captions.
[0141] Specifically, the information in the implicit primer information set can be compared with the primer information extracted from the text and tables (e.g., by matching primer sequence similarity or target gene name), information on identical primers can be merged (e.g., adding experimental parameters supplemented in the figure captions to existing records), missing information can be supplemented (e.g., primer sequences not mentioned in the text but present in the figure captions), and conflicting information can be verified and corrected (e.g., based on the information in the text or marked for manual review), generating a supplemented text content set.
[0142] S405. Replace the original text content set with the supplemented text content set, and use it as the source text for subsequent validity screening, length control processing, and input into the large language model for intelligent reasoning analysis.
[0143] The original text content set is replaced by the supplemented text content set as input for subsequent processing, in order to utilize the primer information in the caption text and improve the comprehensiveness of the processing.
[0144] For example, in subsequent processing steps (validity screening, length control, model input), the supplemented text content set can be used as the source text to replace the original text content set.
[0145] The method provided in this application identifies the format type of document documents and extracts caption text and mines hidden primer information for documents with mixed text and image layouts. Specifically, firstly, the documents are classified into different types by format type identification, allowing for targeted processing strategies for different formats. For documents with mixed text and image layouts, the figures and captions may contain important primer-related information, such as results of primer validation experiments and schematic diagrams of primer binding sites, which are often described in the caption text. Then, through figure area detection and caption text extraction, hidden primer sequence information and experimental parameter information are mined from the captions. This information may not appear in the main text or tables, thus supplementing the text content. Finally, the hidden primer information is merged and aligned with the information in the main text and tables to generate a supplemented text content set, enabling subsequent processing to utilize more comprehensive information. In this way, compared to using only the main text and table text, the supplemented text content set contains more potential primer information, improving the completeness of the original primer record information and reducing information omissions, especially for documents that provide key primer information in the captions, where the effect is more significant.
[0146] Optionally, after inputting the text content set into a large language model for intelligent reasoning analysis to obtain the original primer record information corresponding to the document, the method may further include:
[0147] S501. Obtain the original primer record information and construct a self-checking prompt word. The self-checking prompt word contains an instruction requiring the large language model to perform field-by-field validity checks on the original primer record information.
[0148] The self-checking prompt is the instruction text that instructs the model to perform self-checking and verification of the original primer record information. Field-by-field validity verification checks each field in the original primer record information to determine whether it meets the corresponding rules and requirements (such as whether the primer sequence contains only base characters, whether the target gene matches the serotype, etc.).
[0149] In this step, after obtaining the original primer record information, a prompt containing verification instructions can be constructed, such as: "Please verify the validity of each field of the following original primer record information, including: 1. Whether the characters in the primer sequence field value only contain A, T, G, C and degenerate bases; 2. Whether the association logic between the target gene field value and the serotype annotation field value is reasonable (e.g., a specific serotype corresponds to a specific target gene); 3. Whether the format of the detection sensitivity field value conforms to the preset format rules (e.g., value + unit, unit is copies / mL, fg, etc.). Please return the verification results, including a list of missing fields, a list of logically conflicting fields and candidate correction values, and a list of format-violation fields."
[0150] S502. Input the original primer record information and the self-check prompt words into the large language model in reverse, and instruct the large language model to perform multiple rounds of self-examination and verification operations. The multiple rounds of self-examination and verification operations include verifying whether the characters in the primer sequence field value conform to the base character set, verifying whether the association logic between the target gene field value and the serotype labeling field value is reasonable, and verifying whether the format of the detection sensitivity field value conforms to the preset format rules.
[0151] Reverse input involves sending the original primer record information and self-check prompts back to the large language model. Multi-round introspection and verification is a process where the model checks and verifies the original primer record information multiple times based on the prompts, involving verification of various aspects such as base character composition, logical association between target genes and serotypes, and the format for detection sensitivity.
[0152] Specifically, the original primer record information (such as a JSON format string) and self-check prompts can be combined into input text and sent to the large language model, instructing the model to perform multiple rounds of checks. In each round of checks, the model analyzes and judges each field for different verification content (base characters, logical associations, format rules, etc.). For example, the first round checks primer sequence characters, the second round checks target gene and serotype logic, and the third round checks detection sensitivity format, etc., or it can perform a comprehensive check in one round but return the results point by point.
[0153] S503. Receive the introspection review result returned by the large language model. The introspection review result includes a list of field names marked as missing, a list of field names marked as logically conflicting and their candidate correction values, and a list of field names marked as formatting violations.
[0154] The self-introspection and verification results are returned by the large language model after completing multiple rounds of self-introspection and verification. They include the verification status of each field of the original primer record information, such as which fields are missing information (missing fields), which field values have logical contradictions (logical conflict fields) and possible correction values, and which field values do not meet the format requirements (format violation fields).
[0155] The system receives the introspection and verification results returned by the model (usually in text format), parses them, and extracts a list of missing field names (e.g., ["amplifier length"]), a list of logically conflicting field names and their candidate correction values (e.g., [{"field":"target gene", "original value":"ORF1ab", "candidate correction value":["N gene"]}]), and a list of field names marked as having format violations (e.g., ["detection sensitivity"]).
[0156] S504. For the missing field in the list of missing field names, backtrack from the text content set to locate the original text position corresponding to the missing field, extract the original text content and re-input it into the large language model for filling, and obtain the filled field value.
[0157] Backtracking involves locating the original text position of a missing field within a text content set. Filling in the missing field involves re-inputting the extracted original text content into the model, allowing the model to extract information from it to fill in the missing fields.
[0158] Specifically, for missing fields (such as "amplifier length"), based on their association information in the original primer record information (such as primer name, sequence, target gene), the relevant original text position can be found in the text content set (such as searching for keywords such as "amplifier length" and "product length" and locating them in combination with primer name), the text content at that position can be extracted (such as "amplifier product length is approximately 150bp"), and this content can be entered into the large language model along with the completion instruction (such as "Please extract the value of amplifier length from the following text: [text content]") to obtain the completed field value (such as "150bp").
[0159] S505. For logically conflicting fields in the list of logically conflicting field names, replace the original values of the corresponding fields in the original primer record information with the candidate correction values in the list of candidate correction values.
[0160] A logically conflicting field refers to a field whose values contradict each other semantically or logically (e.g., a target gene is labeled "influenza virus M gene," but the serotype is labeled "COVID-19 Delta type"). The candidate correction value list is a list of possible correct field values provided by the model. Replacement updates the original field values with the candidate correction values.
[0161] For example, a suitable correction value can be selected from the list of candidate correction values (such as the candidate value with the highest confidence based on the model's confidence, context information, or domain knowledge) to replace the original value of the logical conflict field in the original primer record information. For example, the serotype label in the above example can be corrected to "influenza virus H1N1".
[0162] S506. For the format-incorrect fields in the list of field names, perform automatic format conversion processing according to preset standard format rules to obtain compliant field values.
[0163] A format violation field refers to a field whose value format does not conform to the preset standard format rules (e.g., a sensitivity field value of "100 copies" lacks the unit " / mL"). The preset standard format rules specify the format requirements that each field value should follow (e.g., the sensitivity field format is "value + unit", where the unit can be "copies / ml", "fg / mL", etc.). Automatic format conversion processing is the operation that converts the non-compliant format to a compliant format.
[0164] For example, based on preset standard format rules, the values of fields with non-compliant formats can be converted. For instance, "100 copies" can be converted to "100 copies / ml", and "99%" can be standardized to "99.0%", thus obtaining compliant field values.
[0165] S507. The supplemented field values, the replaced candidate correction values, and the compliant field values are merged and updated into the original primer record information to generate the original primer record information after self-examination and error correction processing.
[0166] Merging and updating involves integrating the supplemented, replaced, and transformed field values into the original primer record information, overwriting any erroneous or missing information. The original primer record information that has undergone introspection and error correction is a more accurate and complete version.
[0167] For example, the supplemented field values, the replaced candidate correction values, and the compliant field values can be updated to the corresponding fields of the original primer record information. For instance, the supplemented "150bp" can be filled into the "amplifier length" field, the corrected serotype label can be updated into the "serotype" field, and the converted "100 copies / mL" can be updated into the "detection sensitivity" field, thus forming the original primer record information after self-examination and error correction.
[0168] The method provided in this application constructs self-checking prompts and allows a large language model to perform multiple rounds of introspection and verification of the original primer record information. Specifically, firstly, prompts containing field-by-field verification instructions are constructed to guide the large language model to comprehensively check the original primer record information. Utilizing its powerful semantic understanding and logical reasoning capabilities, the model can identify issues such as non-base characters in the primer sequence, logical contradictions between the target gene and serotype, and non-standard formats for detection sensitivity. Then, the introspection and verification results returned by the model are received. For missing fields, the original text is traced back and re-entered into the model to fill in the missing information, ensuring its completeness. For logically conflicting fields, candidate correction values provided by the model are used to replace the missing information, resolving inconsistencies. For format-violation fields, automatic format conversion is performed according to preset rules to unify the data format. Through these steps, missing fields, logical conflicts, and format violations in the original primer record information can be systematically identified and corrected, generating more accurate and complete original primer record information, reducing abnormal data in the standardization process, and improving the quality and reliability of the final standardized primer dataset.
[0169] Optionally, after generating the standardized primer dataset, the method may further include:
[0170] S601. Obtain the standardized primer datasets corresponding to multiple literature files.
[0171] Obtaining standardized primer datasets from multiple documents is for cross-document primer information analysis and processing, comparing information on the same or related primers in different documents, and resolving data inconsistency issues.
[0172] In this step, the standardized primer datasets corresponding to all processed literature files can be read from the storage location (such as a database or file system) and collected together (e.g., stored as a list or dictionary, with the key being the literature identifier and the value being the dataset).
[0173] S602. Perform sequence similarity matching and semantic association matching on the primer sequences in the standardized primer dataset, and identify primer sequences with sequence similarity exceeding a preset similarity threshold and the same target gene field value as cross-document homologous primers to obtain a homologous primer association index. The homologous primer association index contains the document identifier of the document corresponding to the homologous primer.
[0174] Sequence similarity matching compares the degree of similarity between different primer sequences, typically using sequence alignment algorithms (such as Smith-Waterman, BLAST, Needleman-Wunsch, etc.) to calculate similarity values (e.g., percentage similarity). Semantic association matching analyzes the semantic association between primer sequence-related information (e.g., target gene name, functional description, amplification region, etc.). A preset similarity threshold is a critical value for determining sequence similarity (e.g., 90%). Cross-document homologous primers refer to primers from different documents that have a sequence similarity exceeding the threshold and share the same target gene. A homologous primer association index is an index structure (e.g., a dictionary, where the key is the primer sequence or unique identifier, and the value is a list containing document identifiers) that records homologous primers and their corresponding document identifiers.
[0175] In this step, sequence alignment algorithms are used to calculate pairwise sequence similarity for all primer sequences in the standardized primer dataset (e.g., pairwise alignment of primer sequences to calculate the percentage of identical bases). Simultaneously, semantic association matching is performed to analyze whether target gene field values are identical or highly correlated (e.g., "ORF1ab gene" and "ORF1a / b gene" are considered identical). Primers with sequence similarity exceeding a preset similarity threshold (e.g., 90%) and identical target gene field values are identified as cross-document homologous primers, and their corresponding document identifiers (e.g., DOI, PMID) are recorded to construct a homologous primer association index.
[0176] S603. Based on the homologous primer association index, extract the amplicon length field value, detection sensitivity field value, and detection specificity field value of the homologous primers in different literature files from the standardized primer dataset to form a parameter conflict set.
[0177] The parameter conflict set is a collection of cases where homologous primers have inconsistent values for parameters such as amplicon length, detection sensitivity, and detection specificity in different literature (e.g., a list, where each element is a dictionary containing primer identifier, parameter name, and parameter values from different literature).
[0178] For example, based on the homologous primer association index, records of each homologous primer in different literature can be found, and the values of amplicon length, detection sensitivity, and detection specificity of these records can be extracted. These values can be compared to see if they are consistent (e.g., whether the values are within the error range or whether the units are consistent). Inconsistent parameter values can be combined into a parameter conflict set. For example, if primer A has an amplicon length of 150 bp in literature 1 and 155 bp in literature 2, then this case can be added to the parameter conflict set.
[0179] S604. Obtain the publication level weight and experimental completeness weight corresponding to the literature document. The publication level weight is preset according to the impact factor range of the journal in which the literature document is located, and the experimental completeness weight is pre-calculated according to the completeness of the primer-related experimental description in the literature document.
[0180] Publication level weighting is a weight value that reflects the level of the journal in which a document is published. The weighting varies depending on the impact factor range. Generally, the higher the impact factor, the greater the weight (e.g., journals with an impact factor >10 have a weight of 1.0, those with an impact factor between 5 and 10 have a weight of 0.8, and those with an impact factor <5 have a weight of 0.5).
[0181] The experimental completeness weight is a pre-calculated weight value based on the completeness of primer-related experimental descriptions in the literature (such as whether it includes primer design methods, synthesis methods, concentration optimization, specificity verification, sensitivity verification, repeatability experiments, etc.). The more complete the description, the greater the weight (e.g., the weight of including all experimental descriptions is 1.0, the weight of missing some verification experiments is 0.7, and the weight of brief descriptions is 0.3).
[0182] Specifically, a table can be pre-defined to correspond to journal impact factor ranges and publication level weights (e.g., {"range":[10, ∞), "weight":1.0}, {"range":[5, 10), "weight":0.8}, ...). The publication level weight can be determined by consulting this table based on the journal's impact factor. For experimental completeness weights, a scoring standard is established (e.g., design method 20 points, synthesis method 10 points, specificity verification 30 points, sensitivity verification 30 points, repeatability experiment 10 points, total 100 points). Primer-related experimental descriptions in the literature are scored, and the scores are converted into weight values of 0-1.0 (e.g., a score of 90 points is converted to 0.9).
[0183] S605. For homologous primers with inconsistent parameters in the parameter conflict set, a weighted arbitration calculation is performed according to the publication level weight and the experimental completeness weight to obtain normalized standard parameter values.
[0184] Weighted arbitration calculation is a process that comprehensively considers the weights of publication ranking and experimental completeness to calculate inconsistent parameter values in a conflict set and determine a standard parameter value. The normalized standard parameter value is a unified and standardized parameter value obtained through weighted arbitration calculation.
[0185] Specifically, for each homologous primer with inconsistent parameters in the parameter conflict set, the parameter values from different documents can be multiplied by the sum of their corresponding publication level weight and experimental completeness weight (or other weighting methods, such as publication level weight accounting for 60%, experimental completeness weight accounting for 40%, total weight = publication level weight × 0.6 + experimental completeness weight × 0.4), and then a weighted average can be calculated (e.g., parameter value 1 × weight 1 + parameter value 2 × weight 2 + ... / total weight) or the parameter value with the highest weight can be selected as the normalized standard parameter value. For example, the amplicon length of primer A is 150 bp in document 1 (weight 0.8) and 155 bp in document 2 (weight 0.9). If a weighted average is used, the standard parameter value = (150 × 0.8 + 155 × 0.9) / (0.8 + 0.9) ≈ 152.6 bp, which can be rounded to 153 bp.
[0186] S606. Replace the original parameter values corresponding to homologous primers in the normalized primer dataset with the normalized standard parameter values, and store the original parameter values of the literature files as source information in association with the normalized standard parameter values to generate a normalized primer dataset that has undergone cross-document conflict resolution.
[0187] Replacing the original parameter values involves updating the corresponding parameters of homologous primers in the normalized primer dataset with normalized standard parameter values. Association storage saves the original parameter values along with the standard parameter values to trace the parameter origin. The normalized primer dataset, after cross-document conflict resolution, is a more reliable dataset that addresses the inconsistency issue of homologous primer parameters.
[0188] Specifically, the original parameter values (amplifier length, detection sensitivity, detection specificity) of homologous primers in the standardized primer dataset can be replaced with normalized standard parameter values. At the same time, a traceability information field is added to the dataset, and the original parameter values, document identifiers, weights, and other information of each document are stored as traceability information in association with the standard parameter values (e.g., the standard parameter value field stores 153bp, and the traceability information field stores [{"document ID":"Lit_001", "original value":"150bp", "weight":0.8}, {"document ID":"Lit_002", "original value":"155bp", "weight":0.9}]), generating a standardized primer dataset that has undergone cross-document conflict resolution.
[0189] The method provided in this application identifies homologous primers and handles parameter conflicts in a standardized primer dataset. Specifically, it first identifies homologous primers across different publications through sequence similarity matching and semantic association matching, discovering similar primers targeting the same gene in different publications. Then, it extracts the parameter values of homologous primers from different publications, forming a parameter conflict set to identify inconsistencies. Next, it introduces publication level weights and experimental completeness weights. The publication level weight reflects the academic influence and credibility of the publication, while the experimental completeness weight reflects the detail and reliability of the experimental description. Through weighted arbitration calculation, it comprehensively considers the authority and experimental quality of different publications to obtain more reasonable normalized standard parameter values, avoiding biases caused by simple averaging or subjective selection. Finally, it replaces the original parameter values with standard parameter values and stores the original values as traceability information, solving the parameter inconsistency problem and ensuring data traceability. This solves the problem of inconsistent homologous primer parameters in different publications, generating a more unified and reliable standardized primer dataset, improving data usability and credibility.
[0190] For example, S701 obtains the model's internal attention weight matrix generated during the process of generating the original primer record information by the large language model.
[0191] The large language model is based on the Transformer architecture, whose encoder consists of multiple stacked encoder layers, each containing a multi-head self-attention sublayer. When the large language model decodes the input text character by character to generate the original primer record information, each attention head calculates the semantic association strength between any two positions in the input text sequence, generating attention weights. The attention weights generated by all attention heads in all encoder layers of the large language model are organized along two dimensions: layer and head, resulting in an internal attention weight matrix with dimensions [number of encoder layers, number of attention heads, input sequence length, input sequence length]. The element at position (i,j) of the h-th head in the l-th layer of this matrix represents the normalized attention weight value of the i-th character to the j-th character in the input text when generating the current output character. In implementation, the output attention parameter is enabled in the large language model inference interface. During model forward propagation, the attention weight matrices of each layer and head are returned synchronously, and the caller stores them stacked along the layer and head dimensions.
[0192] S702. Extract primer semantic attention hotspots from the attention weight matrix within the model, aggregate them along the attention head dimension of the encoder level of the large language model, and calculate the cumulative attention weight of each attention head in the primer sequence description text region, target gene description text region, and experimental performance description text region to obtain the primer semantic attention hotspot distribution map.
[0193] The primer sequence description text region consists of text fragments containing consecutive uppercase A, T, G, C bases or 5'-3' direction markers in the input text; the target gene description text region consists of text fragments containing gene name keywords or genomic coordinate numbers; and the experimental performance description text region consists of text fragments containing detection limit units or specificity percentages. During extraction, all attention heads in all encoder layers within the model's internal attention weight matrix are traversed. For each attention head, the attention weight values assigned to that attention head within the character index interval corresponding to the three types of text regions are summed to obtain the attention contribution value of that attention head to that text region. The attention contribution values of all attention heads in all encoder layers to the same text region are accumulated to obtain the cumulative attention weight of that text region. The cumulative attention weights of the three types of text regions are arranged according to the order of their appearance in the input text to generate a primer semantic attention hotspot distribution map.
[0194] S703. Based on the primer semantic attention hotspot distribution map, identify the degree of dependence of the large language model on different text paragraph regions in the text content set when extracting primer information. Mark the text paragraph regions with the cumulative attention weight exceeding the preset attention hotspot threshold as high primer information dependence source regions, and mark the text paragraph regions with the cumulative attention weight below the preset attention cold point threshold as low primer information dependence source regions.
[0195] During information extraction, large language models concentrate their attention resources on input regions relevant to the target semantics. Regions with higher accumulated attention weights contribute more to the model output. A preset attention hotspot threshold is set at 1.5 times the average accumulated attention weight of all text regions, and a preset attention coldspot threshold is set at 0.3 times the average accumulated attention weight of all text regions. Each text segment region in the primer semantic attention hotspot distribution map is traversed, and its accumulated attention weight is compared with the preset attention hotspot threshold. Regions exceeding this threshold are marked as high-dependence source regions for primer information, and their start and end character offsets are recorded. Regions below this threshold are then marked as low-dependence source regions for primer information, and their start and end character offsets are recorded.
[0196] S704. Perform source association binding processing on the text content of the source region with high primer information dependence and the field values in the original primer record information output by the large language model, establish the source mapping relationship from each original primer record information field value to the specific text paragraph region in the text content set, and generate the primer information source mapping chain.
[0197] When a large language model decodes and generates a field value, the region in the input text that contributes the most to generating that field value will receive the highest attention weight value in the self-attention mechanism. Utilizing this principle, for each field value in the original primer record information, the region with the highest accumulated attention weight in the corresponding attention weight distribution during the generation of that field value is retrieved as a highly dependent source region of primer information. The text content, start character offset, and end character offset of this highly dependent source region are then bound and stored with the field value, forming a source mapping relationship for that field value. This binding operation is performed on all field values, and the source mapping relationships of all field values are organized by field name, generating a primer information source mapping chain.
[0198] S705. Perform missing information mining processing on the text content of the low-dependency source region of primer information, and re-feed the text content of the low-dependency source region of primer information as supplementary input into the large language model, and construct missing information directional extraction prompt words. The missing information directional extraction prompt words contain instructions that require the large language model to extract primer-related information that was missed in the first inference from the low-dependency source region, and receive the set of missing primer information returned by the large language model in response to the missing information directional extraction prompt words.
[0199] The prompt for targeted extraction of missing information is a fixed template text: "Please extract all primer-related information from the following text fragment, including primer name, primer sequence, target gene, genomic location, amplicon length, detection sensitivity, and detection specificity, and return it in the form of structured fields. Fields with missing information should be filled with empty values." During implementation, the text content of each low-dependency source region of primer information is concatenated with the prompt for targeted extraction of missing information and fed as new input into the large language model. The large language model performs targeted semantic parsing on the text in this region and outputs a set of structured missing primer information. Each record in the set contains values for the primer name, primer sequence, target gene, genomic location, amplicon length, detection sensitivity, and detection specificity fields.
[0200] S706. Perform field-level incremental merging of the missing primer information set with the original primer record information to generate the supplemented original primer record information.
[0201] The rules for field-level incremental merging are as follows: For each missing primer record in the missing primer information set, search the original primer record information for existing records with identical primer sequence field values or primer sequence similarity exceeding 90%. If such records exist, the non-empty field values from the missing primer record are overwritten into the corresponding empty fields of the existing records. If not, the missing primer record is appended as a new record to the end of the original primer record information. Primer sequence similarity is calculated using an edit distance-based sequence alignment algorithm. The characters of the two primer sequences are compared one by one, and the similarity value is obtained by dividing the number of identical base characters by the total number of base characters in the longer sequence. After merging, the supplemented original primer record information is obtained.
[0202] S707. Based on the primer information tracing mapping chain and the supplemented original primer record information, the large language model is subjected to model attention calibration and fine-tuning. The correspondence between the high-dependency source region and the correct primer field value in the primer information tracing mapping chain is used to construct calibration training samples. The attention layer weight parameters of the large language model are updated through backpropagation to obtain the large language model after primer information extraction and attention calibration.
[0203] The calibration training samples are constructed as follows: the text content of each primer information highly dependent source region is used as the training input, and the field values in the original primer record information corresponding to that highly dependent source region are used as the training labels, thus constructing a training sample pair from input text to output field values. The cross-entropy loss function is used, calculating the cross-entropy loss value between the predicted output of the large language model for this training sample and the training label under the current parameters. The gradient of the cross-entropy loss value with respect to the attention layer weight parameters of the large language model is calculated using the chain rule, and the attention layer weight parameters are updated along the gradient descent direction using the Adam optimizer. Iterative training is performed on all calibration training samples until the loss value converges, resulting in the large language model after primer information extraction and attention calibration.
[0204] S708. Input the set of text content of the subsequent unprocessed literature documents into the large language model after primer information extraction and attention calibration for intelligent reasoning analysis and processing to obtain the original primer record information after attention calibration.
[0205] The text content set of subsequent unprocessed literature documents is obtained after undergoing the same text parsing, validity screening, and length control as described above. The processed text content set is then input into the large language model after primer information extraction and attention calibration. The large language model uses the calibrated attention layer weight parameters to perform semantic encoding and decoding on the input text, and outputs the attention-calibrated original primer record information. Compared with the original primer record information before calibration, the accuracy of extracting primer sequence field values and target gene field values is improved after attention calibration.
[0206] S709. Perform primer information extraction contribution quantification evaluation on each attention head in the internal attention weight matrix of the model, calculate the proportion of the cumulative attention weight of each attention head in the primer sequence description text region, target gene description text region and experimental performance description text region to the total attention weight allocation of the attention head, and mark attention heads with proportion values lower than the preset contribution threshold as redundant attention heads for primer information extraction.
[0207] The total attention weight allocation for each attention head is equal to the sum of the attention weight values of that attention head at all character positions in the input text. The proportion is equal to the cumulative attention weight of that attention head in the three types of primer semantic regions divided by the total attention weight allocation of that attention head. The preset contribution threshold is set to 0.1. A proportion value lower than 0.1 indicates that the attention head allocates more than 90% of its attention resources to text regions unrelated to primer information, and is marked as a redundant attention head for primer information extraction.
[0208] S710. During the large language model inference process after primer information extraction and attention calibration, the weights of attention heads marked as redundant attention heads for primer information extraction are reset to 0, and only non-redundant attention heads are retained to participate in forward propagation calculations. This yields the original primer record information output under the simplified attention inference mode. The original primer record information output under the simplified attention inference mode is then compared with the original primer record information after attention calibration. When the primer sequence field values of the two are consistent, the original primer record information output under the simplified attention inference mode is used as the final original primer record information.
[0209] The implementation of resetting attention head weights to 0 is as follows: Before inference in the large language model, each attention head in each layer of the encoder is traversed. If the current attention head is in the redundant attention head tag list for primer information extraction, all elements of the output weight matrix of that attention head are assigned a value of 0, so that the contribution of that attention head to the input of subsequent layers in forward propagation is 0. During consistency comparison, the original primer record information output in the simplified attention inference mode is compared field by field to see if the primer sequence field values in the original primer record information after attention calibration are completely identical. If they are identical, the output of the simplified attention inference mode takes precedence; otherwise, the output after attention calibration takes precedence. The simplified attention inference mode reduces the computational overhead of redundant attention heads, improving inference speed while maintaining extraction accuracy.
[0210] S801. During the process of performing cross-segment semantic linking operations in the large language model, primer entity relationship reasoning path tracing processing is performed on the decoder level of the large language model to extract the intermediate hidden layer semantic vector sequence activated by the large language model when generating each primer field value.
[0211] The decoder of the large language model consists of multiple stacked decoder layers. Each decoder layer contains a masked multi-head self-attention sublayer, a cross-multi-head attention sublayer, and a feedforward neural network sublayer. When the large language model generates a field value from the original primer record information based on the input text, the cross-attention sublayers of each decoder layer weighted and aggregated the semantic vectors output by the encoder, generating intermediate hidden layer semantic vectors that incorporate the semantic information of the input text. The semantic vectors output by each cross-attention sublayer of the decoder are arranged in order of decoding layer index to form the intermediate hidden layer semantic vector sequence corresponding to that field value. The k-th vector in the sequence represents the aggregated semantic representation of the input text by the k-th layer of the decoder. In implementation, during the forward propagation of the large language model, the outputs of each cross-attention sublayer of the decoder are kept in a reserved state. When decoding the last character of each field value, the cross-attention output vectors of each decoding layer are collected synchronously and arranged in ascending order of layer index to form the intermediate hidden layer semantic vector sequence.
[0212] S802. Perform semantic reasoning logic interpretation on the intermediate hidden layer semantic vector sequence, map the intermediate hidden layer semantic vector sequence to the pre-constructed primer knowledge ontology concept space, and determine the primer concept path that the large language model activates sequentially during the reasoning process by calculating the semantic similarity between the intermediate hidden layer semantic vector and the semantic vector of each primer concept node in the primer knowledge ontology concept space.
[0213] The pre-constructed primer knowledge ontology concept space is a directed graph structure. Nodes are primer concept nodes, including "primer sequence," "target gene," "genomic coordinates," "amplifier length," "detection sensitivity," "detection specificity," "fluorescent group," "quencher group," "forward primer," "reverse primer," and "probe," etc. Edges are semantic relationship edges between concept nodes, including relationship types such as "targeted," "located to," "has length," "has sensitivity," "has specificity," "modified," and "paired with." Each primer concept node pre-stores a semantic vector, which is obtained by encoding the concept name and concept definition text of the concept node by a pre-trained domain text encoder. During mapping, for the semantic vector output by each decoding layer in the intermediate hidden layer semantic vector sequence, the cosine similarity between this semantic vector and the semantic vectors of all primer concept nodes in the primer knowledge ontology concept space is calculated. The primer concept node with the highest cosine similarity is selected as the primer concept activated by that decoding layer. The primer concepts activated by each decoding layer are arranged in the order of the decoding layers to obtain the primer concept path activated sequentially by the large language model when generating the field value.
[0214] S803. Perform causal correspondence analysis on the generation results of the generated values of each field in the original primer record information and the sequentially activated primer concept paths to establish a complete inference causal chain from the input text region through the intermediate primer concept path to the output field value, and obtain the primer field inference causal chain set.
[0215] The logic of causal correspondence analysis is as follows: the generation of field values is directly obtained by decoding the semantic vector output by a specific decoding layer. This semantic vector is then generated by aggregating semantic information from specific regions of the input text through a cross-attention mechanism, and then passing and transforming it layer by layer through intermediate decoding layers. Therefore, there is a causal chain from the input text region to the output field value, passing through the intermediate primer concept path. In practice, for each field value, the decoding layer index corresponding to the last character at the time of its generation is obtained. The attention weight distribution of the cross-attention sublayer of that decoding layer at each position in the input text is extracted, and the input text region with the highest attention weight is taken as the input source region for that field value. The input source region corresponding to that field value, the intermediate primer concept path, and the output field value are linked sequentially to form a complete inference causal chain. The inference causal chains of all field values are summarized to obtain the primer field inference causal chain set.
[0216] S804. Perform reasoning rationality verification on the primer field reasoning causal chain set. Compare the primer concept path in each primer field reasoning causal chain with the legal semantic relationship path defined in the pre-constructed primer knowledge ontology concept space. When there is a semantic relationship jump in the primer concept path that is not defined in the pre-constructed primer knowledge ontology concept space, mark the primer field reasoning causal chain as a causal chain with reasoning jump anomaly.
[0217] A valid semantic relation path defined in the pre-constructed primer knowledge ontology concept space refers to a continuous path that starts from the relevant concept node at the input end, passes through a series of intermediate concept nodes along directed edges, and finally reaches the relevant concept node at the output end, with each hop in the path corresponding to a defined semantic relation edge. An undefined semantic relation jump occurs when two adjacent concept nodes appear in the primer concept path, but they do not have a directly connected semantic relation edge in the pre-constructed primer knowledge ontology concept space. During the comparison, two adjacent primer concept nodes are sequentially selected from the primer concept path of the causal chain inferred from the primer field. The pre-constructed primer knowledge ontology concept space is then queried to see if there is a semantic relation edge starting from the first primer concept node and ending at the second primer concept node. If no such edge exists, a semantic relation jump is determined to have occurred at that point, and the causal chain is marked as a causal chain with an inference jump anomaly.
[0218] S805. Extract the primer field values corresponding to all causal chains marked as having reasoning jump anomalies, construct a set of reasoning questionable primer fields, and package the input source region, primer concept path, and reasoning jump anomaly node location information corresponding to each reasoning questionable primer field in the set of reasoning questionable primer fields into a reasoning questionable field verification data package.
[0219] The set of inference-questionable primer fields is a collection of all marked fields in the original primer records that exhibit anomalies to the internal inference path of the large language model. During packaging, a data record structure is created for each inference-questionable primer field, containing the field name, current field value, the start and end character offsets of the input source region corresponding to the field value, the complete text content of the input source region, the sequence of concept node names in the primer concept path, and the names of the two adjacent concept nodes where the inference jump anomaly occurred. All data records for inference-questionable primer fields are aggregated to generate an inference-questionable field review data package.
[0220] S806. Send the data packet for reviewing questionable inference fields to the manual review interface and receive the manual review and correction results for the data packet for reviewing questionable inference fields.
[0221] The manual review interface is a user interface component that displays the field name, current field value, input source region text content, and inference jump exception description for each problematic primer field in the inference problematic field review data package. It provides three operation options: "Confirm Correct," "Modify Field Value," and "Delete Field." Manual reviewers examine the displayed information for each problematic inference field one by one, determining the correctness of the field value based on the input source region text content and domain knowledge, and selecting the corresponding operation. The manual review correction result includes the operation type and corresponding parameters for each problematic primer field. The operation type is either "Confirm," "Modify," or "Delete," and the "Modify" operation includes a manually entered corrected field value.
[0222] S807. Based on the manual review and correction results, the original primer record information is corrected. The field values of the confirmation markers are retained, the field values of the correction markers are replaced with the manually provided correction field values, and the field values of the deletion markers are removed from the original primer record information to obtain the original primer record information after the inference logic verification.
[0223] The correction process is performed one by one according to the operation type of each record in the manual review correction results: when the operation type is "confirm," the field value of the corresponding field in the original primer record information remains unchanged; when the operation type is "modify," the field value of the corresponding field in the original primer record information is updated to the corrected field value attached in the manual review correction results; when the operation type is "delete," the field value of the corresponding field in the original primer record information is set to null, and the primer record is marked as incomplete. After processing, the original primer record information after inference logic verification is obtained.
[0224] S808. The primer field reasoning causal chain set and the reasoning doubt field verification data package are used as interpretability records of the model reasoning process and are associated with the original primer record information after the reasoning logic is verified.
[0225] The associated storage employs either a file system directory structure or a database multi-table association method. When using a file system approach, a storage directory named after a document identifier is created. This directory stores the original primer record information file after inference logic verification, the primer field inference causal chain set file, and the inference questionable field verification data package file. These three files are associated using a unified document identifier and timestamp. When using a database approach, an inference causal chain storage field and a verification record storage field are added to each record in the standardized primer data table. These fields store the serialized string of the primer field inference causal chain set for the corresponding primer record and the serialized string of the inference questionable field verification data package, respectively.
[0226] S809. Perform path pattern statistics on the primer concept path of each primer record in the original primer record information after the reasoning logic is verified, count the primer concept path patterns with a frequency exceeding the preset frequency threshold in all primer records, and solidify the high-frequency primer concept path patterns into primer information extraction reasoning templates.
[0227] The preset frequency threshold is set to 5% of the total number of primer records. Path pattern statistics use a prefix tree structure. All primer concept paths are inserted into the prefix tree sequentially according to the concept node sequence. Each complete path from the root node to a leaf node in the prefix tree represents a primer concept path pattern, and the terminal node of the path records the frequency of that pattern. After the statistics are completed, all leaf nodes of the prefix tree are traversed, and primer concept path patterns whose frequency exceeds the preset frequency threshold are extracted. The extracted primer field types are labeled according to their semantic meaning and solidified as primer information extraction and reasoning templates.
[0228] S810. When performing intelligent reasoning analysis on new document files in the future, the primer information extraction reasoning template is injected into the input of the large language model in the form of prompt word prefixes, guiding the large language model to extract primer information according to the high-frequency reasoning path and generate original primer record information that conforms to the reasoning template constraints.
[0229] The injection method involves appending an inference template prompt prefix before the prompt text in the output format constraint request. The format of the inference template prompt prefix is: "Please extract primer information according to the following inference path: First, locate the primer sequence description from the text; then, find the target gene name from the context of the primer sequence description; next, extract the genomic location coordinates from the same context; and then extract the detection sensitivity data and detection specificity data from the experimental methods section." After receiving the input containing the inference template prompt prefix, the large language model prioritizes the text region corresponding to the concept node in the inference template in its attention mechanism. It aggregates semantic information layer by layer according to the path indicated by the inference template and generates corresponding field values to obtain the original primer record information that conforms to the inference template constraints.
[0230] S901. Obtain fragment-level original primer record information generated by the large language model for multiple text fragments of the same document in the text content set, and construct a fragment-level primer record set.
[0231] Multiple text segments from the same document were truncated during the length control processing stage because the total number of characters in the original text exceeded a preset context capacity threshold. The large language model performs independent intelligent reasoning and analysis on each text segment, outputting a set of segment-level original primer records for each segment. The segment-level original primer record information corresponding to all text segments from the same document is aggregated to construct a segment-level primer record set. Each record in the set includes the segment index number of its source text segment and the start and end character offsets of the segment in the original text.
[0232] S902. Perform cross-fragment primer entity alignment processing on primer records generated from different text fragments in the fragment-level primer record set, extract primer sequence field values from each fragment-level primer record, calculate sequence similarity between primer sequence field values of different fragment-level primer records, and classify primer records with sequence similarity exceeding the preset homology determination threshold into the same primer entity cluster.
[0233] Sequence similarity calculation employs a global sequence alignment algorithm. Two primer sequence strings are aligned from the 5' end to the 3' end, and each position is compared to determine if the base characters are identical. The number of identical base positions is divided by the total alignment length to obtain the sequence similarity value. The preset homology threshold is 0.85. The process for cross-fragment primer entity alignment is as follows: an empty primer entity cluster set is initialized. Each primer record in the fragment-level primer record set is traversed, and its primer sequence field value is compared with the primer sequence field values of existing records in each primer entity cluster. If the sequence similarity with all records in a primer entity cluster exceeds 0.85, it is included in that primer entity cluster. If the sequence similarity with all primer entity clusters does not meet the condition, a new primer entity cluster is created, and the record is used as the first record of that cluster.
[0234] S903. Perform field value conflict detection processing on primer records generated from different text fragments within the same primer entity cluster. Compare whether the field values under the same field name in each primer record within the same primer entity cluster are consistent. Record the field names with inconsistent field values and the corresponding multiple inconsistent field values as field value conflict items.
[0235] For each primer entity cluster, extract a list of common field names shared by all primer records within the cluster, including primer name, primer sequence, target gene, genomic location, amplicon length, detection sensitivity, and detection specificity. For each common field name, compare the character-level identical values of the field values in each primer record within the cluster. If at least two records have different field values, combine the field name and the different field values of each record within the cluster into a single field value conflict entry.
[0236] S904. For each conflicting field value, perform conflict resolution confidence assessment processing, extract the cumulative attention weight of the corresponding text region in the internal attention weight matrix of the large language model for each text segment that generates the conflicting field value, take the field value corresponding to the text segment with the largest cumulative attention weight as the high confidence candidate value, and calculate the difference between the cumulative attention weight of the high confidence candidate value and the cumulative attention weight of other text segments as the confidence advantage difference.
[0237] The method for extracting the cumulative attention weights is as follows: Obtain the internal attention weight matrix generated by the large language model when processing each text segment. Extract the cumulative attention weights in the primer sequence description text region, target gene description text region, or experimental performance description text region when the primer field value for that text segment was generated from this matrix. For each different field value involved in a field value conflict, trace its source text segment and extract the cumulative attention weights in the corresponding semantic region of that text segment. Use the field value corresponding to the source text segment with the largest cumulative attention weight as the high-confidence candidate value. Subtract the second-largest cumulative attention weight from the cumulative attention weight of the high-confidence candidate value; the difference is the confidence advantage difference.
[0238] S905. Compare the confidence advantage difference of each field value conflict with the preset resolution confidence threshold. When the confidence advantage difference exceeds the preset resolution confidence threshold, automatically use the high confidence candidate value as the resolved field value. When the confidence advantage difference does not exceed the preset resolution confidence threshold, mark the field value conflict as a conflict that needs to be manually resolved and push it to the manual resolution interface.
[0239] The preset confidence threshold for conflict resolution is set based on the numerical range of the accumulated attention weights, and is set to 20% of the accumulated attention weights of high-confidence candidate values. When the difference in confidence advantage exceeds this threshold, it indicates that the high-confidence candidate value has a significant confidence advantage and can be automatically resolved; when the difference in confidence advantage does not exceed this threshold, it indicates that the confidence levels of multiple candidate values are close, and the model cannot automatically determine this, requiring manual intervention. The manual resolution interface is an interactive interface that displays the field name of the conflict item requiring manual resolution, the value of each candidate field, the content of the source text fragment corresponding to each candidate field value, and the accumulated attention weights, and provides a candidate field value selection list and a custom input box.
[0240] S906. Receive the manual resolution decision returned by the manual resolution interface, and use the field values in the manual resolution decision as the field values after resolution.
[0241] The manual resolution decision includes a unique identifier for the conflicting field value and a selected field value or a custom field value. When a candidate field value is selected manually, that candidate field value is used as the resolved field value; when a custom field value is entered manually, that custom field value is used as the resolved field value.
[0242] S907. The field values after resolving all conflicting field values within the same primer entity cluster are merged with the field values in the primer entity cluster that do not conflict, generating a cross-fragment resolving and fusion primer record. The cross-fragment resolving and fusion primer records corresponding to all primer entity clusters are then combined into a cross-fragment resolving and fusion primer record set.
[0243] The merging operation is performed on a per-primer entity cluster basis, creating a new primer record. For fields without conflicts, the common field values of all records within the cluster are directly filled into the corresponding fields of the new record. For fields with resolved conflicts, the resolved field values are filled into the corresponding fields of the new record. After processing all primer entity clusters, all new primer records are aggregated into a cross-fragment resolution and fusion primer record set.
[0244] S908. Aggregate primer records belonging to the same document in the cross-fragment disintegration and fusion primer record set to generate document-level cross-fragment consistent primer record information, and replace the original primer record information of the corresponding document in the original primer record information with the document-level cross-fragment consistent primer record information.
[0245] During aggregation, the document identifier is used as the grouping key. Primer records with the same document identifier in the cross-fragment disintegration and fusion primer record set are grouped into the same group. The primer records within the group are then sorted after deduplication based on the primer sequence field value, generating document-level cross-fragment consistent primer record information. During replacement, the record group corresponding to the document identifier is retrieved from the original primer record information, and the original record group is replaced entirely with document-level cross-fragment consistent primer record information.
[0246] S909. Perform multi-fragment validation labeling on each primer record in the cross-fragment disintegration and fusion primer record set, count how many different text fragments independently extract each primer record in the fragment-level primer record set, and use the number of text fragments independently extracted from the primer record as the multi-fragment validation support of the primer record.
[0247] The statistical method involves tracing back the source text fragment index number of each record in the primer entity cluster, counting the deduplicated fragment index numbers, and the count result is the multi-fragment validation support. The higher the multi-fragment validation support value, the more reliable the record is, indicating that the primer record is mentioned in multiple places in the literature and that the large language model independently extracts consistent information in multiple places.
[0248] S910. Add multi-fragment validation support as confidence auxiliary annotation information to each primer record in the cross-fragment consistency primer record information at the document level, and add a multi-fragment validation support field to the data entries of the corresponding primer records in the standardized primer dataset.
[0249] The additional method involves adding a multi-fragment validation support attribute to each primer record in the cross-fragment consistency primer record information at the document level. The attribute value is the number of text fragments obtained statistically. When the standardized primer dataset is updated, a multi-fragment validation support column is added to the database table structure, and the multi-fragment validation support of each primer record is written to the corresponding data entry.
[0250] Figure 2 This is a schematic diagram of an electronic device provided in an embodiment of this application. The electronic device is used to perform the method described in the foregoing embodiments. Figure 2 As shown, the electronic device 200 may include at least one processor 201, a memory 202, and a communication interface 203.
[0251] The memory 202 is used to store programs. Specifically, the program may include program code, which includes computer operation instructions.
[0252] The memory 202 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage.
[0253] The processor 201 is used to execute computer execution instructions stored in the memory 202 to implement the method described in the foregoing method embodiments. The processor 201 may be a CPU, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0254] The processor 201 can communicate and interact with external devices through the communication interface 203. In specific implementations, if the communication interface 203, memory 202, and processor 201 are implemented independently, they can be interconnected via a bus to complete communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.
[0255] Optionally, in a specific implementation, if the communication interface 503, memory 502, and processor 501 are integrated on a single chip, then the communication interface 503, memory 502, and processor 501 can communicate through an internal interface.
[0256] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0257] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
Claims
1. A literature primer processing method based on artificial intelligence, characterized in that, include: Obtain the set of literature files to be processed; Based on the length and sequence presence characteristics of each document in the document set, the document set is subjected to validity screening and length control processing to obtain a simplified text content set. The sequence presence characteristics are used to identify whether the document contains the target DNA sequence. The text content set is input into a large language model for intelligent reasoning and analysis to obtain the original primer record information corresponding to each of the document files. The original primer record information is subjected to bioinformatics data standardization and cleaning to obtain a standardized primer dataset. The standardized primer dataset includes primer sequences with unified orientation, normalized serotype annotations, and detection probe modification information.
2. The literature primer processing method based on artificial intelligence according to claim 1, characterized in that, The process involves filtering the document collection based on its length and sequence characteristics, and then controlling the length of each document to obtain a streamlined text content set, including: The document is parsed to obtain its original text content. The original text content is matched based on preset DNA sequence matching rules to obtain the sequence existence characteristics of the document; Based on the sequence presence characteristics, invalid documents are removed from the document set to obtain a document set after validity screening. The sequence presence characteristics of the invalid documents indicate that the original text content of the invalid documents does not contain a DNA sequence corresponding to the preset DNA sequence matching rule. The character capacity of the original text content of the valid documents included in the set of valid documents after the validity screening is estimated to obtain the length characteristics of the valid documents. When the length feature meets the preset context capacity threshold, the effective document file is segmented and truncated and content filtered based on the preset context capacity threshold to obtain a single text fragment that fits the model input specification. When the length feature does not meet the preset context capacity threshold, the complete original text content is retained as a usable text fragment. Based on the single text fragment and the available text fragments, a simplified set of text content is generated.
3. The literature primer processing method based on artificial intelligence according to claim 1, characterized in that, The step of inputting the text content set into a large language model for intelligent reasoning and analysis to obtain the original primer record information corresponding to each of the document files includes: Send an output format constraint request to the dialogue interface of the large language model. The output format constraint request is used to limit the returned data structure to include at least one of the following: primer name field, primer sequence field, target gene field, genomic location field, amplicon length field, detection sensitivity field, and detection specificity field. The text content set is attached to the dialogue interface of the large language model as input data for the output format constraint request. The text content set includes primer sequence descriptions, target gene descriptions, genomic location descriptions, and experimental detection performance descriptions that are scattered in different page text segments. The large language model's dialogue interface is instructed to perform cross-paragraph semantic linking operations on the text content set, linking the primer sequence description with the target gene description to generate the value of the target gene field, extracting position coordinate information from the text content set that is in the same literature context as the primer sequence description to generate the value of the genome position field, and locating the experimental performance parameter description corresponding to the primer sequence description from the text content set to generate the values of the detection sensitivity field and the detection specificity field; The system receives response data from the dialogue interface of the large language model that satisfies the output format constraint request. The response data includes the corresponding values of the primer name field, the primer sequence field, the target gene field, the genomic location field, the amplicon length field, the detection sensitivity field, and the detection specificity field. The original primer record information is generated based on the values of the primer sequence field, the target gene field, the genomic location field, the detection sensitivity field, and the detection specificity field in the response data.
4. The literature primer processing method based on artificial intelligence according to claim 1, characterized in that, The process of performing bioinformatics data standardization and cleaning on the original primer record information to obtain a standardized primer dataset includes: Non-base characters in the primer sequence text of the original primer record information are removed, and the molecular orientation identifiers of the retained base character sequences are uniformly adjusted to obtain primer sequences with unified orientation. Based on the virus type associated with the original primer record information, the corresponding serotype conversion rule is invoked to convert the original expression form in the serotype description text in the original primer record information into a unified serotype coding identifier, thereby obtaining a normalized serotype label. Non-base functional group identifiers are detected and isolated from the probe sequence text marked as probes in the original primer record information, and detection probe modification information is generated based on the detected functional group identifiers; The standardized primer dataset is generated by binding and storing the unified primer sequence, the normalized serotype label, the detection probe modification information, and the target gene information in the original primer record information.
5. The literature primer processing method based on artificial intelligence according to claim 1, characterized in that, If the document includes table content, the method further includes: The document file is subjected to page-level table extraction to obtain a set of table structures. The table entries in the set of table structures include the page number information of the table, the column header information of the table, and the table row data. The table entries in the table structure set are associated with the text content set in a contextual manner. Based on the page number information of the table in the table entry, the page text segment under the same page number is extracted from the text content set. The page text segment under the same page number is then concatenated with the table column header information and table row data of the table entry to generate table context description text. Based on the preset primer information extraction template, the page text segments in the text content set are spliced together in page order, and the table context description text of all table entries below the page is inserted after the page text segments to generate a paragraph organization structure. The table column header information and table row data in the table structure set are structurally transformed according to the table dimensions to generate metadata descriptions; The paragraph organization structure and the metadata description are combined and packaged to obtain primer information extraction request data; The primer information extraction request data replaces the text content set as input data for intelligent reasoning and analysis processing of the large language model.
6. The literature primer processing method based on artificial intelligence according to claim 1, characterized in that, The method further includes: Load an existing results storage file, which contains the file names of the processed literature files and the corresponding standardized primer datasets; Construct a set of processed document names based on the existing result storage file; Before performing the validity screening and length control processing on the document, check whether the file name of the current document exists in the set of processed document names; If it exists, skip the subsequent processing steps of the current document and continue processing the next document; After the bioinformatics data standardization and cleaning process is completed on the literature file and a standardized primer dataset is generated, the file name of the current literature file and the corresponding standardized primer dataset are assembled into a single result record, and the single result record is written to the result storage file in append mode.
7. The literature primer processing method based on artificial intelligence according to claim 1, characterized in that, After obtaining the set of literature files to be processed, the method further includes: The format of the document is processed by the format type identification process to obtain the format type identifier of the document. The format type identifier is used to distinguish between plain text document, mixed text and image document, dense table document, and appendix supplementary information document. When the layout type identifier indicates that the current document is a mixed text and image document, the current document is subjected to figure area detection processing to identify the figure area in the document and extract the figure caption text associated with the figure area. The caption text is processed by primer-related entity recognition to extract primer sequence information and experimental parameter information recorded in the caption text, thereby obtaining a set of hidden primer information. The set of hidden primer information is fused and aligned with the primer information extracted from the main text and table data to generate a supplementary set of text content. The original text content set is replaced with the supplemented text content set and used as the source text for subsequent validity screening, length control processing, and input into a large language model for intelligent reasoning analysis.
8. The literature primer processing method based on artificial intelligence according to claim 1, characterized in that, After inputting the text content set into a large language model for intelligent reasoning analysis to obtain the original primer record information corresponding to the document, the method further includes: The original primer record information is obtained, and a self-checking prompt word is constructed. The self-checking prompt word contains an instruction that requires the large language model to perform a field-by-field validity check on the original primer record information. The original primer record information and the self-check prompts are input into the large language model in reverse order, instructing the large language model to perform multiple rounds of self-introspection and verification operations. The multiple rounds of self-introspection and verification operations include verifying whether the characters in the primer sequence field value conform to the base character set, verifying whether the association logic between the target gene field value and the serological labeling field value is reasonable, and verifying whether the format of the detection sensitivity field value conforms to the preset format rules. The system receives the introspection review results returned by the large language model. The introspection review results include a list of field names marked as missing, a list of field names marked as logically conflicting and their candidate correction values, and a list of field names marked as formatting violations. For the missing field in the list of missing field names, the original text position corresponding to the missing field is located back from the text content set, the original text content is extracted and re-input into the large language model for filling, and the filled field value is obtained. For logically conflicting fields in the list of logically conflicting field names, replace the original values of the corresponding fields in the original primer record information with candidate correction values from the list of candidate correction values. For the fields in the list of fields with format violations, automatic format conversion is performed according to preset standard format rules to obtain compliant field values; The supplemented field values, the replaced candidate correction values, and the compliant field values are merged and updated into the original primer record information to generate original primer record information that has undergone introspection and error correction.
9. The literature primer processing method based on artificial intelligence according to claim 1, characterized in that, After generating the standardized primer dataset, the method further includes: Obtain standardized primer datasets corresponding to multiple literature files; The primer sequences in the standardized primer dataset are subjected to sequence similarity matching and semantic association matching. Primer sequences with sequence similarity exceeding a preset similarity threshold and the same target gene field value are identified as cross-document homologous primers, and a homologous primer association index is obtained. The homologous primer association index contains the document identifier of the document corresponding to the homologous primer. Based on the homologous primer association index, the amplicon length field value, detection sensitivity field value, and detection specificity field value of the homologous primers in different literature files are extracted from the standardized primer dataset to form a parameter conflict set. Obtain the publication level weight and experimental completeness weight of the corresponding literature document. The publication level weight is preset according to the impact factor range of the journal in which the literature document is located, and the experimental completeness weight is pre-calculated according to the completeness of the primer-related experimental description in the literature document. For homologous primers with inconsistent parameters in the parameter conflict set, a weighted arbitration calculation is performed according to the publication level weight and the experimental completeness weight to obtain normalized standard parameter values. The normalized standard parameter values are used to replace the original parameter values corresponding to homologous primers in the normalized primer dataset, and the original parameter values of the literature documents are stored as source information in association with the normalized standard parameter values to generate a normalized primer dataset that has undergone cross-document conflict resolution.
10. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-9.
