Questions tagged [dependency-parsing]

92 questions
12
votes
2 answers

Dependency parsing tree in Spacy

I have a sentence John saw a flashy hat at the store How to represent this as a dependency tree as shown below? (S (NP (NNP John)) (VP (VBD saw) (NP (DT a) (JJ flashy) (NN hat)) (PP (IN at) (NP (DT the) (NN…
Niranjan Sonachalam
  • 1,545
  • 1
  • 20
  • 29
11
votes
1 answer

Extracting (subject,predicate,object) from dependency tree

I'm interested in extracting triples (subject,predicate,object) from questions. For example, I would like to transform the following question : Who is the wife of the president of the USA? to : (x,isWifeOf,y) ∧ (y,isPresidentof,USA) x…
10
votes
1 answer

How to get the index of a token in a sentence in spaCy?

Is there an elegant way to get the index of a word/token in its sentence? I am aware of the attributes for tokens https://spacy.io/api/token#attributes The i attribute returns the index within the whole parent document. But the parent document can…
Johannes Krämer
  • 317
  • 1
  • 3
  • 13
10
votes
1 answer

How to Get Dependency Parse Output from SyntaxNet

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…
9
votes
2 answers

Does spacy take as input a list of tokens?

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…
dada
  • 1,390
  • 2
  • 17
  • 40
7
votes
1 answer

Named Entity Recognition in aspect-opinion extraction using dependency rule matching

Using Spacy, I extract aspect-opinion pairs from a text, based on the grammar rules that I defined. Rules are based on POS tags and dependency tags, which is obtained by token.pos_ and token.dep_. Below is an example of one of the grammar rules. If…
7
votes
2 answers

Save SpaCy render file as SVG using DisplaCy

I have the following code: import spacy from spacy import displacy from pathlib import Path nlp = spacy.load('en_core_web_sm', parse=True, tag=True, entity=True) sentence_nlp = nlp("John go home to your family") svg = displacy.render(sentence_nlp,…
Kusi
  • 785
  • 1
  • 10
  • 21
7
votes
1 answer

Definition of POS tag and Dependency label sets are used within Parsey McParseface?

The POS tags and Depedency labels output by Parsey McParseface are given in the tag-set and label-set files here respectively. The Syntaxnet readme outlines that the model was trained on the Penn Treebank, OntoNotes and the English Web Treebanks.…
6
votes
0 answers

nltk stanford dependency parser throws an assertation error

I am using python3 and nltk with stanford dependency parser to parse a list of sentences. Then with the sentence I collect all nodes information. The following is my code, and it is executed in python3 and an virtualenv environment called…
lina
  • 293
  • 2
  • 8
5
votes
0 answers

CoreNLP: Cannot find node in dependency for word said

Frequently when running CoreNLP I am seeing this in stderr: Cannot find node in dependency for word said This seems to happen for the verb that connects a quote to its speaker, which is pretty concerning for my application, quote extraction /…
Edward Newell
  • 17,203
  • 7
  • 34
  • 36
4
votes
1 answer

How to find whether a sentence contain a noun using spacy?

Currently doing a project in NLP. I need to find out whether a sentence have a noun in it. How can I achieve this using spacy?
ye_c_
  • 85
  • 6
4
votes
1 answer

How to retrieve the main intent of a sentence using spacy or nltk?

I have a use case where I want to extract main meaningful part of the sentence using spacy or nltk or any NLP libraries. Example sentence1: "How Can I raise my voice against harassment" Intent would be: "raise voice against harassment" Example…
4
votes
1 answer

Modern dependency parser for Russian

Is there any modern part-of-speech tagger + dependency parser for Russian language? I need a tool or service that will be able to process plain text and output: division into sentences division into tokens part-of-speech tags (fine-grained MSD tags…
adam.ra
  • 1,068
  • 1
  • 10
  • 16
4
votes
3 answers

Parsey McParseface incorrectly identifying root on questions

It seems to me that Parsey has severe issues with correctly tagging questions and any sentence with "is" in it. Text: Is Barrack Obama from Hawaii? GCloud Tokens (correct): Is - [root] VERB Barrack - [nn] NOUN Obama - [nsubj] NOUN from - [adp]…
3
votes
1 answer

How to make a spacy matcher pattern using verb tense/mood?

I've been trying to make a specific pattern for a spacy matcher using Verbs tenses and moods. I found out how to access morphological features of words parsed with spacy using model.vocab.morphology.tag_map[token.tag_], which prints out something…
WanyaaGzz
  • 31
  • 1
1
2 3 4 5 6 7