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

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현