Answers.Body: <p>It depends on the complexity on your sentences. If you have a limited range, you could do simple pattern matching on part-of-speech tags. Put your sentence through a tagger (there are plenty of them around) and look for the first noun following a verb:</p>
  
  <pre><code>I       want an         apple
  Pronoun verb determiner noun
  </code></pre>
  
  <p>(I assume you mean the <strong>object</strong>, as the subject in that sentence would be <em>I</em>). Scan through the list until you hit a verb, then pick the next noun. This should work for most English sentences.</p>
  
  <p>It gets a bit more complicated if your nouns have additional words around them, for example <em>red apple</em> (where <em>red</em> is an adjective) or <em>bottle of beer</em> (where you have the pattern <code>noun OF noun</code>). So if you want to capture those fully, you might need a few more complex matching rules.</p>
  
  <p>Overall it should still be a lot easier than implementing a full-blown syntactic parser which creates a comprehensive structural analysis of your sentence, most of which you wouldn't need in the first place.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-11T23:45:16.653Z
Answers.Text: I'm trying to do something similar to this.  I would like to perform sentiment analysis, however I need to keep track of the subject, so I can be aware of what the sentiment applies to.   using SVO, to manually parse it might work, what would you reccomend?
Answers.UserDisplayName: johnny 5
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-12T12:05:46.030Z
Answers.Text: Depends how precise it has to be. You can get quite far with simple heuristics, but every percentage accuracy in precision beyond say, 70-80 percent,  requires a lot more effort.
Answers.UserDisplayName: Oliver Mason
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-12T17:27:16.940Z
Answers.Text: Thanks, I'm going to try a hybrid solution.  use AI to find the subject using a syntax parser, and then some list of rules to see if the subject from the previous sentence is the same
Answers.UserDisplayName: johnny 5
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-13T11:59:32.647Z
Answers.Text: That sounds like a good approach.
Answers.UserDisplayName: Oliver Mason
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-06T10:11:33.960Z
Answers.LastActivityDate: 2018-12-06T10:11:33.960Z
Answers.UserDisplayName: Oliver Mason
Body: <p>I often develop bots and I need to understand what some people are saying.</p>
  
  <p>Examples:<br>
  - I want an apple<br>
  - I want an a p p l e</p>
  
  <p>How do I find the object (<em>apple</em>)? I honestly don't know where to start looking. Is there an API that I can send the text to which returns the object? Or perhaps I should manually code something that analyses the grammar?</p>
  
Tags: <algorithm><natural-language-processing><ai-basics><getting-started>
Title: How to find the subject in a text?
UserDisplayName: Matheus Freitas
ThreadText: # How to find the subject in a text?
  
  (Asked by: username_0 on 2018-02-15)
  
  I often develop bots and I need to understand what some people are saying.
  
  Examples:  
  - I want an apple  
  - I want an a p p l e
  
  How do I find the object (*apple*)? I honestly don't know where to start looking. Is there an API that I can send the text to which returns the object? Or perhaps I should manually code something that analyses the grammar?
  
  **Tags:** algorithm, natural-language-processing, ai-basics, getting-started
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-12-06. Score: 1
  
  It depends on the complexity on your sentences. If you have a limited range, you could do simple pattern matching on part-of-speech tags. Put your sentence through a tagger (there are plenty of them around) and look for the first noun following a verb:
  
  ```
  I       want an         apple
  Pronoun verb determiner noun
  
  ```
  
  (I assume you mean the **object**, as the subject in that sentence would be *I*). Scan through the list until you hit a verb, then pick the next noun. This should work for most English sentences.
  
  It gets a bit more complicated if your nouns have additional words around them, for example *red apple* (where *red* is an adjective) or *bottle of beer* (where you have the pattern `noun OF noun`). So if you want to capture those fully, you might need a few more complex matching rules.
  
  Overall it should still be a lot easier than implementing a full-blown syntactic parser which creates a comprehensive structural analysis of your sentence, most of which you wouldn't need in the first place.
  
  > **Comments:**
  > **username_2**: I'm trying to do something similar to this.  I would like to perform sentiment analysis, however I need to keep track of the subject, so I can be aware of what the sentiment applies to.   using SVO, to manually parse it might work, what would you reccomend?  
  > **username_1**: Depends how precise it has to be. You can get quite far with simple heuristics, but every percentage accuracy in precision beyond say, 70-80 percent,  requires a lot more effort.  
  > **username_2**: Thanks, I'm going to try a hybrid solution.  use AI to find the subject using a syntax parser, and then some list of rules to see if the subject from the previous sentence is the same  
  > **username_1**: That sounds like a good approach.  
  
  ---
  
  