The term you should Google on is "Bayesian Analysis", which is
basically a fancy term assigned to the task of figuring out the
probability of event X when you know that a related event Y took
place. If you set up your DB correctly, you can use normal SQL to
perform ad hoc Bayesian analysis of Twitter data, but it takes some
work to set it all up well.

For what you describe, it seems you would be able to get the stats you
want by:

- Collecting tweets mentioning "Term A"
- Count # of that population which mentions "Term B", divide by total
number of tweets mentioning "Term A", multiply by 100

If you need to be able to perform ad hoc queries, then you need to
cache the stream of all tweets you might be interested in (using the
firehose, or Streaming API), indexing it on all terms you might
possibly be interested in.

Brian Maso

On May 10, 9:06 am, Stephen Corby <corby.step...@gmail.com> wrote:
> Hey There,
>
> My first post, so go easy on me!
>
> I do social media strategy and monitoring freelance work, so I've
> recently dipped my toes into programming with Python and the Twitter
> API to build some simple applications for clients to perform some
> basic custom functions & queries without having to dish out tons of
> money for some of the expensive social media monitoring tools out
> there.
>
> Gotta say, I'm loving this so far and I'm able to build little one-off
> applications for clients. Anyways, I have a client that is interesting
> in figuring out the following:
>
> Of twitter users who mention "Term A", what are the additional terms
> that they frequently mention. Sort of like eCommerce systems that show
> "users who bought A, also frequently purchased B, C and D".
>
> the output I'm hoping for is something along these lines: Of users who
> mentioned apples, 50% mentioned oranges, 25% mentioned lemons, etc...
>
> I know I'll eventually have to write some code to filter out certain
> words that are irrelevant, but just trying to figure out the framework
> of getting the right data from the API right now.
>
> This has reached the limit of my understanding of the twitter API thus
> far, and just want to see if anyone knew if this is possible. No need
> to explain fully, but anything to point me in the right direction
> would be greatly appreciated-- I'm sure I can eventually figure it out
> (with enough time), but wanted to make sure I wasn't wasting my time
> trying to do something that is beyond the capabilities of the API.
>
> Much appreciated!
>
> Steve

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk

Reply via email to