Guide 10 / 10
How to label posts for sentiment so two people agree
A one-page codebook, a 50-post trial run and one agreement number will make your hand labels hold up.
Short answer
Write a one-page codebook that defines positive, neutral and negative with examples and rules for hard cases, have two people label the same 50 posts separately, and compare. Calculate Cohen's kappa to measure agreement beyond chance; a value above about 0.6 is usually good enough for social posts. Discuss the disagreements, update the codebook, and then label the rest.
Key takeaways
- Hand labels are only as consistent as the rules behind them, so write the rules down first.
- Test on a shared sample of about 50 posts before labeling hundreds.
- Cohen's kappa corrects raw agreement for the agreement you'd get by chance.
- Most disagreements come from a few case types: sarcasm, questions, mixed posts and news.
Automatic sentiment scores are a first pass. When the result matters, someone reads the posts and labels them by hand. That only helps if the labels are consistent, and two people reading the same reply often disagree more than they expect.
The fix is old and dull: write the rules down, test them, and measure agreement.
Why do hand labels disagree?
Hand labels disagree because people bring different assumptions to hard cases like sarcasm, questions, mixed opinions and news.
Give two colleagues these replies and ask for positive, neutral or negative:
- "Is the export feature coming back?"
- "Fast shipping, but the box arrived crushed"
- "They raised prices again lol"
- "Interesting move"
You'll likely get different answers on at least two. Neither person is wrong. They're using different unwritten rules. A codebook turns those unwritten rules into written ones.
What goes into a sentiment codebook?
A codebook defines each label in one or two sentences, gives two or three example posts for each, and sets a rule for every common hard case.
Keep it to a page. A long codebook nobody rereads is worse than a short one people remember. A workable structure:
| Section | What to write |
|---|---|
| Positive | The writer approves, thanks, praises or is happy with the subject. Examples. |
| Negative | The writer complains, criticizes, mocks or is unhappy with the subject. Examples. |
| Neutral | Questions, plain facts, news shares, off-topic replies, or no clear view. Examples. |
| Subject | Whose sentiment toward what? ("The product", not "the weather".) |
| Hard cases | One rule each for sarcasm, questions, mixed posts, links with no comment, and emoji-only replies. |
The subject line matters more than people think. "This weather is awful, perfect day to try the new app" is negative about the weather and positive about the app. Decide in advance which one you're measuring.
Which hard cases need written rules?
Write rules for sarcasm, questions, mixed posts, emoji-only replies and news shares, because these cause most disagreements.
Example rules a small team might adopt:
- Sarcasm: label what the writer means, not the words. "Love waiting on hold" is negative.
- Questions: neutral, unless the question is clearly a complaint ("Why is this still broken?" is negative).
- Mixed posts: label by the part that comes last or carries more weight. "Slow shipping, but I love it" is positive.
- Emoji-only replies: label by the emoji's usual meaning in context; mark as unsure if it could go either way.
- News shares with no comment: neutral.
You can choose different rules. What matters is that everyone uses the same ones. The guides on sarcasm and emoji go deeper on those two.
How do you run a test round?
Pick about 50 posts at random, have two people label them separately, then compare and discuss every disagreement.
- Export your collected posts, for example from the Twitterment checker's CSV, and add an ID column.
- Pick 50 rows at random. A spreadsheet's random function and a sort does the job.
- Each person labels the 50 in their own copy without talking about it.
- Put both label columns side by side and count matches.
- Go through every mismatch together. For each one, either fix a label or add a rule to the codebook.
The discussion is where the codebook gets better. Most teams find three or four new rules in the first round.
How do you calculate Cohen's kappa?
Cohen's kappa is observed agreement minus chance agreement, divided by one minus chance agreement.
Raw agreement overstates consistency, because two people labeling at random would still agree some of the time. Jacob Cohen proposed kappa in 1960 to correct for that.
κ = (p_o − p_e) ÷ (1 − p_e)
Here p_o is the share of posts where both people chose the same label, and p_e is the agreement you'd expect by chance given how often each person used each label.
A worked example with 50 posts:
| B: positive | B: neutral | B: negative | A total | |
|---|---|---|---|---|
| A: positive | 14 | 3 | 1 | 18 |
| A: neutral | 2 | 15 | 3 | 20 |
| A: negative | 0 | 2 | 10 | 12 |
| B total | 16 | 20 | 14 | 50 |
Observed agreement: (14 + 15 + 10) ÷ 50 = 0.78.
Chance agreement: for each label, multiply the two people's shares and add them up. (18 × 16 + 20 × 20 + 12 × 14) ÷ 50² = (288 + 400 + 168) ÷ 2,500 = 0.342.
Kappa: (0.78 − 0.342) ÷ (1 − 0.342) = 0.438 ÷ 0.658 ≈ 0.67.
What kappa is good enough?
For most social media projects, a kappa of about 0.6 or higher is workable, and above 0.8 is very strong.
Landis and Koch suggested labels for kappa ranges in 1977, and they're still widely used: 0.41 to 0.60 moderate, 0.61 to 0.80 substantial, above 0.80 almost perfect. Treat them as a convention.
If you land below 0.6, don't push on with the full set. Look at where the mismatches cluster. Usually one or two case types, often questions or sarcasm, account for most of them, and a clearer rule fixes it. Run a second small round to check.
Once agreement holds up, split the remaining posts between labelers, and spot-check a few dozen from each person at the end. Write the kappa and the number of posts labeled into your report. It tells readers your numbers came from a method, not a mood.
Questions
- How many posts should two people label to test agreement?
- Around 50 is enough for a first check on a small project, and 100 gives a steadier number. Pick them at random from your collection, not the first 50, so they include the awkward cases.
- What is a good Cohen's kappa for sentiment labels?
- Many projects treat 0.6 to 0.8 as solid agreement and anything above 0.8 as very strong, following the bands Landis and Koch proposed in 1977. Those bands are a convention, not a law. For a quick internal report, 0.6 or higher means your codebook is working.
- Do I need two people if I'm labeling alone?
- It helps a lot. If nobody else is available, label the same 50 posts twice, a few days apart, without looking at your first labels. Low agreement with yourself is a strong sign the rules need work.
Sources
Twitterment is independent and not affiliated with X Corp. Features and search operators on X change from time to time; if something here doesn't match what you see, check X's own help pages.