Natural Language Processing (CSE 490U): Text Classification
Noah Smith
c 2017 University of Washington nasmith@cs.washington.edu
January 20–23, 2017
1 / 65
Natural Language Processing (CSE 490U): Text Classification Noah - - PowerPoint PPT Presentation
Natural Language Processing (CSE 490U): Text Classification Noah Smith 2017 c University of Washington nasmith@cs.washington.edu January 2023, 2017 1 / 65 Text Classification Input: a piece of text x V , usually a document
1 / 65
2 / 65
3 / 65
5 / 65
6 / 65
7 / 65
8 / 65
actually in the target class; L = t believed to be in the target class; classify(x) = t correctly labeled as t A B C
9 / 65
(true negatives)
10 / 65
11 / 65
◮ Train on x1:n \ xi, using xi as development data. ◮ Estimate quality on the ith development set: ˆ
12 / 65
13 / 65
14 / 65
15 / 65
16 / 65
17 / 65
18 / 65
20 / 65
◮ Clusters ◮ Task-specific lexicons 21 / 65
22 / 65
23 / 65
24 / 65
25 / 65
26 / 65
27 / 65
28 / 65
29 / 65
30 / 65
31 / 65
32 / 65
33 / 65
34 / 65
35 / 65
36 / 65
37 / 65
38 / 65
39 / 65
−4 −2 2 4 1 2 3 4 5 score loss
40 / 65
−10 −5 5 10 −10 −5 5 10 15
41 / 65
−10 −5 5 10 −10 −5 5 10 15
42 / 65
−4 −2 2 4 1 2 3 4 5 score loss
43 / 65
44 / 65
45 / 65
46 / 65
◮ Pick it uniformly at random from {1, . . . , n}. ◮ ˆ
◮ w ← w − α
−4 −2 2 4 1 2 3 4 5 score loss
48 / 65
◮ Pick it uniformly at random from {1, . . . , n}. ◮ ˆ
◮ w ← w − α
50 / 65
51 / 65
52 / 65
−4 −2 2 4 1 2 3 4 5 6 x function(x) −x + pmax(x, 1)
53 / 65
◮ Lexicon features can provide problem-specific guidance. 54 / 65
◮ Lexicon features can provide problem-specific guidance.
◮ You should have a basic understanding of the tradeoffs in
55 / 65
◮ Lexicon features can provide problem-specific guidance.
◮ You should have a basic understanding of the tradeoffs in
56 / 65
◮ Lexicon features can provide problem-specific guidance.
◮ You should have a basic understanding of the tradeoffs in
57 / 65
58 / 65
59 / 65
60 / 65
61 / 65
62 / 65
63 / 65
64 / 65
◮ Example:
2
◮ Linear kernels are most common in NLP. 65 / 65