Extracting definitions and the text corresponding to the definitionExtracting extension from filename in PythonHow to extract common / significant phrases from a series of text entriesPython Print String To Text FileHow to read a text file into a string variable and strip newlines?Extract file name from path, no matter what the os/path formatHow to extract relationship from text in NLTKextracting relations from textExtracting information from unstructured textExtracting nationalities and countries from textExtracting personal attributes from text

What does Deviance mean in lmer

Is there any way white can win?

Round towards zero

Handwriting Music

How to determine car loan length as a function of how long I plan to keep a car

Is there any practical application for performing a double Fourier transform? ...or an inverse Fourier transform on a time-domain input?

Would it be possible to have a GMO that produces chocolate?

Why did Khan ask Admiral James T. Kirk about Project Genesis?

Most natural way to use the negative with つもり

How do I, an introvert, communicate to my friend and only colleague, an extrovert, that I want to spend my scheduled breaks without them?

Lost property on Portuguese trains

How do thermal tapes transfer heat despite their low thermal conductivity?

Compelling story with the world as a villain

Why do all fields in a QFT transform like *irreducible* representations of some group?

Sum ergo cogito?

Ionization energy of neon vs its cationic counterpart

Did the British navy fail to take into account the ballistics correction due to Coriolis force during WW1 Falkland Islands battle?

Is "The life is beautiful" incorrect or just very non-idiomatic?

Papers on arXiv solving the same problem at the same time

Uri tokenizer as a simple state machine

Why is there so little discussion / research on the philosophy of precision?

Can I get temporary health insurance while moving to the US?

How to find out the average duration of the peer-review process for a given journal?

How to respectfully refuse to assist co-workers with IT issues?



Extracting definitions and the text corresponding to the definition


Extracting extension from filename in PythonHow to extract common / significant phrases from a series of text entriesPython Print String To Text FileHow to read a text file into a string variable and strip newlines?Extract file name from path, no matter what the os/path formatHow to extract relationship from text in NLTKextracting relations from textExtracting information from unstructured textExtracting nationalities and countries from textExtracting personal attributes from text






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I am trying to extract definitions and the text that goes along with that definition.



The definition extraction is relatively easy because they are typically in parentheses and in quotes, so I can run a Regular Expression to find them.



The part I am having trouble with is getting the text that goes along with the definition- it will typically show up before the definition but I don't know how many words will be part of it.



For example:




"(a) The Company has the requisite corporate power and authority to execute and deliver this Agreement, to perform its obligations hereunder and, subject to receipt of the Requisite Company Vote, to consummate the Transactions. The execution, delivery and performance by the Company of this Agreement and the consummation by the Company of the Transactions have been duly authorized by the Company Board and no other corporate action on the part of the Company is necessary to authorize the execution and delivery by the Company of this Agreement, the Plan of Merger and the consummation by it of the Transactions, in each case, subject only to the authorization and approval of this Agreement, the Plan of Merger and the Transactions by way of (i) a shareholders’ special resolution by the affirmative vote of holders of Shares representing at least two-thirds of the voting power of the Shares present and voting in person or by proxy as a single class at the Shareholders’ Meeting, (ii) a shareholders’ resolution by the affirmative vote of holders of Shares representing a majority of the aggregate voting power of the outstanding Shares of the Company and (iii) a shareholders’ resolution by the affirmative vote of holders of a majority of the total outstanding Class A Shares (collectively clauses (i), (ii) and (iii), the “ Requisite Company Vote ”), in each case, in accordance with Section 233(6) of the CICL and the Ninth Amended and Restated Articles of Association of the Company, adopted by special resolution on December 28, 2015 (the “ Company Articles ”). This Agreement has been duly and validly executed and delivered by the Company and, assuming the due authorization, execution and delivery by Parent and Merger Sub, constitutes a legal, valid and binding obligation of the Company, enforceable against the Company in accordance with its terms, subject to bankruptcy, insolvency, fraudulent transfer, reorganization, moratorium and similar Laws of general applicability relating to or affecting creditors’ rights and to general principles of equity (the “ Bankruptcy and Equity Exception ”)."




has three definition we extract- "Requisite Company Vote", "Company Articles" and "Bankruptcy and Equity Exception".



"Requisite Company Vote" looks like the definition should be "collectively clauses (i), (ii) and (iii)" but really should also probably add "of subsection (a)" or I should actually grab the text of clauses (i), (ii), and (iii)



"Company Articles" looks like it should be "Ninth Amended and Restated Articles of Association of the Company, adopted by special resolution on December 28, 2015"



"Bankruptcy and Equity Exception" looks like it should be "bankruptcy, insolvency, fraudulent transfer, reorganization, moratorium and similar Laws of general applicability relating to or affecting creditors’ rights and to general principles of equity"



These are just three examples and I have to build something dynamic enough to be able to handle different types of definitions.



I started by building Noun Phrases using NLTK and a grammar but the NPs don't seem to be capturing everything I need even with testing various different grammars. I thought about using edit distance measurements- potentially by building the string before word by word and testing distance but all things I can think of seem to have their own flaws so I am looking for ideas.










