An intelligent procurement Q&A management method and system based on large language models

Through the large language model combined with the Pydantic model and a finite state machine, the problem of inaccurate procurement intention identification in the existing technology is solved, efficient procurement intention identification and dynamic feedback under the conditions of no clear keywords is achieved, and the accuracy and efficiency of procurement questions and answers are improved.

CN119807384BActive Publication Date: 2025-07-18MINORAND (ZHEJIANG) NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510286293.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-07-18
Estimated Expiration
2045-03-12

AI Technical Summary

Technical Problem

The existing knowledge graph-based Q&A procurement robot cannot accurately identify customers' procurement intentions when there are no clear keywords, resulting in mechanization of dialogue content, lack of long thinking chain thinking, and cannot achieve efficient dynamic adjustment of feedback, affecting the accuracy and fluency of procurement Q&A.

Method used

A large language model is used to combine the Pydantic model and a finite state machine to identify procurement intentions through cross-field verification and logical verification, and a procurement business rule verification model is built to achieve in-depth verification and dynamic adjustment of different procurement business states.

Benefits of technology

Accurately identify procurement intentions with a small amount or no core keyword input, improve the accuracy of automated analysis and processing of the procurement process, enhance the depth and accuracy of Q&A feedback, and improve the efficiency and fluency of procurement Q&A.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807384B_ABST
    Figure CN119807384B_ABST
Patent Text Reader

Abstract

The present invention discloses an intelligent procurement question-answering management method and system based on a large language model, including: constructing an API interface connecting to the large language model and a procurement business database, and configuring a cross-field verification model in the API interface; presetting a field table based on procurement business categories, configuring procurement business verification rules in the API interface, and setting a finite state machine including based on different procurement categories according to the procurement business verification rules; obtaining the input content from the user side, inputting the input content into the large language model, using the large language model to output the user intention text, and verifying the user's procurement intention through the API interface according to the intention text; using the finite state machine to query the status field in the user procurement intention text, judging the status and expected actions of the corresponding business category, and outputting the procurement question-answering text after verifying the user's intention in combination with the cross-field verification model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and particularly relates to an intelligent procurement Q&A management method and system based on a large language model. Background Art

[0002] Currently, the existing technical solutions of Q&A procurement robots still perform keyword matching and comparison based on the knowledge graph. After collecting the core keywords in the Q&A dialogue with the customer, the core keywords are further matched with the corresponding procurement-related knowledge graph, and the matching knowledge graph entity information is obtained and the corresponding customer procurement commodity information is output. However, when there are no relatively clear keywords in the above Q&A dialogue based on the knowledge graph, it is impossible to accurately identify the procurement intention of the corresponding customer, resulting in mechanical dialogue content and lack of thinking with a long thinking chain. Moreover, the existing Q&A system based on the knowledge graph cannot achieve efficient dynamic adjustment and feedback based on the business rules of the Q&A content, making the accuracy and fluency of the feedback in procurement Q&A in the prior art relatively poor. Summary of the Invention

[0003] One object of the present invention is to provide an intelligent procurement Q&A management method and system based on a large language model. The method and system perform data input based on a large language model including but not limited to the GPT model, are used to identify and output the intention information in the Q&A dialogue, and based on the intention information, search for a pre-constructed procurement business rule verification model, and use the business rule verification model to determine whether the current user intention meets the procurement business rules of the Q&A dialogue. If the current Q&A dialogue meets the procurement business rules, the Q&A procurement plan corresponding to the procurement business rules is output. Therefore, based on the powerful language intention reasoning ability of the large language model, the present invention can accurately identify the procurement intention of the input user under the Q&A conditions of few or no core keyword inputs, and improve the accuracy and efficiency of automated procurement analysis and processing during the procurement process.

[0004] Another object of the present invention is to provide an intelligent procurement Q&A management method and system based on a large language model. The method and system use the Pydantic model to construct the API of the large language model, use the Pydantic model to verify at least one procurement business rule for the intention text including the output of the large language model, and the present invention uses the model-level validator of the Pydantic model to perform cross-field logical verification on the intention output by the large language model, so as to achieve linkage verification between different procurement business rules, and output the actual adopted business keywords corresponding to the procurement business of the linkage verification as the input data of the large language model for the next round of Q&A dialogue, thereby significantly improving the accuracy of the judgment of the procurement intention and the depth of Q&A feedback in procurement Q&A of the present invention.

