Open alvieirajr opened 1 month ago
There are multiple issues here:
To be entirely honest, I'm not familiar with the SpaCy dependency graph. But for the first relation, it looks kind of like you want a head with 2 children, nsubj
and prep
, and the prep
child itself has a pobj
child. That's quite easy to find with semgrex:
{} >nsubj {}=first >prep ({}=second >pobj {}=third)
A couple weirdnesses being that there are no such things as prep
or pobj
relations in the Bosque treebank, but I'll leave it to you to figure out what triple you're actually trying to extract. Other relation patterns can be found in the Javadoc You can also put constraints on the words matched inside the {}
, as documented in the SemgrexPattern Javadoc.
There are other dependency extraction toolkits, such as grew, and perhaps someone else here can walk you through using that if semgrex isn't satisfactory.
Hi @AngledLuffa. My real problem is extract dependencies on sentences without use a bank of dependencie rules wroted by myself (this is the Spacy's use case). How i a newbie in this area i was ask for sugestion of dependencies extraction rules in portuguese to chatGPT to use in Spacy, but i dont't know if this sugestions are truly and if this rules will work in portuguese language. So, i will try use a Universal Dependencie model called PT_BOSQUE in CoNLL-U format. Where already exists somes dependency rules. The idea is extract subj, obj and rel automaticly from small sentences.
I will considere your sugestions. Thanks a lot.
One more suggestion is don't use ChatGPt for complicated technical questions
On Tue, Jul 30, 2024, 6:48 PM Antônio Vieira @.***> wrote:
Hi @AngledLuffa https://github.com/AngledLuffa. My real problem is extract dependencies on sentences without use a bank of dependencie rules wroted by myself (this is the Spacy's use case). How i a newbie in this area i was ask for sugestion of dependencies extraction rules in portuguese to chatGPT to use in Spacy, by i dont't know if this sugestions are truly. So, i will try use a Universal Dependencie model called PT_BOSQUE in CoNLL-U format. Where already exists somes dependency rules. The idea is extract subj, obj and rel automaticly from small sentences.
I will considere your sugestions. Thanks a lot.
— Reply to this email directly, view it on GitHub https://github.com/UniversalDependencies/UD_Portuguese-Bosque/issues/416#issuecomment-2259380162, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2AYWOBHLH347NZUAXSRGTZPAQ3DAVCNFSM6AAAAABLW6X446VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJZGM4DAMJWGI . You are receiving this because you were mentioned.Message ID: @.*** com>
I don't want to write down rules of extraction triples of relations as we do using Spacy, like example below (The reason is that there is many and i don't have proficiency to write all of them):
Because this, i want use CoreNLP + Universal Dependencies to extract the relations. I'm using pt_bosque_models. Bellow some details:
To wake up the server i'm using this command:
My StanfordCoreNLP-portuguese.properties file content is:
The follow files are in UD_Portuguese-Bosque.gz:
This is my python example of request file:
The Problem:
If "depparse" is present on params i get the error:
If only "rer" is present on params the request return without errors but come without relations infos, i get only entities and tokens and without the key openie on result raising a error on line "for triple in sentence['openie']:"
Any sugestion ?