stanford-nlp

trouble importing stanford pos tagger into nltk

房东的猫 提交于 2019-11-26 21:30:41
问题 This is probably a very trivial question. I am trying to use the stanford pos tagger through nltk given here The problem is that my nltk lib doesnt contain the stanford module. So I copied the same into the appropriate folder and compiled the same. Now when i try to run an example the module is getting detected but not the class inside the module. Can anyone tell me where I am going wrong?? Again this is probably very dumb. >>> from nltk.tag import stanford >>> st = StanfordTagger(

How to extract the noun phrases using Open nlp's chunking parser

家住魔仙堡 提交于 2019-11-26 20:57:19
问题 I am newbie to Natural Language processing.I need to extract the noun phrases from the text.So far i have used open nlp's chunking parser for parsing my text to get the Tree structure.But i am not able to extract the noun phrases from the tree structure, is there any regular expression pattern in open nlp so that i can use it to extract the noun phrases. Below is the code that i am using InputStream is = new FileInputStream("en-parser-chunking.bin"); ParserModel model = new ParserModel(is);

How can I split a text into sentences using the Stanford parser?

江枫思渺然 提交于 2019-11-26 19:56:45
How can I split a text or paragraph into sentences using Stanford parser ? Is there any method that can extract sentences, such as getSentencesFromString() as it's provided for Ruby ? Kenston Choi You can check the DocumentPreprocessor class. Below is a short snippet. I think there may be other ways to do what you want. String paragraph = "My 1st sentence. “Does it work for questions?” My third sentence."; Reader reader = new StringReader(paragraph); DocumentPreprocessor dp = new DocumentPreprocessor(reader); List<String> sentenceList = new ArrayList<String>(); for (List<HasWord> sentence : dp

Extract list of Persons and Organizations using Stanford NER Tagger in NLTK

可紊 提交于 2019-11-26 17:31:00
问题 I am trying to extract list of persons and organizations using Stanford Named Entity Recognizer (NER) in Python NLTK. When I run: from nltk.tag.stanford import NERTagger st = NERTagger('/usr/share/stanford-ner/classifiers/all.3class.distsim.crf.ser.gz', '/usr/share/stanford-ner/stanford-ner.jar') r=st.tag('Rami Eid is studying at Stony Brook University in NY'.split()) print(r) the output is: [('Rami', 'PERSON'), ('Eid', 'PERSON'), ('is', 'O'), ('studying', 'O'), ('at', 'O'), ('Stony',

Java Stanford NLP: Part of Speech labels?

依然范特西╮ 提交于 2019-11-26 07:50:22
问题 The Stanford NLP, demo\'d here, gives an output like this: Colorless/JJ green/JJ ideas/NNS sleep/VBP furiously/RB ./. What do the Part of Speech tags mean? I am unable to find an official list. Is it Stanford\'s own system, or are they using universal tags? (What is JJ , for instance?) Also, when I am iterating through the sentences, looking for nouns, for instance, I end up doing something like checking to see if the tag .contains(\'N\') . This feels pretty weak. Is there a better way to

How can I split a text into sentences using the Stanford parser?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 07:28:36
问题 How can I split a text or paragraph into sentences using Stanford parser? Is there any method that can extract sentences, such as getSentencesFromString() as it\'s provided for Ruby? 回答1: You can check the DocumentPreprocessor class. Below is a short snippet. I think there may be other ways to do what you want. String paragraph = "My 1st sentence. “Does it work for questions?” My third sentence."; Reader reader = new StringReader(paragraph); DocumentPreprocessor dp = new DocumentPreprocessor

Stanford Parser and NLTK

旧巷老猫 提交于 2019-11-25 22:58:42
问题 Is it possible to use Stanford Parser in NLTK? (I am not talking about Stanford POS.) 回答1: Note that this answer applies to NLTK v 3.0, and not to more recent versions. Sure, try the following in Python: import os from nltk.parse import stanford os.environ['STANFORD_PARSER'] = '/path/to/standford/jars' os.environ['STANFORD_MODELS'] = '/path/to/standford/jars' parser = stanford.StanfordParser(model_path="/location/of/the/englishPCFG.ser.gz") sentences = parser.raw_parse_sents(("Hello, My name