Text Classification with Open Source Models
M to open the slide menu? to see all navigation shortcuts“All quantitative models of language are wrong — but some are useful”
“The use of computers in content analysis invokes a shift in methodological emphasis, from solving the human problem of achieving reliable coding for large volumes of text […] to solving the computational problem of preserving relevant readings of the texts.”
In manual content analysis, we care about reliability:
In automated content analysis, we care mostly about validity:
Suggestions by Song et al. (2020) for a gold standard
Confusion Matrix:
| Model Classification | |||
| 1 | 0 | ||
|
Gold- Standard |
1 |
True Positive (TP) |
False Negative (FN) |
| 0 |
False Positive (FP) |
True Negative (TN) |
|
Comparing the fear coding of two models against a gold standard, for four example statements:
|
Gold Standard |
Model A | Model B | |
|---|---|---|---|
| Statements | Fear | Fear | Fear |
| “The current heat wave really scares me.” | 1 | 1 | 1 |
| “It’s getting worse every year. COME ON MERZ, DO SOMETHING!!!” | 0 | 1 | 0 |
| “It drives me nuts that we’re still running coal-fired power plants.” | 0 | 1 | 0 |
| “I often lose sleep thinking about global warming.” | 1 | 1 | 0 |
| TP | 2 | 1 | |
| TN | 0 | 2 | |
| FP | 2 | 0 | |
| FN | 0 | 1 | |
| Accuracy | 50% | 75% | |
| Recall | 100% | 50% | |
| Precision | 50% | 100% |
\[Precision = \dfrac{TP}{TP + FP}\] \[Recall = \dfrac{TP}{TP + FN}\] \[Accuracy = \dfrac{TP + TN}{TP + TN + FP + FN}\]
