stanford-nlp

Get corresponding verbs and nouns for adverbs and adjectives

六月ゝ 毕业季﹏ 提交于 2019-12-05 21:01:44
How can I get corresponding verbs and nouns for adverbs and adjectives in python? It seems simple succession and precedence may not be very accurate. There may be stopwords like to eg. in I am delighted to learn... I can't any library or even problem statement formalised as such. Code right now. Now I want to return the corresponding the verb for adverb and noun for each adjective in the sentence. Please help. Code: def pos_func(input_text): #pos tagging code: text=input_text tokens=tokenize_words(text) tagged=pos_tag(tokens) pos_store(tagged) def pos_store(tagged): verbs=[] adjectives=[]

Example for Stanford NLP Classifier

余生长醉 提交于 2019-12-05 20:59:17
I am trying to learn the Stanford NLP Classifier and would like to work on the problem of document classification. Can anyone suggest a place where I can find a working example? I was also looking at the Open NLP libraries and was able to find many working examples, like http://tharindu-rusira.blogspot.com/2013/12/opennlp-text-classifier.html So, as we can see here, it is quite easy to figure out what's going on and create a small working prototype. However, I can't find a simple example for stanford NLP which will show me How to specify training data for a classifier. How to train a model.

NLTK CoreNLPDependencyParser: Failed to establish connection

一世执手 提交于 2019-12-05 19:53:15
I'm trying to use the Stanford Parser through NLTK, following the example here . I follow the first two lines of the example (with the necessary import) from nltk.parse.corenlp import CoreNLPDependencyParser dep_parser = CoreNLPDependencyParser(url='http://localhost:9000') parse, = dep_parser.raw_parse('The quick brown fox jumps over the lazy dog.') but I get an error saying: [...] Failed to establish a new connection: [Errno 61] Connection refused" I realize that it must be an issue with trying to connect to the url given as input to the constructor. dep_parser = CoreNLPDependencyParser(url=

Is there a C# utility for matching patterns in (syntactic parse) trees?

梦想与她 提交于 2019-12-05 15:36:47
问题 I'm working on a Natural Language Processing (NLP) project in which I use a syntactic parser to create a syntactic parse tree out of a given sentence. Example Input: I ran into Joe and Jill and then we went shopping Example Output: [TOP [S [S [NP [PRP I]] [VP [VBD ran] [PP [IN into] [NP [NNP Joe] [CC and] [NNP Jill]]]]] [CC and] [S [ADVP [RB then]] [NP [PRP we]] [VP [VBD went] [NP [NN shopping]]]]]] I'm looking for a C# utility that will let me do complex queries like: Get the first VBD

Stanford CoreNLP Error creating edu.stanford.nlp.time.TimeExpressionExtractorImpl

回眸只為那壹抹淺笑 提交于 2019-12-05 14:49:48
I am trying to learn the Stanford CoreNLP library. I am using C# with the posted example ( https://sergeytihon.wordpress.com/2013/10/26/stanford-corenlp-is-available-on-nuget-for-fc-devs/ ). I loaded the package “Stanford.NLP.CoreNLP” (it added IKVM.NET) via nuget and downloaded the code. Unzipped the .jar models. My directory is correct. I get the following error: > edu.stanford.nlp.util.ReflectionLoading.ReflectionLoadingException was > unhandled HResult=-2146233088 Message=Error creating > edu.stanford.nlp.time.TimeExpressionExtractorImpl > Source=stanford-corenlp-3.5.0 StackTrace: at > edu

How to extract Named Entity + Verb from text

时光怂恿深爱的人放手 提交于 2019-12-05 14:20:09
Well, my aim is to extract NE (Person) and a verb connected to it from a text. For example, I have this text: Dumbledore turned and walked back down the street. Harry Potter rolled over inside his blankets without waking up. As an ideal result i should get Dumbledore turned walked; Harry Potter rolled I use Stanford NER to find and mark persons, then I delete all sentences that don't contain NE. So, in the end I have a 'pure' text that consists only of sentences with names of characters. After that I use Stanford Dependencies. As the result I get smth like this (CONLLU output-format): 1

Stanford Core NLP: Entity type non deterministic

人走茶凉 提交于 2019-12-05 13:44:06
I had built a java parser using Stanford Core NLP. I am finding an issue in getting the consistent results with the CORENLP object. I am getting the different entity types for the same input text. It seems like a bug to me in CoreNLP. Wondering if any of the StanfordNLP users have encountered this issue and found workaround for the same. This is my Service class which I am instantiating and reusing. class StanfordNLPService { //private static final Logger logger = LogConfiguration.getInstance().getLogger(StanfordNLPServer.class.getName()); private StanfordCoreNLP nerPipeline; /* Initialize the

Running Stanford corenlp server with French models

我的未来我决定 提交于 2019-12-05 09:59:40
I am trying to analyse some French text with the Stanford CoreNLP tool (it's my first time trying to use any StanfordNLP software) To do so, I have downloaded the v3.6.0 jar and the corresponding french models . Then I run the server with: java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer As described in this answer , I call the API with: wget --post-data 'Bonjour le monde.' 'localhost:9000/?properties={"parse.model":"edu/stanford/nlp/models/parser/nndep/UD_French.gz", "annotators": "parse", "outputFormat": "json"}' -O - but I get the following log + error: [pool-1-thread-1]

How to implement Stanford CoreNLP wrapper for Apache Spark using sparklyr?

廉价感情. 提交于 2019-12-05 08:14:28
I am trying to create a R package so I can use the Stanford CoreNLP wrapper for Apache Spark (by databricks) from R. I am using the sparklyr package to connect to my local Spark instance. I created a package with the following dependency function spark_dependencies <- function(spark_version, scala_version, ...) { sparklyr::spark_dependency( jars = c( system.file( sprintf("stanford-corenlp-full/stanford-corenlp-3.6.0.jar"), package = "sparkNLP" ), system.file( sprintf("stanford-corenlp-full/stanford-corenlp-3.6.0-models.jar"), package = "sparkNLP" ), system.file( sprintf("stanford-corenlp-full

Preventing Stanford Core NLP Server from outputting the text it receives

社会主义新天地 提交于 2019-12-05 07:27:52
问题 I am running a Stanford CoreNLP server: java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9001 -timeout 50000 Whenever it receives some text, it outputs it in the shell it is running it. How to prevent this from happening? It that matters, here is the code I use to pass data to Stanford Core NLP Server: ''' From https://github.com/smilli/py-corenlp/blob/master/example.py ''' from pycorenlp import StanfordCoreNLP import pprint if __name__ == '__main__': nlp =