[0005] Another object of the present invention is to provide an intelligent procurement Q&A management method and system based on a large language model. While the method and system perform multi-field verification of procurement intentions based on the model-level validator of the Pydantic model, a finite state machine (FSM) is also set up. According to the finite state machine (FSM), the definitions of corresponding procurement business states and the conversion rules of different procurement business states are configured, and the fields of the corresponding procurement business states are used as the corresponding fields of the model-level validator of the Pydantic model for cross-field verification. Thus, the large language model API constructed based on the Pydantic model and the finite state machine (FSM) in the present invention can effectively perform in-depth procurement business verification output on procurement businesses in different procurement business states, and improve the accuracy and efficiency of procurement business based on business rules by combining the intention recognition ability of the large language model.

[0006] To achieve at least one of the above object of the invention, the present invention further provides an intelligent procurement Q&A management method based on a large language model, the method comprising:

[0007] Construct an API interface connecting to the large language model and a procurement business database, and configure a data verification model for the large API interface, wherein the data verification model includes a cross-field verification model;

[0008] Preset a field table based on the procurement business categories, configure procurement business verification rules in the API interface, and set up a finite state machine including different procurement categories based on the procurement business verification rules;

[0009] Obtain the input content from the user side, input the input content into the large language model, use the large language model to output the user intention text, and verify the user's procurement intention through the API interface according to the intention text;

[0010] Use the finite state machine to query the status fields in the current user procurement intention text, judge the status and expected actions of the corresponding business categories, and output the procurement Q&A text after verifying the user's intention in combination with the cross-field verification model.

[0011] According to one preferred embodiment of the present invention, the data verification model is a Pydantic model. The method for performing multi-field verification using the Pydantic model includes: defining the Pydantic model as the base model BaseModel. After obtaining the output user intent text by inputting the user's input content to the large language model, using the Pydantic model to perform data conversion on the user intent text to obtain Python object data that meets the requirements of the base model BaseModel, and then performing field extraction and field type checking on the Python object data so that the Python object data conforms to the field declaration type of the Pydantic model.

[0012] According to another preferred embodiment of the present invention, after obtaining the field table of the procurement business category, extracting the corresponding field objects of the procurement business category according to different procurement business rules, and configuring the model-level validator annotation @model_validator according to the Pydantic model, encapsulating the corresponding field objects and the model-level validator annotation @model_validator into a class method ClassMethod of the API interface according to the procurement business rules. The verification method for the corresponding multiple procurement business category field objects is defined in the class method ClassMethod, and the verification of the corresponding field objects for different procurement businesses is performed based on the method in the class method ClassMethod.

[0013] According to another preferred embodiment of the present invention, the method for performing multi-field verification using the Pydantic model includes: pre-configuring the service SDK. At the start of the procurement conversation, calling the historical procurement field objects in the procurement business database through the service SDK and the corresponding field objects of the corresponding procurement business category, and performing numerical range verification for different procurement business categories using the model-level validator annotation @model_validator configured by the Pydantic model based on the historical procurement field objects. The numerical verification method includes: after obtaining the historical procurement field objects according to the procurement business rules, using the defined numerical length len() function or range() function of the numerical type field as the numerical range verification for different procurement business categories. If the numerical range of at least one procurement business category of the historical procurement field objects does not meet the numerical verification result, output the standard procurement requirement text based on the corresponding procurement business rules through the preset mapping rules of the ORM.

[0014] According to another preferred embodiment of the present invention, the method includes: in each round of procurement Q&A dialogue, using the preprocessing mode of the Pydantic model to perform data cleaning and data conversion on the historical procurement field object obtained by the service SDK, the user input text, and the user intention text fed back based on the large language model. The data cleaning includes removing stop words, removing spaces, filling default values, and format conversion, and using the field-level validator annotation @field_validator of the Pydantic model to perform data cleaning on complex fields to obtain clean field objects, and performing cross-field verification using the post-processing mode mode='after of the model-level validator annotation @model_validator in the Pydantic model based on the field objects after data cleaning.

