title: Finding custom entities using NLP
body: <p>Basically, from a paragraph, I have to find two entities <code>Role</code> and <code>Oragnization</code>.</p>
  <ul>
  <li>Org should be captured along with their branch location, not their full address if provided in paragraph</li>
  <li>Role can be in bracket and right before bracket at same time like
  <code>Org as role(The &quot;Role&quot;)</code></li>
  <li>Role can have multiple words</li>
  </ul>
  <p>Example paragraph would be:</p>
  <blockquote>
  <p>XXXX, dated as of November 10, 2050, among: (i) <code>&lt;ORG_NAME_1 PLC&gt;</code>,
  a public company incorporated under the laws and having
  its registered office at the 123 Penss Aven, NY, USA (the “<code>&lt;ROLE1&gt;</code>”), (ii) <code>&lt;ORG_NAME_2 PLC&gt;</code>, a public limited company incorporated
  under the laws having its registered office at Manhattan Blvd, Seattle, WA, as <code>&lt;ROLE2&gt;</code> (the
  “<code>&lt;ROLE2&gt;</code>”), (iii) the , Guarantors named in some random text hereto, (iv)
  <code>&lt;ORG_NAME_3&gt;, N.A., Belfast Branch</code>, as <code>&lt;ROLE3&gt;</code> (the “<code>&lt;ROLE3&gt;</code>”), (v) <code>&lt;ORG_NAME_4&gt;</code> , as <code>&lt;ROLE4&gt;</code>, <code>&lt;ROLE5&gt;</code> and <code>&lt;ROLE6&gt;</code>, and (vi) <code>&lt;ORG_NAME_5&gt;</code> <code>Deutschland AG</code>, as <code>&lt;ROLE7&gt;</code>.</p>
  </blockquote>
  <p>After processing, desired result would be linking role with organization.</p>
  <pre><code>&lt;ROLE1&gt; --&gt; &lt;ORG_NAME_1 PLC&gt;
  &lt;ROLE2&gt; --&gt; &lt;ORG_NAME_2 PLC&gt;
  &lt;ROLE3&gt; --&gt; &lt;ORG_NAME_3&gt;, N.A., Belfast Branch
  &lt;ROLE4&gt;, &lt;ROLE5&gt; and &lt;ROLE6&gt; --&gt; &lt;ORG_NAME_4&gt; 
  &lt;ROLE7&gt; --&gt; &lt;ORG_NAME_5&gt; Deutschland AG
  </code></pre>
  <p>Another example would be</p>
  <blockquote>
  <p>XXXX dated as of November 28, 2027 among <code>&lt;ORG_NAME_1&gt; A/S</code>, a company incorporated
  under the laws of Australia (the “<code>&lt;ROLE1&gt;</code>”), the Guarantors (as defined herein), <code>&lt;ORG_NAME_2&gt;, N.A., Montreal</code>
  <code>Branch</code>, as <code>&lt;ROLE2&gt;</code>, <code>&lt;ROLE3&gt;</code>, <code>&lt;ROLE4&gt;</code>, <code>&lt;ROLE5&gt;</code>, <code>&lt;ROLE6&gt;</code> and <code>&lt;ROLE7&gt;</code></p>
  </blockquote>
  <p>After processing, desired result should be:</p>
  <pre><code>&lt;ROLE1&gt; --&gt; &lt;ORG_NAME_1&gt; A/S
  &lt;ROLE2&gt;, &lt;ROLE3&gt;, &lt;ROLE4&gt;, &lt;ROLE5&gt;, &lt;ROLE6&gt; and &lt;ROLE7&gt; --&gt; &lt;ORG_NAME_2&gt;, N.A., Montreal Branch
  </code></pre>
  <p>I tried to use PoS, NER but not desired results.</p>
  <ul>
  <li>Played with stanford NLP for NER, but organizations are not detected properly, tried to train my own data but accuracy is not accepted enough. It does not detect all organizations properly and is tagged as <code>OTHER</code> rather. Did not tweak with actual CRF model.</li>
  <li>Played with NLTK python and tried to make some rule around NNP(proper noun) but sometimes roles are detected as verb, sometimes noun and it depends on case also sometimes, so not sure if it is desired approach.</li>
  </ul>
  <p>There are not much varieties in paragraph patterns, I can post 1 or 2 more examples of different patterns if needed. Roles are fixed around 40 and organization would be dynamic.</p>
  <p>Please suggest if I should read out some specific papers or models. Thanks.</p>