dependency-parsing

Is there a way to retrieve the whole noun chunk using a root token in spaCy?

不想你离开。 提交于 2021-02-08 10:40:43
问题 I'm very new to using spaCy. I have been reading the documentation for hours and I'm still confused if it's possible to do what I have in my question. Anyway... As the title says, is there a way to actually get a given noun chunk using a token containing it. For example, given the sentence: "Autonomous cars shift insurance liability toward manufacturers" Would it be possible to get the "autonomous cars" noun chunk when what I only have the "cars" token? Here is an example snippet of the

In Spacy NLP, how extract the agent, action, and patient — as well as cause/effect relations?

倖福魔咒の 提交于 2020-06-29 05:04:14
问题 I would like to use Space to extract word relation information in the form of "agent, action, and patient." For example, "Autonomous cars shift insurance liability toward manufacturers" -> ("autonomous cars", "shift", "liability") or ("autonomous cars", "shift", "liability towards manufacturers"). In other words, "who did what to whom" and "what applied the action to something else." I don't know much about my input data, so I can't make many assumptions. I also want to extract logical

How to translate syntatic parse to a dependency parse tree?

╄→гoц情女王★ 提交于 2019-12-25 04:26:51
问题 Using Link Grammar I can have the syntaxic parse of sentences something like the following: +-------------------Xp------------------+ +------->WV------->+------Ost------+ | +-----Wd----+ | +----Ds**x---+ | | +Ds**c+--Ss--+ +-PHc+---A---+ | | | | | | | | | LEFT-WALL a koala.n is.v a cute.a animal.n . +---------------------Xp--------------------+ +------->WV------>+---------Osm--------+ | +-----Wd----+ | +------Ds**x------+ | | +Ds**c+--Ss-+ +--PHc-+-----A----+ | | | | | | | | | LEFT-WALL a

Converting output of dependency parsing to tree

谁说胖子不能爱 提交于 2019-12-22 13:55:43
问题 I am using Stanford dependency parser and the I get the following output of the sentence I shot an elephant in my sleep python dep_parsing.py [((u'shot', u'VBD'), u'nsubj', (u'I', u'PRP')), ((u'shot', u'VBD'), u'dobj', (u'elephant', u'NN')), ((u'elephant', u'NN'), u'det', (u'an', u'DT')), ((u'shot', u'VBD'), u'nmod', (u'sleep', u'NN')), ((u'sleep', u'NN'), u'case', (u'in', u'IN')), ((u'sleep', u'NN'), u'nmod:poss', (u'my', u'PRP$'))] I want to convert this into a graph with nodes being each

How to keep punctuation in Stanford dependency parser

拜拜、爱过 提交于 2019-12-11 11:05:57
问题 I am using Stanford CoreNLP (01.2016 version) and I would like to keep the punctuation in the dependency relations. I have found some ways for doing that when you run it from command line, but I didn't find anything regarding the java code which extracts the dependency relations. Here is my current code. It works, but no punctuation is included: Annotation document = new Annotation(text); Properties props = new Properties(); props.setProperty("annotators", "tokenize, ssplit, pos, lemma, parse

Does spacy take as input a list of tokens?

自作多情 提交于 2019-12-07 02:31:56
问题 I would like to use spacy's POS tagging, NER, and dependency parsing without using word tokenization. Indeed, my input is a list of tokens representing a sentence, and I would like to respect the user's tokenization. Is this possible at all, either with spacy or any other NLP package ? For now, I am using this spacy-based function to put a sentence (a unicode string) in the Conll format: import spacy nlp = spacy.load('en') def toConll(string_doc, nlp): doc = nlp(string_doc) block = [] for i,

How to Get Dependency Parse Output from SyntaxNet

前提是你 提交于 2019-11-28 21:39:22
How do you get a dependency parse (not syntax tree) output from SyntaxNet ( https://github.com/tensorflow/models/tree/master/syntaxnet ) ? I see a description of dependency parsing...a description of how to train a model, but not how to get dependency parse output. Does SyntaxNet (Specifically the Parsey McParseface model) even do dependency parsing out of the box? Passing --arg_prefix brain_parser to the parser_eval.py should do the trick. But this requires the tagged output to be fed as input. Here's an example where the first pass tags the words and the second pass resolves dependencies:

How to Get Dependency Parse Output from SyntaxNet

北战南征 提交于 2019-11-27 14:02:14
问题 How do you get a dependency parse (not syntax tree) output from SyntaxNet (https://github.com/tensorflow/models/tree/master/syntaxnet) ? I see a description of dependency parsing...a description of how to train a model, but not how to get dependency parse output. Does SyntaxNet (Specifically the Parsey McParseface model) even do dependency parsing out of the box? 回答1: Passing --arg_prefix brain_parser to the parser_eval.py should do the trick. But this requires the tagged output to be fed as