[0015] According to another preferred embodiment of the present invention, the implementation method of the finite state machine includes: setting the state State, trigger event Event, transition rule Transition, and action Action corresponding to each procurement business category according to the finite state machine; and performing data conversion on the state State, trigger event Event, transition rule Transition, and action Action through the Pydantic model to obtain field objects of corresponding types; at the beginning of each procurement dialogue, obtaining the state State corresponding to each procurement business category, performing data conversion on the state State of the procurement business category to obtain a state field object, incorporating the state field object into the procurement business rules, and performing cross-field verification including state verification in combination with the state field object and the model-level validator annotation @model_validator of the Pydantic model.

[0016] According to another preferred embodiment of the present invention, the method includes: in the multi-round dialogue of procurement, creating a model by using the create_model instruction in, and inheriting the base class model BaseModel of the previous round of dialogue in a static sharing manner, and configuring the validator type and validation method for the created model by using the config instruction and the validators dictionary to dynamically configure the Pydantic model parameter values.

[0017] According to another preferred embodiment of the present invention, the method implemented by the finite state machine includes: after obtaining the trigger event Event corresponding to the procurement business category through the service SDK, judging the conversion rule Transition and action Action required by the current trigger event Event according to the finite state machine, generating the new state State of the procurement business category through the conversion rule Transition and action Action, generating a new state field according to the new state State of the procurement business category, and using the new state field as the verification field for the corresponding procurement business verification rule.

[0018] In order to achieve at least one of the above invention purposes, the present invention further provides an intelligent procurement Q&A management system based on a large language model, and the system executes the above-mentioned intelligent procurement Q&A management method based on a large language model.

[0019] The present invention provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to execute the above-mentioned intelligent procurement Q&A management method based on a large language model. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It shows a flowchart of an intelligent procurement Q&A management method based on a large language model of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0021] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art can think of other obvious variations. The basic principles defined in the following description can be applied to other implementation schemes, variation schemes, improvement schemes, equivalent schemes, and other technical schemes that do not deviate from the spirit and scope of the present invention.

[0022] It can be understood that the term "one" should be understood as "at least one" or "one or more". That is, in one embodiment, the number of one element can be one, and in other embodiments, the number of the element can be multiple. The term "one" cannot be understood as a limitation on the quantity.

[0023] Please combine Figure 1, the present invention discloses an intelligent procurement Q&A management method and system based on a large language model. The method includes the following steps: First, an API interface needs to be deployed in the procurement Q&A project, and the large language model access address is connected through the API interface. The large language model access address can be, but is not limited to, the deployment addresses of GPT, LLaMA, and Tongyi Qianwen. The API interface protocol can be, but is not limited to, the Http protocol, etc. The relevant large language model path parameters can be configured by setting the URL of the Http protocol. A Pydantic model is configured in the deployed API interface. The Pydantic model is used to verify the output text from the in-depth reasoning of the large language model. The present invention can use the cross-field verification of the Pydantic model combined with relevant verification methods to verify the procurement rules for different procurement business categories. The present invention also configures a finite state machine in the API interface, and uses the finite state machine to judge the current or predicted next state State, trigger event Event, transition rule Transition, and action Action of the corresponding procurement business category. And based on the current or next state State of the corresponding procurement business category, the state field is constructed. In the present invention, the cross-field verification of the Pydantic model is performed on the state field and ordinary fields such as the name and value of the corresponding procurement business category, so as to realize dynamic and high-precision procurement Q&A output for the procurement business. That is to say, in the present invention, the in-depth reasoning ability of the large language model for the input content is utilized, and combined with the verification rules related to the procurement business content, directional and high-precision Q&A output is performed, so that the traditional AI Q&A content has a deeper thinking chain on the basis of meeting professional Q&A, and the depth and accuracy of the thinking chain of the Q&A output are improved.

[0024] Specifically, after the API interface in the present invention is deployed, it depends on injecting relevant generated files and configuration parameters of the Pydantic model to provide an environment for generating the Pydantic model. The generated files of the Pydantic model include JSON Schema files, OpenAPI Schema files, data dictionaries, etc. The JSON Schema file is used to annotate and validate JSON metadata files; the OpenAPI Schema file is used to deploy API files, and the data dictionary serializes data in the corresponding Pydantic model into a recognizable and storable format (such as the JOSN format). The parameters configured in the Pydantic model can include but are not limited to ref_template (reference template), schema_type (schema type), etc. The relevant generated files and configuration parameters of the above Pydantic model can be implemented by calling function methods such as model_json_schema() or Config(). The above relevant generated files and configuration parameters of the Pydantic model are only examples, and the present invention will not elaborate on this in detail.

