stanford-nlp

nltk StanfordNERTagger : NoClassDefFoundError: org/slf4j/LoggerFactory (In Windows)

自闭症网瘾萝莉.ら 提交于 2019-12-18 02:47:42
问题 NOTE: I am using Python 2.7 as part of Anaconda distribution. I hope this is not a problem for nltk 3.1. I am trying to use nltk for NER as import nltk from nltk.tag.stanford import StanfordNERTagger #st = StanfordNERTagger('stanford-ner/all.3class.distsim.crf.ser.gz', 'stanford-ner/stanford-ner.jar') st = StanfordNERTagger('english.all.3class.distsim.crf.ser.gz') print st.tag(str) but i get Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at edu.stanford.nlp

Chunking Stanford Named Entity Recognizer (NER) outputs from NLTK format

故事扮演 提交于 2019-12-18 02:42:39
问题 I am using NER in NLTK to find persons, locations, and organizations in sentences. I am able to produce the results like this: [(u'Remaking', u'O'), (u'The', u'O'), (u'Republican', u'ORGANIZATION'), (u'Party', u'ORGANIZATION')] Is that possible to chunk things together by using it? What I want is like this: u'Remaking'/ u'O', u'The'/u'O', (u'Republican', u'Party')/u'ORGANIZATION' Thanks! 回答1: You can use the standard NLTK way of representing chunks using nltk.Tree . This might mean that you

How do I use IOB tags with Stanford NER?

♀尐吖头ヾ 提交于 2019-12-17 17:59:09
问题 There seem to be a few different settings: iobtags iobTags entitySubclassification (IOB1 or IOB2?) evaluateIOB Which setting do I use, and how do I use it correctly? I tried labelling like this: 1997 B-DATE volvo B-BRAND wia64t B-MODEL highway B-TYPE tractor I-TYPE But on the training output, it seemed to think that B-TYPE and I-TYPE were different classes. I am using the 2013-11-12 release. 回答1: How this can be done is currently (2013 releases) a bit of a mess, since there are two different

Stanford Core NLP - understanding coreference resolution

安稳与你 提交于 2019-12-17 17:38:23
问题 I'm having some trouble understanding the changes made to the coref resolver in the last version of the Stanford NLP tools. As an example, below is a sentence and the corresponding CorefChainAnnotation: The atom is a basic unit of matter, it consists of a dense central nucleus surrounded by a cloud of negatively charged electrons. {1=[1 1, 1 2], 5=[1 3], 7=[1 4], 9=[1 5]} I am not sure I understand the meaning of these numbers. Looking at the source doesn't really help either. Thank you 回答1:

Stanford nlp for python

好久不见. 提交于 2019-12-17 10:15:05
问题 All I want to do is find the sentiment (positive/negative/neutral) of any given string. On researching I came across Stanford NLP. But sadly its in Java. Any ideas on how can I make it work for python? 回答1: Use py-corenlp Download Stanford CoreNLP The latest version at this time (2018-10-23) is 3.9.2: wget https://nlp.stanford.edu/software/stanford-corenlp-full-2018-10-05.zip https://nlp.stanford.edu/software/stanford-english-corenlp-2018-10-05-models.jar If you do not have wget, you probably

Getting corefrences with Standard corenlp package

馋奶兔 提交于 2019-12-14 03:48:53
问题 I'm trying to get coreferences in a text. I'm new to the corenlp package. I tried the code below, which doesn't work, but I'm open to other methods as well. /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package corenlp; import edu.stanford.nlp.ling.CoreAnnotations.CollapsedCCProcessedDependenciesAnnotation; import edu.stanford.nlp.ling.CoreAnnotations.CorefGraphAnnotation; import edu.stanford.nlp.ling.CoreAnnotations.NamedEntityTagAnnotation;

Extract parent and child node from python tree

*爱你&永不变心* 提交于 2019-12-14 03:36:26
问题 I am using nltk's Tree data structure.Below is the sample nltk.Tree. (S (S (ADVP (RB recently)) (NP (NN someone)) (VP (VBD mentioned) (NP (DT the) (NN word) (NN malaria)) (PP (TO to) (NP (PRP me))))) (, ,) (CC and) (IN so) (S (NP (NP (CD one) (JJ whole) (NN flood)) (PP (IN of) (NP (NNS memories)))) (VP (VBD came) (S (VP (VBG pouring) (ADVP (RB back)))))) (. .)) I am not aware of nltk.Tree datastructure. I want to extract the parent and the super parent node for every leaf node e.g. for

How to get sentiment via stanford corenlp interactive shell?

ⅰ亾dé卋堺 提交于 2019-12-13 18:47:19
问题 I have been trying to get the sentiment value from the stanford corenlp , but it seems in the interactive shell, the sentiment is not given as an output. I have specified the annotators using the command given in the official website. java -cp "*" -Xmx3g edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,lemma,ner,parse,dcoref, sentiment Also, when i tried for getting just the sentiment, then at first asked for other annotators, after providing i didn't give any output

CoreNLP Stanford Dependency Format

丶灬走出姿态 提交于 2019-12-13 16:43:26
问题 Bills on ports and immigration were submitted by Senator Brownback, Republican of Kansas From the above sentence, I am looking to obtain the following typed dependencies: nsubjpass(submitted, Bills) auxpass(submitted, were) agent(submitted, Brownback) nn(Brownback, Senator) appos(Brownback, Republican) prep_of(Republican, Kansas) prep_on(Bills, ports) conj_and(ports, immigration) prep_on(Bills, immigration) This should be possible as per Table 1, Figure 1 on the documentation for Stanford

Stanford-parser in Ruby does not create Preprocesser

天涯浪子 提交于 2019-12-13 15:22:42
问题 I am trying to use Stanford-parser for Ruby and get a RuntimeError: Constructor not found I had to install 'rbj' and 'treebank' gems to get it running. Now I can require 'stanfordparser' but can't get to preproc = StanfordParser::DocumentPreprocessor.new The funciton that returns the error is here (ruby-1.9.3-p0/gems/stanfordparser-2.2.0/lib/java_object.rb:40:in `new'): def initialize(obj, *args) @java_object = obj.class == String ? Rjb::import(obj).send(:new, *args) : obj end I saw a couple