QUESTION 1 OF 10

How does text classification differ from token classification?

Reveal the answer and explore the explanation.

01
EasyCore

How does text classification differ from token classification?

Answer
Answer

Assigns one or more predefined labels to a text input.

Practical example

Categorize support tickets by issue type.

PythonRelated concept example
from collections import Counter
pred, ref = 'new york city'.split(), 'new york'.split()
match = sum((Counter(pred)&Counter(ref)).values())
p,r = match/len(pred),match/len(ref)
print(2*p*r/(p+r))

Simple token overlap F1 for nonempty answers.

Reference: Further reading ↗

Last 30 min revisionHigh-yield interview Q&As