[0025] Further, after the Pydantic model configuration of the present invention is completed, data processing needs to be performed on the data of the API interface. The data processing method can be implemented through relevant methods of the Pydantic model. The specific steps include: data cleaning and data conversion of the user input text and the user intention text fed back based on the large language model. Data cleaning includes removing stop words, removing spaces, filling default values, and format conversion. The field types are declared using the Pydantic model, and the field types include: dict (dictionary), Callable (callable object), str (string), bool (boolean operation), etc.; when the input user intention text, user input text, and the field types declared by the Pydantic model are different, format conversion is automatically performed to obtain the field types that meet the declared ones. Or in the present invention, data cleaning of complex fields can also be performed through the field-level validator annotation @field_validator configured in the Pydantic model. For example, the field-level validator annotation @field_validator can be used to remove trailing and leading spaces and capitalize the first letter: the trim_whitespace method is added to the field-level validator annotation @field_validator(A1), and the function of the trim_whitespace method can remove the leading and trailing spaces of field A1 and capitalize the first letter. The above trim_whitespace method is for illustrative purposes, and those skilled in the art can set the corresponding cleaning method for the field-level validator annotation @field_validator according to the actual situation. It should be noted that the base model BaseModel of the Pydantic model in the present invention can be used to perform the above data cleaning to obtain a clean field object.

[0026] In one preferred embodiment of the present invention, it is necessary to pre-configure a service SDK (Software Development Kit) in the front-end software of the procurement project. The service SDK has tools to simplify the integration and development process of specific services or functions. The service SDK can deploy and provide API interfaces for the procurement business database and the back-end server in the front end, and can also encapsulate relevant functional modules and the event listening function for the back-end server or database. Using the service SDK, the verification method of the procurement business rules can also be encapsulated into the corresponding API, so as to realize the interactive verification between the user intention questions output by the large language model and the database.

[0027] Furthermore, the core technical means of the present invention is to provide a cross-field verification method to solve the verification of different procurement business categories in the procurement project. The verification content types include field content verification (used to determine whether there is a procurement business category), numerical range verification (used to determine whether the corresponding procurement business category value meets the requirements), numerical calculation verification (used to determine whether the numerical calculation result of the corresponding procurement business category meets the requirements), and procurement business category status verification (used to judge whether the current corresponding procurement business category status meets the requirements). Multiple of the above different verification content types can be selected for combined verification. The selection of combined verification will be set according to the procurement business rules respectively, and the present invention will not elaborate on this in detail. In the present invention, the cross-field verification is carried out by using the model-level validator annotation @model_validator configured in the Pydantic model. After the model-level validator annotation @model_validator, multiple field contents are configured, and the verification methods for the corresponding field contents are configured. Multiple field contents and the verification methods for the corresponding field contents configured after the model-level validator annotation @model_validator can be encapsulated into a class method ClassMethod corresponding to the API interface of the large language model through the service SDK. The class method ClassMethod defines the corresponding multiple procurement business category field objects and the verification methods for the corresponding field objects, and the verification of the corresponding field objects for different procurement businesses is carried out based on the methods in the class method ClassMethod. When at least one field type verification does not meet the requirements, the basic business information corresponding to the fields that do not meet the requirements is output, and a templatized procurement business Q&A feedback is provided. It is worth mentioning that in another preferred embodiment of the present invention, for the output procurement business Q&A feedback, the present invention can also output the corresponding requirement text information through the preset mapping rules of ORM (Object-Relational Mapping). In the ORM, the object can be configured as a class or an Instance (instance) that encapsulates the procurement business category field objects and the verification methods for the corresponding field objects. The corresponding mapping relationship can include but is not limited to database tables, and the corresponding mapping can be the row data of the table, etc.

