2
$\begingroup$

We would like identify similar text (clauses) on a contract based on a trained corpus.

For instance:

Contract - small sample

NOW, THEREFORE, the parties hereto mutually agree as follows:

1. Scope of Services. The CONTRACTOR shall, in a proper and satisfactory manner as determined by OHA, provide all the goods and services set forth in Attachment – S1,
which is hereby made a part of this Contract.

2. Time of Performance. The performance required of the CONTRACTOR under this Contract shall be completed in accordance with the Time Schedule set forth in Attachment – S2, which is hereby made a part of this Contract.

3. Compensation. The CONTRACTOR shall be compensated according to the Compensation provision set forth in Attachment – S3, which is hereby made a part of this Contract.

4. Standards of Conduct Declaration. The Standards of Conduct Declaration of the CONTRACTOR is attached and is made a part of this Contract.

Trained clauses

We already have classified a few clauses from previous contracts. For instance:

#time_of_performance = 
[
    "Under this contract the performance required to be completed in accordance with the a predefined schedule."
,
    "The completion of each phase of the project will be used to define the performance of this contract"
,
    etc.
]

Where #time_of_performance is the classification for these clauses.

Expected result

Given the contract and the trained set, we would like to get parts/ranges of the texts and its classifications:

#time_of_performance = ["2. Time of Performance. The performance required of the CONTRACTOR under this Contract shall be completed in accordance with the Time Schedule set forth in Attachment – S2, which is hereby made a part of this Contract."]

Is there a known approach for this problem or a recommended processing pipeline?

$\endgroup$

2 Answers 2

1
$\begingroup$

Since all the sentences length are not highly varying, you can use sentence embeddings and do the clustering on top of that.

For example,

Text => USE => vector[1024] => KMeans

USE - Universal sentence encoders

Kmeans - SKlearn Module

You can adjust the number of clusters using these techniques.

$\endgroup$
0
$\begingroup$

Not sure where you are in terms of prior knowledge, but this blog post might get you started.

$\endgroup$
1
  • $\begingroup$ this a introduction to NLP. it's too broad $\endgroup$ Oct 23, 2019 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.