Contract extraction
The contract extraction service extracts elements from contracts. This topic describes how to use this service.
Activate the service and purchase a resource plan
Before you use the pre-trained model, you must ensure that the NLP Self-Learning Platform service is activated. After you activate the service, you must purchase a resource plan.
NLP Self-Learning Platform: Activation page
Self-Learning Platform resource plan: Purchase page
1. Create a project
Go to the NLP Self-Learning Platform console. The platform supports multiple projects and application algorithms. This tutorial guides you through the process of creating a Contract Extraction project.
Go to My Projects and click Create Project. In the Application Algorithms section, select the Contract Extraction algorithm and click Create. On the next page, enter a project name and description.
2. Data preparation
In My Projects, manage your data in the Data Center. You can create data in one of two ways:
1. Create an annotation task. 2. Upload a dataset.
2.1 Create an annotation task
Step 1: Upload documents and add annotators
The project creator and project administrators are annotators by default. You can also assign annotation tasks to RAM users. These users can then log on to the platform with their RAM user credentials to annotate data.
RAM user logon instructions:
1. Go to the RAM user logon page: https://signin.aliyun.com/login.htm
2. After logging on, go to My Projects and click Create Annotation Task.
Note: Only data files that use the UTF-8 encoding format are supported.
Step 2: Add custom labels
The contract extraction service includes more than 20 built-in entity labels that do not require annotation. This can reduce the data annotation cost for model training to less than 20% of the original cost.
Select the preset fields for the annotation task. Then, add the custom label fields that require annotation.
Step 3: Annotate data
2.2 Upload a dataset
A model learns patterns from annotated data. Therefore, you must first prepare a labeled dataset.
If you already have annotated data, you must format it as required by the Self-Learning Platform before you upload it.
The uploaded data must be in JSON format and use the following structure. Place the text in the "content" field and the labels in the "records" field. In the "records" field, the key is the entity name, and the value is the offset of the labeled content in the original text.
{
"id_0001": { // This is the unique identifier for the document in your dataset.
"content": "
Temporary Worker Dispatch Agreement
Party A: Shenzhen aaa Electronics Co., Ltd. Party B: Shenzhen BBB Labor Dispatch Co., Ltd.
Address: A Industrial Park, X Avenue, Shenzhen Address: Room 1010, Building B, No. 1 S East Road, Z Sub-district, Y District, Shenzhen
Legal Representative: Han Liu
Legal Representative: Wang Wu
Authorized Representative: Li Si
Authorized Representative: Zhang San
Phone: 89601111
Phone: 1390000****
Due to tight production schedules and a shortage of personnel, to ensure labor demand and maintain normal production operations, and in accordance with the "Contract Law of the People's Republic of China", the "Labor Contract Law of the People's Republic of China", and other relevant laws and regulations, Party A and Party B, based on the principles of equality, voluntariness, and mutual agreement, enter into this agreement regarding the dispatch of temporary workers from Party B to Party A. Both parties agree to abide by the terms listed in this agreement.
Party A accepts and agrees:
Party B accepts and agrees:
Party A Representative Signature:
Party B Representative Signature:",
"records": {
"Party A Name": [{
"span": "Shenzhen aaa Electronics Co., Ltd.",
"offset": [ // The byte offset of the annotated field. The offset of the first byte is 0.
11,
23
]
}],
"Party B Name": [{
"span": "Shenzhen BBB Labor Dispatch Co., Ltd.",
"offset": [
27,
41
]
},
}]
"Party A Address": [{
"span": "A Industrial Park, X Avenue, Shenzhen",
"offset": [
45,
55
]
},
}]
"Party B Address": [{
"span": "Room 1010, Building B, No. 1 S East Road, Z Sub-district, Y District, Shenzhen",
"offset": [
59,
80
]
},
}]
}
}
}
3. Create a model
In the Model Hub, click Create Model.
To view model details, click the View button next to the model.
The Model Details page
Test a model
After a model is trained, you can test its performance online.
Model Testing on the Platform
You can test the trained model with text on the platform. You can also run additional training sessions to improve the accuracy of specific labels.
Appendix: Built-in fields for contract extraction and their descriptions |
No. |
Entity Name |
Description |
1 |
Contract Name |
|
2 |
Contract Number |
|
3 |
Contract Term |
|
4 |
Number of Contract Copies |
|
5 |
Contract Amount |
|
6 |
Contract Amount (in numbers) |
|
7 |
Contract Amount (in words) |
|
8 |
Tax Rate |
|
9 |
Start Time |
|
10 |
End Time |
|
11 |
Signing Date |
|
12 |
Effective Date |
|
13 |
Party A Name |
|
14 |
Party A Seal/Signature Name |
|
15 |
Party A Bank Account Number |
|
16 |
Party A's bank account |
|
17 |
Party A Bank Name |
|
18 |
Party A Address |
|
19 |
Party B Name |
|
20 |
Party B Seal/Signature Name |
|
21 |
Party B Bank Account Number |
|
22 |
Party B's Bank Account |
|
23 |
Party B Bank Name |
|
24 |
Party B Address |
|
25 |
Court of Litigation |
|
26 |
Arbitration Institution |