92 questions
4
votes
1
answer
140
views
Why is this dependency parser choosing the same action over again?
I am attempting to write a small dependency parser using a multiclass perceptron as the learner. The parser is a simple machine that has a few actions: START_ARC, MOVE_RIGHT, END_ARC and to move ...
0
votes
0
answers
23
views
spaCy DependencyMatcher: One head for multiple children
How can I extract a single noun that is the head of multiple children?
I'm facing an issue in dependency matching in spaCy. I want to extract the nouns describing the name entities (identified by ...
1
vote
1
answer
1k
views
List of dependencies in Spacy
I'm a beginner in NLP and i've decided to start with Spacy. It's simple to handle and to comprehend.
Neverthless, i can't acess to the full documentation or parsing.
I mean , i don't know the meaning ...
0
votes
0
answers
112
views
Dependency Parsing in Spacy
I want to extract the pair verb-noun of my text using dependency parsing.
I did this:
document = nlp('appoint department heads or managers and assign or delegate responsibilities to them ')
print (&...
0
votes
0
answers
283
views
How can I parse the action that belongs to a Person using Spacy in Python?
I have a set of acknowledgements extracted from academic papers that contain sentences like the following:
I would like to thank PERSON1 for helping me with this paper.
We gratefully acknowledge ...
1
vote
1
answer
804
views
Is possible to get dependency/pos information for entities in Spacy?
I am working on extracting entities from scientific text (I am using scispacy) and later I will want to extract relations using hand-written rules. I have extracted entities and their character span ...
0
votes
1
answer
1k
views
SpaCy Matcher - Restricting Potential Matches
Not too sure exactly how to word the problem, so thank you for indulging the title...
I'm using SpaCy's Matcher function to parse clauses (adverbial/prepositional/etc.) as a part of pre-processing. ...
0
votes
0
answers
56
views
How many of "tags" and "predicted_dependencies" in the dependency parsing (allennlp.predictors.predictor)?
I am using "allennlp.predictors.predictor" to extract the information of dependency parsing for sentences. May I know how many numbers of "tags" and "predicted_dependencies&...
1
vote
1
answer
267
views
Run dependency parser on pre-initialized doc object of spacy
I am trying to incorporate spacy's dependency parser into a legacy code in java through web API.
All other components tokenizer, tagger, merged_words, NER are done from the legacy NLP code. I am only ...
4
votes
1
answer
984
views
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?
1
vote
0
answers
482
views
Pytorch save/load model with lower dev set accuracy?
Here is the question: I am loading my pytorch model(best result on dev set while training) from the checkpoint file during model evaluation, remembering to do model.eval() and with torch.no_grad(), I ...
1
vote
1
answer
256
views
Add known matches to Spacy document with character offsets
I would like to run some analysis on documents using different Spacy tools, though I am interested in the Dependency Matcher in particular.
It just so happens that for these documents, I already have ...
1
vote
1
answer
2k
views
Extract subtree (Phrase) for nsubj elements using spacy
The aim is to extract the sub-tree (phrases) from the sentence if the 'nsubj' exists in the given sentence.
Here is the code which I am using:
import spacy
nlp = spacy.load('en')
piano_doc = nlp('...
1
vote
1
answer
205
views
Issue in creating Semgrex patterns with relation names containing ":" colon
I am trying to perform Semgrex in https://corenlp.run/ on the below sentence to extract the transition event. Since the dependency relation "obl:from" has a colon in it, I get an error. But ...
0
votes
1
answer
846
views
Unable to use Allennlp biaffine parser model
I am trying to use allennlp predictor for biaffine parser. Here is the code:-
from allennlp.predictors.predictor import Predictor
predictor = Predictor.from_path("https://s3-us-west-2.amazonaws....
2
votes
0
answers
906
views
Stanford Stanza -- Dependency Parsing Module -- Output for document with more than one sentence
I have a query about formatting the output of the dependency parsing module when the document to be parsed contains more than one sentence.
One of the examples of using the dependency parsing module ...
0
votes
1
answer
962
views
Entity Attribute Extraction On Unstructured Medical Text
I am working on Named entities and their attribute extraction. Where my objective is to extract attributes associated with a particular entity in the sentence.
For example - "The Patient report ...
0
votes
1
answer
181
views
Spacy pattern exception case based on verb form
I'm trying to make a spacy pattern that recognizes when a noun is followed by an adjective, which I have as follows:
pattern = [{'POS':'NOUN'}, {'POS':'ADJ'}]
however, I am trying to make a case ...
3
votes
1
answer
1k
views
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....
1
vote
1
answer
313
views
NLP: Compare these two sentences. Is this a misclassification?
I am using the dependence parse of spacy. I am puzzled with these two very similar sentences.
Sentence 1:
text='He noted his father was a nice guy.'
Note that in this sentence "father" is ...
0
votes
1
answer
181
views
NLP: Which are the dependency tags associated with a verb?
I need to identify all dependency tags associated with a verb. So far, I have identified:
'ROOT'
'xcomp'
spacy.explain('xcomp')
Out[72]: 'open clausal complement'
'aux'
spacy.explain('aux')
Out[73]: ...
0
votes
2
answers
150
views
nlp: is this dependence tag correct? What does exactly it mean in this situation?
I am exploring the amazing python library and I got this:
text='The Titanic managed to sail into the coast intact, and Conan went to Chicago.'
token_pos=[token.pos_ for token in spacy_doc]
token_tag=...
1
vote
1
answer
1k
views
nlp: What is exactly a grammar dependence tag 'attr'?
I am exploring the spacy nlp python library. I have got this:
text='Daniel is a smart clever professor.'
spacy_doc = nlp(text)
token_pos=[token.pos_ for token in spacy_doc]
token_tag=[token.tag_ for ...
1
vote
0
answers
358
views
Test for whether a token is a conjunction head in spaCy
Question
Is there a way to detect whether a token is a conjunction head in spaCy?
Problem description
I'd like the following sentence:
"Both Americans and Muslim friends and citizens, tax-paying ...
0
votes
1
answer
1k
views
In Spacy NLP, how extract the agent, action, and patient -- as well as cause/effect relations?
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&...
0
votes
1
answer
2k
views
How to get indices of words in a Spacy dependency parse?
I am trying to use Spacy to extract word relations/dependencies, but am a little unsure about how to use the information it gives me. I understand how to generate the visual dependency tree for ...
1
vote
0
answers
497
views
Dialogflow Rule-based grammar matching
I am doing some research about chatbots and more specifically Dialogflow.
When I was searching for the intent classification I find out that Dialogflow is using rule-based grammar matching and ML ...
0
votes
1
answer
386
views
How do I train a pseudo-projective parser on spaCy?
I am trying to train a parser for custom semantics following the sample code from https://raw.githubusercontent.com/explosion/spaCy/master/examples/training/train_intent_parser.py
The idea is to get a ...
1
vote
0
answers
538
views
Gap-Degree of non-projective dependency tree
The following is how my class defines gap-degree:
The gap-degree of a word in a dependency tree is the least k for which the substring consisting of the word and its descendants is entirely comprised ...
2
votes
1
answer
3k
views
How to change text sentence into CoNLL-U format?
I am studying dependency parsing using CoNLL-U format.
I can find how to handle CoNLL-U parser or tokenlist, but I cannot find how to convert a text sentence into a CoNLL-U format.
I tried converting ...
7
votes
1
answer
1k
views
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_. ...
4
votes
1
answer
6k
views
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 ...
0
votes
0
answers
369
views
Dependency parsing in python stanford core NLP
I am working on NLP project based on stanford Coe NLP.I have got the sentiment corresponding to each text/sentence-thanks to the document here
Now I need to get the list of nouns and related ...
2
votes
3
answers
2k
views
How to get spaCy to use universal dependencies
Spacy's site said they use universal dependencies scheme in their annotations specifications page. But when I parse "I love you", '''you''' was made a "dobj" of "love". There's no "dobj" in the ...
1
vote
1
answer
972
views
What is the meaning of labels on the arrows of dependency parser graph?
I am using coreNLP module demo by Stanford online here: https://corenlp.run .
So, I am trying out a few sentences to see their syntactic structure using dependency parser available here.
One such ...
2
votes
1
answer
878
views
Converting Spacy generated dependency into CoNLL format cannot handle more than one ROOT?
I used the SpaCy library to generate dependencies and save it into a CoNLL format using the code below.
import pandas as pd
import spacy
df1 = pd.read_csv('cleantweets', encoding='latin1')
df1['...
1
vote
0
answers
94
views
Pattern-lib : Which word is the ROOT(dependency parsing) of the sentence?
In spacy the start of the dependency begins at ROOT.
In pattern.en the same verb is just tagged as VP. If there are multiple VP's how do you know which one is the ROOT ?
Is it always the one marked ...
0
votes
1
answer
335
views
Stanford pos-tagger incremental training
We've been using Stanford CoreNLP for a while and most of the time it delivered correct results.
But for certain sentences the dependency parsing results mess up. As we observed, some of these errors ...
0
votes
1
answer
1k
views
StanfordNLP, CoreNLP, spaCy - different dependency graphs
I'm trying to use simple rules/patterns defined over a dependency graph to extract very basic informations from sentences (e.g., triples such as subject->predicate->object). I started using ...
7
votes
2
answers
8k
views
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 ...
0
votes
1
answer
174
views
How to tell if two natural language queries have the same meaning
I am building a system to change natural language questions into SQL queries. Right now what I am implementing is a refactoring of a natural language question to be more structured so that I will have ...
2
votes
1
answer
494
views
POS tagging not consistent using Spacy en_core_web_lg model
POS tagging for PROPN not working in an expected manner using the en_core_web_lg model.
POS tagging works more predictably using the _md model.
Given the (poorly-formed) sentence:
"CK7, CK-20, GATA 3, ...
0
votes
1
answer
2k
views
Is there a way to retrieve the whole noun chunk using a root token in spaCy?
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 ...
1
vote
2
answers
830
views
About parsing parentheses in English model
This sentence is part of the Simplified Wikipedia:
There are three things in air, Nitrogen (79%), oxygen (20%), and other types of gases (1%).
The parenthetical percentages are not handled well in ...
0
votes
1
answer
674
views
How to obtain enhanced dependency parsing from Stanford NLP tools?
I'm working on a project about dependency parsing for Polish. We’re trying to train the Stanford Neural Network Dependency Parser on data from Polish language (using Universal Dependencies treebanks ...
2
votes
1
answer
661
views
Examples where Dependency Parser fails
Can anyone give me few sentences on when the dependency parser fails and why they failed and what is the fix for it?
0
votes
0
answers
98
views
How can I detect a verb order with Stanford CoreNLP Dependency Parser?
I have a RDF/Turtle Resource as below:
@prefix factory: <http://linkedfactory.iwu.fraunhofer.de/vocab#> .
@prefix : <http://linkedfactory.iwu.fraunhofer.de/data/> .
@prefix rdf: <http:...
3
votes
2
answers
469
views
Segmenting sentence into subsentences with CoreNLP
I am working on the following problem: I would like to split sentences into subsentences using Stanford CoreNLP. The example sentence could be:
"Richard is working with CoreNLP, but does not really ...
1
vote
1
answer
170
views
coreNLPDependencyParser output explanation
i am running coreNLPDependencyParser for a sentence
The quick brown fox jumps over the lazy dog.
and i am getting output in this way
The DT 4 det
quick JJ 4 amod
brown ...
0
votes
1
answer
362
views
Dependency Parsing using Stanford Dependency Parser
i am trying to extract main verb in a sentence and i followed this question , i am expecting output in this format
nsubj(swim-4, Parrots-1)
aux(swim-4, do-2)
neg(swim-4, not-3)
root(ROOT-0, swim-4)
...