Transcription of The Stanford CoreNLP Natural Language Processing Toolkit
1 The Stanford CoreNLP Natural Language Processing ToolkitChristopher D. ManningLinguistics & Computer ScienceStanford SurdeanuSISTAU niversity of BauerDept of Computer ScienceStanford FinkelPrismatic J. BethardComputer and Information SciencesU. of Alabama at McCloskyIBM describe the design and use of theStanford CoreNLP Toolkit , an extensiblepipeline that provides core Natural lan-guage analysis. This Toolkit is quite widelyused, both in the research NLP communityand also among commercial and govern-ment users of open source NLP technol-ogy. We suggest that this follows froma simple, approachable design, straight-forward interfaces, the inclusion of ro-bust and good quality analysis compo-nents, and not requiring use of a largeamount of associated IntroductionThis paper describe the design and development ofStanford CoreNLP , a Java (or at least JVM-based)annotation pipeline framework, which providesmost of the common core Natural Language pro-cessing (NLP) steps, from tokenization through tocoreference resolution.
2 We describe the originaldesign of the system and its strengths (section 2),simple usage patterns (section 3), the set of pro-vided annotators and how properties control them(section 4), and how to add additional annotators(section 5), before concluding with some higher-level remarks and additional appendices. Whilethere are several good Natural Language analysistoolkits, Stanford CoreNLP is one of the mostused, and a central theme is trying to identify theattributes that contributed to its Original Design and DevelopmentOur pipeline system was initially designed for in-ternal use. Previously, when combining multiplenatural Language analysis components, each withtheir own ad hoc APIs, we had tied them togetherwith custom glue code.
3 The initial version of theTokeniza)on*Sentence*Spli0ng*Part4of4 speech*Tagging*Morphological*Analysis*Na med*En)ty*Recogni)on*Syntac)c*Parsing*Ot her*Annotators*Coreference*Resolu)on**Ra w*text*Execu)on*Flow*Annota)on*Object*An notated*text*(tokenize)*(ssplit)*(pos)*( lemma)*(ner)*(parse)*(dcoref)*(gender, sentiment)!Figure 1: Overall system architecture: Raw textis put into anAnnotationobject and then a se-quence of Annotators add information in an analy-sis pipeline. The resultingAnnotation, containingall the analysis information added by the Annota-tors, can be output in XML or plain text pipeline was developed in 2006 in or-der to replace this jumble with something uniform interface was provided for anAnnota-torthat adds some kind of analysis information tosome text.
4 AnAnnotatordoes this by taking in anAnnotationobject to which it can add extra infor-mation. AnAnnotationis stored as a typesafe het-erogeneous map, following the ideas for this datatype presented by Bloch (2008). This basic archi-tecture has proven quite successful, and is still thebasis of the system described here. It is illustratedin figure 1. The motivations were: To be able to quickly and painlessly get linguis-tic annotations for a text. To hide variations across components behind acommon API. To have a minimal conceptual footprint, so thesystem is easy to learn. To provide a lightweight framework, using plainJava objects (rather than something of heav-ier weight, such as XML or UIMA s CommonAnalysis System (CAS) objects).
5 In 2009, initially as part of a multi-site grantproject, the system was extended to be more easilyusable by a broader range of users. We provideda command-line interface and the ability to writeout anAnnotationin various formats, includingXML. Further work led to the system being re-leased as free open source software in the one hand, from an architectural perspec-tive, Stanford CoreNLP does not attempt to do ev-erything. It is nothing more than a straightforwardpipeline architecture. It provides only a Java does not attempt to provide multiple machinescale-out (though it does provide multi-threadedprocessing on a single machine).
6 It provides a sim-ple concrete API. But these requirements satisfya large percentage of potential users, and the re-sulting simplicity makes it easier for users to getstarted with the framework. That is, the primaryadvantage of Stanford CoreNLP over larger frame-works like UIMA (Ferrucci and Lally, 2004) orGATE (Cunningham et al., 2002) is that users donot have to learn UIMA or GATE before they canget started; they only need to know a little practice, this is a large and important differ-entiator. If more complex scenarios are required,such as multiple machine scale-out, they can nor-mally be achieved by running the analysis pipelinewithin a system that focuses on distributed work-flows (such as Hadoop or Spark).
7 Other systemsattempt to provide more, such as the UIUC Cu-rator (Clarke et al., 2012), which includes inter-machine client-server communication for process-ing and the caching of Natural Language this functionality comes at a cost. The systemis complex to install and complex to , in practice, an organization may wellbe committed to a scale-out solution which is dif-ferent from that provided by the Natural languageanalysis Toolkit . For example, they may be usingKryo or Google s protobuf for binary serializationrather than Apache Thrift which underlies Cura-tor. In this case, the user is better served by a fairlysmall and self-contained Natural Language analysissystem, rather than something which comes witha lot of baggage for all sorts of purposes, most ofwhich they are not the other hand, most users benefit greatlyfrom the provision of a set of stable, robust, high1 Nevertheless, it can call an analysis component written inother languages via an appropriate wrapperAnnotator, andin turn, it has been wrapped by many people to provide Stan-ford CoreNLP bindings for other linguistic analysis components, which canbe easily invoked for common scenarios.
8 Whilethe builder of a larger system may have made over-all design choices, such as how to handle scale-out, they are unlikely to be an NLP expert, andare hence looking for NLP components that is a huge advantage that StanfordCoreNLP and GATE have over the empty tool-box of an Apache UIMA download, somethingaddressed in part by the development of well-integrated component packages for UIMA, suchas ClearTK (Bethard et al., 2014), DKPro Core(Gurevych et al., 2007), and JCoRe (Hahn et al.,2008). However, the solution provided by thesepackages remains harder to learn, more complexand heavier weight for users than the pipeline de-scribed attributes echo what Patricio (2009) ar-gued made Hibernate successful, including: (i) doone thing well, (ii) avoid over-design, and (iii)up and running in ten minutes or less!
9 Indeed,the design and success of Stanford CoreNLP alsoreflects several other of the factors that Patriciohighlights, including (iv) avoid standardism, (v)documentation, and (vi) developer there are many factors that contribute to theuptake of a project, and it is hard to show causal-ity, we believe that some of these attributes ac-count for the fact that Stanford CoreNLP is one ofthe more used NLP toolkits. While we certainlyhave not done a perfect job, compared to muchacademic software, Stanford CoreNLP has gainedfrom attributes such as clear open source licens-ing, a modicum of attention to documentation, andattempting to answer user Elementary UsageA key design goal was to make it very simple toset up and run Processing pipelines, from eitherthe API or the command-line.
10 Using the API, run-ning a pipeline can be as easy as figure 2. Or,at the command-line, doing linguistic processingfor a file can be as easy as figure 3. Real life israrely this simple, but the ability to get started us-ing the product with minimal configuration codegives new users a very good initial 4 gives a more realistic (and complete)example of use, showing several key properties ofthe system. An annotation pipeline can be appliedto any text, such as a paragraph or whole storyrather than just a single sentence. The behavior ofAnnotator pipeline = new StanfordCoreNLP();Annotation annotation = new Annotation("Can you parse my sentence?)