rock3125 / enhanced-subject-verb-object-extraction

Enhanced Subject Word Object Extraction
Apache License 2.0
148 stars 50 forks source link

This is awesome! Question on building on it #14

Closed alexwilsonaqnu closed 3 years ago

alexwilsonaqnu commented 3 years ago

Hello,

Thanks so much for this. I'm new to Python, so forgive me if this is pretty obvious. I was wondering how one could count the number of sentences of a type, i.e. how could I count if a sentence has a single subject verb object or was passive or just was a subject and verb.

I started to write a sum function, but thought I'd ask the genius of the group!

Thanks so much.

Best, Alex

rock3125 commented 3 years ago

Hi Alex,

Oh! that is a good question. Not sure if you should use this library for that. First of all - I'd separate all the different things you want to count. Passive sentences are one thing, and they usually have an AUX verb in addition to the main verb. The real issue with what you want to deal is sentence complexity. To do that, you need to have a look at Dependency parsing. Spacy is a really good library which I use to do that. Take a look at this (a spacy visualization tool):

https://explosion.ai/demos/displacy

Put in a few sentences, read up on some English grammar (if you haven't already), and use the left and right lists of a spacy dependency parse to pull sentences apart like this. Only then can you do meaninful analysis!

hope that helps,

Rock

alexwilsonaqnu commented 3 years ago

Thank you!

On Fri, Jun 11, 2021 at 1:53 AM Rock de Vocht @.***> wrote:

Hi Alex,

Oh! that is a good question. Not sure if you should use this library for that. First of all - I'd separate all the different things you want to count. Passive sentences are one thing, and they usually have an AUX verb in addition to the main verb. The real issue with what you want to deal is sentence complexity. To do that, you need to have a look at Dependency parsing. Spacy is a really good library which I use to do that. Take a look at this (a spacy visualization tool):

https://explosion.ai/demos/displacy

Put in a few sentences, read up on some English grammar (if you haven't already), and use the left and right lists of a spacy dependency parse to pull sentences apart like this. Only then can you do meaninful analysis!

hope that helps,

Rock

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/peter3125/enhanced-subject-verb-object-extraction/issues/14#issuecomment-859327426, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZ2Z6GBLTOGL6SY5GCDCH3TSGXIJANCNFSM46O7SCMQ .

-- Alex Wilson 616-334-4761 @.***