[0028] In one preferred embodiment of the present invention, the method for multi-field verification of the Pydantic model includes: According to the pre-configured service SDK, at the beginning of the procurement conversation, the historical procurement field object in the procurement business database is called through the service SDK and the corresponding field object of the corresponding procurement business category. The above historical procurement object can use the preprocessing mode of the Pydantic model (mode='before') to perform preprocessing of historical procurement data such as data format type conversion and data cleaning to obtain a clean historical procurement field object. And based on the historical procurement field object, the model-level validator annotation @model_validator configured by the Pydantic model is used to perform numerical range verification for different procurement business categories. The numerical verification method includes: After obtaining the historical procurement field object according to the procurement business rules, the numerical length len() function or range() function of the defined numerical field is set as the numerical range verification for different procurement business categories. If the numerical range of at least one procurement business category of the historical procurement field object does not meet the numerical verification result, the standard procurement requirement text based on the corresponding procurement business rules is output through the preset mapping rules of the ORM.

[0029] The present invention also provides a Finite State Machine (FSM). The finite state machine can judge the current or predict the next state of the corresponding procurement business category according to the procurement business category. The implementation method of the finite state machine includes: setting the state State, trigger event Event, transition rule Transition, and action Action corresponding to each procurement business category according to the finite state machine; and converting the state State, trigger event Event, transition rule Transition, and action Action into field objects of corresponding types through the Pydantic model; at the beginning of each procurement conversation, obtain the state State corresponding to each procurement business category, and perform data conversion on the state State of the procurement business category to obtain a state field object, and incorporate the state field object into the procurement business rules. For example, if the procurement business category status is (purchased), the next state corresponding to this procurement business category can be predicted as (awaiting shipment or shipped), and the corresponding action for the next state (such as goods collection, etc.) can be predicted. Cross-field verification including state verification is performed in combination with the state field object and the model-level validator annotation @model_validator of the Pydantic model. The state field obtained based on the finite state machine (FSM) can be dynamically verified and fed back according to the actual situation of different procurement business categories, so as to output procurement requirements that conform to the actual situation.

[0030] The method implemented by the finite state machine includes: after obtaining the trigger event Event corresponding to the procurement business category through the service SDK, judging the transition rule Transition and action Action required by the current trigger event Event according to the finite state machine, generating the new state State of the procurement business category through the transition rule Transition and action Action, generating a new state field according to the new state State of the procurement business category, and using the new state field as the verification field of the corresponding procurement business verification rule.

[0031] In one preferred embodiment of the present invention, the Pydantic model can also be dynamically modified in multiple rounds of procurement conversations. The specific method includes: in multiple rounds of procurement conversations, creating a model by using the create_model instruction in, and inheriting the base model BaseModel of the previous round of conversation in a static sharing manner, and using the config instruction and the validators dictionary to configure the validator type and verification method for the created model, for dynamically configuring the Pydantic model parameter values. By inheriting the model and through the config instruction, the Pydantic model does not need to be rebuilt on a large scale, and only by modifying a small range of parameters can the Pydantic model be dynamically modified to adapt to different conversation contents.

[0032] Embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. Embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), the above-mentioned functions defined in the methods of the present application are executed. It should be noted that the computer-readable medium mentioned above in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection having one or more wire segments, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or combined with an instruction execution system, apparatus, or device. And in the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program codes are carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or combined with an instruction execution system, apparatus, or device. The program codes contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless segments, wire segments, optical cables, RF, etc., or any suitable combination of the above.

[0033] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than that noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0034] Those skilled in the art should understand that the embodiments of the present invention described above and shown in the accompanying drawings are only examples and do not limit the present invention. The objectives of the present invention have been fully and effectively achieved. The functions and structural principles of the present invention have been demonstrated and explained in the embodiments. Without departing from the said principles, the embodiments of the present invention may have any variations or modifications.

Claims

