"FacebookTopic" (Built-in Classifier)

Determine which topic a Facebook post is about.



  • This classifier attempts to infer the topic of a text.
  • This classifier has been trained on Facebook posts, but can be used for other texts as well.
  • The input text should typically be one or a few sentences.
  • This classifier assumes the topic of the text is unique. The probabilities reflect the belief in these topics, not the proportion of topics.
  • The current version only works for the English language.


open allclose all

Basic Examples  (2)

Use the "FacebookTopic" built-in classifier to detect the topic of a Facebook post:

Classify multiple examples:

Unrecognized topics or languages will return Indeterminate:

Obtain the probabilities for the 3 most likely classes:

Obtain a ClassifierFunction for this classifier:

Apply the classifier to a list of texts:

Scope  (1)

Load the ClassifierFunction corresponding to the built-in classifier:

Obtain the possible classes using Information:

Options  (3)

ClassPriors  (1)

Use a custom ClassPriors to restrict the possible outputs:

IndeterminateThreshold  (1)

Use a custom IndeterminateThreshold:

UtilityFunction  (1)

Obtain the utility function of the classifier:

Modify this utility function to penalize "Weather" being misclassified as "FoodAndDrink":

Classify the post using this new utility:

Compare to the result with the default utility:

Neat Examples  (1)

Obtain different possible topics with their corresponding probabilities:

Visualize the result using WordCloud: