stanford-nlp

Stanford Universal Dependencies on Python NLTK

流过昼夜 提交于 2019-12-21 19:48:36
问题 Is there any way I can get the Universal dependencies using python, or nltk?I can only produce the parse tree. Example: Input sentence: My dog also likes eating sausage. Output: Universal dependencies nmod:poss(dog-2, My-1) nsubj(likes-4, dog-2) advmod(likes-4, also-3) root(ROOT-0, likes-4) xcomp(likes-4, eating-5) dobj(eating-5, sausage-6) 回答1: Wordseer's stanford-corenlp-python fork is a good start as it works with the recent CoreNLP release (3.5.2). However it will give you raw output,

Stanford Core NLP LexicalizedParser Model

懵懂的女人 提交于 2019-12-21 14:33:30
问题 I am new to NLP. I am trying a sample program with LexicalizedParser but am not able to locate the model. String parseModel = "...../models/lexparser/englishPCFG.ser.gz"; LexicalizedParser lecicalizedParser = LexicalizedParser.loadModel(parseModel); I have the required stanford-core-nlp-3.5.2.jar and the ner jar too in build path of a sample Java application. I tried referring the absolute path of the core jar and load it but could not. :( How can I refer to the exact location of this model

Stanford Core NLP LexicalizedParser Model

孤街浪徒 提交于 2019-12-21 14:32:15
问题 I am new to NLP. I am trying a sample program with LexicalizedParser but am not able to locate the model. String parseModel = "...../models/lexparser/englishPCFG.ser.gz"; LexicalizedParser lecicalizedParser = LexicalizedParser.loadModel(parseModel); I have the required stanford-core-nlp-3.5.2.jar and the ner jar too in build path of a sample Java application. I tried referring the absolute path of the core jar and load it but could not. :( How can I refer to the exact location of this model

NLTK was unable to find stanford-postagger.jar! Set the CLASSPATH environment variable

杀马特。学长 韩版系。学妹 提交于 2019-12-21 07:49:06
问题 I am working on a project that requires me to tag tokens using nltk and python. So I wanted to use this. But came up with a few problems. I went through a lot of other already asked questions and other forums but I was still unable to get a soultion to this problem. The problem is when I try to execute the following: from nltk.tag import StanfordPOSTagger st = StanfordPOSTagger('english-bidirectional-distsim.tagger') I get the following: Traceback (most recent call last): `File "<pyshell#13>"

Stanford NER Features

a 夏天 提交于 2019-12-21 06:17:15
问题 I am currently trying to use the Stanford NER system and I am trying to see what features can be extracted through setting of the flags in a properties file. It seems that the features documented at http://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/ie/NERFeatureFactory.html are not comprehensive. For example, all the feature flags related to dist similarity and clustering are not included (e.g. useDistSim, etc.). Is there a more complete list of all the features and corresponding

Analyse the sentences and extract person name, organization and location with the help of NLP

点点圈 提交于 2019-12-21 04:38:11
问题 I need to solve the following using NLP, can you give me pointers on how to achieve this using OpenNLP API a. How to find out if a sentence implies a certain action in the past, present or future. (e.g.) I was very sad last week - past I feel like hitting my neighbor - present I am planning to go to New York next week - future b. How to find the word which corresponds to a person or company or country (e.g.) John is planning to specialize in Electrical Engineering in UC Berkley and pursue a

Using Stanford CoreNLP

空扰寡人 提交于 2019-12-21 04:32:13
问题 I am trying to get around using the Stanford CoreNLP. I used some code from the web to understand what is going on with the coreference tool. I tried running the project in Eclipse but keep encountering an out of memory exception. I tried increasing the heap size but there isnt any difference. Any ideas on why this keeps happening? Is this a code specific problem? Any directions of using CoreNLP would be awesome. EDIT - Code Added import edu.stanford.nlp.dcoref.CorefChain; import edu.stanford

How can I extract address from raw text using NLTK in python?

安稳与你 提交于 2019-12-21 04:08:36
问题 I have this text '''Hi, Mr. Sam D. Richards lives here, 44 West 22nd Street, New York, NY 12345 . Can you contact him now? If you need any help, call me on 12345678''' . How the address part can be extracted from the above text using NLTK? I have tried Stanford NER Tagger , which gives me only New York as Location. How to solve this? 回答1: Definitely regular expressions :) Something like import re txt = ... regexp = "[0-9]{1,3} .+, .+, [A-Z]{2} [0-9]{5}" address = re.findall(regexp, txt) #

Finding head of a noun phrase in NLTK and stanford parse according to the rules of finding head of a NP

怎甘沉沦 提交于 2019-12-21 03:52:16
问题 generally A head of a nounphrase is a noun which is rightmost of the NP as shown below tree is the head of the parent NP. So ROOT | S ___|________________________ NP | ___|_____________ | | PP VP | ____|____ ____|___ NP | NP | PRT ___|_______ | | | | DT JJ NN NN IN NNP VBD RP | | | | | | | | The old oak tree from India fell down Out[40]: Tree('S', [Tree('NP', [Tree('NP', [Tree('DT', ['The']), Tree('JJ', ['old']), Tree('NN', ['oak']), Tree('NN', ['tree'])]), Tree('PP', [Tree('IN', ['from']),

Is it possible to train Stanford NER system to recognize more named entities types?

流过昼夜 提交于 2019-12-20 08:18:44
问题 I'm using some NLP libraries now, (stanford and nltk) Stanford I saw the demo part but just want to ask if it possible to use it to identify more entity types. So currently stanford NER system (as the demo shows) can recognize entities as person(name), organization or location. But the organizations recognized are limited to universities or some, big organizations. I'm wondering if I can use its API to write program for more entity types, like if my input is "Apple" or "Square" it can