1. An intelligent procurement Q&A management method based on large language models, characterized in that, The method includes: Construct an API interface connecting to a large language model and a procurement business database, and configure a data validation model for the API interface, where the data validation model includes a cross-field validation model; Preset a field table based on the procurement business category, configure procurement business validation rules in the API interface, and set a finite state machine including different procurement categories based on the procurement business validation rules; Obtain the input content from the user side, input the input content into the large language model, use the large language model to output the user intention text, and verify the user's procurement intention through the API interface according to the intention text; Use the finite state machine to query the status field in the current user procurement intention text, judge the status and expected actions of the corresponding business category, and output the procurement Q&A text after verifying the user's intention in combination with the cross-field validation model; The data validation model is a Pydantic model. The method for performing cross-field validation using the Pydantic model includes: defining the Pydantic model as the base model BaseModel, after obtaining the output user intention text by inputting the user's input content into the large language model, using the Pydantic model to perform data conversion on the user intention text to obtain Python object data that meets the requirements of the base model BaseModel, and performing field type checking after extracting the fields of the Python object data to make the Python object data conform to the Pydantic model field declaration type; After obtaining the field table of the procurement business category, extract the corresponding field objects of the procurement business category according to different procurement business rules, configure the model-level validator annotation @model_validator according to the Pydantic model, and encapsulate the corresponding field objects and the model-level validator annotation @model_validator into a class method ClassMethod of the API interface according to the procurement business rules. The class method ClassMethod defines the verification methods for the corresponding field objects of multiple procurement business categories, and performs verification on the corresponding field objects of different procurement businesses based on the methods in the class method ClassMethod; The method for cross-field validation of the Pydantic model includes: pre-configuring the service SDK. At the start of the procurement conversation, call the historical procurement field object in the procurement business database through the corresponding field object of the service SDK and the corresponding procurement business category, and perform numerical range validation for different procurement business categories based on the historical procurement field object using the model-level validator annotation @model_validator configured in the Pydantic model. The numerical range validation method includes: after obtaining the historical procurement field object according to the procurement business rules, use the numerical length len() function or range() function of the defined numerical field as the numerical range validation for different procurement business categories. If the numerical range of at least one procurement business category of the historical procurement field object does not meet the numerical verification result, output the standard procurement requirement text based on the corresponding procurement business rules through the preset mapping rules of the ORM.

2. The intelligent procurement Q&A management method based on a large language model according to claim 1, wherein The method includes: in each round of procurement Q&A conversation, use the preprocessing mode of the Pydantic model to perform data cleaning and data conversion on the historical procurement field object obtained by the service SDK, the user input text, and the user intention text feedback based on the large language model. Data cleaning includes removing stop words, removing spaces, filling default values, and format conversion, and use the field-level validator annotation @field_validator of the Pydantic model to perform data cleaning on complex fields to obtain clean field objects, and perform the cross-field validation using the post-processing mode mode='after of the model-level validator annotation @model_validator in the Pydantic model based on the field objects after data cleaning.

3. The intelligent procurement Q&A management method based on a large language model according to claim 1, characterized in that The implementation method of the finite state machine includes: setting the state State, trigger event Event, transition rule Transition, and action Action corresponding to each procurement business category according to the finite state machine; and converting the state State, trigger event Event, transition rule Transition, and action Action into field objects of corresponding types through the Pydantic model; at the start of each procurement conversation, obtain the state State corresponding to each procurement business category, and perform data conversion on the state State of the procurement business category to obtain a state field object, incorporate the state field object into the procurement business rules, and perform cross-field validation including state validation in combination with the state field object and the model-level validator annotation @model_validator of the Pydantic model.

4. The intelligent procurement Q&A management method based on a large language model according to claim 1, wherein The method includes: in multiple rounds of procurement conversations, creating a model by using the create_model instruction, inheriting the base model BaseModel of the previous round of conversation in a static sharing manner, and using the config instruction and the validators dictionary to configure the validator type and validation method for the created model, for dynamically configuring the parameter values of the Pydantic model.

5. The intelligent procurement Q&A management method based on a large language model according to claim 3, wherein The method implemented by the finite state machine includes: after obtaining the trigger event Event corresponding to the procurement business category through the service SDK, judging the conversion rule Transition and action Action required by the current trigger event Event according to the finite state machine, generating the new state State of the procurement business category through the conversion rule Transition and action Action, generating a new state field according to the new state State of the procurement business category, and using the new state field as the validation field for the corresponding procurement business validation rule.

6. An intelligent procurement Q&A management system based on a large language model, characterized in that, The system executes the intelligent procurement Q&A management method based on a large language model according to any one of claims 1-5.

7. A computer-readable storage medium storing a computer program, which is executed by a processor to implement the intelligent procurement Q&A management method based on a large language model according to any one of claims 1-5.

Citation Information

Patent Citations

  • Network policy intention translation system and method based on retrieval enhancement

    CN119513313A

  • NLP methods and systems for querying data sets

    US20240070152A1