share|improve this question


























  • you need to post some code, what have you tried so far?

    – system123456
    Mar 27 at 17:40

















1















I am trying to extract definitions and the text that goes along with that definition.



The definition extraction is relatively easy because they are typically in parentheses and in quotes, so I can run a Regular Expression to find them.



The part I am having trouble with is getting the text that goes along with the definition- it will typically show up before the definition but I don't know how many words will be part of it.



For example:




"(a) The Company has the requisite corporate power and authority to execute and deliver this Agreement, to perform its obligations hereunder and, subject to receipt of the Requisite Company Vote, to consummate the Transactions. The execution, delivery and performance by the Company of this Agreement and the consummation by the Company of the Transactions have been duly authorized by the Company Board and no other corporate action on the part of the Company is necessary to authorize the execution and delivery by the Company of this Agreement, the Plan of Merger and the consummation by it of the Transactions, in each case, subject only to the authorization and approval of this Agreement, the Plan of Merger and the Transactions by way of (i) a shareholders’ special resolution by the affirmative vote of holders of Shares representing at least two-thirds of the voting power of the Shares present and voting in person or by proxy as a single class at the Shareholders’ Meeting, (ii) a shareholders’ resolution by the affirmative vote of holders of Shares representing a majority of the aggregate voting power of the outstanding Shares of the Company and (iii) a shareholders’ resolution by the affirmative vote of holders of a majority of the total outstanding Class A Shares (collectively clauses (i), (ii) and (iii), the “ Requisite Company Vote ”), in each case, in accordance with Section 233(6) of the CICL and the Ninth Amended and Restated Articles of Association of the Company, adopted by special resolution on December 28, 2015 (the “ Company Articles ”). This Agreement has been duly and validly executed and delivered by the Company and, assuming the due authorization, execution and delivery by Parent and Merger Sub, constitutes a legal, valid and binding obligation of the Company, enforceable against the Company in accordance with its terms, subject to bankruptcy, insolvency, fraudulent transfer, reorganization, moratorium and similar Laws of general applicability relating to or affecting creditors’ rights and to general principles of equity (the “ Bankruptcy and Equity Exception ”)."




has three definition we extract- "Requisite Company Vote", "Company Articles" and "Bankruptcy and Equity Exception".



"Requisite Company Vote" looks like the definition should be "collectively clauses (i), (ii) and (iii)" but really should also probably add "of subsection (a)" or I should actually grab the text of clauses (i), (ii), and (iii)



"Company Articles" looks like it should be "Ninth Amended and Restated Articles of Association of the Company, adopted by special resolution on December 28, 2015"



"Bankruptcy and Equity Exception" looks like it should be "bankruptcy, insolvency, fraudulent transfer, reorganization, moratorium and similar Laws of general applicability relating to or affecting creditors’ rights and to general principles of equity"



These are just three examples and I have to build something dynamic enough to be able to handle different types of definitions.



I started by building Noun Phrases using NLTK and a grammar but the NPs don't seem to be capturing everything I need even with testing various different grammars. I thought about using edit distance measurements- potentially by building the string before word by word and testing distance but all things I can think of seem to have their own flaws so I am looking for ideas.










share|improve this question


























  • you need to post some code, what have you tried so far?

    – system123456
    Mar 27 at 17:40













1












1








1








I am trying to extract definitions and the text that goes along with that definition.



The definition extraction is relatively easy because they are typically in parentheses and in quotes, so I can run a Regular Expression to find them.



The part I am having trouble with is getting the text that goes along with the definition- it will typically show up before the definition but I don't know how many words will be part of it.



For example:




"(a) The Company has the requisite corporate power and authority to execute and deliver this Agreement, to perform its obligations hereunder and, subject to receipt of the Requisite Company Vote, to consummate the Transactions. The execution, delivery and performance by the Company of this Agreement and the consummation by the Company of the Transactions have been duly authorized by the Company Board and no other corporate action on the part of the Company is necessary to authorize the execution and delivery by the Company of this Agreement, the Plan of Merger and the consummation by it of the Transactions, in each case, subject only to the authorization and approval of this Agreement, the Plan of Merger and the Transactions by way of (i) a shareholders’ special resolution by the affirmative vote of holders of Shares representing at least two-thirds of the voting power of the Shares present and voting in person or by proxy as a single class at the Shareholders’ Meeting, (ii) a shareholders’ resolution by the affirmative vote of holders of Shares representing a majority of the aggregate voting power of the outstanding Shares of the Company and (iii) a shareholders’ resolution by the affirmative vote of holders of a majority of the total outstanding Class A Shares (collectively clauses (i), (ii) and (iii), the “ Requisite Company Vote ”), in each case, in accordance with Section 233(6) of the CICL and the Ninth Amended and Restated Articles of Association of the Company, adopted by special resolution on December 28, 2015 (the “ Company Articles ”). This Agreement has been duly and validly executed and delivered by the Company and, assuming the due authorization, execution and delivery by Parent and Merger Sub, constitutes a legal, valid and binding obligation of the Company, enforceable against the Company in accordance with its terms, subject to bankruptcy, insolvency, fraudulent transfer, reorganization, moratorium and similar Laws of general applicability relating to or affecting creditors’ rights and to general principles of equity (the “ Bankruptcy and Equity Exception ”)."




