interaction.ml.categories

This target provides results of how VEDO tagging and scoring has been applied to interactions during filtering. While it can be used in an Analysis query or Query filter, it cannot be used in an Interaction Filter.

As a query filter

When using an Interaction filter that includes the following tags, filtered interactions matching the tag rules will be tagged and scored in one of three branches: spam, intent, and mood.

tag.spam.true 1 { fb.content contains "win a car" } 
tag.spam.false 2 { fb.content contains "big data meetup" } 
tag.intent.buy 10 { fb.content contains "buying" } 
tag.intent.sell 20 { fb.content contains "selling" } 
tag.mood.happy 10 { fb.content contains "happy" } 
tag.mood.sad 10 { fb.content contains "sad" }

Suppose we encounter an interaction that matches all of these tagging rules:

"Come to our big data meetup and win a car! We'll talk about buying and selling. Anyone who arrives feeling sad will leave feeling happy!"

How will the scoring contest work?

  • In the tag.spam branch, the winner is tag.spam.false which scores 2. So the string "spam.false" is written to the interaction.ml.categories array.
  • In the tag.intent branch, the winner is tag.intent.sell which scores 20. So the string "intent.sell" is written to the interaction.ml.categories array.
  • In the tag.mood branch, there is no winner. Nothing is written to the interaction.ml.categories array.

Note that we write, for example, "spam.false" to the array, not "tags.spam.false".

Thus, your query filter might be:

interaction.ml.categories == "intent.sell" // This will work

You would receive no results if you wrote:

interaction.ml.categories == "tags.intent.sell" // This won't work

As an analysis target

In an analysis query you can use this target to examine the most popular tags that have been applied during interaction filtering. Let's add one extra tag to our logic. We'll also change the scores so that "mood" can have a winner:

tag.spam.true    1 { fb.content contains "win a car"       } 
tag.spam.false   2 { fb.content contains "big data meetup" }
tag.intent.buy  10 { fb.content contains "buying"          } 
tag.intent.sell 20 { fb.content contains "selling"         } 
tag.mood.happy  30 { fb.content contains "happy"           } 
tag.mood.sad    20 { fb.content contains "sad"             } 
tag.mood.hungry 10 { fb.content contains "hungry"          }

Once this interaction filter has run long enough to load some data into your index, you can use interaction.ml.categories as an analysis target like this, to determine the terms that appear most frequently:

'analysis_type': 'freqDist', 'parameters': {'threshold': 3, 'target': 'interaction.ml.categories'}

The output might look like this:

{
    "unique_authors": 200600, 
    "analysis": {
        "analysis_type": "freqDist", 
        "redacted": false, 
        "results": [
            {
                "key": "spam.false", 
                "unique_authors": 25600, 
                "interactions": 26335
            }, 
            {
                "key": "spam.true", 
                "unique_authors": 16900, 
                "interactions": 18409
            }, 
            {
                "key": "mood.happy", 
                "unique_authors": 2200, 
                "interactions": 2309
            }
        ], 
        "parameters": {
            "threshold": 3, 
            "target": "interaction.ml.categories"
        }
    }, 
    "interactions": 220066
}

In this case spam.false won the scoring contest the most times. That is, your index contains more interactions where spam.false beat spam.true. The next most popular tag in interactions in your index is spam.true. The final entry in the output (because threshold was set to 3) is mood.hungry.

Use interaction.ml.categories as an analysis target with a threshold of “1”, to return only the values for the most commonly applied tag.

Resource information

Target service: PYLON for Facebook Topic Data

Target object: Interaction

Type: array(string)

Array: Yes

Tokenized for query filters: No

Interaction filter: No

Analysis target: Yes

Query filter: Yes

Child analysis target: No