stanford-nlp

psutil.AccessDenied when using StanfordCoreNLP in Pycharm? [duplicate]

南楼画角 提交于 2021-01-29 05:20:27
问题 This question already has answers here : psutil.AccessDenied Error while trying to load StanfordCoreNLP (3 answers) Closed 6 months ago . # coding=utf-8 from stanfordcorenlp import StanfordCoreNLP nlp = StanfordCoreNLP(r'/Users/silas/stanford-corenlp/', lang='zh') sentence = '清华大学位于北京。' print nlp.word_tokenize(sentence) print nlp.pos_tag(sentence) print nlp.ner(sentence) print nlp.parse(sentence) print nlp.dependency_parse(sentence) nlp.close() I'm using Mac. Java, NLKT, and Stanforcorenlp

Stanford NLP Tokens Regex — doesn't recognize NER

别来无恙 提交于 2021-01-29 05:12:08
问题 I'm just barely getting started with Tokens Regex. I haven't really found an intro or tutorial that gives me what I need. (If I've missed something, links are appreciated!) The super short, bare-bones idea is that I want to do something like using pattern: ( ( [ { ner:PERSON } ]) /was/ /born/ /on/ ([ { ner:DATE } ]) ) (from https://nlp.stanford.edu/software/tokensregex.html) to match "John Smith was born on March 1, 1999", and then be able to extract "John Smith" as the person and "March 1,

object databricks is not a member of package com

妖精的绣舞 提交于 2021-01-28 07:52:45
问题 I am trying to use Stanford NLP library in Spark2 using Zeppelin (HDP 2.6). Apparently there is wrapper built by Databricks for the Stanford NLP library for Spark. Link: https://github.com/databricks/spark-corenlp I have downloaded the jar for the above wrapper from here and also downloaded Stanford NLP jars from here. Then I have added both sets of jars as dependencies in Spark2 interpreter settings of Zeppelin and restarted the interpreter. Still the below sample program gives the error

Configuring SUTime to use custom rule files

社会主义新天地 提交于 2021-01-28 04:47:19
问题 I am trying to configure SUTime annotator (part of "ner") to use my own date/time rule files INSTEAD of the out-of-the-box rule files that are located in "models/sutime/" in the distribution JAR for Stanford CoreNLP models. The reason for me doing that is that I want to slightly modify what SUTime rules are doing. According to the official SUTime documentation, all it takes is specifying the "sutime.rules" property in the form of comma-separated file paths. But after I did that, it appears

How to split Japanese text?

限于喜欢 提交于 2021-01-27 17:16:25
问题 What is the best way of splitting Japanese text using Java? For Example, for the below text: こんにちは。私の名前はオバマです。私はアメリカに行く。 I need the following output: こんにちは 私の名前はオバマです 私はアメリカに行く Is it possible using Kuromoji? 回答1: You can use java.text.BreakIterator. String TEXT = "こんにちは。私の名前はオバマです。私はアメリカに行く。"; BreakIterator boundary = BreakIterator.getSentenceInstance(Locale.JAPAN); boundary.setText(TEXT); int start = boundary.first(); for (int end = boundary.next(); end != BreakIterator.DONE; start = end,