has three definition we extract- "Requisite Company Vote", "Company Articles" and "Bankruptcy and Equity Exception".



"Requisite Company Vote" looks like the definition should be "collectively clauses (i), (ii) and (iii)" but really should also probably add "of subsection (a)" or I should actually grab the text of clauses (i), (ii), and (iii)



"Company Articles" looks like it should be "Ninth Amended and Restated Articles of Association of the Company, adopted by special resolution on December 28, 2015"



"Bankruptcy and Equity Exception" looks like it should be "bankruptcy, insolvency, fraudulent transfer, reorganization, moratorium and similar Laws of general applicability relating to or affecting creditors’ rights and to general principles of equity"



These are just three examples and I have to build something dynamic enough to be able to handle different types of definitions.



I started by building Noun Phrases using NLTK and a grammar but the NPs don't seem to be capturing everything I need even with testing various different grammars. I thought about using edit distance measurements- potentially by building the string before word by word and testing distance but all things I can think of seem to have their own flaws so I am looking for ideas.










share|improve this question
















I am trying to extract definitions and the text that goes along with that definition.



The definition extraction is relatively easy because they are typically in parentheses and in quotes, so I can run a Regular Expression to find them.



The part I am having trouble with is getting the text that goes along with the definition- it will typically show up before the definition but I don't know how many words will be part of it.



For example:




"(a) The Company has the requisite corporate power and authority to execute and deliver this Agreement, to perform its obligations hereunder and, subject to receipt of the Requisite Company Vote, to consummate the Transactions. The execution, delivery and performance by the Company of this Agreement and the consummation by the Company of the Transactions have been duly authorized by the Company Board and no other corporate action on the part of the Company is necessary to authorize the execution and delivery by the Company of this Agreement, the Plan of Merger and the consummation by it of the Transactions, in each case, subject only to the authorization and approval of this Agreement, the Plan of Merger and the Transactions by way of (i) a shareholders’ special resolution by the affirmative vote of holders of Shares representing at least two-thirds of the voting power of the Shares present and voting in person or by proxy as a single class at the Shareholders’ Meeting, (ii) a shareholders’ resolution by the affirmative vote of holders of Shares representing a majority of the aggregate voting power of the outstanding Shares of the Company and (iii) a shareholders’ resolution by the affirmative vote of holders of a majority of the total outstanding Class A Shares (collectively clauses (i), (ii) and (iii), the “ Requisite Company Vote ”), in each case, in accordance with Section 233(6) of the CICL and the Ninth Amended and Restated Articles of Association of the Company, adopted by special resolution on December 28, 2015 (the “ Company Articles ”). This Agreement has been duly and validly executed and delivered by the Company and, assuming the due authorization, execution and delivery by Parent and Merger Sub, constitutes a legal, valid and binding obligation of the Company, enforceable against the Company in accordance with its terms, subject to bankruptcy, insolvency, fraudulent transfer, reorganization, moratorium and similar Laws of general applicability relating to or affecting creditors’ rights and to general principles of equity (the “ Bankruptcy and Equity Exception ”)."




has three definition we extract- "Requisite Company Vote", "Company Articles" and "Bankruptcy and Equity Exception".



"Requisite Company Vote" looks like the definition should be "collectively clauses (i), (ii) and (iii)" but really should also probably add "of subsection (a)" or I should actually grab the text of clauses (i), (ii), and (iii)



"Company Articles" looks like it should be "Ninth Amended and Restated Articles of Association of the Company, adopted by special resolution on December 28, 2015"



"Bankruptcy and Equity Exception" looks like it should be "bankruptcy, insolvency, fraudulent transfer, reorganization, moratorium and similar Laws of general applicability relating to or affecting creditors’ rights and to general principles of equity"



These are just three examples and I have to build something dynamic enough to be able to handle different types of definitions.



I started by building Noun Phrases using NLTK and a grammar but the NPs don't seem to be capturing everything I need even with testing various different grammars. I thought about using edit distance measurements- potentially by building the string before word by word and testing distance but all things I can think of seem to have their own flaws so I am looking for ideas.







python nlp nltk extract






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 17:41







user2183943

















asked Mar 27 at 17:38









user2183943user2183943

327 bronze badges




327 bronze badges















  • you need to post some code, what have you tried so far?

    – system123456
    Mar 27 at 17:40

















  • you need to post some code, what have you tried so far?

    – system123456
    Mar 27 at 17:40
















you need to post some code, what have you tried so far?

– system123456
Mar 27 at 17:40





you need to post some code, what have you tried so far?

– system123456
Mar 27 at 17:40












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55383438%2fextracting-definitions-and-the-text-corresponding-to-the-definition%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55383438%2fextracting-definitions-and-the-text-corresponding-to-the-definition%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript