<?xml version="1.0"?><!DOCTYPE article SYSTEM "/project/take/software/searchbench_offline_processing/paperxml_generator/aclextractor/src/python/../resource/dtd/paperxml.dtd"><article><header><firstpageheader><page local="1" global="18"/><title>Corpus Based Classification of Text in Australian Contracts</title><author surname="Curtotti" givenname="Michael"><org  name="Konan University" country="Japan" city="Kobe"/></author><author surname="McCreath" givenname="Eric"><org  name="Konan University" country="Japan" city="Kobe"/></author></firstpageheader><frontmatter><p><b>Corpus Based Classification of Text in Australian Contracts</b></p><p><b>Michael Curtotti</b></p><p>Australian National University Canberra, Australia michael.curtotti@anu.edu.au</p><p><b>Eric Mccreath</b></p><p>Australian National University Canberra, Australia eric.mccreath@anu.edu.au</p></frontmatter><abstract>Written contracts are a fundamental framework for commercial and coopera­tive transactions and relationships. Lim­ited research has been published on the ap­plication of machine learning and natural language processing (NLP) to contracts. In this paper we report the classification of components of contract texts using ma­chine learning and hand-coded methods. Authors studying a range of domains have found that combining machine learning and rule based approaches increases accu­racy of machine learning. We find similar results which suggest the utility of consid­ering leveraging hand coded classification rules for machine learning. We attained an average accuracy of 83.48% on a multi-class labelling task on 20 contracts com­bining machine learning and rule based approaches, increasing performance over machine learning alone. </abstract></header><body><section number="1" title="Introduction"><p>Contracts govern economic transactions and com­mercial or organisational relationships from triv­ial purchases to major national infrastructure projects. Any large organisation (whether private or public) must unavoidably invest significant re­sources in developing and concluding contracts, as the contracts it enters define its legal relations with organisations and individuals with which it inter­acts. As one author has noted, contracts are an integral part of any business enterprise and it is "difficult to overstate their importance to the busi­ness world" (Khoury and Yamouni, 2007, p16). In addition, drafting contracts represents a major eco­nomic activity for the legal industry.</p><p>Ambiguity is an unresolved problem in natu­ral language processing. It is also an important problem affecting the drafting and operation of contracts. The costs of ambiguity in a contract can be enormous. The presence of ambiguity in­creases the risk of litigation, project failure and loss of commercial relationships. Instances of lit­igated ambiguity are used in drafting manuals as instructional tales for the unwary drafter (Aitken and Butt, 2004, p37).</p><p>Our future research goal is to investigate ap­proaches that will help identify such ambiguity, however, a precursor for addressing the problem of ambiguity is accurate labelling or classification of the constituent parts of contract documents.<footnote anchor="1"/> In this paper we report work on classifying 'lines' in contracts into 32 classes. We compare three dif­ferent classification approaches in order to deter­mine which approach may provide the best per­formance with respect to this task: supervised machine learning; a hand-crafted rule based tag­ger; or combining hand-crafted rules based tag­ging with machine learning.</p></section><section number="2" title="Background"><p>Natural language processing involves applying a pipeline of transformations to text. A typical first step is to segment the text into its sentences, af­ter which further processing is applied (Jurafsky and Martin, 2009, p 69). This works well in usual English prose, but is not necessarily well suited to contracts because of the heavy use of layout to em­body structure and semantics. In a contract, a sen­tence may occur within a single paragraph of text, or may be spread over several line breaks due to the use of sub-paragraphing as an aid to compre­hension. Such sub-paragraphs may embody dis­junctive or conjunctive conditions associated with</p><footnote label="1">This task can also be thought of as a document segmen­tation task, although we here consider it as a classification exercise.</footnote><p>Michael Curtotti and Eric McCreath. 2010. Michael Curtotti and Eric McCreath. In <i>Proceedings of Australasian Language Technology Association Workshop, </i>pages 18—26<page local="2" global="19"/></p><p>a rule. A 'clause'<footnote anchor="2"/> is the typical structural unit which embodies a legal rule or set of rules. Some­times clauses are organised into sub-clauses and clauses and sub-clauses may be numbered in hier­archical fashion (e.g. 1, 1.1, (a), (i), (A))(Aitken and Butt, 2004, pp 23, 27). Line breaks often occur immediately before data such as headings, clauses, sub-clauses, party names, dates or execu­tion blocks. Being able to label a line as to its char­acter, key content or function thus enriches avail­able information for later NLP. The line is thus a valuable starting point for applying NLP.</p></section><section number="3" title="Related Work"><p><b>3.1   Classification and Segmentation of Contracts and Legislative Documents</b></p><p>There would appear to be little published work on the application of natural language process­ing (NLP) or machine learning specifically for the classification of text in legal contracts. An excep­tion to this is (Indukuri and Krishna, 2010) who apply a support vector machine over feature vec­tors extracted from contract clauses. These feature vectors are comprised of n-grams up to size n = 4. They classify contract sentences as clauses or non-clauses and then sub-classify clauses as concerned with payment terms or not. Indukuri and Krishna note the lack of published work on classification of sentences in contract documents for workflow and monitoring purposes.</p><p>While also limited, there has been some work on segmentation or classification of legislative cor­pora using machine learning. (Mencfa, 2009) re­ports 100% precision and recall in machine learn­ing on classification of legislation into articles, sections and parts (although to a task for which he is able to craft an equally accurate regular expres­sion based segmenter). (Bacci et al., 2009) auto­matically classify plain text legislative documents for the purpose of XML mark up. (Francesconi, 2006), on whose work Bacci et al. build, describes four separate modules for dealing with plain text legacy content which they are seeking to convert to XML tagged text. (Hasan et al., 2008) carry out segmentation of Spanish legislative bulletins using the table of contents as an aid to segmenta­tion. This work, in the legislative field, provides a parallel application domain for the work under­taken here in respect of contracts, although it is generally true that legislation will tend to conform to far tighter stylistic rules, because of the central control of legislative drafting.</p><footnote label="2">The term 'clause' here refers to a legal rule or rules ap­pearing in a contract, rather than the linguistic entity.</footnote><subsection number="3.2" title="Combining Machine Learning and Hand Coded Approaches"><p>A number of researchers have combined hand-coded approaches and machine learning to pro­duce better overall results.</p><p>(Kipp, 2006) augments handcrafted rules with machine learnt rules for gesture generation.</p><p>(McCreath and Kay, 2003) used such a com­bined approach to improve performance on cate­gorizing emails.</p><p>(Park and Zhang, 2003) address the problem of text chunking for the Korean language, combining hand-crafted rules with a memory based machine learning method. A rule based method is used to determine whether an instance may constitute an exceptional case, with machine learning used to correct classifications assigned by the rule based method. They report up to a 2.83% improvement in F-scores over memory-based learning alone.</p><p>(Rochery et al., 2002) report the use of hand­crafted rules to enhance the accuracy of machine learning utilising boosting. They apply the method to a multi-labelling classification problem where they are seeking to classify spoken utterances. They attribute increased accuracy to the fact that the rules they develop are not represented in their data at all or do not appear sufficiently to have sta­tistical impact during the training process. They note that the combination has the greatest effect when there are less then 100 examples, with the benefit of the combination decreasing as the num­ber of training examples increases. The method therefore has direct applicability to reducing the data requirement for machine learning (a costly as­pect of supervised machine learning).</p><p>(Takahashi et al., 2005) utilise a combination of SVM based learning and hand-crafted rules for the task of classifying occupations from social sur­veys. They effect a combination by using rule de­rived labels as features for the machine learner. Again the work occurs in a multi-class labelling context (with around 200 occupation codes). They find that SVM approaches are superior to rule-based approaches alone but that combining rule-based and SVM learning produces the best results. They also examine the effect of the number of training examples, noting that the differential benefits of combining methods reduces with increas­ing data.<page local="3" global="20"/></p><doubt alpha="0.0" length="2" tooSmall="False" monospace="0.0">19</doubt><p>In our study we use class labels assigned by a hand-coded tagger as additional features for ma­chine learning to obtain an increase in accuracy in the domain of text classification.</p><p>The work reported above, and our own paper, come from diverse domains and illustrate the ap­plication of combined rule/ML approaches using a variety of machine learning algorithms.</p><p>This suggests the wide utility of using hand-coded rules to improve accuracy of machine learn­ing. Symetrically we may say that machine learn­ing may potentially be used to improve the accu­racy of hand-coded rules. Here we essentially fol­low a hybrid model of development that examines each method separately as well as in combination.</p><doubt alpha="66.7" length="6" tooSmall="False" monospace="0.0">4 Data</doubt></subsection><subsection number="4.1" title="Australian Contract Corpus"><p>The data which forms the basis of this study is a corpus of 256 contracts ('the Australian Contract Corpus') which has been compiled from the web using the Google Australia web search: http: //www.google.com.au.3 The corpus is con­stituted of 1043364 tokens (words and punctua­tion), 42910 sentences, and a vocabulary of 14217. The lexical diversity of this corpus is 73.39.<footnote anchor="4"/> As far as we are aware there is no published work based on a corpus of Australian contract language, however space does not permit a fuller discussion of the design and analysis of the corpus.</p></subsection><subsection number="4.2" title="Data Representation"><p>For the purpose of this study we randomly selected 30 contracts from the Australian Contract Corpus to produce data sets for application of machine learning. The 30 contracts were divided into three sets: a training set (Set A)<footnote anchor="5"/>, a second set (Set B)<footnote anchor="6"/>(primarily used as a test set, although sometimes combined with Set A to form a larger training set) and an additional test set (Set C)<footnote anchor="7"/>, each of 10 con­tracts. Set C was added to increase both available data and the number of contracts on which testing could be carried out.</p><footnote label="3">The search phrase we employed was: "clause party agreement" , limiting the search to "pages from Australia" and the filetype to ".doc". The collection of the corpus was undertaken in the period 6 - 24 December 2009. Each doc­ument was visually inspected by one of the authors to verify that it was an Australian contract and documents were added to the corpus in order of their appearance in Google search results. We have made available the list of URLs of the docu­ments that make up the corpus at: http://cs.anu.edu . au/people/Michael.Curtotti/. We also make code and data referred to in this paper available at the same loca­tion.</footnote><footnote label="4">Lexical diversity refers to the ratio of the total number of tokens in the corpus to the total number of types of tokens i.e. tokens/vocabulary. The statistics and information provided here were extracted using the NLTK. (Bird et al., 2009).</footnote><p>To simplify processing all contracts were con­verted into text files as a preprocessing step.<footnote anchor="8"/> Also we removed material that typically does not ap­pear in contracts (primarily guideline notes for drafters).</p><p>For purposes of our study each 'line' or 'para­graph' in a contract constituted a data point. Sets A, B and C provided 1825, 2157 and 2231 lines/data points, respectively.</p><p>To classify our data for machine learning we first employed our hand-coded tagger to produce a labelled data set constituted of a line and pri­mary and secondary labels according to our clas­sification system (see below). The classifications applied by the hand-coded tagger were then manu­ally corrected to remove any labelling errors. Both for the reason that hand tagging data from scratch is more error prone than correcting previously ma­chine tagged data, and because of the high labour in manual tagging, machine assisted tagging is a standard method used in corpus creation (Biber et al., 1998, p 262), ((ed) Christopher S. Butler, 1992, p 131).</p></subsection><subsection number="4.3" title="Feature Selection"><p>Features were then extracted from our labelled lines using a hand-coded feature extractor to ex­tract up to 40 features to be used for machine learning, with the primary class label earlier ap­plied to each line serving as the target for machine learning.<footnote anchor="9"/> Features for machine learning were se­lected based on assumed relevance to the intended classification.<footnote anchor="10"/> While a bag of word representation with automatic feature extraction was trialed, this was found to result in lower accuracy than a manually selected (but small) number of fea­tures.<page local="4" global="21"/> Traditionally, 'feature engineering' or 'se­lection' in text classification has focussed on 'bag of words' or proximate features such as n-grams or noun phrases (Scott and Matwin, 1999). Our selection of features might be regarded as 'hybrid' in that they implicitly encode domain knowledge and 'rules'. For example, we expect a definition line to contain the widely used word 'means' as in 'x means y'. We would expect clause headings to display a different pattern of parts of speech occur­rence, as compared to clauses themselves. We also consider features such as the relationship between the particular line/datapoint and its neighbouring lines (e.g. is the preceding line long or short), or the document as a whole (e.g. relative placement of the line within the document).</p><footnote label="5">Contracts numbered in our corpus: 55, 74, 77, 91, 94, 144, 174, 185, 208 and 213</footnote><footnote label="6">Contracts 11, 12, 164, 193, 196, 199, 249, 59, 64, 9 7 Contracts 200, 254, 175, 180, 120,102, 207, 127, 75 and</footnote><doubt alpha="0.0" length="2" tooSmall="False" monospace="0.0">79</doubt><footnote label="8">Notably, this step does have the downside of discarding valuable style and layout information found in the word doc­ument format.</footnote><footnote label="9">In some instances the assignment of class is not entirely disjunctive and implies a priority ordering of potential classi­fications. For instance a clause may contain address details, and be classified as such rather than as a clause. The feature extractor removed secondary labels.</footnote><footnote label="10">The full list of features is as follows: 1. relative position of a line within the contract; 2. line end punctuation; 3. num-</footnote><doubt alpha="0.0" length="2" tooSmall="False" monospace="0.0">20</doubt><p>Features used in the related work carried out by others on contracts and legislation include: n-grams (Indukuri), bag of word together with capi­talisation and character patterns (Mencia), the use of sequential word and token data as a HMM to predict state where state is the classification of the portion of text (Bacci/Francesconi) and the use of word terms identifying titles and lists of indexed terms (Hasan).</p></subsection><subsection number="4.4" title="Classes"><p>We adopted 32 classes for our classification scheme.   These classes represented significant</p><p>bering at the beginning of the line; 4. line length in charac­ters; 5. line length in tokens; 6. number of nouns; 7. number of adjectives; 8. number of verbs; 9. number of preposi­tions; 10. number of coordinating conjunctions and cardinal numbers;11. numberofmodalverbs;12. numberofpersonal pronouns, possessives;13. numberofadjectives;14. whether must occurs; 15. whether may occurs; 16. whether shall oc­curs; 17. whether means occurs;18. the position of the word means in the line; 19. whether the word 'include' occurs; 20. the position of the word 'includes' in the line; 21. whether the phase 'has the same meaning' occurs; 22. whether the line begins with a capital letter followed by a stop or a space; 23. do the letters 'abn' or 'acn' appear; 24. does the word ad­dress appear near the beginning of the line; 25. does the word 'contact' appear near the beginning of the line; 26. does the word 'email' appear near the beginning of the line; 27. does the word 'fax' appear near the beginning of the line; 28. does the word 'note' appear at the beginning of the line; 29. does the word 'phone' appear at the beginning of the line; 30. do the terms 'web' or 'www' appear near the beginning of the line; 31-36. token lengths of 3 lines before and after the data line; 37. the tag applied by the hand coded tagger to the data line; 38. whether the contract from which the line comes has clause headings; 39. whether the contract from which the line comes has clause sub-headings; 40. whether the contract has a schedule.</p><p>structural elements (such as clause headings or content lines) or sometimes key contract meta data (for instance the parties, the date on which an agreement is made, email addresses, ABNs etc).<footnote anchor="11"/>Of particular interest to us, was an ability to accu­rately identify clausematter (the primary location of legal rules of a contract) and clause headings (which in some contracts effectively mark bound­aries between major rule sets).</p></subsection></section><section number="5" title="Experimental Evaluation"><p>Analysis of our data sets was carried out using two major methods: analysis using the training Set A measuring peformance on test Set B (i.e. testing for accuracy of classification of lines in Set B); and analysis using training Set A where each contract in test Sets B and C was used individually as a test set (testing for accuracy of classification of lines of each individual contract). The former testing approach is more widely used but the latter is more consistent with our intended end application: that is, developing an ability to accurately classify lines in a previously unseen contract as an individual document.</p><p>Set A consisted of 1825 lines of data, Set B con­sisted of 2157 lines of data and Set C consisted of 2231 lines of data.</p><subsection number="5.1" title="Tools"><p>The following tools were used to carry out ma­chine learning tasks reported in this paper:</p><p>1. the <i>python </i>programming language was used to develop a hand coded line tagger, a feature extractor and code for evaluation of the per­formance of the hand coded tagger;</p></subsection></section><section number="2." title="the Natural Language Toolkit (NLTK)(Bird"><p>et al., 2009) was used in corpus development and in the hand coded tagger for application of parts of speech tags; and</p><p>3. the Weka data mining software(Hall et al., 2009) was used to carry out machine learn­ing.</p><footnote label="11">The following class labels were applied: CLAUSE-MATTER,   CLAUSEHEAD,   DEF, CONTENTSHEAD,</footnote><p>BLANK, DROSS, AND, BETWEEN, DATEMADE-LINE, PARTIESHEAD, PARTYLINE, RECITALHEAD, RECITALLINE, HEAD, CONTENTLINE, PRELIM, OP-ERATIVEPROVISIONLINE, NUMBEREDLINE, SCHED-ULEHEAD, SCHEDULEITEM, EXECUTIONBLOCK, NOTE, ABNLINE, ADDRESSLINE, EMAILLINE, WEBLINE, FAXLINE, PH-LINE, REF-LINE, SCH­OTHERMATTER, CONTACTOFFICER, TITLELINE.</p><doubt alpha="0.0" length="2" tooSmall="False" monospace="0.0">21</doubt><page local="5" global="22"/><subsection number="5.2" title="Hand-Coded Tagger"><p>Our hand-coded tagger follows a pipeline method­ology. A contract is separated into a list of lines. In the first phase, each line is passed through a series of "if-then-else" routines (essentially utilising reg­ular expressions) to assign primary and secondary labels to the line. This produces a contract with enhanced information content, in the form of a tu­ple of labels and line text. This output is then fed through a series of methods, progressively boot­strapping improvements to labelling, based on the information available when the method is applied. For instance content lines will be identified, these are then used in later methods to seek to identify clause headings. In addition, the tagger extracts contract meta data such as: a list of definitions, a list of clause headings, where the beginning of operative provisions occurs, where the schedule begins. Such features may or may not occur in a contract. In addition the tagger also provided a method for hand correcting tagging which was used to create our data set for supervised machine learning purposes.</p><p>Development of the tagger relied heavily on do­main knowledge to identify logical tests for label application. For instance the occurrence of num­bering at the beginning a line was used to identify clause headings, or the presence of a common text pattern which occur in definitions i.e. (the pattern <i>["word[1-3]] means [...]" </i>was used as a criterion for identifying a line as a definition).</p><p>The first row of Table 1 reports accuracy of the hand coded tagger when applied to Set B as the test set (the % accuracy of tagging of individual lines in Set B is reported). The second row of Table 1 reports average accuracy with which the lines in each of 20 contracts in Sets B and C are tagged (standard deviation is also reported). The high variance of the results at a contract by con­tract level suggests a need for future work to iden­tify if issues such as contract 'type' may account for the differences (the lowest level of accuracy was around 50% and the highest around 95%).</p><table caption="Table 2 provides measures of precision, recall and F-measure attained by the hand coded tag-"></table><p>ger on Set B for key data items: clause headings, clauses themselves and definitions.<footnote anchor="12"/> These re­sults on key measures are sufficient for our ini­tial purposes and will allow us to focus subsequent work on addressing ambiguity in the substantive rules found in a contract.</p></subsection><subsection number="5.3" title="Supervised Machine Learning"><p>Column 1 of Table 3 reports the accuracy of var­ious supervised machine learning algorithms with Set A as training set and Set B as test set. Of the algorithms applied, Random Forest (imple­mented using 100 trees and 30 random features) performed best. No ML method performed better than the hand coded tagger tested on the same test set (see row 1 of Table 1).</p></subsection><subsection number="5.4" title="Machine Learning vs Hand-coded methods"><p>Given our ultimate focus on developing applied tools, we are primarily concerned to identify the best methods to maximise the accuracy of our clas­sification task. Whether this proves to be ma­chine learning methods or hand-coded methods or a combination of the two is immaterial from this viewpoint (other than in regard of development costs).</p><p>Also it is useful to consider whether methods and insights from one method may assist in the other. For instance, hand-coded rules that success­fully labelled lines directly suggested 'features' to be extracted for machine learning purposes. Con­versely the identification of 'features' for machine learning can be regarded as a programming ab­straction where the algorithm is 'under the hood' but human intervention is required in the form of feature selection for 'learning' to occur (implic­itly encoding of rules in the feature set). In de­riving our results we used a confusion matrix as a tool to assist in identifying areas where the hand-</p><p>, and F-Measure</p><p>Precision is <b><i>TP+FP ' </i></b><b><i>"^"^</i></b><b><i> </i></b><b><i>ikJ</i></b><b><i> TP</i></b>+FN' is P+R, where TP is true positives, <i>FP </i>is false positives, <i>FN</i><i> </i>is false negatives, P is precision, and <i>R</i><i> </i>is recall.</p><doubt alpha="0.0" length="2" tooSmall="False" monospace="0.0">22</doubt><table caption="Table 2: Performance results for Hand-Coded Line Tagger" class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p>Precision</p></td><td class="cell"><p>Recall</p></td><td class="cell"><p>F-Measure</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>CL.HEAD</p></td><td class="cell"><p>0.98</p></td><td class="cell"><p>0.83</p></td><td class="cell"><p>0.89</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>CL.MATTER</p></td><td class="cell"><p>0.91</p></td><td class="cell"><p>0.91</p></td><td class="cell"><p>0.91</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>DEF</p></td><td class="cell"><p>1.00</p></td><td class="cell"><p>0.66</p></td><td class="cell"><p>0.80</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><table caption="Table 1: Accuracy of Line Tagger." class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p></p></td><td class="cell"><p><i>x s</i></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>On Set B Contracts Contract x Contract</p></td><td class="cell"><p>86.27% NA 82.84% 10.85%</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><page local="6" global="23"/><p>coded tagger required improvement and as a com­mon baseline for performance. In certain forms of machine learning, the resulting machine learn­ing model can be represented as code in "if, then, else" form(as inthe outputofadecisionlistorde-cision tree learner). We may thus conceive of ma­chine learning and hand coding of rules as differ­ent 'programming paradigms' - a perspective that encourages us to apply insights across the bound­ary between them.</p><p>Further, we wished to explore the relative accu­racy of machine learning vs hand coding for this particular task. Such an exploration is valuable from a cost benefit point of view. Supervised ma­chine learning (where we have focused our atten­tion) requires the production of human annotated data (which is costly to produce) as well as fea­ture testing and refinement. Also machine learn­ing may be computationally intensive. Production of an accurate hand-coded tagger requires expert knowledge and considerable testing and code re­finement in order to achieve a high level of ac­curacy (which again is resource intensive). We did not undertake quantitative data collection in respect of time employed in the two methods, particularly as we followed an iterative develop­ment model that switched between rule based and machine learning focussed work and as we were searching for optimal outcomes. Nonetheless we anecdotally report that each method presented sig­nificant demands in terms of development time.</p><p>In the results reported above we note that no machine learning approach alone exceeded the performance of the hand coded tagger when con­sidering performance on test Set B as a whole. This is the result also found at contract by contract level (see below Table 4).</p></subsection><subsection number="5.5" title="Leveraging Hand-Coded Labels for Machine Learning"><p>As noted above we also wished to explore whether utilising the output from the hand coded tagger as input features for machine learning might im­prove the accuracy of machine learning alone. A converse question that could be framed is whether the rule based tagger's performance could be im­proved by combination with machine learning.</p><p>We carried out two trials that bear on these ques­tions:</p><p>1. machine learning alone and machine learning enhanced with rule based input on an entire</p><doubt alpha="66.7" length="21" tooSmall="False" monospace="0.0">test set (Set B); and</doubt><p>2. machine learning alone, rule alone and ma­chine learning enhanced with rule based in­put at contract by contract level.</p><p>Column 2 of Table 3 shows the improvement in performance of various machine learning methods when tags applied by the hand coded tagger were provided as input features. All methods show im-provementwithadditionoftherulederivedfeature on Set B as a whole.<footnote anchor="13"/></p><p>We report below a comparison of accuracy of machine learning, rule based tagging and a com­bination of both in respect of Decision Trees. De­cision trees offer the advantage that the output is easily interpretable as a rule set for tagging.</p><p>Although the results reported in Table 4 are different (as different contracts are included in the tested contracts)<footnote anchor="14"/> average accuracy continued to show a differential between machine learning alone, and machine learning leveraged with hand rules, as described above. On this combination ML + Rule also outperformed the rule based tag­ger alone, but by a very narrow margin. In 17 of 20 cases ML + Rule improved or did not worsen performance ofMLalone. In15 of20 cases, ML+ rule was no worse or outperformed the hand coded tagger alone.<page local="7" global="24"/> Notably variation is quite high as compared to the mean. Testing for statistical sig­nificance we can reject a null hypothesis that the mean accuracy for ML + Rule is the same as for ML alone. We cannot reject a null hypothesis that ML + Rule is the same as Rule alone.<footnote anchor="15"/> We note also that this investigation was only carried out in respect of the decision tree learner.</p><footnote label="13">The training set for the results reported in Table 3 was Set A. The test set was Set B.</footnote><footnote label="14">The training set was Set A. Sets B and C provided 20 individual contracts (effectively 20 test sets) for testing.</footnote><doubt alpha="0.0" length="2" tooSmall="False" monospace="0.0">23</doubt><table caption="Table 3: Comparative Performance ML alone and ML + Rule on train and test set" class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>ML Algorithm</p></td><td class="cell"><p>ML Alone   ML + Rule</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>Naive Bayes SMO (SVM) Cl. via Regression Decision Tree Bagging Majority Vote Random Forest</p></td><td class="cell"><p>82.38% 84.75% 82.80% 85.40% 83.91% 87.07% 82.01% 87.02% 83.54% 87.76% 84.42% 87.11% 85.12% 86.69%</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><table caption="Table 4: Tagging Accuracy Mean and Standard Deviation - Contract by Contract" class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>Method</p></td><td class="cell"><p>x</p></td><td class="cell"><p><i>s</i></p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>ML Alone Rule Alone ML + Rule</p></td><td class="cell"><p>79.12% 82.84% 83.48%</p></td><td class="cell"><p>10.71% 10.85% 9.83%</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table><p><b>5.5.1   Is it more effective to increase data or use rule based features?</b></p><p>To further explore the question of how much ef­fort might be saved by combining rule based ap­proaches with machine learning alone we tested the effect of adding random noise to the feature set provided by the hand coded tagger. We found that we had to randomly flip over 45% of these tags before they ceased to impact positively on classification accuracy. This suggests that even poorly prepared hand coded rules can improve per-formance.<footnote anchor="16"/></p><p>We also tested the effect of incrementally in­creasing the amount of available training data to explore any decrease in differential in perfor­mance. Testing using Set C as the test set and taking training data from Sets A and B, we pro­gressively increased training data by increments of 500 instances of data. Differential performance decreases progressively, starting around 5% and reducing to 2.5% as more training data is made available.<footnote anchor="17"/> (See Table 5.) Extrapolating from these figures we would expect at a minimum that training data would have to be doubled to remove differential accuracy. Relatively little effort in de­veloping rule based features may substitute for considerable work in creating additional super­vised data.</p><footnote label="15">We gratefully acknowledge the assistance of Bob For­rester of the ANU Statistical Consulting Unit in deriving this result, undertaken utilising a generalised linear model to undertake model fitting adjusting for different file (con­tract) types. Predictions of estimated mean proportions were: ML Alone 0.7760 (s.e. 0.007181), Rule alone 0.8106 (s.e. 0.006775), ML+ Rule 0.8181 (s.e. 0.006677).</footnote><footnote label="16">Using a Decision Tree, ML + Rule accuracy on testSetB with training Set A, was 87.0% with zero noise, 86.9% with 5% noise, 84.7% with 10% noise, 85.2% with 20% noise,</footnote><doubt alpha="40.7" length="54" tooSmall="False" monospace="0.0">84.4% with 30% noise, 83.9% with 40% noise, 82.8% with</doubt><doubt alpha="66.2" length="154" tooSmall="False" monospace="0.0">45% noise, 82.4% with 50% noise. Decision Tree accuracy on ML alone on this training and test set was 82.0%.17The data has a negative correlation of -0.70</doubt><p>Table 5: Difference in % accuracy of ML alone and ML with rule based feature with increasing training data.</p><subsubsection number="5.5.2" title="Decision tree output"><p>An examination of the decision tree produced af­ter adding the output of the hand-coded tagger to machine learning is of interest.</p><doubt alpha="64.3" length="42" tooSmall="False" monospace="0.0">LTlabel = #CLAUSEMATTER# |   tknLngth &lt;= 4</doubt><doubt alpha="43.3" length="60" tooSmall="False" monospace="0.0">||  nounNum &lt;= 1:   #CLAUSEMATTER# (6.0/2.0) ||  nounNum &gt; 1</doubt><doubt alpha="35.2" length="142" tooSmall="False" monospace="0.0">|||   linePos.   &lt;= 0.383929:   #PRELIM# (2.0) |||   linePos.   &gt; 0.383929:   #CLAUSEHEAD# (2.0) |   tknLngth &gt; 4:  #CLAUSEMATTER# (508.0/7.0)</doubt><p>LTlabel = #PH-LINE#</p><doubt alpha="38.2" length="34" tooSmall="False" monospace="0.0">|   prepNum &lt;= 1:  #PH-LINE# (5.0)</doubt><doubt alpha="54.3" length="35" tooSmall="False" monospace="0.0">| prepNum &gt; 1: #CLAUSEMATTER# (2.0)</doubt><doubt alpha="62.9" length="62" tooSmall="False" monospace="0.0">LTlabel = #EMAILLINE#:   #EMAILLINE# (3.0) LTlabel = #ABNLINE#</doubt><doubt alpha="38.1" length="42" tooSmall="False" monospace="0.0">|   preLine2 &lt;= 0:   #TITLELINE# (2.0/1.0)</doubt><doubt alpha="45.2" length="31" tooSmall="False" monospace="0.0">| preLine2 &gt; 0: #ABNLINE# (3.0)</doubt><p>Figure 1: Part of the decision tree learnt when the labels from the hand-coded are provided as an at­tribute.</p><p>Using only the machine learning feature set, the size of the pruned tree is 199 with 108 leaves. After addition of labels provided by our hand-coded tagger the size of the decision tree is re­duced to 105 with 69 leaves. Figure 1 shows part of this decision tree and as illustrated, the deci­sion tree generally begins with the label assigned by the hand-coded tagger 'LTlabel' and amends the label (where necessary) utilizing other fea­tures available to the machine learner. Some labels (e.g. EMAILLINE) were simply adopted without change. In the case of the CLAUSEMATTER la­bel, the machine learner used the number of to­kens in the line ('tknLngth'), number of nouns in the line ('nounNum') and the relative position of the line in the contract ('linePos.') to re-assign the class of the line. The significance of the use of la­bels assigned by the hand-coded tagger is that the decision-tree identifies that attribute as providing the most significant information gain (that is re­duction in entropy) and therefore partitions on that feature (Callan, 2003, p245). This remains true in this example irrespective of the class to which the data is being assigned.<page local="8" global="25"/><footnote anchor="18"/> It is obvious that the best feature for assigning the correct label for an item of data is the correct or probably correct la­bel (if one can obtain it without undue endeavour). From a practical viewpoint some effort directing to hand-crafting code to extract appropriate class labels may thus assist machine learning.</p><doubt alpha="0.0" length="2" tooSmall="False" monospace="0.0">24</doubt><table class="main" frame="box" rules="all" border="1" regular="False"><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>Data</p></td><td class="cell"><p>0.5</p></td><td class="cell"><p>1K</p></td><td class="cell"><p>1.5</p></td><td class="cell"><p>2K</p></td><td class="cell"><p>2.5</p></td><td class="cell"><p>3K</p></td><td class="cell"><p>3.5</p></td><td class="cell"><p>4K</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"><p>Diff.</p></td><td class="cell"><p>5.1</p></td><td class="cell"><p>3.4</p></td><td class="cell"><p>5</p></td><td class="cell"><p>4.2</p></td><td class="cell"><p>3.3</p></td><td class="cell"><p>3.1</p></td><td class="cell"><p>3.9</p></td><td class="cell"><p>2.6</p></td><td class="cell"></td></tr><tr class="row"><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td><td class="cell"></td></tr></table></subsubsection></subsection></section><section number="6" title="Conclusions and Future Work"><p>In terms of the overall performance of the methods described in this paper the closest point of compar­ison is the work reported by Indukuri and Krishna (Indukuri and Krishna, 2010). While comparisons using different methods, software and data are of dubious validity, we may note their broad similar­ity. With a training set of 10 contracts and a test set of 20 contracts, the contract-by-contract average F-measure for the clausematter class was 0.8632. Also in 14 contracts of the 20 tested the F-measure for the clausematter class was above 0.85. With a training set of 10 contracts (Set A) and a test set of 10 contracts (Set B) (as a single test set) the F-measure for the clausematter class was 0.921.<footnote anchor="19"/>Using 4-grams as features, Indukuri and Krishna report an accuracy of 83.48% on the task of clas­sification clauses from non-clauses, applied to 73 sentences to be so classified. Whereas the task in that case was a binary classification task over one contract, we report results on multi-class classifi­cation over test sets of up to 20 contracts.<footnote anchor="20"/></p><p>The work we have undertaken and related work reviewed in this paper (Section 3) suggests the po­tentially broad utility of combining rule based and machine learning methods. One potential hybrid classification method in its simplest formulation may look something like this:</p><p>1. determine the required or anticipated level of accuracy for the intended application;</p><p>2. develop a simple code rule set for the classifi­cation task (i.e. with minimal expenditure of resources);</p><p>3. if classification accuracy is sufficient ma­chine learning would not be required, if not proceed as usual in development of machine learning using the output of hand coded rules as an input to machine learning.</p><footnote label="18">The Weka decision tree implementation, "J.48", is based on the Quinlan's C4.5(Quinlan, 1986).</footnote><footnote label="19">The results reported here are derived using a random for­est algorithm and using the hand coded tag as an input feature for classification.</footnote><footnote label="20">Coincidentally the 83.48% figure is the same as our av­erage result over all classes for 20 contracts.</footnote><p>Such a development model does not avoid the de­velopment of a supervised training set, as such a set is required both to assess the accuracy of the rule based tagger as well as the machine learner (should development proceed to that stage). How­ever it may reduce the amount of data required to attain a desired level of accuracy. The method could of course be applied iteratively, if the accu­racy level is insufficient after a first iteration.</p><p>Future work to be explored includes the effec­tive "typing" of contracts (particularly in light of the high variance of performance on individual contracts). For instance, some contracts use clause headings, others do not. Some use schedules, oth­ers do not, etc. Such type information may fur­ther assist in the classification task (the accuracy of which varies considerably depending on the con­tract to which it is applied). In typical preprocess­ing, documents in corpora are converted to plain text. This results in the loss of layout and hierar­chical information found in word documents. The preservation of such information for use in classi­fication tasks may improve accuracy.</p><p>The preliminary work here is also a precursor to work on identification of ambiguity and the devel­opment of practical tools to assist in contract draft­ing. In separate work, we intend also to describe and analyse the contract corpus that is referred to here as the basis of this work.</p></section><references><p>J. K. Aitken and P. Butt. 2004. <i>Piesse The Elements of Drafting. </i>Lawbook Co, 10th edition.</p><p>L. Bacci, P. Spinosa, C. Marchetti, R. Battistoni, I. Flo­rence, I. Senate, and I. Rome. 2009. Automatic mark-up of legislative documents and its application to parallel text generation. In <i>Proc. ofLOAIT Work­shop, </i>pages 45-54.</p><p>D. Biber, S. Conrad, and R. Reppen. 1998. <i>Corpus lin­guistics: Investigating language structure and use. </i>Cambridge University Press.</p><p>Steven Bird, Edward Loper, and Ewan Klein. 2009. <i>Natural Language Processing with Python. </i>O'Reilly Media Inc.</p><p>Rob Callan. 2003. <i>Artificial Intelligence. </i>Palgrave Macmillan.</p><doubt alpha="0.0" length="2" tooSmall="False" monospace="0.0">25</doubt><page local="9" global="26"/><p>(ed) Christopher S. Butler. 1992. <i>Computers and writ­ten texts. </i>Blackwell.</p><p>E. Francesconi. 2006. The Norme in Rete Project: Standards and Tools for Italian Legislation. <i>Interna­tional Journal Legal Information, </i>34:358.</p><p>Mark Hall, Eibe Frank, Geoffrey Holmes, Bernhard Pfahringer, Peter Reutemann, and Ian H. Witten.</p><p>2009. The weka data mining software. <i>SIGKDD</i> <i>Explorations, </i>11(1).</p><p>I. Hasan, J. Parapar, and R. Blanco. 2008. Seg­mentation of legislative documents using a domain-specific lexicon. In <i>Proceedings of the 19th Interna­tional Conference on Database and Expert Systems Application, </i>pages 665-669.</p><p>Kishore Varma Indukuri and P. Radha Krishna. 2010. Mining e-contract documents to classify clauses. In <i>COMPUTE '10: Proceedings of the Third Annual ACM Bangalore Conference, </i>pages 1-5, New York, NY, USA. ACM.</p><p>Daniel Jurafsky and James H. Martin. 2009. <i>Speech and Language Processing: An introduction to natu­ral language processing, computational linguistics, and speech recognition. </i>Pearson Prentice Hall, 2nd edition.</p><p>D. Khoury and Y. S. Yamouni. 2007. <i>Understanding Contract Law. </i>Lexis Nexis Butterworths, 7th edi­tion.</p><p>M. Kipp. 2006. Creativity meets automation: Combin­ing nonverbal action authoring with rules and ma­chine learning. In <i>Intelligent Virtual Agents, </i>pages 230-242. Springer.</p><p>Eric McCreath and Judy Kay. 2003. Iems: Helping Users Manage Email. <i>User Modeling 2003, </i>pages 146-146.</p><p>Eneldo Loza Mencfa. 2009. Segmentation of legal documents. In <i>Proceedings ofthe 12th International Conference on Artificial Intelligence and Law, </i>pages 88-97. ACM.</p><p>Seong-Bae Park and Byoung-Tak Zhang. 2003. Text chunking by combining hand-crafted rules and memory-based learning. In <i>Proceedings of the 41st Annual Meeting on Association for Computational Linguistics, </i>pages 497-504.</p><p>J.R. Quinlan. 1986. Induction of decision trees. <i>Ma­chine Learning, </i>1:81-106.</p><p>M. Rochery, R. Schapire, M. Rahim, N. Gupta, G. Ric-cardi, S. Bangalore, H. Alshawi, and S. Douglas. 2002. Combining prior knowledge and boosting for call classification in spoken language dialogue. In <i>Proceedings </i><i>ofthe</i><i> IEEE International Conference ofAcoustics and Speech and Signal Processing.</i><i></i></p><p>S. Scott and S. Matwin. 1999. Feature Engineering for Text Classification. In <i>Machine learning: pro­ceedings of the Sixteenth International Conference (ICML'99), Bled, Slovenia, June 27-30, 1999, </i>page 379. Morgan Kaufmann Pub.</p><p>K. Takahashi, H. Takamura, and M. Okumura. 2005. Automatic occupation coding with combination of machine learning and hand-crafted rules. <i>Advances in Knowledge Discovery and Data Mining, </i>pages 269-279.</p><doubt alpha="0.0" length="2" tooSmall="False" monospace="0.0">26</doubt></references></body></article>