Enterprise information extraction method based on LLM model
Through the enterprise information extraction method based on the LLM model, LoRA fine-tuning and generative adversarial network models are used to solve the problems of insufficient accuracy and low efficiency in enterprise information extraction in the existing technology, and achieve high-accuracy extraction of enterprise address information, which meets the needs of enterprises. Information management needs.
Patent Information
- Application Number
- CN202410859145.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-08-23
AI Technical Summary
Existing enterprise information extraction and labeling technologies have problems such as insufficient accuracy, high industry professional requirements, and low processing efficiency. Especially when processing enterprise address information, the extraction effect of park names and road names is poor.
The enterprise information extraction method based on the LLM model is used to obtain sample data for preprocessing and LoRA fine-tuning training, and the generative adversarial network model and feature extraction blocks are used to gradually improve the accuracy of the model until it reaches 97.8% accuracy.
It achieves the accurate extraction and standardized processing of enterprise information, especially in enterprise address information, improves the accuracy of extraction of information such as provinces, cities, districts/counties, streets, parks, road names, house numbers, etc., and meets the needs of enterprise informatization. management needs.
Smart Images

Figure CN118536499A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of reasoning methods or devices in computer systems using knowledge-based patterns, and in particular to an enterprise information extraction method based on an LLM model. Background Art
[0002] The rapid development of information technology is changing the traditional economic structure and order. Enterprises are no longer in the material economic environment of the past, but in an information economic environment that uses the Internet as a medium and customers as the center, closely linking the enterprise's organizational structure, technology research and development, production and manufacturing, marketing, and after-sales service. The transformation of information-driven management has an all-round impact on the growth of enterprises. Under this premise, the refinement of enterprise information management is very necessary.
[0003] Enterprise information extraction and labeling technology is currently widely used in enterprise information management. The most important thing in enterprise information extraction is the extraction of basic information of the enterprise, especially the name, address and other information of the enterprise. However, in the existing technology, this technology still has some shortcomings: (1) Inaccurate: Due to the complexity of text materials and the diversity of languages, enterprise information extraction and labeling technologies often have problems such as "polysemy" and "ambiguity" when processing text, resulting in inaccurate extraction and labeling results; (2) High requirements for industry expertise: Enterprise information extraction and labeling technology requires high industry expertise. If the processed text content involves professional vocabulary or language characteristics in the field, the effect of the technology will not be ideal; (3) The processing efficiency is low. The amount of enterprise information is huge. If the traditional manual extraction and labeling method is used, it will often consume a lot of manpower, material resources, and time, and it is difficult to ensure the efficiency and accuracy of the processing.
[0004] The existing natural language processing (NLP) technology has a low recognition rate for rare words because it uses rule-based and statistical methods and supports fewer types of named entities. For example, HANLP currently only supports the recognition of a few named entities such as names of people, places, and organizations. In the process of extracting enterprise-related information and labels from various types of information data, taking enterprise address information as an example (but not limited to enterprise address), the province, city, district / county, street, park, road name, house number and other information of the enterprise are extracted from the enterprise address information. Among them, the province, city, district / county, and street can also achieve good results using the original NLP technology, but the park name and road name have poor extraction effect because they have no obvious regularity. Summary of the invention
[0005] The invention solves the problems existing in the prior art and provides an enterprise information extraction method based on the LLM model.
[0006] The technical solution adopted by the present invention is a method for extracting enterprise information based on the LLM model, the method comprising the following steps: S1 obtains sample data of enterprise information and performs preprocessing; S2 converts and encodes the preprocessed sample data; S3 uses the data information obtained in S2 to perform LoRA fine-tuning training; S4 replaces the original parameter set of the LLM model with the new parameter set obtained through training, calculates the test data, and obtains the calculation results; S5 If the accuracy of the LLM model after the updated parameters reaches the preset standard, the process ends; otherwise, the test data is used as new sample data and S2 is repeated together with the sample data of S1.
[0007] Preferably, in S1, hierarchical information is extracted from the acquired sample data, errors are corrected on the extracted results, and administrative divisions are supplemented to the extracted hierarchical regional information to obtain a complete address chain of the enterprise information.
[0008] Preferably, the complete address chain includes province, city, district / county, street, park, road name, and house number; for enterprise information that does not exist in a street or park, a substitute symbol is inserted.
[0009] Preferably, in S3, the LLM model is copied and different local LoRA fine-tuning trainings are performed respectively.
[0010] Preferably, in S4, new parameter sets under different training conditions are obtained based on S3, the original parameter sets of the LLM model are replaced respectively, and the test data are calculated to obtain the calculation results, and the calculation results and their deviations are obtained.
[0011] Preferably, the deviation is located at a corresponding deviation position, the sample data is segmented based on the deviation position, and both ends are padded based on preset rules to obtain new sample segmentation data.
[0012] Preferably, a generative adversarial network model is constructed, including a generator and a discriminator; The sample segmentation data and its labels are input into the generator, and the generated samples are input into the discriminator to obtain the probability that the sample is true.
[0013] Preferably, the generative adversarial network model further includes a feature extraction block; The generated sample and the original sample data are input into the feature extraction block to obtain the sample feature difference points.
[0014] Preferably, the parameter update of S5 is guided based on the sample feature difference points.
[0015] Preferably, a grid space is constructed based on a complete address chain, with the province or city as the initial node, and the elements of the address chain after the province or city as associated nodes, which are connected in sequence; clustering of associated enterprises is achieved based on the initial node or different associated nodes.
[0016] The present invention relates to an enterprise information extraction method based on an LLM model, which comprises the following steps: obtaining sample data of enterprise information, performing preprocessing, converting and encoding the preprocessed sample data; performing LoRA fine-tuning training using the obtained data information; replacing the original parameter set of the LLM model with the new parameter set obtained through training, calculating the test data, and obtaining the calculation result; and terminating the training if the accuracy of the updated parameter and the subsequent LLM model reaches a preset standard; otherwise, the test data is used as newly added sample data and the training is repeated together with the initial sample data.
[0017] The beneficial effect of the present invention is that, with the improvement of the natural language understanding ability of the LLM model, the open source LLM model is fine-tuned and trained with LoRA using small sample industry business data in the industry, and then the trained model is used to calculate and process business data, including classification, labeling, named entity extraction, etc., especially accurate information extraction of enterprise information; Taking the standardization of corporate addresses as an example, the current accuracy rate can reach 97.8%. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a flow chart of the method of the present invention; Figure 2 Schematic diagram of the structure of the generative adversarial network model of the present invention. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] The present invention relates to an enterprise information extraction method based on an LLM model, the method comprising the following steps: S1 obtains sample data of enterprise information and performs preprocessing; S2 converts and encodes the preprocessed sample data; S3 uses the data information obtained in S2 to perform LoRA fine-tuning training; S4 replaces the original parameter set of the LLM model with the new parameter set obtained through training, calculates the test data, and obtains the calculation results; S5 If the accuracy of the LLM model after the updated parameters reaches the preset standard, the process ends; otherwise, the test data is used as new sample data and S2 is repeated together with the sample data of S1.
[0021] In the present invention, the enterprise address data is cleaned and labeled; the sorted sample data is used to train the ChatGLM-6b model, and the new model obtained after training is used to sequentially extract information such as province, city, district / county, street, park, road name, house number, etc. from the enterprise address.
[0022] In the present invention, it is necessary to prepare the model training sample data first. Taking the extraction of enterprise address information as an example, more than 10,000 real enterprise address data are sorted out, and the enterprise address data are extracted by using technologies including but not limited to regularization, HANLP, ChatGLM-6b, etc., such as province, city, district / county, street, park, road name, house number, etc., and on this basis, the extraction results are manually adjusted to ensure the correctness of the training sample data; the above sample data sets are added with the national administrative division data (province, city, district / county, street) to form the final training sample data set; After preparing the sample data, the ChatGLM-6b model is fine-tuned and trained using the LoRA method. After the training is completed, the parameter set obtained from the training is appended to the original parameter set of the ChatGLM-6b model, and the province, city, district / county, street, park, road name, house number and other information of a new batch of enterprise address data are extracted. The extraction results of the new model are checked, and the erroneous data are merged into the original sample data. ChatGLM-b is fine-tuned again and iterated continuously until the model extraction accuracy reaches the target requirement.
[0023] The method is described below with specific steps.
[0024] (1) Obtain sample data of enterprise information and perform preprocessing; The obtained sample data is subjected to hierarchical information extraction, the extracted results are corrected, and the extracted hierarchical regional information is supplemented with administrative divisions to obtain a complete address chain of the enterprise information.
[0025] The complete address chain includes province, city, district / county, street, park, road name, and house number; for enterprise information that does not exist in a street or park, a substitute symbol is inserted.
[0026] In the present invention, the obtained sample data is hierarchically extracted according to the administrative divisions from large to small. Some information that has not been regularized for the enterprise address may have typos, wrong districts, wrong streets, etc., which are corrected and finally the administrative divisions are completed to obtain the complete address chain of the enterprise. To be precise, it is an address data chain, which is used to correspond to different administrative divisions.
[0027] On the basis of (1), a grid space is constructed based on the complete address chain, with the province or city as the initial node, and the elements of the address chain after the province or city as the associated nodes, which are connected in sequence; clustering of associated enterprises is achieved based on the initial node or different associated nodes.
[0028] That is, grid management and visual management of enterprises can be achieved here, and the corresponding clusters of enterprises can be selected through different induction methods, which is convenient for the superior competent department to make overall planning for enterprises; in fact, after constructing the grid space, it is also convenient to realize the statistics of enterprise migration behavior and facilitate more intuitive statistics of industry behavior data.
[0029] (2) Convert and encode the preprocessed sample data; In the present invention, the training sample data is processed and organized according to the format required by the model, as follows: [{"instruction":"From the above text, extract entity information such as \"province\", \"city\", \"district\ / county\", \"street\", \"park name\", \"road name\", \"house number\", etc., and output the content in json format", "input":"801-10, Section B, 8th Floor, No. 556, Xixi Road, Xihu District, Hangzhou, Zhejiang Province", "output":"{\"Province\": \"Zhejiang Province\", \"City\": \"Hangzhou City\", \"District\ / County\": \"Xihu District\", \"Street\": \"\", \"Park Name\": \"\", \"Road Name\": \"Xixi Road\", \"House Number\":\"No. 556, 8th Floor, Section B, 801-10\"}"}...]
[0030] (3) Use the data information obtained in (2) to perform LoRA fine-tuning training; The LLM model is copied and different local LoRA fine-tuning trainings are performed separately.
[0031] In the present invention, the ChatGLM-6b model is taken as an example, and fine-tuning training is performed in LoRA mode; LoRA (Low-Rank Adaptation) is an effective method for fine-tuning LLM, which updates part of the model parameters by introducing a low-rank decomposition matrix instead of directly adjusting all model parameters. In this way, fast and efficient fine-tuning can be achieved while maintaining the performance of the original model, with high parameter efficiency, reduced computing and storage costs, high training efficiency, reduced demand for new data, and high flexibility.
[0032] In the present invention, when implementing the LoRA fine-tuning LLM model, its advantages are fully utilized to update different parts of the model respectively. Based on this, different training results will be obtained in theory, which is exactly what is needed in the implementation process.
[0033] (4) Replace the original parameter set of the LLM model with the new parameter set obtained through training, calculate the test data, and obtain the calculation results; Based on S3, new parameter sets under different training conditions are obtained, the original parameter sets of the LLM model are replaced respectively, and the test data are calculated to obtain the calculation results and their deviations.
[0034] The deviation is located at the corresponding deviation position, the sample data is segmented based on the deviation position, and both ends are filled based on preset rules to obtain new sample segmentation data.
[0035] Build a generative adversarial network model, including a generator and a discriminator; The sample segmentation data and its labels are input into the generator, and the generated samples are input into the discriminator to obtain the probability that the sample is true.
[0036] The generative adversarial network model also includes a feature extraction block; The generated sample and the original sample data are input into the feature extraction block to obtain the sample feature difference points.
[0037] The parameters of (5) are updated based on the sample feature difference points.
[0038] In the present invention, the basic implementation method is that after a round of training is completed, the new parameter set obtained by training is added to the original parameter set of the ChatGLM-6b model, and the province, city, district / county, street, park, road name, house number and other information of a new batch of enterprise address data (test data) are extracted to obtain the new model extraction result.
[0039] In the present invention, under the premise of proposing a solution of locally fine-tuning different parts of the LLM, the training results are likely to be different, which will obtain new parameter sets under different training, and replace the original parameter sets of the LLM model with different new parameter sets to obtain the calculation results and their deviations; It should be noted that these deviations will be represented at one or several positions in the address chain, so the sample data can be split based on the deviation position and filled (address chain), where the filled elements are the agreed clean data.
[0040] In the present invention, the sample segmentation data and its label are input into the generator, the generator receives the sample segmentation data (as noise) and the label, outputs the generated sample related to the specified label, and the generated sample is input into the discriminator, which obtains the probability (or probability distribution) of the sample segmentation data being true based on the original sample data; In order to further guide the processing of samples, the generated samples and the original sample data are input into the feature extraction block together. The feature extraction block obtains the difference points of sample features and can guide parameter updates (horizontal adjustment) as well as parameter updates between different rounds of training (vertical adjustment).
[0041] (5) If the accuracy of the LLM model after updating the parameters reaches the preset standard, the process ends; otherwise, the test data is used as new sample data and (2) is repeated together with the sample data in (1).
[0042] In the present invention, if the test result does not meet the target requirement, the erroneously extracted data sample is merged into the original training sample data set, and the ChatGLM-6b model is fine-tuned again, and the process is repeated until the model extraction accuracy reaches the target requirement.
[0043] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0044] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0045] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0046] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0047] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0048] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for extracting enterprise information based on the LLM model, characterized by: The method comprises the following steps: S1 obtains sample data of enterprise information and performs preprocessing; S2 converts and encodes the preprocessed sample data; S3 uses the data information obtained in S2 to perform LoRA fine-tuning training; S4 replaces the original parameter set of the LLM model with the new parameter set obtained through training, calculates the test data, and obtains the calculation results; S5 If the accuracy of the LLM model after the updated parameters reaches the preset standard, the process ends; otherwise, the test data is used as new sample data and S2 is repeated together with the sample data of S1.
2. The enterprise information extraction method based on the LLM model according to claim 1 is characterized in that: In S1, hierarchical information is extracted from the acquired sample data, errors are corrected on the extracted results, and administrative divisions are supplemented for the extracted hierarchical regional information to obtain a complete address chain of the enterprise information.
3. The enterprise information extraction method based on the LLM model according to claim 2 is characterized in that: The complete address chain includes province, city, district / county, street, park, road name, and house number; for enterprise information that does not exist in a street or park, a substitute symbol is inserted.
4. The enterprise information extraction method based on the LLM model according to claim 1 is characterized in that: In S3, the LLM model is copied and different local LoRA fine-tuning trainings are performed.
5. The enterprise information extraction method based on the LLM model according to claim 4 is characterized in that: In S4, new parameter sets under different training conditions are obtained based on S3, and the original parameter sets of the LLM model are replaced respectively, and the test data are calculated to obtain the calculation results, and the calculation results and their deviations are obtained.
6. The enterprise information extraction method based on the LLM model according to claim 5 is characterized by: The deviation is located at the corresponding deviation position, the sample data is segmented based on the deviation position, and both ends are filled based on preset rules to obtain new sample segmentation data.
7. The enterprise information extraction method based on the LLM model according to claim 6 is characterized by: Build a generative adversarial network model, including a generator and a discriminator; The sample segmentation data and its labels are input into the generator, and the generated samples are input into the discriminator to obtain the probability that the sample is true.
8. The enterprise information extraction method based on the LLM model according to claim 7 is characterized by: The generative adversarial network model also includes a feature extraction block; The generated sample and the original sample data are input into the feature extraction block to obtain the sample feature difference points.
9. The enterprise information extraction method based on the LLM model according to claim 8 is characterized by: The parameter update of S5 is guided based on the sample feature difference points.
10. The enterprise information extraction method based on the LLM model according to claim 2 is characterized in that: Construct a grid space based on the complete address chain, with the province or city as the initial node, and the elements of the address chain after the province or city as the associated nodes, connected in sequence; Clustering of related enterprises is achieved based on the initial node or different related nodes.
