Contract analysis method and device, computer readable storage medium, computer program product and terminal equipment
By setting up a cost library in contract analysis and combining semantic matching and contextual association technologies, the problem of difficulty in automatically calculating contract costs in the existing technology is solved, and accurate automatic calculation and security of service costs are achieved, and financial calculation efficiency and security are improved.
Patent Information
- Application Number
- CN202510625409.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-08-15
AI Technical Summary
The existing automated contract analysis plan is difficult to flexibly process dynamic data such as personnel configuration, number of positions and corresponding costs associated with the contract, and cannot automatically complete cost calculations, and there are shortcomings in terms of safety and compliance.
By pre-setting the cost library, extracting the text content related to the service in the contract, and calculating the service cost based on the target cost information in the cost library. Semantic matching and context association technology are used to extract accurate text content, and calculating wage costs are calculated based on different calculation modes to realize automatic calculation of service costs, and the encryption and log tracking mechanism are used to ensure security.
Automatic calculation of service costs is realized, the accuracy and efficiency of cost calculation is improved, the accuracy and security of financial calculations are significantly improved, and the needs of diversified contract analysis are met.
Smart Images

Figure CN120493906A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a contract parsing method and apparatus, a computer-readable storage medium, a computer program product, and a terminal device. Background Art
[0002] Currently, when processing contracts, companies often rely on manual labor to review and enter key information, such as the contract amount, Party A and Party B information, and the expiration date, page by page. This approach suffers from low efficiency, high error rates, an inability to effectively aggregate data, and a low level of standardization.
[0003] Most existing automated contract parsing solutions use optical character recognition (OCR) and preset field extraction.
[0004] However, existing automated contract parsing solutions are unable to flexibly handle dynamic data such as personnel configuration, number of positions and corresponding costs associated with the contract, and are unable to automatically complete cost calculations. Summary of the Invention
[0005] This application provides a contract parsing method and device, and provides a solution for automatically completing cost estimation and improving cost estimation efficiency.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] In a first aspect, a contract parsing method is provided, which is applied to a terminal device, or a chip in a terminal device, or a chip module, the contract parsing method comprising: extracting a first text content in a contract text to be parsed, the first text content including a service location and service content; retrieving target cost information corresponding to the area to which the service location belongs from a cost library, the cost library including cost information corresponding to multiple areas; and calculating the service cost of the service provided in the contract text to be parsed based on the service content and the target cost information.
[0008] Optionally, the extracting of the first text content in the contract text to be parsed includes: extracting a value corresponding to a first word in the contract text to be parsed that semantically matches a standard keyword as the first text content; in response to the absence of the first word, extracting a value corresponding to the context of a second word associated with the standard keyword as the first text content, wherein the second word is semantically associated with at least a part of the standard keyword.
[0009] Optionally, extracting the value corresponding to the context of the second word associated with the standard keyword as the first text content includes: matching the contract text to be parsed with the standard keyword, and determining the second word that semantically matches a part of the standard keyword; and searching for a corresponding value in the context of the second word as the first text content.
[0010] Optionally, extracting the value corresponding to the first word in the contract text to be parsed that semantically matches the standard keyword includes: precisely matching the contract text to be parsed with the standard keyword to obtain the first word, and the first word is consistent with the standard keyword; in response to the absence of the first word consistent with the standard keyword, fuzzy matching the contract text to be parsed with the standard keyword to obtain the first word, and the semantic similarity between the first word and the standard keyword is greater than a first threshold.
[0011] Optionally, the service content includes service positions and their corresponding number of service personnel, and the calculation of the service cost of the service provided in the contract text to be parsed based on the service content and the target cost information includes: determining the target logistics cost in the target cost information and the salary and subsidy corresponding to the service position; calculating the target labor cost based on the number of service personnel and the salary and subsidy corresponding to the service position; and determining the service cost based on the target logistics cost and the target labor cost.
[0012] Optionally, the service content includes a service period, and determining the logistics cost in the target cost information and the subsidy corresponding to the service position includes: determining the service season based on the service period; determining the corresponding logistics cost in the target cost information and the subsidy corresponding to the service position based on the service season.
[0013] Optionally, the cost information corresponding to each area includes multi-level costs, the first-level costs including wage costs, social security costs and logistics costs; the second-level costs of the wage costs include wages and subsidies; the second-level costs of the social security costs include personal social security and unit social security; the second-level costs of the logistics costs include housing costs and operating costs; the third-level costs of the wages include basic wages, overtime pay and holiday pay, and the third-level costs of the subsidies include performance subsidies, rank subsidies, position subsidies, food subsidies, certificate subsidies, accommodation subsidies and high temperature subsidies.
[0014] In the second aspect, the present application also provides a contract parsing device, which is characterized in that it includes: an extraction module for extracting the first text content in the contract text to be parsed, wherein the first text content includes the service location and service content; a cost information retrieval module for retrieving the target cost information corresponding to the area to which the service location belongs from the cost library, wherein the cost library includes cost information corresponding to multiple areas; a service cost calculation module for calculating the service cost of the service provided in the contract text to be parsed based on the service content and the target cost information.
[0015] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. The computer program is executed by a processor to perform a method provided by the first aspect.
[0016] In a fourth aspect, a contract parsing device is provided, comprising a storage module and a processor, wherein the storage module stores a computer program that can be run on the processor, and the processor runs the computer program to execute a method provided in the first aspect.
[0017] In a fifth aspect, a computer program product is provided, on which a computer program is stored, and the computer program is executed by a processor to perform a method provided in the first aspect.
[0018] In a sixth aspect, an embodiment of the present application further provides a chip having a computer program stored thereon, which implements the steps of the above method when the computer program is executed by the chip.
[0019] In the seventh aspect, an embodiment of the present application also provides a system chip for use in a terminal, wherein the system chip includes at least one processor and an interface circuit, wherein the interface circuit and the at least one processor are interconnected through lines, and the at least one processor is used to execute instructions to execute a method provided in the first aspect.
[0020] In an eighth aspect, an embodiment of the present application further provides a terminal device comprising a storage module and a processor, wherein the storage module stores a computer program that can be run on the processor, and the processor executes the steps of the contract parsing method when running the computer program.
[0021] Compared with the existing technology, the technical solution of this application has the following beneficial effects:
[0022] In the technical solution of the present application, the first text content in the contract text to be parsed is extracted, and the first text content includes the service location and service content; the target cost information corresponding to the region to which the service location belongs is retrieved from the cost library, and the cost library includes cost information corresponding to multiple regions; the service cost of the service provided in the contract text to be parsed is calculated based on the service content and the target cost information. The technical solution of the present application realizes the automatic calculation of service costs by pre-setting a cost library, extracting the first text content related to the provided services in the contract, and calculating the service costs in combination with the target cost information in the cost library. In addition, by dynamically matching the dynamic data in the contract with the cost library, the accuracy of cost calculation can be improved.
[0023] Furthermore, the technical solution of this application can also calculate the service gross profit margin based on the quantitative value of the cooperation results, service costs and other service specifications, significantly improving the efficiency and accuracy of financial measurement.
[0024] Furthermore, when extracting the first text content, the technical solution of the present application, in response to the absence of a first word that semantically matches the standard keyword, extracts as the first text content a value corresponding to the context of a second word associated with the standard keyword, where the second word is semantically associated with at least a portion of the standard keyword. In the event of non-standard contract content, the technical solution of the present application can accurately locate the first text content through semantic contextual association, laying the foundation for subsequent cost calculation and ensuring the accuracy of cost calculation.
[0025] In addition, the technical solution of this application adopts encryption and log tracking mechanisms in data transmission, storage and access, which can not only meet the needs of diversified contract analysis, but also effectively ensure the security and compliance of sensitive information, significantly improving financial calculation efficiency and overall management level. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a flow chart of a contract parsing method provided in an embodiment of the present application;
[0027] Figure 2 This is a flowchart of another contract parsing method provided in an embodiment of the present application;
[0028] Figure 3 is a schematic diagram of cost information provided by an embodiment of the present application;
[0029] Figure 4 This is a schematic diagram of the structure of a contract parsing device provided in an embodiment of the present application;
[0030] Figure 5 This is a hardware structure diagram of a contract parsing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] As mentioned in the background, existing automated contract parsing solutions struggle to flexibly handle dynamic data such as contract staffing, number of positions, and associated costs. This makes it impossible to automatically calculate the cost and real-time gross profit margin for each contract based on uploaded information such as positions, number of people, social security, and logistics costs. Furthermore, regarding security and compliance, some solutions lack robust encryption and change tracking for sensitive data, making it difficult to meet the demands of more sophisticated cost analysis and regulatory oversight.
[0032] This technical solution automatically calculates service costs by pre-setting a cost library, extracting the first text content related to the services provided in the contract, and calculating the service costs based on the target cost information in the cost library. Furthermore, by dynamically matching the dynamic data in the contract with the cost library, the accuracy of cost calculations can be improved.
[0033] The contract referred to in this application may be a labor dispatch contract, which refers to the labor contract signed between the labor dispatch unit and the dispatched worker, as well as the labor dispatch agreement signed between the labor dispatch unit and the employing unit. In this form of employment, the labor dispatch unit is responsible for recruiting and managing employees and dispatching them to work at the employing unit. The labor dispatch contract includes at least one of the following:
[0034] Workplace: clearly specify the work location of the dispatched workers;
[0035] Job content: clarify the positions and responsibilities of dispatched workers;
[0036] Working hours: The contract must clearly stipulate working hours, rest days, holidays, etc.;
[0037] Salary and benefits: including basic salary, overtime pay, bonuses, etc., as well as social insurance and housing provident fund payments;
[0038] Dispatch period: The contract must specify the start and end time of the dispatch.
[0039] The contract referred to in this application may also be a labor cooperation contract, outsourcing contract, agency contract or other appropriate types of contracts, and this application does not impose any restrictions on this.
[0040] The user data involved in the technical solution of this application are all obtained with the user's authorization. For example, the user is explicitly informed of the data purpose, scope and permissions through an interactive interface, and valid authorization is obtained after the user actively checks the consent box or completes the electronic signature.
[0041] To make the above-mentioned purposes, features, and advantages of the present application more clearly understood, the following detailed description of specific embodiments of the present application is given in conjunction with the accompanying drawings. It should be understood that in the various embodiments of the present application, the order of the sequence numbers of the processes does not imply the order of execution. The execution order of the processes should be determined by their functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0042] This application embodiment provides a contract parsing method, referring to Figure 1 , the following is a detailed description through specific steps.
[0043] It is understood that, in a specific implementation, the contract parsing method can be implemented as a software program that runs on a processor integrated within a chip or chip module. The method can also be implemented using a combination of software and hardware, which is not limited in this application.
[0044] In step 101, the first text content in the contract text to be parsed is extracted. The first text content includes the quantitative value of the cooperation results, the service location and the service content.
[0045] In practice, the contract to be parsed can be one of the aforementioned types, such as a labor dispatch contract. The contract to be parsed includes the quantified value of the cooperation outcome (e.g., the total amount in a labor dispatch contract), the service location, and the service content.
[0046] For example, the quantitative value of the cooperation achievement may be the total contract price, such as the total amount including tax.
[0047] For example, the quantitative value of the cooperation results may be a monthly amount including tax.
[0048] In a specific example, the contract to be parsed may include the following fields:
[0049] Party A's company, project address (customer address), unified social credit code, total contract price (total amount including tax), monthly amount including tax, number of employees (required number of employees), number of positions, service type, contract start date, contract end date, total number of months, day shift start and end time, night shift start and end time.
[0050] In a non-limiting embodiment, standard keywords may be pre-set, and the value corresponding to the first word in the contract text to be parsed that semantically matches the standard keyword is extracted as the first text content. The standard keyword may indicate the quantitative value of the cooperation achievement, the service location, and the service content.
[0051] Specifically, the contract text to be parsed is accurately matched with the standard keywords to obtain the first word, which is consistent with the standard keyword.
[0052] For example, the standard keyword may indicate the quantitative value of the cooperation results, which may specifically be the monthly lump sum amount including tax or the monthly amount.
[0053] For example, standard keywords may indicate the service location and service content, which may specifically be a government project, a property community, a city appearance, a commercial organization, a business plaza, a factory warehouse, etc.
[0054] Furthermore, to ensure the accuracy of the first text content extraction, in addition to extracting according to the standard keywords, the standard keywords can also be semantically expanded to extract the value corresponding to the first word in the contract text to be parsed that has a semantic match with a synonym of the standard keyword as the first text content.
[0055] In a specific implementation, in response to the absence of a first word that is consistent with the standard keyword, the contract text to be parsed is fuzzy matched with the standard keyword to obtain the first word, and the semantic similarity between the first word and the standard keyword is greater than a first threshold.
[0056] Specifically, please refer to Table 1 and Table 2. Table 1 shows the standard keyword monthly tax-inclusive lump sum amount and its synonyms. Table 2 shows various standard keywords indicating the service location and service content and their synonyms.
[0057] Table 1
[0058]
[0059] Table 2
[0060]
[0061] In a non-limiting embodiment, the contract to be parsed may not be standardized, and the first text content cannot be determined by semantic matching of standard keywords and their synonyms. In this case, the present application determines the first text content by semantically associating the context.
[0062] In a specific implementation, in response to the absence of the first word, a value corresponding to the context of a second word associated with the standard keyword is extracted as the first text content, and the second word is semantically associated with at least a portion of the standard keyword.
[0063] Please refer to the Figure 2 , Figure 2 A process of determining the first text content by semantically associating the context is shown.
[0064] In step 201 , the contract text to be parsed is matched with standard keywords, and a second word that semantically matches a portion of the standard keywords is determined.
[0065] In step 202 , a corresponding value is searched in the context of the second word to serve as the first text content.
[0066] Specifically, when a second word in the contract text to be parsed semantically matches a portion of a standard keyword, the system automatically searches for numerical information in the vicinity of the second word (e.g., a number of words or sentences before or after it) to infer the numerical value of the contract field. This contextual semantic analysis method can accurately infer contract fields that are related to the standard keyword but are not explicitly labeled or are expressed vaguely.
[0067] For example, if the standard keyword is "total contract amount," the initial match would look for "amount," and then look for words like "total," "total," or "total" in the context. Alternatively, the initial match would look for words like "total," and then look for words like "amount," "money," or "yuan" in the context.
[0068] For example, for the standard keyword "monthly lump sum amount including tax", contexts associated with the keywords "monthly", "lump sum", and "tax included" are searched, such as numbers near the keywords, as the contract amount.
[0069] For example, for the standard keyword "monthly package amount including tax", contexts associated with the keywords "monthly" and "tax included" are searched, such as numbers near the keywords, as the contract amount.
[0070] Continue to refer to Figure 1 In step 102, the target cost information corresponding to the region to which the service location belongs is retrieved from the cost library, and the cost library includes cost information corresponding to multiple regions.
[0071] In this embodiment, the cost library can be pre-built, and different regions have different cost information. Then, by retrieving the target cost information corresponding to the region to which the service location belongs from the cost library to calculate the cost, flexibility in cost calculation can be achieved.
[0072] In a specific embodiment, please refer to Figure 3 , Figure 3 A structure of cost information is shown.
[0073] The cost information corresponding to each region (also called labor cost) includes multi-level costs. The first-level costs include wage costs, social security costs, and logistics costs.
[0074] The second-level costs of wage costs include wages and subsidies; the second-level costs of social security costs include personal social security and unit social security; the second-level costs of logistics costs include housing costs and operating costs.
[0075] The third-level cost of wages includes basic salary, overtime pay and holiday pay. The third-level cost of subsidies includes performance subsidies, rank subsidies, position subsidies, food subsidies, certificate subsidies, accommodation subsidies and high temperature subsidies.
[0076] In an optional embodiment, the structure of cost information can be adaptively configured based on different actual application scenarios. For example, the second-level costs of logistics costs include essential costs and non-essential costs. The third-level costs of essential costs include clothing costs; the third-level costs of non-essential costs include rent costs, equipment costs, office costs, transportation costs, and utilities.
[0077] In a specific embodiment, when calculating the target labor cost based on the number of service personnel and the wages and subsidies corresponding to the service positions, the target labor cost includes the wage cost and the subsidy cost, and the wage cost can be calculated according to a pre-set calculation mode. The calculation mode is selected from the following calculation modes: fixed salary, shift salary, hourly salary, and live-in salary.
[0078] The fixed salary calculation mode indicates that the salary for the service position is fixed. Therefore, the salary cost is the product of the number of service employees and the fixed salary.
[0079] When the calculation mode is shift-based salary, service personnel can obtain the agreed salary for a single shift by completing the agreed workload. Different types of shifts have different salary rates, for example, holiday shifts are paid more than weekday shifts. Therefore, when calculating wages based on shift-based salary, the following formula can be used:
[0080] Single-person wage cost = Sp×Np +Sh×Nh, where Sp represents the weekday shift wage, Np represents the number of weekday shifts, Sh represents the holiday shift wage, and Nh represents the number of holiday shifts.
[0081] Specifically, weekday and holiday shift wages can be included in the target cost information. Weekday and holiday shifts can be determined based on the service time in the contract to be parsed. The total wage cost is the product of the single-person wage cost and the number of service personnel.
[0082] When the calculation mode is hourly wage, service personnel can obtain single-shift working hours after completing the agreed workload of a shift. Different types of working hours have different hourly wages. For example, holiday hourly wages are higher than overtime hourly wages, and overtime hourly wages are higher than regular hourly wages. Therefore, when calculating wages based on hourly wage, the following formula can be used:
[0083] Salary cost per person = Rb × Hb + Ro × (Hw - Hb - Hh) + Rh × Hh, where Rb represents the regular hourly wage, Hb represents the base hours worked, Ro represents the overtime hourly wage, Rh represents the holiday hourly wage, Hw represents the actual base hours worked that month, and Hh represents the holiday hours worked. Total salary cost is the product of salary cost per person and the number of employees served.
[0084] Specifically, the formula for calculating basic working hours (Hb) is: Hb = (365 - Dh - W × 2) / 12 × T, where 365 represents the number of days in a year, Dh represents the number of holidays in a year, W represents the number of weeks in a year, 2 represents the number of holidays in a week, 12 represents the number of months in a year, and T represents the standard daily working hours. For example, if the service location is in China, where Dh has 13 holidays per year, the basic working hours (Hb) are typically 166.64 hours, or Hb = (365 - 13 - 52 × 2) / 12 × 8 = 166.64.
[0085] Among them, live-in pay is mainly used in special job scenarios such as night care, hotel duty, etc. Service personnel can receive the agreed salary for a single shift after completing the agreed workload. Therefore, when calculating wages based on live-in pay, the following formula can be used:
[0086] Single-person wage cost = As × Ns, As represents the live-in shift salary, and Ns represents the number of shifts.
[0087] By setting different wage cost calculation modes, the embodiments of the present application can be used in more application scenarios, achieve flexibility in wage cost calculation, and meet the diverse needs of users.
[0088] Furthermore, the contract text to be parsed also includes service time, such as the project start and end times. In addition to retrieving target cost information based on the service location, target cost information can also be determined by combining the service location and service time to further ensure the accuracy of cost calculations. This is because different costs will be generated depending on the season of service. For example, there is a high temperature subsidy in the summer, but the cost of clothing in the winter and summer are different.
[0089] Specifically, the cost information corresponding to the service location area is retrieved from the cost database, and then the target season cost in the cost information is determined based on the service time. The target season cost and other costs in the cost information together form the target cost information.
[0090] by Figure 3 Taking the cost information shown as an example, the service time is from July 1st to 31st. Compared with other seasons, there is an additional high temperature subsidy, which is the target season cost; the target season cost is reflected in the wage cost, and together with the social security cost and logistics cost, it forms the target cost information.
[0091] Continue to refer to Figure 1 In step 103, the service cost of the service provided in the contract text to be parsed is calculated based on the service content and the target cost information.
[0092] In this embodiment, the target cost information typically represents the cost of a single service employee in a single service position. The service cost of the services provided in the contract to be parsed varies depending on the service content in the contract, such as the service position and number of employees. To accurately determine the service cost, the service content in the contract is matched with the target cost information to determine the service cost of the services provided in the contract to be parsed.
[0093] In one non-limiting embodiment, the target logistics cost and the wages and subsidies corresponding to the service positions in the target cost information are first determined. The target labor cost is then calculated based on the number of service personnel and the wages and subsidies corresponding to the service positions. The service cost is then determined based on the target logistics cost and the target labor cost.
[0094] Specifically, when there is no need to pay for equipment for service personnel, the service cost is the sum of the target logistics cost and the target labor cost.
[0095] Exemplarily, the calculation formula of service cost is as follows: service cost = ∑((salary + subsidy) × number of service personnel) + logistics cost.
[0096] Furthermore, the service cost also includes the target social security cost, which is the sum of the target logistics cost, target labor cost, and target social security cost. The target social security cost can be calculated based on parameters such as the social security contribution base and social security deduction ratio for the service location, and this application does not impose any restrictions on this.
[0097] For example: If the contract project address in the contract to be parsed is: "No. 123, XXX Road, Pudong New Area, Shanghai", the system will automatically extract the service location as "Shanghai" and automatically call the Shanghai region number (Region_ID) in the cost library. This number is then used to associate the target cost information, i.e., the labor cost, social security cost, and logistics cost data, and automatically return the service cost of the services provided under this contract in the Shanghai area for the user to confirm or adjust.
[0098] Furthermore, the service content includes the service period. Different service periods may correspond to different logistical costs (such as water and electricity fees) or subsidies (such as high temperature subsidies). Therefore, the logistical costs and subsidies can be determined based on the service season to ensure the accuracy of service cost calculation.
[0099] Specifically, the service season is determined based on the service period; the corresponding logistics costs in the target cost information and the subsidies corresponding to the service positions are determined based on the service season.
[0100] A specific application scenario of this application is to calculate the contract gross profit margin to assist in completing financial calculations. The calculation formula for the contract gross profit margin is as follows:
[0101] Gross profit margin = (quantified value of cooperation results - service costs - taxes) / quantified value of cooperation results × 100%. The quantified value of cooperation results corresponds to the contract amount in the labor dispatch contract.
[0102] For example, the calculation formula for the monthly gross profit margin of a contract is as follows: gross profit margin = ((monthly contract amount - ∑((salary + subsidy) × number of service personnel) - logistics costs - taxes) / monthly contract amount) × 100%.
[0103] In a specific example, the quantitative value of the cooperation results can be the total contract amount, in which case the contract gross profit margin is calculated.
[0104] In a specific example, the quantitative value of the cooperation results can be the monthly contract amount, in which case the monthly gross profit margin is calculated.
[0105] It should be noted that the serial numbers of the steps in this embodiment do not limit the execution order of the steps.
[0106] In a specific application scenario, this application provides a contract parsing system. Users can upload a photo or scan of the contract to be parsed, and the system obtains the contract text to be parsed through optical character recognition (OCR).
[0107] Furthermore, before extracting the first text content from the contract text to be parsed, the contract text to be parsed may be cleansed and standardized. Different standardization methods may be used for different fields.
[0108] For example, for the field "Party A Company", a. use the full name (such as the legal company name on the business license).
[0109] For example, for the field "project address (customer address)", the format of "province (municipality) + city (district) + district / county + street + detailed house number" is used.
[0110] For example, for the field "unified social credit code", it must be 18 characters, consisting of numbers and uppercase English letters, and spaces or special symbols must be removed.
[0111] For example, for the fields "Contract Total Price, Lump Sum Amount Including Tax, Monthly Lump Sum Amount Including Tax, and Monthly Amount Including Tax," the values are expressed in RMB, accurate to two decimal places. Amounts are separated by the thousandths separator "," (for example, "120,000.00"). The amount is followed by "Yuan." A correct example is: 120,000.00 Yuan.
[0112] For example, for fields such as "Contract Start Date" and "Contract End Date," the unified format is YYYY-MM-DD, for example: 2025-03-01. The year is represented by four digits, and if the month and day are less than two digits, a leading zero is added.
[0113] In a specific application scenario, a pre-trained large model can be used to perform the steps of the aforementioned contract parsing method. Specifically, the contract text to be parsed can be input into the large model, which then outputs the service cost and, further, the gross profit margin.
[0114] Taking the output result as the service cost as an example, when training a large model, training data is pre-built. The training data is built as follows:
[0115] Extract contract texts in various formats from actual contracts;
[0116] Mark the location of the first text content and clearly indicate the corresponding semantic field type;
[0117] Generate more contract text variations by using methods such as synonym replacement, random text deletion, and sentence reordering;
[0118] Leveraging the large model's inherent generation capabilities, we generated more similar expressions for common fields such as "monthly fee," "service fee unit price," "monthly service fee," and "monthly fee," and added them to the training dataset after manual confirmation.
[0119] Normalize the labeled data to ensure the consistency and quality of the training data;
[0120] Use the training data to fine-tune a pre-trained language model (such as BERT) or a large language model (such as ChatGPT).
[0121] Please refer to Figure 4 , Figure 4 A contract parsing device 40 is shown, and the contract parsing device 40 may include:
[0122] Extraction module 401, used to extract first text content from the contract text to be parsed, the first text content including the service location and service content;
[0123] The cost information retrieval module 402 is used to retrieve the target cost information corresponding to the region to which the service location belongs from the cost database. The cost database includes cost information corresponding to multiple regions.
[0124] The service cost calculation module 403 is used to calculate the service cost of the service provided in the contract text to be parsed based on the service content and target cost information.
[0125] Furthermore, the extraction module 401 includes: a first extraction unit, used to extract the value corresponding to the first word in the contract text to be parsed that matches the semantics of the standard keyword as the first text content; a second extraction unit, used to extract the value corresponding to the context of the second word associated with the standard keyword as the first text content in response to the absence of the first word, and the second word is semantically associated with at least a part of the standard keyword.
[0126] Furthermore, the second extraction unit is also used to match the contract text to be parsed with the standard keywords and determine a second word that semantically matches a part of the standard keywords; the second extraction unit is also used to search for a corresponding value in the context of the second word as the first text content.
[0127] Furthermore, the service cost calculation module 403 also includes: a salary determination unit, which is used to determine the target logistics cost in the target cost information and the salary and subsidies corresponding to the service position; a labor cost calculation unit, which is used to calculate the target labor cost based on the number of services and the salary and subsidies corresponding to the service position; and a service cost calculation unit, which is used to determine the service cost based on the target logistics cost and the target labor cost.
[0128] Furthermore, the salary determination unit is further used to determine the service season according to the service period, and the salary determination unit is further used to determine the corresponding logistics costs in the target cost information and the subsidies corresponding to the service position according to the service season.
[0129] In a specific implementation, the above-mentioned contract parsing device 40 can correspond to a chip with a contract parsing function in a terminal device, such as a system-on-a-chip (SOC), a baseband chip, etc.; or correspond to a chip module with a contract parsing function in a terminal device; or correspond to a chip module with a data processing function chip, or correspond to a terminal device.
[0130] For other relevant descriptions about the contract parsing device 40, please refer to the relevant descriptions in the aforementioned embodiments, which will not be repeated here.
[0131] Regarding the various modules / units contained in the various devices and products described in the above embodiments, they can be software modules / units, hardware modules / units, or partly software modules / units and partly hardware modules / units. For example, for various devices and products applied to or integrated into a chip, the various modules / units contained therein can all be implemented in the form of hardware such as circuits, or at least part of the modules / units can be implemented in the form of software programs, which run on the processor integrated inside the chip, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated into a chip module, the various modules / units contained therein can all be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component of the chip module (such as a chip, circuit module, etc.) or in different components, or at least part of the modules / units can be implemented in the form of software programs. It is implemented in the form of a software program, which runs on the processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in the terminal equipment, the various modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or different components in the terminal equipment, or at least some modules / units can be implemented in the form of a software program, which runs on the processor integrated inside the terminal equipment, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits.
[0132] The present application also discloses a storage medium, which is a computer-readable storage medium having a computer program stored thereon. When the computer program is executed, the steps of the method described in the aforementioned embodiment can be executed. The storage medium may include a read-only memory module (ROM), a random access memory module (RAM), a magnetic disk or an optical disk, etc. The storage medium may also include a non-volatile memory module or a non-transitory memory module, etc.
[0133] Please refer to Figure 5 The embodiment of the present application also provides a hardware structure diagram of a contract parsing device. The device includes a processor 501, a storage module 502 and a transceiver 503.
[0134] Processor 501 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application. Processor 501 may also include multiple CPUs, and processor 501 may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor here may refer to one or more devices, circuits, or processing cores for processing data (such as computer program instructions).
[0135] The storage module 502 can be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory module (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, and the present embodiment of the application does not impose any restrictions on this. The storage module 502 can exist independently (in this case, the storage module 502 can be located outside the device or inside the device), or it can be integrated with the processor 501. Among them, the storage module 502 can contain computer program code. The processor 501 is used to execute the computer program code stored in the storage module 502, thereby implementing the method provided in the embodiment of the present application.
[0136] The processor 501, the storage module 502 and the transceiver 503 are connected via a bus. The transceiver 503 is used to communicate with other devices or communication networks. Optionally, the transceiver 503 may include a transmitter and a receiver. The device used to implement the receiving function in the transceiver 503 can be regarded as a receiver, and the receiver is used to perform the receiving step in the embodiment of the present application. The device used to implement the sending function in the transceiver 503 can be regarded as a transmitter, and the transmitter is used to perform the sending step in the embodiment of the present application. For example, the transceiver 503 receives the text of the contract to be parsed or the photo of the contract to be parsed from the user terminal through the interface; the transceiver 503 pushes the calculated service cost and / or the gross profit margin of the contract to the user terminal through the interface.
[0137] It should be understood that the term "and / or" in this document simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document indicates that the related objects are in an "or" relationship.
[0138] The term "plurality" used in the embodiments of the present application refers to two or more.
[0139] The first, second, etc. descriptions appearing in the embodiments of this application are only for illustration and distinction of the description objects. There is no order, nor does it indicate any special limitation on the number of devices in the embodiments of this application, and cannot constitute any limitation on the embodiments of this application.
[0140] The "connection" appearing in the embodiments of the present application refers to various connection methods such as direct connection or indirect connection to achieve communication between devices, and the embodiments of the present application do not impose any limitations on this.
[0141] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means.
[0142] In the several embodiments provided in this application, it should be understood that the disclosed methods, devices, and systems can be implemented in other ways. For example, the device embodiments described above are merely schematic; for example, the division of the units is merely a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection of devices or units, which may be electrical, mechanical, or other forms.
[0143] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0144] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may be physically included separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0145] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit stored in a storage medium includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to perform some steps of the method described in various embodiments of the present application.
[0146] Although the present application is disclosed as above, the present application is not limited thereto. Any person skilled in the art may make various changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims.
Claims
1. A contract analysis method, characterized in that: include: Extracting first text content from the contract text to be parsed, where the first text content includes a service location and service content; Retrieving target cost information corresponding to the region to which the service location belongs from a cost library, wherein the cost library includes cost information corresponding to multiple regions; The service cost of the service provided in the contract text to be parsed is calculated based on the service content and the target cost information.
2. The contract analysis method according to claim 1, characterized in that: Extracting the first text content from the contract text to be parsed includes: Extracting a value corresponding to a first word in the contract text to be parsed that semantically matches the standard keyword as the first text content; In response to the absence of the first word, a value corresponding to a context of a second word associated with the standard keyword is extracted as the first text content, the second word being semantically associated with at least a portion of the standard keyword.
3. The contract analysis method according to claim 2, characterized in that: The extracting a value corresponding to the context of the second word associated with the standard keyword as the first text content includes: Matching the contract text to be parsed with the standard keywords, and determining the second words that semantically match a portion of the standard keywords; A corresponding value is searched in the context of the second word to serve as the first text content.
4. The contract analysis method according to claim 2, characterized in that: The step of extracting the value corresponding to the first word in the contract text to be parsed that has a semantic match with the standard keyword includes: Accurately matching the contract text to be parsed with the standard keyword to obtain the first word, where the first word is consistent with the standard keyword; In response to the absence of the first word consistent with the standard keyword, the contract text to be parsed is fuzzy matched with the standard keyword to obtain the first word, and the semantic similarity between the first word and the standard keyword is greater than a first threshold.
5. The contract analysis method according to claim 1, characterized in that: The service content includes service positions and the corresponding number of service personnel. The service cost of the service provided in the contract text to be parsed is calculated based on the service content and the target cost information, including: Determining the target logistics cost in the target cost information and the wages and subsidies corresponding to the service positions; Calculate the target labor cost based on the number of service personnel and the corresponding wages and subsidies for the service positions; The service cost is determined based on the target logistics cost and the target labor cost.
6. The contract analysis method according to claim 5, characterized in that: The service content includes the service period, and the determination of the logistics cost in the target cost information and the subsidy corresponding to the service position includes: Determine the service season based on the stated service period; The logistics costs corresponding to the target cost information and the subsidies corresponding to the service positions are determined according to the service season.
7. The contract analysis method according to claim 1, characterized in that: The cost information corresponding to each region includes multi-level costs. The first-level costs include wage costs, social security costs and logistics costs; the second-level costs of the wage costs include wages and subsidies; the second-level costs of the social security costs include personal social security and unit social security; the second-level costs of the logistics costs include housing costs and operating costs; the third-level costs of the wages include basic wages, overtime pay and holiday pay, and the third-level costs of the subsidies include performance subsidies, rank subsidies, position subsidies, food subsidies, certificate subsidies, accommodation subsidies and high temperature subsidies.
8. A contract analysis device, characterized in that: include: An extraction module, configured to extract first text content from the contract text to be parsed, wherein the first text content includes a service location and service content; A cost information retrieval module is used to retrieve target cost information corresponding to the region to which the service location belongs from a cost library, wherein the cost library includes cost information corresponding to multiple regions; The service cost calculation module is used to calculate the service cost of the service provided in the contract text to be parsed based on the service content and the target cost information.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the contract analysis method according to any one of claims 1 to 7 are executed.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a computer, the steps of the contract analysis method described in any one of claims 1 to 7 are implemented.
11. A terminal device comprising a storage module and a processor, wherein the storage module stores a computer program that can be run on the processor, characterized in that: When the processor runs the computer program, the processor executes the steps of the contract parsing method according to any one of claims 1 to 7.