1
$\begingroup$

I am trying to find the parties between which the agreement is executed from the statement below.

AGREEMENT, dated as of January 10, 2000, is entered into by and between ABC-EFG GROUP Inc. having an address at 418 Mona Drive, Prominade 34, Florida 34673, United States of America and Rob Cummins, an individual residing in the state of Florida, and having an address at 13 test Dr, Arosa, FL 43566

To get this, I tried the following code:

for chunk in doc.noun_chunks: # after loading "nlp = spacy.load("en_core_web_sm")" and doc = nlp("string")
   print(chunk.text, chunk.root.text, chunk.root.dep_,chunk.root.head.text)

which gives me:

AGREEMENT AGREEMENT nsubjpass entered
January January pobj of
ABC-EFG GROUP Inc. Inc. pobj between
an address address dobj having
418 Mona Drive Drive pobj at
United States States conj Drive
America America pobj of
Rob Cummins Cummins conj America
an individual individual appos States
the state state pobj in
Florida Florida pobj of
an address address dobj having
13 test test pobj at
Dr Dr ROOT Dr
FL FL appos Arosa

I don't understand how I am supposed to find the two parties from this output.

I am not specific to spaCy. A suggestion of any other model or method also will work.

Please note that I have already tried NER but the results are very poor.

$\endgroup$

1 Answer 1

1
$\begingroup$

Using dependency parsing alone will not give you what you need. You may be able to get your answer by interpreting the dependency tree. For instance, in this case ABC-EFG GROUP Inc. is a pobj of between, which could infer that it is party 1. In this particular case, the dependency parsing isn't fully correct and party 2 (Rob Cummins) is difficult to find.

I would recommend you try the following things:

It seems that the parties are either organization or people, so you could narrow down your candidates to proper nouns and you could use NER to see whether any ORG or PER are detected. That will not tell you exactly whether they are the parties, but they could give you useful hints.

In this case, it feels like a plain regular expression could work. Whatever proper noun occurs after between seems to be party 1, and whatever follows and seems to be party 2. Of course, a regular expression would only work for cases written with the same pattern, but it is always wise to consider. Perhaps, you are already a fair amount of your scenarios with a solution that will always work. You could also use the presence of words like "between" and "and" as a feature.

If you don't have a lot of training examples, you could take a look at libraries like mimesis and faker. They allow you to generate company names, addresses, people names, etc.

$\endgroup$
6
  • $\begingroup$ "In this case, it feels like a plain regular expression could work. Whatever proper noun occurs after between seems to be party 1, and whatever follows and seems to be party 2.", this is specific to given example only but not the generalised approach. This may fail wit hother statements. $\endgroup$
    – SKB
    May 15, 2020 at 9:59
  • $\begingroup$ Fair enough, I've updated my answer to give my thoughts on this. When you say that NER results are poor. What kind of quality are we talking about? Because I have worked on a very similar problem and my trained SpaCy NER model worked really well. How much training data do you have? $\endgroup$ May 15, 2020 at 10:07
  • $\begingroup$ When NER model has been trained, it was picking the results which are ocation specific. I did not get chance to train it on very high number of tests(below 25, i know this is very less). But one idea here i can think of is,if there is any corpus which contain all suffixes of companies (like LLC,LTD, technalogies, pvl ltd etc)? I can validate against the suffixes in conjunction with 'PERSON' NER ? $\endgroup$
    – SKB
    May 15, 2020 at 10:26
  • $\begingroup$ "I have worked on a very similar problem and my trained SpaCy NER model worked really well. How much training data do you have?", if you could help with different steps you follwed to improve the results please? $\endgroup$
    – SKB
    May 15, 2020 at 10:27
  • $\begingroup$ Well, that's the thing, I didn't do anything special to improve the results. Simply training the NER model with data very similar to yours was enough to get satisfactory results (i.e. 0.83 F1-score), hence my question about how much data you have and what your performance actually is. Based on your previous comment, I don't know of any dataset like this, but something that could be useful are libraries like Faker and Mimesis which allow you to generate company names, people names, addresses etc. (I updated my answer) $\endgroup$ May 15, 2020 at 10:36

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.