0
$\begingroup$

I want to extract various amounts and tenure of contracts from different contract documents that we have.

For example : Mr xyz, this contact is valid for 3 Months and you have to pay $3000 as agreement fee.

Expected output : 3 Months, $3000

Please note that this is just an example but the sequence,format, currency and tenure is not fixed in actual problem

$\endgroup$
1
$\begingroup$

Named Entity Recognition (NER) models should be able to identify money amounts.

Other NLP techniques such as Dependency Parsing or Constituency Parsing can be used to identify the subject of the sentence - or the person the amount is referred to.

For the months amount, I think once you have other informations that's something you could extract with a "hard coded" script.

| improve this answer | |
$\endgroup$
1
$\begingroup$

I don't know much your data varies but I find that regular expressions can usually solve these sort of problems. In the example you gave you could, for instance, write these Python regular expressions that will extract the contract length and agreement fee.

# Contract Length
re.findall('\d+ (?:Weeks|Months|Years)', 'Mr xyz, this contact is valid for 3 Months and you have to pay $3000 as agreement fee')

# Agreement Fee
re.findall('\$\d+', 'Mr xyz, this contact is valid for 3 Months and you have to pay $3000 as agreement fee')

If however, you have more variance in your data, and you are able to label it, then named entity recognition (NER) is something you should definitely look at.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks Gad for reply but using regex will not be a robust solution for this and any variance in data will fail the model i.e with regex approach it is not clear that amount and agreement are related entities and amount is for the given contract only. NER will also help to isolate amount and tenure but not the relation between the 2. $\endgroup$ – SKB Apr 23 at 6:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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