{"id":1002,"date":"2013-05-07T00:40:21","date_gmt":"2013-05-07T00:40:21","guid":{"rendered":"http:\/\/garysieling.com\/blog\/?p=1002"},"modified":"2013-05-07T00:40:21","modified_gmt":"2013-05-07T00:40:21","slug":"entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/","title":{"rendered":"Entity recognition with Scala and Stanford NLP Named Entity Recognizer"},"content":{"rendered":"<p>The following sample will extract the contents of a court case and attempt to recognize names and locations using entity recognition software from Stanford NLP. From the samples, you can see it&#8217;s fairly good at finding nouns, but not always at identifying the type of each noun.<\/p>\n<p>In this example, the entities I&#8217;d like to see are different &#8211; companies, law firms, lawyers, etc, but this test is good enough. The default examples provided let you choose different sets of things that can be recognized: {Location, Person, Organization}, {Location, Person, Organization, Misc}, and {Time, Location, Organization, Person, Money, Percent, Date}. The process of extracting PDF data and processing it takes about five seconds.<\/p>\n<p>For this text, selecting different options sometimes led to the classifier picking different options for a noun &#8211; one time it&#8217;s a person, another time it&#8217;s an organization, etc. One improvement might be to run several classifiers and to allow them to vote. This classifier also loses words sometimes &#8211; if a subject is listed with a first, middle, and last name, it sometimes picks just two words. I&#8217;ve noticed similar issues with company names.<\/p>\n<pre lang=\"Java\">\nimport org.apache.tika.parser.pdf._\nimport org.apache.tika.metadata._\nimport org.apache.tika.parser._\nimport java.io._\nimport org.xml.sax._\nimport edu.stanford.nlp.ie.crf.CRFClassifier\nimport edu.stanford.nlp.ling.CoreAnnotations\n\nobject pdfHandler extends ContentHandler {\n  val contents: StringBuffer = new StringBuffer()\n\n  def characters(ch: Array[Char], start: Int, length: Int) {\n    contents.append(new String(ch))\n  }\n\n  def endDocument() {\n  }\n\n  def endElement(uri: String, localName: String, qName: String) {\n  }\n\n  def endPrefixMapping(prefix: String) {\n  }\n\n  def ignorableWhitespace(ch: Array[Char], start: Int, length: Int) {\n  }\n\n  def processingInstruction(target: String, data: String) {\n  }\n\n  def setDocumentLocator(locator: Locator) {\n  }\n\n  def skippedEntity(name: String) {\n  }\n\n  def startDocument() {\n  }\n\n  def startElement(uri: String, localName: String, qName: String, atts: Attributes) {\n  }\n\n  def startPrefixMapping(prefix: String, uri: String) {\n  }\n}\n\nobject pdf extends App {\n  val file = \"\"\"e:\\data\\11-1285_i4dk.pdf\"\"\"\n\n  val pdf: PDFParser = new PDFParser();\n\n  val stream: InputStream = new FileInputStream(file)\n  val handler: ContentHandler = pdfHandler\n  val metadata: Metadata = new Metadata()\n  val context: ParseContext = new ParseContext()\n\n  pdf.parse(stream,\n    handler,\n    metadata,\n    context)\n\n  stream.close()\n\n  val contents: String = pdfHandler.contents.toString()\n  println(contents)\n\n  val src = \"stanford-ner-2013-04-04\/classifiers\/\"\n  val classifier1 = \"english.all.3class.distsim.crf.ser.gz\"\n  val classifier2 = \"english.conll.4class.distsim.crf.ser.gz\"\n  val classifier3 = \"english.muc.7class.distsim.crf.ser.gz\"\n\n  val serializedClassifier = src + classifier1\n\n  val classifier = CRFClassifier.getClassifierNoExceptions(serializedClassifier)\n  val out = classifier.classify(contents)\n\n  var words = 0\n  for (i <- 0 to out.size() - 1) {\n    val sentence = out.get(i)\n\n    var foundWord = \"\"\n    var oldWordClass = \"\"\n\n    for (j <- 0 to sentence.size() - 1) {\n      val word = sentence.get(j)\n      val wordClass = word.get(classOf[CoreAnnotations.AnswerAnnotation]) + \"\"\n\n      if (!oldWordClass.equals(wordClass)) {\n        if (!oldWordClass.equals(\"O\") &#038;&#038; !oldWordClass.equals(\"\")) {\n          print(\"[\/\" + oldWordClass + \"]\")\n        }\n      }\n\n      if (!wordClass.equals(\"O\") &#038;&#038; !wordClass.equals(\"\")) {\n        if (!oldWordClass.equals(wordClass)) {\n          print(\"[\" + wordClass + \"]\")\n        }\n      }\n\n      oldWordClass = wordClass\n\n      words = words + 1\n      print(word);\n      print(\" \");\n\n      if (words > 10) {\n        words = 0\n        println(\" \")\n      }\n    }\n  }\n}\n<\/pre>\n<pre>\n11-1285 [ORGANIZATION]US Airways , Inc. [\/ORGANIZATION]v.  \n[PERSON]McCutchen [\/PERSON]-LRB- 4\\\/16\\\/13 -RRB- 1 -LRB-  \nSlip Opinion -RRB- OCTOBER TERM ,  \n2012 Syllabus NOTE : Where it  \nis feasible , a syllabus -LRB-  \nheadnote -RRB- will be released ,  \nas isbeing done in connection with  \nthis case , at the time  \nthe opinion is issued . The  \nsyllabus constitutes no part of the  \nopinion of the Court but has  \nbeenprepared by the Reporter of Decisions  \nfor the convenience of the reader  \n. See [LOCATION]United States [\/LOCATION]v. [ORGANIZATION]Detroit  \nTimber & Lumber Co. [\/ORGANIZATION], 200  \nU. S. 321 , 337 .  \nSUPREME COURT OF THE [ORGANIZATION]UNITED STATES  \nSyllabus US AIRWAYS [\/ORGANIZATION], INC. ,  \nIN ITS CAPACITY AS FIDUCIARY AND  \nPLAN ADMINISTRATOR OF THE [LOCATION]US [\/LOCATION]AIRWAYS  \n, INC. . EMPLOYEE BENEFITS PLAN  \nv. [PERSON]MCCUTCHEN [\/PERSON]ET AL. . CERTIORARI  \nTO THE [ORGANIZATION]UNITED STATES [\/ORGANIZATION]COURT OF  \nAPPEALS FOR THE THIRD CIRCUIT No.  \n11 -- 1285 . Argued November  \n27 , 2012 -- Decided April  \n16 , 2013 The health benefits  \nplan established by petitioner [ORGANIZATION]US Airways  \n[\/ORGANIZATION]paid $ 66,866 in medical expenses  \nfor injuries suffered by respondentMcCutchen ,  \na [ORGANIZATION]US Airways [\/ORGANIZATION]employee , in  \na car accident caused by athird  \nparty . The plan entitled [ORGANIZATION]US  \nAirways [\/ORGANIZATION]to reimbursement if \n[PERSON]McCutchen [\/PERSON]\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The following sample will extract the contents of a court case and attempt to recognize names and locations using entity recognition software from Stanford NLP. From the samples, you can see it&#8217;s fairly good at finding nouns, but not always at identifying the type of each noun. In this example, the entities I&#8217;d like to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Entity recognition with Scala and Stanford NLP Named Entity Recognizer&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[4,5,6],"tags":[300,378,385,417,480,495,530],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"The following sample will extract the contents of a court case and attempt to recognize names and locations using entity recognition software from Stanford NLP. From the samples, you can see it&#039;s fairly good at finding nouns, but not always at identifying the type of each noun. In this example, the entities I&#039;d like to\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"gary\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Gary Sieling - Software Engineer\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Entity recognition with Scala and Stanford NLP Named Entity Recognizer - Gary Sieling\" \/>\n\t\t<meta property=\"og:description\" content=\"The following sample will extract the contents of a court case and attempt to recognize names and locations using entity recognition software from Stanford NLP. From the samples, you can see it&#039;s fairly good at finding nouns, but not always at identifying the type of each noun. In this example, the entities I&#039;d like to\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2013-05-07T00:40:21+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2013-05-07T00:40:21+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Entity recognition with Scala and Stanford NLP Named Entity Recognizer - Gary Sieling\" \/>\n\t\t<meta name=\"twitter:description\" content=\"The following sample will extract the contents of a court case and attempt to recognize names and locations using entity recognition software from Stanford NLP. From the samples, you can see it&#039;s fairly good at finding nouns, but not always at identifying the type of each noun. In this example, the entities I&#039;d like to\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\\\/#blogposting\",\"name\":\"Entity recognition with Scala and Stanford NLP Named Entity Recognizer - Gary Sieling\",\"headline\":\"Entity recognition with Scala and Stanford NLP Named Entity Recognizer\",\"author\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\"},\"datePublished\":\"2013-05-07T00:40:21+00:00\",\"dateModified\":\"2013-05-07T00:40:21+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\\\/#webpage\"},\"articleSection\":\"Code Examples, Data Mining, Data Science, java, natural language processing, nlp, pdf, scala, scraping, stanford\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.garysieling.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/code-examples\\\/#listItem\",\"name\":\"Code Examples\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/code-examples\\\/#listItem\",\"position\":2,\"name\":\"Code Examples\",\"item\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/code-examples\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\\\/#listItem\",\"name\":\"Entity recognition with Scala and Stanford NLP Named Entity Recognizer\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\\\/#listItem\",\"position\":3,\"name\":\"Entity recognition with Scala and Stanford NLP Named Entity Recognizer\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/code-examples\\\/#listItem\",\"name\":\"Code Examples\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\",\"name\":\"Gary Sieling\",\"description\":\"Software Engineer\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/\",\"name\":\"gary\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0be925276d848ffe98a6a9dc8cf33e67?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"gary\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\\\/#webpage\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\\\/\",\"name\":\"Entity recognition with Scala and Stanford NLP Named Entity Recognizer - Gary Sieling\",\"description\":\"The following sample will extract the contents of a court case and attempt to recognize names and locations using entity recognition software from Stanford NLP. From the samples, you can see it's fairly good at finding nouns, but not always at identifying the type of each noun. In this example, the entities I'd like to\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"datePublished\":\"2013-05-07T00:40:21+00:00\",\"dateModified\":\"2013-05-07T00:40:21+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/\",\"name\":\"Gary Sieling\",\"description\":\"Software Engineer\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Entity recognition with Scala and Stanford NLP Named Entity Recognizer - Gary Sieling","description":"The following sample will extract the contents of a court case and attempt to recognize names and locations using entity recognition software from Stanford NLP. From the samples, you can see it's fairly good at finding nouns, but not always at identifying the type of each noun. In this example, the entities I'd like to","canonical_url":"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/#blogposting","name":"Entity recognition with Scala and Stanford NLP Named Entity Recognizer - Gary Sieling","headline":"Entity recognition with Scala and Stanford NLP Named Entity Recognizer","author":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"publisher":{"@id":"https:\/\/www.garysieling.com\/blog\/#organization"},"datePublished":"2013-05-07T00:40:21+00:00","dateModified":"2013-05-07T00:40:21+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/#webpage"},"isPartOf":{"@id":"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/#webpage"},"articleSection":"Code Examples, Data Mining, Data Science, java, natural language processing, nlp, pdf, scala, scraping, stanford"},{"@type":"BreadcrumbList","@id":"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.garysieling.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/code-examples\/#listItem","name":"Code Examples"}},{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/code-examples\/#listItem","position":2,"name":"Code Examples","item":"https:\/\/www.garysieling.com\/blog\/category\/code-examples\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/#listItem","name":"Entity recognition with Scala and Stanford NLP Named Entity Recognizer"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/#listItem","position":3,"name":"Entity recognition with Scala and Stanford NLP Named Entity Recognizer","previousItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/code-examples\/#listItem","name":"Code Examples"}}]},{"@type":"Organization","@id":"https:\/\/www.garysieling.com\/blog\/#organization","name":"Gary Sieling","description":"Software Engineer","url":"https:\/\/www.garysieling.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author","url":"https:\/\/www.garysieling.com\/blog\/author\/gary\/","name":"gary","image":{"@type":"ImageObject","@id":"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/0be925276d848ffe98a6a9dc8cf33e67?s=96&d=identicon&r=g","width":96,"height":96,"caption":"gary"}},{"@type":"WebPage","@id":"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/#webpage","url":"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/","name":"Entity recognition with Scala and Stanford NLP Named Entity Recognizer - Gary Sieling","description":"The following sample will extract the contents of a court case and attempt to recognize names and locations using entity recognition software from Stanford NLP. From the samples, you can see it's fairly good at finding nouns, but not always at identifying the type of each noun. In this example, the entities I'd like to","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.garysieling.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/#breadcrumblist"},"author":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"creator":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"datePublished":"2013-05-07T00:40:21+00:00","dateModified":"2013-05-07T00:40:21+00:00"},{"@type":"WebSite","@id":"https:\/\/www.garysieling.com\/blog\/#website","url":"https:\/\/www.garysieling.com\/blog\/","name":"Gary Sieling","description":"Software Engineer","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.garysieling.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Gary Sieling - Software Engineer","og:type":"article","og:title":"Entity recognition with Scala and Stanford NLP Named Entity Recognizer - Gary Sieling","og:description":"The following sample will extract the contents of a court case and attempt to recognize names and locations using entity recognition software from Stanford NLP. From the samples, you can see it's fairly good at finding nouns, but not always at identifying the type of each noun. In this example, the entities I'd like to","og:url":"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/","article:published_time":"2013-05-07T00:40:21+00:00","article:modified_time":"2013-05-07T00:40:21+00:00","twitter:card":"summary_large_image","twitter:title":"Entity recognition with Scala and Stanford NLP Named Entity Recognizer - Gary Sieling","twitter:description":"The following sample will extract the contents of a court case and attempt to recognize names and locations using entity recognition software from Stanford NLP. From the samples, you can see it's fairly good at finding nouns, but not always at identifying the type of each noun. In this example, the entities I'd like to"},"aioseo_meta_data":{"post_id":"1002","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2023-02-04 16:14:28","updated":"2026-07-06 00:55:46","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.garysieling.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.garysieling.com\/blog\/category\/code-examples\/\" title=\"Code Examples\">Code Examples<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tEntity recognition with Scala and Stanford NLP Named Entity Recognizer\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.garysieling.com\/blog"},{"label":"Code Examples","link":"https:\/\/www.garysieling.com\/blog\/category\/code-examples\/"},{"label":"Entity recognition with Scala and Stanford NLP Named Entity Recognizer","link":"https:\/\/www.garysieling.com\/blog\/entity-recognition-with-scala-and-stanford-nlp-named-entity-recognizer\/"}],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/1002"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=1002"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/1002\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=1002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=1002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=1002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}