Text classification: Make sure that a single sentence allows several labels

Distinguishing between cross-subscription, multiple labels and hierarchical labels, and selecting outputs and losses.

Thematic shorts • IntroductionCollate in 2 self-measured2 First-hand sources
Start Body
Learning objectives and first steps2 objectives 2 first fixes

Try to do it after reading

  • Distinguishing between cross-subscription, multiple labels and hierarchical labels, and selecting outputs and losses.
  • Check the input, label and evaluation conditions in the example

Suggested first

  • Text Tasks and Language Expressions
  • Conditional probability and vector calculations

Define the answer before classifying

A message could be “travel” or “work”, or “photograph” and “travel”. If the business label allows for overlap, and one is used to force the model to be selected using a standardized classification head, the correct answer will be lost before the modelling begins. The label space is designed to determine what models can express earlier than the number of layers.

(b) The probability of multiple classifications using a set of categories that are jointly normalized; Multi-label tasks are usually the probability of each label being exported independently, and are determined by the label threshold. Independent output does not mean that the actual labels are independent of each other, but only that the forecasters do not exclude them by a sum-of-the-mode constraint. Dependence between labels can continue to learn through shared expressions or other structures.

Three little examples of labels

Set up an article on photography and travel, not involving badminton, with the correct label vector being [1]. Three independent outputs may be 0.8, 0.7, 0.1, the sum of which is greater than one without problems. If the output is to be normalized, the first two labels must compete for the same probabilities quality; Even when selection is eventually allowed, training targets are not consistent with label definitions.

A distinction should also be made between "without this label" and "not yet marked with this label". The crowds were marked only for travel and no negative example of photography could be established on that basis. (b) The ability to record whether each label has been cleared and to use a valid label mask; Otherwise, more tag data will become more abundant, and missing labels may instead create more mismonitoring.

Different denominators are used in the evaluation

A check-by-label rate and recall rate can be found to have been ignored. The mini-averages that combine all the judgements are vulnerable to high frequency labels, with the labels first counted and then averaged emphasizing category balance. The entire label collection is more stringent: one of the three labels is wrong, and the record fails. They answered different questions and should not choose only the highest one.

Tier labels also need to check for parent-child consistency. If football news is judged to be important, it should be stated in the rules of marking. Threshold values are selected only on the validation set, which is used for the final evaluation. It was also important to divide the information by author or source, and the same template message was randomly distributed to training and testing to exaggerate generalization.

Check understanding

The combined probability of multi-label output is 1.6, is there a certain error?

Not necessarily. Labels can be created simultaneously, each with the probability that the labels will occur, and the sum does not have to be bound by one. The first thing to do is to confirm whether model tasks allow multiple labels.

A very high average, does that mean that all the themes are well identified?

Can't. High-frequency themes may account for the overwhelming majority of judgements. It is important to check whether low-frequency themes are almost never predicted by looking at indicators by category, macro averages and label frequency.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. Jurafsky and Martin — Text Classification
  2. scikit-learn — Multiclass and multioutput algorithms

Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.

← Back to the knowledge directory
Ask Max Ask about this site
Ask Max ↗

Opening the assistant…

Paper figure

Photo comments

LEAVE A NOTE

About this photograph

Connecting to the discussion board…

    Comments become public after moderation. You can delete your own comments from this browser.
    No email is required. Clearing cookies prevents this browser from claiming earlier comments.

    MAX WANG / INDEX

    Find something

    Enter a keyword, or explore the directory below.