NER and context mapping
Standard NER is going to extract individual entities, which in this case is time (3 months, 1 month) and currency ($3000, etc). You'll also want to think about Relationship Extraction, which identifies how two pieces of text relate to one another. For example, from a Euclidean distance measure, &quot;contract&quot; is related to &quot;valid&quot; and &quot;executed&quot;, and &quot;valid&quot; is related to &quot;3 months&quot; while &quot;executed&quot; is related to &quot;1 month&quot;. Based on what you said your desired output should be, you'll want to train your model to calculate the shortest distance between &quot;contract&quot; and &quot;3 months&quot;, which in this case means teaching it to look for &quot;valid&quot; while ignoring &quot;executed&quot;. There are different ways of doing this which you'll want to think about in terms of what works best for your corpus of text.
Here's a link to get you started (also includes links to other resources).